Commit 1e61c363 authored by Mathieu Giraud's avatar Mathieu Giraud

split-form-imgt.py: factorize into 'verbose_open_w'

parent 351122a5
......@@ -23,6 +23,10 @@ print IMGT_LICENSE
open_files = {}
current_file = None
def verbose_open_w(name):
print " ==> %s" % name
return open(name, 'w')
# Create isolated files for some sequences
SPECIAL_SEQUENCES = [
'TRDD2*01',
......@@ -45,14 +49,12 @@ for l in sys.stdin:
current_file = open_files[system]
else:
name = '%s.fa' % system
print " ==>", name
current_file = open(name, 'w')
current_file = verbose_open_w(name)
open_files[system] = current_file
if seq in SPECIAL_SEQUENCES:
name = '%s.fa' % seq.replace('*', '-')
print " ==>", name
current_special = open(name, 'w')
current_special = verbose_open_w(name)
if current_file:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment