Dear all,
This is my first time working with Biopython. I tried to translate unambigous rna sequences from a multi-fasta format file (containing 5 different random sequences) with 3 frame shifts (= meaning getting all possible translation of the RNA sequence). I got this part with the help of Biopython Tutorial and Cook book pdf . “onlinehttp://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc35”
Then I tried to write all the possible translation into a new file. And here I am, stuck.
What I already tried:
1) Using Bio.SeqRecord I get only 5 translations of the 5 different RNA sequences. So I don’t get the other 2 frame shifted translation sequences under the original one.
2) And I even tried it with records but then I get 3 sequences only translated. But these are from the last sequence (= means 5th sequence from fasta file) of the random RNA with all 3 possible translation of RNA.
I did not find any other method that could write my translated sequences into a new fasta file. Please help I have tried everything. That means that I have even tried to write all the sequences with hand (see site: writing sequence files) even this attempt was not successful because every translated frame was written in one single line. So I got 5 lines, with 1 line containing all possible translations. What I am trying to achieve is to put all the translated sequences into a fasta file. This means there should be in total 15 sequences.
It'd be helpful to post some code snippets to illustrate what you'd tried. Without checking into biopython's ability to translate 3 frames directly from the interface, one approach can be
rec.seq.translate()
,rec.seq[1:].translate()
, andrec.seq[2:].translate()
.I already tried that but then also I would only get 5 translated sequences that are in the frame. The other 2 translations are not there.
This code will give:
TypeError: __init__() got an unexpected keyword argument 'seq1'
Please use the formatting bar (especially the
code
option) to present your post better. I've done it for you this time.Thank you!
Sorry, Thanks :)