annotate karyotype-from-fasta.py @ 13:c4bde687c846 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 0cfd88d16b0b20a66d4b21b037ddee6a8c440d88
author iuc
date Wed, 12 Apr 2023 15:09:05 +0000
parents e6cbe3190642
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
4b519282a05b "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
4b519282a05b "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff changeset
2 import sys
8
e6cbe3190642 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit cc96dd4a8aef7d0b6d3057024af0344ab8a9410f"
iuc
parents: 7
diff changeset
3
7
4b519282a05b "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
4b519282a05b "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff changeset
5
4b519282a05b "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff changeset
6
4b519282a05b "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
4b519282a05b "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")):
4b519282a05b "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff changeset
9 sys.stdout.write(
4b519282a05b "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(
4b519282a05b "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)
4b519282a05b "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff changeset
12 )
4b519282a05b "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit ef20b4968a6d00c49209de6b723f8b96d8bd128a"
iuc
parents:
diff changeset
13 )