[Biopython] gff3file

Atteyet-Alla.Yassin Atteyet-Alla.Yassin at ukb.uni-bonn.de
Wed Jun 3 12:58:53 UTC 2015


I hope that is now right. I obtained the following erreor

 >>> from Bio import SeqIO
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named 'Bio'
 >>> with open("CP008802.out", "w") as output:
... 
output.write("Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n")
...     for record in SeqIO.parse("CP008802.txt", "genbank"):
...         print("Converting %s" % record.name)
...         for f in record.features:
...             if f.type != "gene":
...                 continue
...             locus_tag = f.qualifiers["locus_tag"][0]
...             if len(f.location.parts) > 1:
...                 print("What should we do for %s (compound location)? 
%s" % (locus_tag, f.location))
...                 continue
... 
output.write('%s\tGenBank\t%s\t%i\t%i\t0,000000\t%s\t.\tlocus_tag\t"%s"; 
transcript_id "%s"\n'
...                          % (record.name, f.type,
...                             f.location.start + 1, f.location.end, 
f.location.strand,
...                             locus_tag, locus_tag))
... print("Done")



More information about the Biopython mailing list