You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a minor issue, first the NCBI have not yet updated the computer readable file ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt (which I've emailed them about), but we could add the tables by hand (as we had to for Table 26).
However there is also a larger issue: What to do with Tables 27, 28 and 31 where some codons can be an amino acid or a stop codon? I think we can store that in the existing codon table object, but it has troubling implications for down stream analysis like ORF finding or our translate functionality.
This gives a new meaning to the term ambiguous codon, because here the bases themselves are unambiguous.
I just stumbled upon this issue while working on CodonTable.py for coding style issues.
The current update_NCBI_codon_table.py script will not recognize these 'alternative' stop codons, but it's easy to change that (I did this already in my branch).
What would you suggest for the moment? Not implementing these codon tables (27, 28, 31) at all? Raising a warning when they are imported? Raising a warning or an error when they are used for translation?
My suggestion would be to give a warning if one of these tables is used in Bio.Seq.translate. We should throw an error if to_stop is True. If cds is True the respective codons should only be interpreted as stop codons if they are the last codon.
Just a quick idea: Since all amino acid letters in the codon tables are uppercase, how about encoding 'amino acid or stop' as lowercase letter?
Are there other places in Biopython where these codon tables would make trouble?
There may be a few people using the codon tables directly, but the main use case is in Bio.Seq for translation.
I agree that if translate(..., cds=True) is used we have a clear interpretation: Any special ambiguous codons during the sequence are amino acids, but as the final codon are a stop codon.
Perhaps the safest option if cds=False and one of these special codons appears is to raise an exception (which we can change in future?). Another option if cds=False is to give a warning, but translate the special codons as amino acids?
I am against using lower case for 'amino acid or stop', there are too many other ad-hoc uses of case to confusing things.
At least for the taxa of tables 27 and 28, Swart et al. (2016) (fig 6, S5) suggests that there are some telltale signs to possibly distinguish AA vs stop.
A "possible stop codon" indication as suggested by MarkusPiotrowski could retain some information to help a human figure out that sort of thing with some simple heuristics (example: we know the 3' UTR is short, so we go back 10-ish "aa"s in the translation and pick the first possible stop). Since lowercase is ruled out, we might need to change return type.
... or we could just pass in a better CDS in the first place and not bother with post-translation guessing.
Activity
Adding NCBI genetic code tables up to 25.
peterjc commentedon May 10, 2017
Based on archive.org, the new tables 27 to 31 were added between 28 Oct and 26 Nov 2016.
peterjc commentedon Sep 22, 2017
I emailed the NCBI about this again, it looks like the source file has been updated based on https://www.ncbi.nlm.nih.gov/IEB/ToolBox/C_DOC/lxr/source/data/gc.prt - but the public copy on the FTP site has not.
Also the website says "Last update of the Genetic Codes: Nov. 18, 2016" which fits with my estimate based on archive.org
peterjc commentedon Oct 31, 2017
Good news: The NCBI's GenBank taxonomy team got in touch by email, and the FTP site has been updated with version 4.2 of the genetic codes:
ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt
That still leaves the tricky question of how we're going to represent these new codons which can be stop of an amino acid in Biopython...
MarkusPiotrowski commentedon Dec 30, 2017
I just stumbled upon this issue while working on
CodonTable.pyfor coding style issues.The current
update_NCBI_codon_table.pyscript will not recognize these 'alternative' stop codons, but it's easy to change that (I did this already in my branch).What would you suggest for the moment? Not implementing these codon tables (27, 28, 31) at all? Raising a warning when they are imported? Raising a warning or an error when they are used for translation?
My suggestion would be to give a warning if one of these tables is used in
Bio.Seq.translate. We should throw an error ifto_stopisTrue. IfcdsisTruethe respective codons should only be interpreted as stop codons if they are the last codon.Just a quick idea: Since all amino acid letters in the codon tables are uppercase, how about encoding 'amino acid or stop' as lowercase letter?
Are there other places in Biopython where these codon tables would make trouble?
peterjc commentedon Jan 1, 2018
There may be a few people using the codon tables directly, but the main use case is in
Bio.Seqfor translation.I agree that if
translate(..., cds=True)is used we have a clear interpretation: Any special ambiguous codons during the sequence are amino acids, but as the final codon are a stop codon.Perhaps the safest option if
cds=Falseand one of these special codons appears is to raise an exception (which we can change in future?). Another option ifcds=Falseis to give a warning, but translate the special codons as amino acids?I am against using lower case for 'amino acid or stop', there are too many other ad-hoc uses of case to confusing things.
peterjc commentedon Feb 23, 2018
Closed by #1501
Artoria2e5 commentedon Dec 21, 2023
At least for the taxa of tables 27 and 28, Swart et al. (2016) (fig 6, S5) suggests that there are some telltale signs to possibly distinguish AA vs stop.
A "possible stop codon" indication as suggested by MarkusPiotrowski could retain some information to help a human figure out that sort of thing with some simple heuristics (example: we know the 3' UTR is short, so we go back 10-ish "aa"s in the translation and pick the first possible stop). Since lowercase is ruled out, we might need to change return type.
... or we could just pass in a better CDS in the first place and not bother with post-translation guessing.
peterjc commentedon Dec 21, 2023
I agree with your final line - let's not do any guessing/heuristics here.