pestifer.core.labels module

Labels and segtypes for residues This module defines the segment types and residue names used in CHARMM and PDB files, along with their mappings. It also provides a class for managing these labels and mappings.

class pestifer.core.labels.LabelMappers[source]

Bases: object

Class to hold label mappers for residue names and segment types.

update_alias_mappings()[source]

Update the alias mappings for residues based on the current aliases.

update_aliases(residue_aliases=[], atom_aliases=[])[source]

Update the aliases with new residue and atom aliases.

Parameters:
  • residue_aliases (list) – A list of strings containing new residue aliases to be added. Each string should be in the format “RESNAME ALIAS”.

  • atom_aliases (list) – A list of strings containing new atom aliases to be added. Each string should be in the format “RESNAME ATOMNAME ALIAS”.

update_atomselect_macros(fp)[source]

Update the atomselect macros in the file fp based on the segtypes dict. This is a developer-only feature. Access to this method is provided by the pestifer modify-package command (see pestifer.cli.pestifer.modify_package()).

update_segtypes(new_segtypes)[source]

Update the segment types with new resnames.

Parameters:

new_segtypes (dict) – A dictionary containing new segment types to be added or updated. Each key is a segment type, and the value is a list of residue names to add to that segment type.

pestifer.core.labels.Labels = <pestifer.core.labels.LabelMappers object>

Global instance of LabelMappers class to access segment types and residue names. This instance provides access to the segment types and residue names used in CHARMM and PDB files. It allows for easy mapping between residue names and their corresponding segment types, as well as providing access to the CHARMM residue names for PDB residue names. Any module file that imports Labels from pestifer.core.labels will have access to this instance. This is useful for tasks that require residue name and segment type management, such as preparing input files for molecular simulations or analyzing protein structures.