orthonym.rules.amino_acids#
Note
Internal API. Names and behaviour may change between releases.
Amino acid detection and naming.
Alpha-amino acids have the general structure: H2N-CHR-COOH SMARTS pattern: [NX3;H2,H1][CX4][CX3](=O)[OX2H1]
For standard amino acids, trivial names are used. For non-standard, systematic naming applies: - Carboxylic acid is principal group - Amine becomes “amino” prefix
Peptide guard: molecules with peptide bonds (-C(=O)-NH-) are NOT simple amino acids and must NOT be flattened to “2-aminoXXXanoic acid”.
- orthonym.rules.amino_acids.count_peptide_bonds(mol)#
Count the number of peptide bonds (-C(=O)-NH-CH-) in a molecule.
Peptide bonds link amino acid residues. A molecule with >= 1 peptide bond is a peptide, not a simple amino acid.
- Parameters:
mol – RDKit Mol object
- Returns:
Number of peptide bond matches found
- Return type:
int
- orthonym.rules.amino_acids.is_peptide(mol)#
Check if molecule contains peptide bonds (is a di/tri/polypeptide).
A molecule with one or more -C(=O)-NH-CH- linkages is a peptide, not a simple amino acid. Must also have the amino acid pattern (terminal NH2 + COOH) to distinguish from random amides.
- Parameters:
mol – RDKit Mol object
- Returns:
True if molecule is a peptide (has amino acid pattern AND peptide bonds)
- Return type:
bool
- orthonym.rules.amino_acids.detect_amino_acid(mol)#
Check if molecule is an amino acid.
Detects alpha-amino acid pattern: NH2-CH(R)-COOH
- Parameters:
mol – RDKit Mol object
- Returns:
True if molecule contains alpha-amino acid pattern
- Return type:
bool
- orthonym.rules.amino_acids.get_amino_acid_atoms(mol)#
Get atom indices of alpha-amino acid core.
The SMARTS pattern [NX3;H2,H1][CX4][CX3](=O)[OX2H1] matches: - N (amino nitrogen) - alpha_C (alpha carbon attached to N) - carbonyl_C (carboxylic acid carbon) - carbonyl_O (=O oxygen) - acid_O (OH oxygen)
- Returns:
Tuple of (N, alpha_C, carbonyl_C, carbonyl_O, acid_O) atom indices, or None
- Return type:
Tuple[int, int, int, int, int] | None
- orthonym.rules.amino_acids.name_amino_acid(mol, canonical_smiles)#
Generate name for an amino acid.
For standard amino acids, returns trivial name. For non-standard, returns systematic name.
a phase-02: SMILES lookup is checked BEFORE the alpha-amino acid SMARTS gate. This allows non-alpha amino acids (taurine, creatine, etc.) that are in the OPSIN vocabulary to be named correctly via direct SMILES lookup.
Peptide guard: if the molecule contains peptide bonds (-C(=O)-NH-), it is NOT a simple amino acid. Returns None so the molecule falls through to the general naming pipeline (or returns None for complex peptides beyond current scope).
- Parameters:
mol – RDKit Mol object
canonical_smiles (str) – Canonical SMILES of the molecule
- Returns:
Amino acid name, or None if not an amino acid or is a peptide
- Return type:
str | None
- orthonym.rules.amino_acids.is_n_substituted_amino_acid(mol)#
Check if amino acid has N-substituents (like sarcosine = N-methylglycine).