packman.molecule.bond module¶
The ‘Bond’ object host file.
This is file information, not the class information. This information is only for the API developers. Please read the ‘Bond’ 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 Bond
help( Bond )
- Authors:
- Pranav Khade(https://github.com/Pranavkhade)
-
class
packman.molecule.bond.Bond(id, atom1, atom2, type, source=None)¶ Bases:
objectThis class contains the information about the ‘Bond’ object (packman.molecule.Bond).
This class contains all the information available about the Bond. The Bond class is the connection between the lowest in the hierarchy of the ‘molecule’ API classes (Atom). 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
- Since this is an object file, user is allowed to bond any two atoms in the structure. However, it is recommended to use caution and stick to the conventions when bonding two atoms.
- The bonds that are not in the CONNECT records of the structure file are calculated using the following algorithm:
- Zhang, Q., Zhang, W., Li, Y. et al. A rule-based algorithm for automatic bond type perception. J Cheminform 4, 26 (2012). https://doi.org/10.1186/1758-2946-4-26
Parameters: - id (int) – ID of the bond.
- atom1 (packman.molecule.Atom) – The first atom connected by the bond. (order is not important)
- atom2 (packman.molecule.Atom) – The second atom connected by the bond. (order is not important)
- source (str) – Source of information for the given bond.
- type (str) – Bond can be either of the following type: (covalent, ionic, hydrogen or other)
- electrons (tuple) – A python tuple containing information about shared electrons (eg…. (1,1) means the electrons shared between a single hydrocarbon bond if the atom1 is carbon and atom2 is hydrogen touple order here is (atom1, atom2).
-
get_atoms()¶ Get the atoms involved in the bond.
Returns: (atom1, atom2) if successful; None otherwise
-
get_id()¶ Get the ID of the ‘Bond’
Returns: ID of the bond. Return type: id (int)
-
get_property(property_name)¶ Get the Property of the given ‘Bond’.
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_source()¶ Get the source of the information of the created bond.
Returns: Source of information for the given bond. Return type: source (str)
-
get_torsion(neighbor1=None, neighbor2=None, radians=True)¶ Calculate the torsion angle of the given covalent bond with the corresponding selected neighbors.
Note
At least four atoms are needed to form two planes that can measure the torsional angles; therefore, along with the two bond atoms, the user needs to provide the additional two atoms that are ideally non-mutual neighbors of the atoms in the bond.
Parameters: - neighbor1 (int/packman.molecule.Atom) – Neighbour of the Atom1 as an ‘Atom’ object or Atom ID.
- neighbor1 – Neighbour of the Atom2 as an ‘Atom’ object or Atom ID.
- radians (True/False) – Return value of the angle in radians (returns value in degrees if False; Default : True)
Returns: The torsion angle in radians/degrees if sucessful, None otherwise.
-
get_type()¶ Get the type of the bond
Returns: type of the bond (str) if successful; None otherwise
-
set_atoms(new_pair)¶ Set the atoms involved in the bond.
Parameters: atom_pair (tuple) – Tuple of packman.molecule.Atom objects.
-
set_property(property_name, value)¶ Set the Property of the given ‘Bond’.
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.
-
set_torsion(theta, neighbor1=None, neighbor2=None, radians=True)¶ Set the torsion for the given covalent bond with the corresponding selected neighbors.
Note
At least four atoms are needed to form two planes that change the torsional angles; therefore, along with the two bond atoms, the user needs to provide the additional two atoms that are ideally non-mutual neighbors of the atoms in the bond.
Parameters: - theta (int) – Set the torsional angle (see the ‘radians’ parameter description)
- neighbor1 (int/packman.molecule.Atom) – Neighbour of the Atom1 as an ‘Atom’ object or Atom ID.
- neighbor1 – Neighbour of the Atom2 as an ‘Atom’ object or Atom ID.
- radians (True/False) – Parameter ‘theta’ will be assuned to be in Radians if True, Degrees will be assumed when False. ( Default : True)
Returns: True if successful, None otherwise
-
set_type(new_type)¶ Set the bond type.
Bond can be either of the following type: (covalent, ionic, hydrogen or other)
Parameters: new_type (str) –