SBHydrogenBondGroup#
See also
SAMSON SDK: SBMStructuralModelNodeHydrogenBondGroup
With SBHydrogenBondGroup
you can:
compute
hydrogen-bonds
(H-bonds) for specified systems,process, remove, and add H-bonds.
See also
Note
H-bonds
are stored within an H-bond group, which itself is stored in a structural model
.
Below are sample codes to add H-bonds based on a structural model
or between receptors and ligands (see Selecting nodes for more information on how to get nodes):
# get an indexer of all structural models in the active document
structural_model_indexer = SAMSON.getNodes("node.type structuralModel")
# get the first structural model
structural_model = structural_model_indexer[0]
with SAMSON.holding("Add H-bonds"): # make it undoable
# create an H-bond group object between atoms in a single node indexer
h_bond_group = SBHydrogenBondGroup("H-bonds", structural_model_indexer)
# compute H-bonds
h_bond_group.update()
# hold the node for undo/redo
SAMSON.hold(h_bond_group)
# create the H-bond group
h_bond_group.create()
# add the node to the active document
structural_model.addChild(h_bond_group)
# get an indexer of all structural models in the active document
structural_model_indexer = SAMSON.getNodes("node.type structuralModel")
# get the first structural model
structural_model = structural_model_indexer[0]
# get an indexer with receptor and ligand nodes
receptor_indexer = SAMSON.getNodes("node.category receptor")
ligand_indexer = SAMSON.getNodes("node.category ligand")
with SAMSON.holding("Add H-bonds"): # make it undoable
# create an H-bond group object between atoms in two node indexers
h_bond_group = SBHydrogenBondGroup("H-bonds between receptor and ligand",
receptor_indexer, ligand_indexer)
# compute H-bonds
h_bond_group.update()
# hold the node for undo/redo
SAMSON.hold(h_bond_group)
# create the H-bond group
h_bond_group.create()
# add the node to the active document
structural_model.addChild(h_bond_group)
You can remove H-bonds from an H-bond group based on some criteria, e.g., based on the donor-acceptor distance:
# get H-bonds from the H-bond group, excluding the H-bond group itself
hbond_indexer = h_bond_group.getNodes("not n.t hbg")
print(f"The total number of computed H-bonds is {len(hbond_indexer)}")
with SAMSON.holding("Remove some H-bonds"): # make it undoable
for hbond in hbond_indexer:
# check the donor-acceptor distance
if hbond.donorAcceptorDistance > SBQuantity.angstrom(3.5):
#print(hbond)
h_bond_group.removeChild(hbond)
hbond_indexer = h_bond_group.getNodes("not n.t hbg")
print(f"The total number of computed H-bonds is {len(hbond_indexer)}")
You can also add new H-bonds in an H-bond group, as follows:
with SAMSON.holding("Add new H-bonds"): # make it undoable
# create an H-bond object based on already defined acceptor, donor,
# and (optionally) hydrogen atoms
hbond = SBHydrogenBond(acceptor, donor) #, hydrogen
# hold the node for undo/redo
SAMSON.hold(hbond)
# create the H-bond
hbond.create()
# add the H-bond in the H-bond group
h_bond_group.addChild(hbond)
- class samson.SBHydrogenBondGroup(*args, **kwargs)#
Bases:
SBStructuralGroup
This class describes a Hydrogen-bond group in a structural model
Overloaded function.
__init__(self: samson.SBHydrogenBondGroup) -> None
Constructs a Hydrogen-bond group
__init__(self: samson.SBHydrogenBondGroup, name: str) -> None
Constructs a Hydrogen-bond group with the given name
__init__(self: samson.SBHydrogenBondGroup, name: str, nodeIndexer: samson.SBNodeIndexer) -> None
Constructs a Hydrogen-bond group with H-bonds within the system present in nodeIndexer
__init__(self: samson.SBHydrogenBondGroup, name: str, nodeIndexer1: samson.SBNodeIndexer, nodeIndexer2: samson.SBNodeIndexer) -> None
Constructs a Hydrogen-bond group with H-bonds between two systems present in nodeIndexer1 and nodeIndexer2
- class HydrogenBondSystemSetupType(self: samson.SBHydrogenBondGroup.HydrogenBondSystemSetupType, value: int)#
Bases:
pybind11_object
Members:
SingleSystem : Within a single system
BetweenTwoSystems : Between two systems
- BetweenTwoSystems = <HydrogenBondSystemSetupType.BetweenTwoSystems: 1>#
- SingleSystem = <HydrogenBondSystemSetupType.SingleSystem: 0>#
- property name#
- property value#
- getAcceptorElementsString(self: samson.SBHydrogenBondGroup) str #
Returns a string with acceptor element types
- getAngleThreshold(self: samson.SBHydrogenBondGroup) samson.SBQuantity.unitsSI #
Returns the H-bond group’s D-H-A angle threshold
- getDonorBorneHydrogen(self: samson.SBHydrogenBondGroup, donor: samson.SBAtom, acceptor: samson.SBAtom, angleThreshold: samson.SBQuantity.unitsSI) samson.SBAtom #
Returns a donor-borne hydrogen atom
- getDonorElementsString(self: samson.SBHydrogenBondGroup) str #
Returns a string with donor element types
- getHydrogenBondAtoms(self: samson.SBHydrogenBondGroup) samson.SBNodeIndexer #
Gets atoms (acceptors, donors, hydrogens) of visible hydrogen bonds
- getHydrogenBondSystemSetupType(self: samson.SBHydrogenBondGroup) samson.SBHydrogenBondGroup.HydrogenBondSystemSetupType #
Returns the current hydrogen bond system setup type
- getNumberOfVisibleHydrogenBonds(self: samson.SBHydrogenBondGroup) int #
Returns the number of visible hydrogen bonds
- getSystem1(self: samson.SBHydrogenBondGroup) samson.SBNodeIndexer #
Returns an indexer of nodes in the system 1
- getSystem2(self: samson.SBHydrogenBondGroup) samson.SBNodeIndexer #
Returns an indexer of nodes in the system 2
- getThresholdDistanceOfModerateHBond(self: samson.SBHydrogenBondGroup) samson.SBQuantity.unitsSI #
Returns the H-bond group’s threshold distance for moderate H-bonds
- getThresholdDistanceOfStrongHBond(self: samson.SBHydrogenBondGroup) samson.SBQuantity.unitsSI #
Returns the H-bond group’s threshold distance for strong H-bonds
- getThresholdDistanceOfWeakHBond(self: samson.SBHydrogenBondGroup) samson.SBQuantity.unitsSI #
Returns the H-bond group’s threshold distance for weak H-bonds
- resetDefaultParameters(self: samson.SBHydrogenBondGroup) None #
Resets the H-bond group parameters to their default values
- selectHydrogenBondAtoms(self: samson.SBHydrogenBondGroup) None #
Selects atoms (acceptors, donors, hydrogens) of visible hydrogen bonds
- setAngleThreshold(self: samson.SBHydrogenBondGroup, angle: samson.SBQuantity.unitsSI) None #
Sets the H-bond group’s D-H-A angle threshold to angle
- setSystem(*args, **kwargs)#
Overloaded function.
setSystem(self: samson.SBHydrogenBondGroup, nodeIndexer: samson.SBNodeIndexer) -> None
Sets a single system
setSystem(self: samson.SBHydrogenBondGroup, nodeIndexer1: samson.SBNodeIndexer, nodeIndexer2: samson.SBNodeIndexer) -> None
Sets two systems
- setThresholdDistanceOfModerateHBond(self: samson.SBHydrogenBondGroup, distance: samson.SBQuantity.unitsSI) None #
Sets the H-bond group’s threshold distance for moderate H-bonds to distance
- setThresholdDistanceOfStrongHBond(self: samson.SBHydrogenBondGroup, distance: samson.SBQuantity.unitsSI) None #
Sets the H-bond group’s threshold distance for strong H-bonds to distance
- setThresholdDistanceOfWeakHBond(self: samson.SBHydrogenBondGroup, distance: samson.SBQuantity.unitsSI) None #
Sets the H-bond group’s threshold distance for weak H-bonds to distance
- update(self: samson.SBHydrogenBondGroup) None #
Updates the hydrogen bonds in the hydrogen bond group
- BetweenTwoSystems = <HydrogenBondSystemSetupType.BetweenTwoSystems: 1>#
- SingleSystem = <HydrogenBondSystemSetupType.SingleSystem: 0>#
- property hideLeastProbableHBondsFlag#
Whether the least probable H-bonds should be hidden
- property showModerateHBondsFlag#
Whether to show the moderate H-bonds
- property showStrongHBondsFlag#
Whether to show the strong H-bonds
- property showWeakHBondsFlag#
Whether to show the weak H-bonds