[Biopython] is_aa() returning true on nonstandard amino acids

Peter Cock p.j.a.cock at googlemail.com
Fri Apr 21 20:23:11 UTC 2017


On Fri, Apr 21, 2017 at 7:37 PM, Ahmad Abdelzaher
<underoath006 at gmail.com> wrote:
> I was really happy that I found out about is_aa, however, I just found out
> that it returns false positives on a lot of modified residues like
> S-NITROSO-CYSTEINE (SCN) and a few others.
>
> Is it supposed to do that? Is there another method for standard amino acids
> only?

Er, probably. To me that is a modified amino acid, so still an amino
acids - but hopefully one of the structure experts will comment.

> Also sorry to hijack my own thread, but I was trying to sample some random
> structures with certain constraints using the PDB's advanced search. I
> specifically chose no ligands or modified residues, yet  I still get those
> in my structures, any idea why?
>
> Finally, noob question, is_aa doesn't work unless I do "from
> Bio.PDB.Polypeptide import is_aa" or "from Bio.PDB.Polypeptide import *",
> but doesn't work if I do "from Bio.PDB import Polypeptide", doesn't the
> class come with all its methods?

Here Polypeptide is not a class but a module, so if you do the
import as "from Bio.PDB import Polypeptide" then you should
be able to access the function as "Polypeptide.is_aa".

Using "import *" is not recommended style.

Modern Python follows the PEP8 style guidelines which use
all lower case for all module names, but Bio.PDB predates this
convention, and can cause confusion as a result.

Peter


More information about the Biopython mailing list