I have this script to create the fasta, ptt and rnt files required from a genbank annotation file from the ncbi I hope it will help, it requires biopython to parse the genbank file and to write the fasta file.
from Bio import SeqIO
annotation_file = ""
rnt_file = ""
ptt_file = ""
fasta_file = ""
r = SeqIO.parse(annotation_file, "gb")
for record in r:
fasta_file = open(fasta_file, "a")
SeqIO.write(record, fasta_file, "fasta")
fasta_file.close()
record.features = [f for f in record.features if f.type == "rRNA" or f.type == "tRNA"]
fout = open(rnt_file, "a")
fout.write("{0} - 0..{1}\n".format(record.description, len(record)))
fout.write("{0} RNAs\n".format(len(record.features)))
fout.write("Location\tStrand\tLength\tPID\tGene\tSynonym Code\tCOG\tProduct\n")
strand = {1:'+', -1:'-'}
for f in record.features:
fout.write("{0}\n".format("\t".join([str(f.location.start)+".."+str(f.location.end),strand[f.strand],str(abs(f.location.start-f.location.end)),'-',f.qualifiers["locus_tag"][0],f.qualifiers["locus_tag"][0],"-",f.qualifiers["product"][0]])))
fout.close()
r = SeqIO.parse(annotation_file, "gb")
for record in r:
record.features = [f for f in record.features if f.type == "CDS"]
fout = open(ptt_file, "a")
fout.write("{0} - 0..{1}\n".format(record.description, len(record)))
fout.write("{0} proteins\n".format(len(record.features)))
fout.write("Location\tStrand\tLength\tPID\tGene\tSynonym Code\tCOG\tProduct\n")
for f in record.features:
fout.write("{0}\n".format("\t".join([str(f.location.start)+".."+str(f.location.end),strand[f.strand],str(abs(f.location.start-f.location.end)),'-',f.qualifiers["locus_tag"][0],f.qualifiers["locus_tag"][0],"-",f.qualifiers["product"][0]])))
fout.close()
What genome is it? And do you have 4 files of each type? With three plasmids, one is probably small and missing rnas, so you may have to re-order according to the WARNING in the manual.