Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. from Bio import SeqIO
  2.  
  3. o = open("locus-tags.csv",'w')
  4. o.write("old-tag,new-tag\n")
  5.  
  6. for seq in SeqIO.parse(open("file.gbk",'r'),'genbank'):
  7. for f in seq.features:
  8. if f.type == "gene":
  9. o.write("{},{}\n".format(f.qualifiers["old_locus_tag"][0],f.qualifiers["locus_tag"][0])
  10.  
  11. o.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement