Mercurial > repos > iuc > circos
annotate karyotype-from-fasta.py @ 11:0ee66defe58b draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit b9ec351920dbc83fa14bd1f8cfdd0a6a19b89473"
| author | iuc |
|---|---|
| date | Tue, 16 Nov 2021 09:19:09 +0000 |
| parents | b7c1698df177 |
| children |
| rev | line source |
|---|---|
|
7
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env python |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
2 import sys |
|
8
b7c1698df177
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit cc96dd4a8aef7d0b6d3057024af0344ab8a9410f"
iuc
parents:
7
diff
changeset
|
3 |
|
7
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
4 from Bio import SeqIO |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
5 |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
6 |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
7 # Process fasta data, extracting only headers |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
8 for idx, seq in enumerate(SeqIO.parse(sys.argv[1], "fasta")): |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
9 sys.stdout.write( |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
10 "chr - {seq_id} {seq_id} 0 {length} chr{idx}color\n".format( |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
11 seq_id=seq.id, idx=idx, length=len(seq) |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
12 ) |
|
ecaa0210e62b
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff
changeset
|
13 ) |
