pestifer.objs.link module¶
A Link is a covalent bond between two residues in a protein structure.
- class pestifer.objs.link.Link(*args, chainID1: str, resid1: ResID, name1: str, chainID2: str, resid2: ResID, name2: str, altloc1: str | None = None, altloc2: str | None = None, resname1: str | None = None, resname2: str | None = None, sym1: str | None = None, sym2: str | None = None, link_distance: float | None = None, segname1: str | None = None, segname2: str | None = None, residue1: Residue = None, residue2: Residue = None, atom1: Atom = None, atom2: Atom = None, empty: bool | None = None, segtype1: str | None = None, segtype2: str | None = None, ptnr1_label_asym_id: str | None = None, ptnr2_label_asym_id: str | None = None, ptnr1_label_seq_id: str | None = None, ptnr2_label_seq_id: str | None = None, ptnr1_label_comp_id: str | None = None, ptnr2_label_comp_id: str | None = None, ptnr1_auth_asym_id: str | None = None, ptnr2_auth_asym_id: str | None = None, ptnr1_auth_seq_id: str | None = None, ptnr2_auth_seq_id: str | None = None, ptnr1_auth_comp_id: str | None = None, ptnr2_auth_comp_id: str | None = None, patchname: str | None = None, patchhead: int | None = None)[source]¶
Bases:
BaseObjA class for handling covalent bonds between residues where at least one residue is non-protein
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': False}¶
Configuration for
pydantic.BaseModel.
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- name2: str¶
Required attributes for a Link object. These attributes must be provided when creating a Link object.
chainID1: The chain ID of the first residue in the link.resid1: The residue ID of the first residue in the link.name1: The name of the first atom in the link.chainID2: The chain ID of the second residue in the link.resid2: The residue ID of the second residue in the link.name2: The name of the second atom in the link.
- patchhead: int | None¶
Optional attributes for a Link object. These attributes can be provided to modify the behavior of the link. -
residue1: The first residue object in the link. -residue2: The second residue object in the link. -atom1: The first atom object in the link. -atom2: The second atom object in the link. -empty: A boolean indicating if the link is empty. -segtype1: The segment type of the first residue. -segtype2: The segment type of the second residue. -ptnr1_label_asym_id: The asym ID of the first partner in the link (mmCIF). -ptnr2_label_asym_id: The asym ID of the second partner in the link (mmCIF). -ptnr1_label_seq_id: The sequence ID of the first partner in the link (mmCIF). -ptnr2_label_seq_id: The sequence ID of the second partner in the link (mmCIF). -ptnr1_label_comp_id: The component ID of the first partner in the link (mmCIF). -ptnr2_label_comp_id: The component ID of the second partner in the link (mmCIF). -ptnr1_auth_asym_id: The author asym ID of the first partner in the link (mmCIF). -ptnr2_auth_asym_id: The author asym ID of the second partner in the link (mmCIF). -ptnr1_auth_seq_id: The author sequence ID of the first partner in the link (mmCIF). -ptnr2_auth_seq_id: The author sequence ID of the second partner in the link (mmCIF). -ptnr1_auth_comp_id: The author component ID of the first partner in the link (mmCIF). -ptnr2_auth_comp_id: The author component ID of the second partner in the link (mmCIF). -patchname: The name of the patch applied to the link. -patchhead: 1 = residue1 is the first residue in the link, 2 = residue2 is the first residue in the link.
- set_patchname(force=False)[source]¶
Set the charmmff patch name for this link. This method assigns a patch name based on the residues involved in the link. If the patch name is already set and
forceis False, it will not change the patch name. This method does not return any value. It modifies thepatchnameattribute of the Link object. It checks the residues involved in the link and assigns a patch name based on predefined mappings.- Parameters:
force (bool, optional) – If True, forces the patch name to be set even if it is already assigned. Default is False.
- class pestifer.objs.link.LinkList(initlist: Iterable[T] = ())[source]¶
Bases:
BaseObjList[Link]A class for handling lists of Links
- apply_segtypes(map)[source]¶
Apply segtype values to each of the two residues using the map
- Parameters:
map (dict) – map of segtypes for given resnames
- assign_residues(Residues: ResidueList) tuple['ResidueList', 'LinkList'][source]¶
Assigns residue and atom pointers to each link; sets up the up and down links of both residues so that linked residue objects can reference one another; flags residues from list of residues passed in that are not assigned to any links
- Parameters:
Residues (ResidueList) – list of residues to assign to links; this is typically a list of all residues in the structure, but it can also be a list of residues that are not linked to any other residues, such as when reading in a set of links from a pre-built psf file.
- Returns:
Residues – list of residues from Residues that are not used for any assignments
- Return type:
- describe() str[source]¶
Returns a string description of the LinkList.
- Returns:
A string describing the number of links in the list.
- Return type:
- classmethod from_cif(dc: DataContainer) LinkList[source]¶
Create a LinkList from a CIF DataContainer.
- Parameters:
dc (DataContainer) – A CIF DataContainer containing the necessary fields to create Link objects.
- Returns:
An instance of LinkList created from the CIF DataContainer.
- Return type:
- classmethod from_pdb(pdb: PDBRecordDict) LinkList[source]¶
Create a LinkList from a PDBRecordDict.
- pestifer.objs.link.ic_reference_closest(res12: list['Residue'], ICmaps: list[dict]) str[source]¶
Given the two Residues in res12 and the maps in ICmaps, return the mapping key to which the given IC values are closest in a Euclidean sense.
This method will identify the four atoms of the IC and reference them directly when calling the measure_dihedral function.
The list of computed dihedral values from the set of atoms is a “point” in “IC-space”, and each patch has its own “reference point” in this space.
The reference point to which the point is closest is identified as the desired result.
- Parameters:
res12 (list) – exactly two Residue objects which must have lists of atoms attributes
A list of dictionaries, each with the following structure:
Key
Description
ICatomnames
List of 4 atom names as they appear in the CHARMM FF IC.
mapping
Dictionary mapping patch names to IC values.