packman.molecule.chain module¶
The ‘Chain’ object host file.
This is file information, not the class information. This information is only for the API developers. Please read the ‘Chain’ object documentation for details.
- Citation:
- Pranav M Khade, Robert L Jernigan, PACKMAN-Molecule: Python Toolbox for Structural Bioinformatics, Bioinformatics Advances, 2022;, vbac007, https://doi.org/10.1093/bioadv/vbac007
Example:
from packman.molecule import Chain
help( Chain )
Note
- Iterating over chain only fetches the residues not the hetero atoms
- The object fetches the atoms and residues which are not in order as they appear in the PDB. Find a way to fix this
- Authors:
- Pranav Khade(https://github.com/Pranavkhade)
-
class
packman.molecule.chain.Chain(id)¶ Bases:
objectThis class contains the information about the ‘Chain’ object (packman.molecule.Chain).
This class contains all the information available about the Chain and stores the corresponding ‘Residue’ and ‘Hetmol’ objects in itself. The Chain class is the third lowest in the hierarchy of the ‘molecule’ API classes. the order of hierarchy being: Protein> Model> Chain> Residue> Atom. This class is also the component of the ‘molecule’ module API. Please read the Tutorials and Documentation for more details.
Note
- Please refer to the [https://web.archive.org/web/20080905024351/http://www.wwpdb.org/docs.html] for the description of the arguments.
- Add get_atoms()
Parameters: id (str) – Chain ID from the PDB file as it is. Each Chain in a PDB file Model/Frame has unique ID. (essential) -
calculate_entropy(entropy_type, chains=None, probe_size=1.4, onspherepoints=30)¶ Calculate the entropy for the each amino acid will be returned.
The ‘chains’ argument should be used when the user wants to restrict the analysis to a chain or group of chains rather than the whole structure.
Parameters: - entropy_type (str) – Type of entropy to be calculated (Options: PackingEntropy)
- chains ([str]/str) – Chain IDs for the Entropy calculation (None means all the chains are included; single string means only one chain ID; multiple chains should be an array of strings).
- probe_size (float) – Radius of the probe to generate the surface points (This value should not be less than 1;Read the Publication for more details)
- onspherepoints (int) – Number of points to be generated around each point for the surface (Read the Publication for more details)
-
get_atom(idx)¶ Get the atom of the given ID.
- Note: - This function is different from
packman.molecule.chain.get_atoms()and alsopackman.molecule.residue.get_atom() - If the PDB file is constructed manually/ has multiple atoms of the same ID, the first instance of the atom with that id is returned. Please avoid saving two atoms with same ID in a same structure file in a given frame/model.
Parameters: idx (int) – Get atom by the id Returns: Atom of the given ID if successful; None otherwise. Return type: atom ( packman.molecule.Atom)- Note: - This function is different from
-
get_atoms()¶ Get the generator of corresponding ‘atom’ objects of the residues of the ‘Chain’
Returns: generator of ‘atom’ objects if successful, None otherwise.
-
get_backbone()¶ Get the Backbone atoms of the given ‘Chain’ as a list of ‘Atom’ object
Note
- Backbone Atoms: CA, O, N, C
Returns: list of packman.molecule.Atom if successful, None otherwise.
-
get_bonds()¶ Get the Bonds in the given ‘Chain’
Please check out calculate_bonds() for more information on the bond calculations.
-
get_calpha()¶ Get the C-Alpha atoms of the ‘Chain’ as an ‘Atom’ object.
Returns: generator of packman.molecule.Atom objects if successful, None otherwise.
-
get_entropy(entropy_type)¶ Get the Packing Entropy of the given ‘Chain’.
Please note that if the Entropy is calculated using specific atoms, this option might not give results for the amino acids that are not included because of the specific selection. Use the get_total_chain_entropy() function. Please see the documentation for more details.
Parameters: type (str) – Type of entropy (Allowed Values: 1. PackingEntropy) Note
- More type of Entropies might be added in the future.
-
get_hetatoms()¶ Get the generator of corresponding ‘atom’ objects of the hetmols of the ‘Chain’
Returns: generator of ‘atom’ objects if successful, None otherwise.
-
get_hetmol(idx)¶ Get the hetmol of the given ID.
- Note: - This function is different from
packman.molecule.chain.get_hetmols() - If the PDB file is constructed manually/ has multiple hetmol of the same ID, the first instance of the hetmol with that id is returned. Please avoid saving two hetmol with same ID in a same structure file in a given frame/model.
Parameters: idx (int) – Get hetmol by the id Returns: HetMol of the given ID if successful; None otherwise. Return type: residue ( packman.molecule.HetMol)- Note: - This function is different from
-
get_hetmols()¶ Get the generator of corresponding ‘HetMol’ objects of the ‘Chain’
Returns: generator of ‘HetAtom’ objects if successful, None otherwise.
-
get_hinges()¶ Get the hinges in the chain as a dictionary of ‘Hinge’ objects.
Returns: packman.molecule.annotations.Hinge if successful, None otherwise.
-
get_id()¶ Get the ID of the ‘Residue’
Returns: str if successful, None otherwise.
-
get_parent()¶ Get the ‘Model’ the given ‘Chain’ belongs to.
Returns: packman.molecule.Model if successful, None otherwise.
-
get_property(property_name)¶ Get the Property of the given ‘Chain’.
Property is any key and value combination that can be assigned to this object. This (along with the set_property) feature is mainly useful for the user customization. Properties are like pinboards. You can pin anything to the object with a key as a pin.
Parameters: property_name (object) – The ‘Key’ or a name the user wants to assign to to the property Note
- Users can add custom annotations; for example: If particular chain becomes disordered, it can be annotated with this feature.
-
get_residue(idx)¶ Get the residue of the given ID.
- Note: - This function is different from
packman.molecule.chain.get_residues() - If the PDB file is constructed manually/ has multiple residues of the same ID, the first instance of the residue with that id is returned. Please avoid saving two residues with same ID in a same structure file in a given frame/model.
Parameters: idx (int) – Get residue by the id Returns: Residue of the given ID if successful; None otherwise. Return type: residue ( packman.molecule.Residue)- Note: - This function is different from
-
get_residues()¶ Get the generator of corresponding ‘Residue’ objects of the ‘Chain’
Returns: generator of ‘Residue’ objects if successful, None otherwise.
-
get_sequence()¶ Get the Amino acid sequence of the chain. (Protein chains only)
Returns: FASTA format string of the chain sequence.
-
set_hinges(new_hinges)¶ Set/Add hinge to the ‘Chain’ object
Parameters: new_hinges (packman.molecule.annotations.Hinge) – The ‘Hinge’ User wishes to assign/add to the given ‘Chain’
-
set_id(new_id)¶ Set the ID of the given ‘Chain’
Parameters: new_id (str) – The ID User wishes to assign to the given ‘Chain’
-
set_parent(parent)¶ Set the Parent of the given ‘Residue’
Parameters: new_parent (packman.molecule.Chain) – The parent ‘Chain’ User wishes to assign to the given ‘Residue’
-
set_property(property_name, value)¶ Set the Property of the given ‘Chain’.
Property is any key and value combination that can be assigned to this object. This (along with the get_property) feature is mainly useful for the user customization. Properties are like pinboards. You can pin anything to the object with a key as a pin.
Parameters: - property_name (object) – The ‘Key’ or a name the user wants to assign to to the property
- value (object) – The value the user wants to assign to the property
Note
- Users can add custom annotations; for example: If particular amino acid becomes disordered, it can be annotated with this feature.