residues#

Utilities for loading and distributing the amino acid residue mass vocabulary. The bundled residues.yaml contains standard monoisotopic masses for all 20 canonical amino acids plus common modifications used by Casanovo.

Utilities for loading and distributing the amino acid residue mass vocabulary.

casanovoutils.residues.COMMANDS(destination_path: PathLike) None#

Copy the default residues.yaml file included with this package to a specified destination.

Parameters:

destination_path (PathLike) – Path to copy the YAML file to. May be a directory or a file path.

Return type:

None

casanovoutils.residues.dump_residues(destination_path: PathLike) None#

Copy the default residues.yaml file included with this package to a specified destination.

Parameters:

destination_path (PathLike) – Path to copy the YAML file to. May be a directory or a file path.

Return type:

None

casanovoutils.residues.get_residues(residues_path: PathLike | None = None) dict[str, float]#

Load a mapping of amino acid residue names to masses from a YAML file.

If residues_path is not provided, the function loads a default residues.yaml file located in the same directory as this module.

Parameters:

residues_path (PathLike, optional) – Path to a YAML file containing residue mass information. If None (default), the bundled residues.yaml file is used.

Returns:

A dictionary mapping residue identifiers (typically one-letter or multi-character amino acid codes) to their corresponding masses.

Return type:

dict[str, float]

casanovoutils.residues.main() None#