Question: Problem combining ptt, rnt files
2
gravatar for yurists
4.4 years ago by
yurists20
Canada
yurists20 wrote:

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 • 1.9k views
ADD COMMENTlink modified 3.1 years ago by rafa.rios.5050 • written 4.4 years ago by yurists20

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 REPLYlink written 4.4 years ago by Chris S.290
1
gravatar for rafa.rios.50
3.1 years ago by
rafa.rios.5050
Colombia
rafa.rios.5050 wrote:

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 COMMENTlink written 3.1 years ago by rafa.rios.5050
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1086 users visited in the last hour