def process_Genbank( filename, org_num, refseq ): #extracts 'CDS', 'tRNA', 'rRNA' features from genbank file features = get_bed_from_genbank( filename, refseq, ['CDS', 'tRNA', 'rRNA'] ) for feature in features.keys(): feature_file = open( os.path.join( os.path.split( filename )[0], "%s.%s.bed" % ( refseq, feature ) ), 'wb+' ) feature_file.write( '\n'.join( features[feature] ) ) feature_file.close() print "Genbank extraction finished for chrom:", refseq, "file:", filename
def process_Genbank( filename, org_num, refseq ): # extracts 'CDS', 'tRNA', 'rRNA' features from genbank file features = get_bed_from_genbank( filename, refseq, ['CDS', 'tRNA', 'rRNA'] ) for feature in features.keys(): feature_file = open( os.path.join( os.path.split( filename )[0], "%s.%s.bed" % ( refseq, feature ) ), 'wb+' ) feature_file.write( '\n'.join( features[feature] ) ) feature_file.close() print "Genbank extraction finished for chrom:", refseq, "file:", filename
def process_Genbank(filename, org_num, refseq): # extracts 'CDS', 'tRNA', 'rRNA' features from genbank file features = get_bed_from_genbank(filename, refseq, ['CDS', 'tRNA', 'rRNA']) for feature, values in features.items(): feature_file = open( os.path.join( os.path.split(filename)[0], f"{refseq}.{feature}.bed"), 'wb+') feature_file.write('\n'.join(values)) feature_file.close() print("Genbank extraction finished for chrom:", refseq, "file:", filename)