molsysmt.build.get_non_standard_residues#

molsysmt.build.get_non_standard_residues(molecular_system, selection='all', syntax='MolSysMT', engine='MolSysMT')[source]#

Identify non-standard residues in a molecular system and suggest standard replacements.

This function detects residues whose names are not part of the standard set recognised by the backend and maps their group indices to the names of the standard residues that can be used as replacements.

Parameters:
  • molecular_system (molecular system) – Molecular system in any of the supported forms.

  • selection (str, list, tuple, or numpy.ndarray, default 'all') – Atom selection used to restrict the search to a subset of the system.

  • syntax (str, default 'MolSysMT') – Syntax used to interpret the selection string.

  • engine ({'MolSysMT', 'PDBFixer'}, default 'MolSysMT') –

    Backend used to detect non-standard residues.

    • 'MolSysMT': native implementation using MolSysMT’s built-in amino-acid database (~817 entries from MDTraj/PDB). Works with any supported form; no external dependency required.

    • 'PDBFixer': delegates to pdbfixer.findNonstandardResidues (~150-entry substitution table). Also reads MODRES records when the source is a PDB/mmCIF file.

Returns:

Dictionary mapping group (residue) indices (int) in the original molecular system to the names (str) of the closest standard residue replacements suggested by the backend.

Return type:

dict

Raises:

NotImplementedMethodError – Raised if the requested engine is not supported.

Notes

When engine='MolSysMT' the detection relies on the name_to_type table in molsysmt.element.group.amino_acid.group_types, which maps ~817 residue names (standard + non-standard amino acids, D-forms, protonation-state variants, PTMs) to their canonical 3-letter codes. A residue is reported as non-standard when its name maps to a different standard code (e.g. 'MSE''MET'). Residues that map to 'XAA' (completely unknown) are not reported.

Added in version 1.0.0.