Problem combining ptt, rnt files
1
2
Entering edit mode
9.5 years ago
yurists ▴ 20

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 • 3.4k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
2
Entering edit mode
8.2 years ago
rafa.rios.50 ▴ 60

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

Login before adding your answer.

Traffic: 2010 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6