Seq.translate(myseq) vs. myseq.translate()
0
1
Entering edit mode
8.7 years ago
uki ▴ 40

This might be a rather trivial question but I am interested in what goes on under the hood, when you translate a nucleotide sequence to an amino acid sequence using Biopython (v: 1.66, if it's important)

I dont really recall where I saw it but I was initially using what I can only refer to as static calls (Java-talk) to the Seq module e.g. Seq.translate(myseq) and then apply str() on that. I noticed that doing it this way, given several million sequences from MiSeq platform, the script was taking significant amounts of memory from the system. If I switch to myseq.translate() the memory usage stay significantly lower for some reason.

Any ideas as to what might be the difference between these two methods?

ngs biopython translation • 1.8k views
ADD COMMENT
1
Entering edit mode

Can you add a bit more code to make it clear what you are doing? My hunch is you are comparing the function (which can act on strings of Seq objects) to the Seq object method. e.g.

>>> from Bio.Seq import Seq, translate
>>> print(Seq("AAAACT").translate())
KT
>>> print(translate("AAAACT"))
KT
>>> print(translate(Seq("AAAACT")))
KT

These will have different speeds, but what you describe with significant memory usage suggests something else was going on.

ADD REPLY

Login before adding your answer.

Traffic: 2324 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