Templates
- class enzymm.template.AnnotatedResidue(_atoms: Tuple[TemplateAtom, TemplateAtom, TemplateAtom], _vec: Vec3, _indices: Tuple[int, int], reference_idx: int, reference_pdb: HomologousPDB, reference_residue: ReferenceCatalyticResidue)
Child class inheriting from
Residuefor M-CSA annotated template residues.- reference_pdb
HomologousPDBThe PDB reference of the residue.
- reference_residue
ReferenceCatalyticResidueThe reference residue.
- __init__(_atoms: Tuple[TemplateAtom, TemplateAtom, TemplateAtom], _vec: Vec3, _indices: Tuple[int, int], reference_idx: int, reference_pdb: HomologousPDB, reference_residue: ReferenceCatalyticResidue) None
Initilaize a
Residueinstance from a triplet ofTemplateAtomobjects.- Parameters:
atoms –
tupleof 3TemplateAtominstances- Returns:
- property has_ptm: bool
Wether the residue in the M-CSA reference PDB structure was post-translationally modified
- class enzymm.template.AnnotatedTemplate(*, residues: Sequence[AnnotatedResidue], pdb_id: str, mcsa_id: int, number_of_mutated_residues: int, number_of_metal_ligands: Tuple[int, int], number_of_ptm_residues: Tuple[int, int], number_of_side_chain_residues: Tuple[int, int], total_reference_residues: int, assembly: int, id: str | None = None, template_id_string: str | None = None, cluster: Cluster | None = None, uniprot_id: str | None = None, organism: str | None = None, organism_id: str | None = None, resolution: float | None = None, experimental_method: str | None = None, enzyme_discription: str | None = None, represented_sites: int | None = None, ec: Iterable[str] = (), cath: Iterable[str] = ())
Child class inheriting from
Templatefor M-CSA annotated catalytic site templates.- __init__(*, residues: Sequence[AnnotatedResidue], pdb_id: str, mcsa_id: int, number_of_mutated_residues: int, number_of_metal_ligands: Tuple[int, int], number_of_ptm_residues: Tuple[int, int], number_of_side_chain_residues: Tuple[int, int], total_reference_residues: int, assembly: int, id: str | None = None, template_id_string: str | None = None, cluster: Cluster | None = None, uniprot_id: str | None = None, organism: str | None = None, organism_id: str | None = None, resolution: float | None = None, experimental_method: str | None = None, enzyme_discription: str | None = None, represented_sites: int | None = None, ec: Iterable[str] = (), cath: Iterable[str] = ())
Initialize an annotated template with descriptions of catalytic activity from the M-CSA.
- Keyword Arguments:
residues –
SequenceofResidueinstancespdb_id –
strThe PDB ID of the templatetemplate_id_string –
strString in the ID line of a templatemcsa_id –
intThe M-CSA entry index form which the template was generatedcluster –
ClusterInstance of the templateuniprot_id –
strUniProt Identifier of the Protein from which the template was generatedorganism –
strOrganism name of the Protein from which the template was generatedorganism_id –
strTaxonomic Identifier of the Organism of the Protein from which the template was generatedresolution –
floatResolution of the Protein Structure from which the template was generatedexperimental_method –
strExperimental method by which the Protein Structure of the template was resolvedenzyme_description –
strText Discription of the Protein from which the template was generatedrepresented_sites –
intThe number of Enzymes which this template is representative forec –
listofstrof EC numbers associated with Enzymes this template representscath –
listofstrof CATH numbers associated with Enzymes this template representsnumber_of_mutated_residues –
intThe number of side chain specific residues which have been mutated relative to the referencenumber_of_metal_ligands –
tupleof (int,int) Number of metal chelating residues in the template and the referencenumber_of_ptm_residues –
tupleof (int,int) Number of post translationally modified residues in the template and the referencenumber_of_side_chain_residues –
tupleof (int,int) Number of side chain interacting residues in the template and the referencetotal_reference_residues –
intTotal number of residues (main and side chain) in the reference structure
Note
In order for a template file to be loaded as an
AnnotatedTemplate, it must have both anmcsa_idand apdb_id. Thispdb_idmust be found in the PDB-homologs of the M-CSA!Note
It is recommended to not pass an
idstring. IfidisNone, theidwill be set to> {
effective_size}-Residues_{template_id_string}_Cluster_{Cluster.id}-{Cluster.member}-{Cluster.size}This identifier string should be unique.
- Returns:
- copy() AnnotatedTemplate
Create a copy of the template.
- Returns:
A new template object with identical attributes and a copy of the
TemplateAtomit contains.- Return type:
- classmethod load(file: TextIO | Iterator[str] | str | PathLike[str], id: str | None = None, warn: bool = False, with_annotations: bool = True) Template | AnnotatedTemplate
Overloaded load to parse a
pyjess.Templateand its associated info into aTemplateobject- Parameters:
file –
file-likeobject orstrorpath-likefrom which to loadid –
strorNoneInternal pyjess string which will superseed the ID string parsed from the template file. DefaultNonewith_annotations –
boolIf True (default) M-CSA derived templates with a PDB-id and M-CSA id will be annotated with extra information.
- Returns:
- classmethod loads(text: str, id: str | None = None, warn: bool = False, with_annotations: bool = True) Template | AnnotatedTemplate
Load Template from
str. CallsTemplate.load()- Parameters:
- Returns:
- class enzymm.template.Cluster(id: int, member: int, size: int)
Class for storing template cluster information.
- class enzymm.template.Residue(atoms: Tuple[TemplateAtom, TemplateAtom, TemplateAtom])
Class for storing template residues (defined as 3 atoms) with relevant information.
- __init__(atoms: Tuple[TemplateAtom, TemplateAtom, TemplateAtom])
Initilaize a
Residueinstance from a triplet ofTemplateAtomobjects.- Parameters:
atoms –
tupleof 3TemplateAtominstances- Returns:
- property allowed_residues: str
Get the allowed residue types as string of single letter codes.
- Type:
- property atoms: Tuple[TemplateAtom, TemplateAtom, TemplateAtom]
Get the
tupleof threeTemplateAtomdescribing the residue.
- property backbone: bool
True if an atom may match a backbone atom.
True if the atom may match backbone atoms. Check if the atom has ‘ANY’ or ‘XXX’ in its residue_names attribute
- Type:
- static calc_residue_orientation(atoms: Tuple[TemplateAtom, TemplateAtom, TemplateAtom]) Tuple[Vec3, Tuple[int, int]]
Method to calculate the residue orientation depending on the residue type.
- Parameters:
atoms –
tupleof 3TemplateAtom
Note
For symmetric atom triplets, the angle is calculated from the central atom to the midpoint between the two identical atom types. For non-symetric atom triplets, the angle is calculated between two atoms following the axis of polarization.
- Returns:
of
Residue.orientation_vectorandResidue.orientation_vector_indices- Return type:
- classmethod construct_residues_from_atoms(atoms: Iterable[TemplateAtom]) List[Residue]
Classmethod to construct a
ListofResiduefrom aninterableofTemplateAtom- Parameters:
atoms –
iterableofTemplateAtommodulo 3
Note
The atoms are chunked into residues of 3 atoms. Ensure the atoms are in order of residues!
- Returns:
of
Residue- Return type:
List
- classmethod from_molecule_residue(molecule: Molecule, residue_idx: int, chain_name: str, distance_weight: float = 0, match_mode: Literal[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 100, 101, 102, 103, 104, 105, 106, 107] = 0) Residue
Classmethod to construct a residue from a
Moleculeand residue indices- Parameters:
Note
Technically each atom in the residue could have a different match mode and distance weight. This behaviour is currently unsupported for this constructor. Raise an issue/pr if you desire this behaviour
- Returns:
- property orientation_vector: Vec3
Calculate the residue orientation vector according to the residue type.
- Type:
- class enzymm.template.Template(*, residues: Sequence[Residue], pdb_id: str | None = None, mcsa_id: int | None = None, id: str | None = None, template_id_string: str | None = None, cluster: Cluster | None = None, uniprot_id: str | None = None, organism: str | None = None, organism_id: str | None = None, resolution: float | None = None, experimental_method: str | None = None, enzyme_discription: str | None = None, represented_sites: int | None = None, ec: Iterable[str] = (), cath: Iterable[str] = ())
Class for storing templates and associated information.
Inherits and extends from
Template- __init__(*, residues: Sequence[Residue], pdb_id: str | None = None, mcsa_id: int | None = None, id: str | None = None, template_id_string: str | None = None, cluster: Cluster | None = None, uniprot_id: str | None = None, organism: str | None = None, organism_id: str | None = None, resolution: float | None = None, experimental_method: str | None = None, enzyme_discription: str | None = None, represented_sites: int | None = None, ec: Iterable[str] = (), cath: Iterable[str] = ())
Initialize a template.
- Keyword Arguments:
residues –
sequenceofResidueinstancespdb_id –
strThe PDB ID of the templatetemplate_id_string –
strString in the ID line of a templatemcsa_id –
intThe M-CSA entry index form which the template was generatedcluster –
ClusterInstance of the templateuniprot_id –
strUniProt Identifier of the Protein from which the template was generatedorganism –
strOrganism name of the Protein from which the template was generatedorganism_id –
strTaxonomic Identifier of the Organism of the Protein from which the template was generatedresolution –
floatResolution of the Protein Structure from which the template was generatedexperimental_method –
strExperimental method by which the Protein Structure of the template was resolvedenzyme_description –
strText Discription of the Protein from which the template was generatedrepresented_sites –
intThe number of Enzymes which this template is representative forec –
listofstrof EC numbers associated with Enzymes this template representscath –
listofstrof CATH numbers associated with Enzymes this template represents
Note
It is recommended not to pass an id string. If id is
None, the id string will be set to:> {
Template.dimension}-residues_{Template.template_id_string}_Cluster_{Cluster.id}-{Cluster.member}-{Cluster.size}This identifier string should be unique.
Note
residues can be constructed from a
listofTemplateAtomsvia the staticmethodResidue.construct_residues_from_atoms(atoms=atoms)Note
Iterating over
TemplategivesTemplateAtom. If you want to getResidue, iterate overTemplate.residues- Returns:
- copy() Template
Create a copy of the template.
- Returns:
A new template object with identical attributes and a copy of the
TemplateAtomit contains.- Return type:
- dump(file: TextIO)
Dump
Templatetofile-likeobject.- Parameters:
file –
file-likeobject to write to
- dumps() str
Dump
Templateto astr. CallsTemplate.dump()
- property effective_size: int
The number of unique residues in the template, excluding backbone residues and unspecific residues.
- Type:
- classmethod from_molecule(molecule: Molecule, residue_ids: List[Tuple[str, int]], cluster: Cluster | None = None, organism: str | None = None, organism_id: str | None = None, resolution: float | None = None, experimental_method: str | None = None, enzyme_description: str | None = None, uniprot_id: str | None = None, represented_sites: int | None = 1, ec: List[str] | None = None, cath: List[str] | None = None) Template
Classmethod to construct a template from a
Moleculeand a list of residue specifications- Parameters:
molecule –
Moleculeresidue_ids –
listoftupleofstrandintfor the chain_name and residue_indexcluster –
ClusterInstance of the templateorganism –
strOrganism name of the Protein from which the template was generatedorganism_id –
strTaxonomic Identifier of the Organism of the Protein from which the template was generatedresolution –
floatResolution of the Protein Structure from which the template was generatedexperimental_method –
strExperimental method by which the Protein Structure of the template was resolvedenzyme_description –
strText Discription of the Protein from which the template was generateduniprot_id –
strUniProt Identifier of the Protein from which the template was generatedrepresented_sites –
intThe number of Enzymes which this template is representative forec –
listofstrof EC numbers associated with Enzymes this template representscath –
listofstrof CATH numbers associated with Enzymes this template represents
Note
A template generated through this method will not specify an M-CSA id.
- Returns:
- classmethod from_structure_file(path: Path | TextIO | str, residue_ids: List[Tuple[str, int]]) Template
Classmethod to construct a template from a filepath to a structure and a list of residue specifications
- Parameters:
path –
path-likeorstrto a structure fileresidue_ids –
listoftupleofstrandintfor the chain_name and residue_indexuniprot_id –
strUniProt Identifier of the Protein from which the template was generatedec –
listofstrof EC numbers associated with Enzymes this template representscath –
listofstrof CATH numbers associated with Enzymes this template represents
Note
A template generated through this method will represent a single site and will not specify an M-CSA id or any other meta data.
- Returns:
- classmethod load(file: TextIO | Iterator[str] | str | PathLike[str], id: str | None = None, warn: bool = False) Template
Overloaded load to parse a
pyjess.Templateand its associated info into anTemplateobject
- classmethod loads(text: str, id: str | None = None, warn: bool = False) Template
Load Template from
str. CallsTemplate.load()
- class enzymm.template.Vec3(x: float, y: float, z: float)
Class for storing 3D vectors in XYZ.
- __add__(other: int | float | Vec3) Vec3
Overloads the + operator to add either an
int,floator otherVec3to aVec3.
- __matmul__(other: Vec3) float
Overloads the @ operator to perform dot product between two
Vec3vectors.
- __sub__(other: int | float | Vec3) Vec3
Overloads the - operator to subtract either an
int,floator otherVec3from aVec3.
- __truediv__(other: int | float | Vec3) Vec3
Overloads the / operator to divide a
Vec3object by either anint,floator otherVec3.
- enzymm.template.load_templates(template_dir: Path | None = None, warn: bool = False, verbose: bool = False, with_annotations: bool = True) Iterator[Template | AnnotatedTemplate]
Load templates from a given directory, recursively.
- Parameters:
template_dir –
Path|NoneDirectory which to search recursively for files with the ‘.pdb’ extension. By default, set toNone, it will load templates included in this library.warn –
boolIf warnings about annoation issues in templates should be printed. DefaultFalsewith_annotations –
boolIf True (default) M-CSA derived templates with a PDB-id and M-CSA id will be annotated with extra information.
- Yields: