Advertisement
eni86

db.py

Jan 29th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import gffutils
  2. import sys
  3. def parse_anotation(anotation_file):
  4.     anotation = gffutils.create_db(dbfn=anotation_file, data="Somedata", force=True, keep_order=True, merge_strategy='merge', sort_attribute_values=True)
  5.     db = gffutils.FeatureDB(anotation, keep_order=True)
  6.  
  7.     return db
  8.  
  9. def main(anotation_file):
  10.     anotation = parse_anotation(anotation_file)
  11.     for item in anotation.children(gene, featuretype="CDS"):
  12.         print (item.start," ",item.end)
  13.  
  14. main(sys.argv[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement