This checksum is the same as seguid but with base64.urlsafe
encoding instead of the normal base64. This means that
the characters + and / are replaced with - and _ so that
the checksum can be part of a URL.
Turn a nucleotide sequence into a protein sequence by creating a new sequence object.
This method will translate DNA or RNA sequences. It should not
be used on protein sequences as any result will be biologically
meaningless.
Parameters:
name (- table - Which codon table to use? This can be either a) – (string), an NCBI identifier (integer), or a CodonTable
object (useful for non-standard genetic codes). This
defaults to the “Standard” table.
string (- stop_symbol - Single character) – terminators. This defaults to the asterisk, “*”.
for (what to use) – terminators. This defaults to the asterisk, “*”.
Boolean (- cds -) – translation continuing on past any stop codons (translated as the
specified stop_symbol). If True, translation is terminated at
the first in frame stop codon (and the stop_symbol is not
appended to the returned protein sequence).
full (defaults to False meaning do a) – translation continuing on past any stop codons (translated as the
specified stop_symbol). If True, translation is terminated at
the first in frame stop codon (and the stop_symbol is not
appended to the returned protein sequence).
Boolean – this checks the sequence starts with a valid alternative start
codon (which will be translated as methionine, M), that the
sequence length is a multiple of three, and that there is a
single in frame stop codon at the end (this will be excluded
from the protein sequence, regardless of the to_stop option).
If these tests fail, an exception is raised.
True (indicates this is a complete CDS. If) – this checks the sequence starts with a valid alternative start
codon (which will be translated as methionine, M), that the
sequence length is a multiple of three, and that there is a
single in frame stop codon at the end (this will be excluded
from the protein sequence, regardless of the to_stop option).
If these tests fail, an exception is raised.
:paramthis checks the sequence starts with a valid alternative start
codon (which will be translated as methionine, M), that the
sequence length is a multiple of three, and that there is a
single in frame stop codon at the end (this will be excluded
from the protein sequence, regardless of the to_stop option).
If these tests fail, an exception is raised.
Parameters:
gaps. (- gap - Single character string to denote symbol used for) – Defaults to the minus sign.
A Seq object is returned if translate is called on a Seq
object; a MutableSeq object is returned if translate is called
pn a MutableSeq object.
It isn’t a valid CDS under NCBI table 1, due to both the start codon
and also the in frame stop codons:
>>> coding_dna.translate(table=1,cds=True)Traceback (most recent call last):...Bio.Data.CodonTable.TranslationError: First codon 'GTG' is not a start codon
If the sequence has no in-frame stop codon, then the to_stop argument
has no effect:
NOTE - Ambiguous codons like “TAN” or “NNN” could be an amino acid
or a stop codon. These are translated as “X”. Any invalid codon
(e.g. “TA?” or “T-A”) will throw a TranslationError.
NOTE - This does NOT behave like the python string’s translate
method. For that use str(my_seq).translate(…) instead
Transcribe a DNA sequence into RNA and return the RNA sequence as a new Seq object.
Following the usual convention, the sequence is interpreted as the
coding strand of the DNA double helix, not the template strand. This
means we can get the RNA sequence just by switching T to U.
As Seq objects are immutable, a TypeError is raised if
transcribe is called on a Seq object with inplace=True.
Trying to transcribe an RNA sequence has no effect.
If you have a nucleotide sequence which might be DNA or RNA
(or even a mixture), calling the transcribe method will ensure
any T becomes U.
Trying to transcribe a protein sequence will replace any
T for Threonine with U for Selenocysteine, which has no
biologically plausible rational.
As Seq objects are immutable, a TypeError is raised if
transcribe is called on a Seq object with inplace=True.
Trying to back-transcribe DNA has no effect, If you have a nucleotide
sequence which might be DNA or RNA (or even a mixture), calling the
back-transcribe method will ensure any U becomes T.
Trying to back-transcribe a protein sequence will replace any U for
Selenocysteine with T for Threonine, which is biologically meaningless.
This checksum is the same as seguid but with base64.urlsafe
encoding instead of the normal base64. This means that
the characters + and / are replaced with - and _ so that
the checksum can be part of a URL.