Mercurial > repos > eric-rasche > circos
diff fasta-to-karyotype.py @ 3:b56f47c58779 draft
planemo upload for repository https://github.com/TAMU-CPT/galaxy-circos-tool commit 4503a4ca99e65aa821e2c953f2f18eaadeed170a
author | eric-rasche |
---|---|
date | Wed, 01 Mar 2017 23:56:56 -0500 |
parents | e8475d0195fe |
children |
line wrap: on
line diff
--- a/fasta-to-karyotype.py Wed Mar 01 22:49:11 2017 -0500 +++ b/fasta-to-karyotype.py Wed Mar 01 23:56:56 2017 -0500 @@ -3,9 +3,9 @@ import sys for idx, seq in enumerate(SeqIO.parse(sys.argv[1], 'fasta')): - print "chr - {seq_id} {idx} 0 {length} set3-12-qual-{color}".format( + sys.stdout.write("chr - {seq_id} {idx} 0 {length} set3-12-qual-{color}\n".format( seq_id=seq.id, idx=idx, length=len(seq), color=((idx + 1) % 12) - ) + )) if len(sys.argv) > 2: # band hs1 p36.32 p36.32 2200000 5100000 gpos25 @@ -16,7 +16,7 @@ with open(sys.argv[2], 'r') as handle: for line in handle: lineData = dict(zip(COLS, line.split())) - print "band {chrom} {name} {name} {chromStart} {chromEnd} {color}".format( + sys.stdout.write("band {chrom} {name} {name} {chromStart} {chromEnd} {color}\n".format( # Can access name because requiring >bed3 name=lineData['name'], chrom=lineData['chrom'], @@ -24,7 +24,7 @@ chromEnd=lineData['chromEnd'], # ???? color=lineData.get('itemRgb', 'gpos50'), - ) + )) # band # ID # parentChr