This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem combining ptt, rnt files

Hi,

I'm analyzing bacterial RNA-seq data with EDGE-pro. The bacterial genome consists of the chromosome and 3 plasmids. I combined the fasta, ptt and rnt files using the cat command (as suggested by the EDGEpro manual) but the software refuses to read the files. The program has no problem running with the files for the chromosome alone. Is there a better way of combining fa/ptt/rnt files?

Thanks

rna-seq

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.

1 answer

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()

Log in to answer this question.