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 supported MolSysMT format.

  • selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.

  • syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).

  • engine (object, default='MolSysMT') – Argument engine.

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.