Example #1
0
 def setUp(self):
     test_input = test_genbank.yeast
     self.test_file = "test.gbk"
     self.out_file = "out.fa"
     handle = open(self.test_file,'w')
     handle.write(test_input)
     handle.close()
     genbank_annotation.parse("NC_12345",self.test_file,open(self.out_file,'w'))
Example #2
0
def go(root_dir,output_file,index_obj=None,types=[".gbk",".gff"]):
    outHandle = open(output_file,'w')
    for root, subFolders, files in os.walk(root_dir):
        for fname in files:
            genome_files = []
            organism,ext = os.path.splitext(os.path.basename(fname))
            if ext==".gbk" and ext in types:
                absfile=os.path.join(root,fname)
                genbank_annotation.parse(organism,absfile,outHandle)
            elif ext==".gff" and ext in types:
                absfile=os.path.join(root,fname)
                gff_annotation.parse(organism,absfile,index_obj,outHandle)