Hello
I'm trying to import a fasta sequence using the SeqIO library and i'm having trouble using a method on my sequence - of which I want the console to spit out the resultant mRNA sequence.
- import library: from Bio import SeqIO
- set sequence object: sequence = SeqIO.parse(open(fastaFile),'fasta')
enter the loop in order to access the sequence data (which is now stored as 2 data members .id and .seq in the list/array records): for sequence in record:
This is where i'm having trouble:
>>>for sequence in records: . . . mRNA = record.seq.transcribe() . . . print mRNA
I want to take the data stored in record.id and by using function transcribe(), perform the function and set it equal to a new object value that I can print. Where am I going wrong? Do I need to create a list object mRNA in order to load the record.id?
Thank you
What error are you getting?
Are you sure that
.transcribe()
is a method of.id
?I'm not getting any errors, it simply doesn't print the object MRNA so I figured my syntax is wrong. And no I don't think .transcribe() is a method of .id. I believe it's a built in method in bio python library Seq
You probably should call transcribe() on the record itself.
record is an array of .id and .seq so I dont think i'm declaring the object mRNA correctly?, Or i'm not passing the .seq/.id data member into the object correctly because that still isn't proper syntax for it to print mRNA.
Thanks
Please add code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
This may conflict with numbering, but spending some effort properly formatting a post will make things much clearer for us.