Mercurial > repos > iuc > transtermhp
comparison transtermhp.py @ 3:1a1ec22a7e28 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/transtermhp commit 581d451609b919893ba53d104a5bcf2e9e565d1d
author | iuc |
---|---|
date | Wed, 07 Jun 2017 07:53:53 -0400 |
parents | c28817831a24 |
children | 9a90656a1af9 |
comparison
equal
deleted
inserted
replaced
2:1d8ad7599f02 | 3:1a1ec22a7e28 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 import sys | |
3 import re | 2 import re |
4 import subprocess | 3 import subprocess |
4 import sys | |
5 | |
6 from BCBio import GFF | |
5 from Bio import SeqIO | 7 from Bio import SeqIO |
6 from BCBio import GFF | 8 from Bio.SeqFeature import ( |
7 from Bio.SeqFeature import SeqFeature, FeatureLocation | 9 FeatureLocation, |
10 SeqFeature | |
11 ) | |
8 | 12 |
9 | 13 |
10 def main(expterm, fasta, gff3): | 14 def main(expterm, fasta, gff3): |
11 with open(fasta, 'r') as handle: | 15 with open(fasta, 'r') as handle: |
12 seq_dict = SeqIO.to_dict(SeqIO.parse(handle, "fasta")) | 16 seq_dict = SeqIO.to_dict(SeqIO.parse(handle, "fasta")) |
63 } | 67 } |
64 ) | 68 ) |
65 rec.features.append(feature) | 69 rec.features.append(feature) |
66 yield rec | 70 yield rec |
67 | 71 |
72 | |
68 if __name__ == '__main__': | 73 if __name__ == '__main__': |
69 for record in main(*sys.argv[1:4]): | 74 for record in main(*sys.argv[1:4]): |
70 GFF.write([record], sys.stdout) | 75 GFF.write([record], sys.stdout) |