SBStructuralModel#

See also

SAMSON SDK: SBMStructuralModel

class samson.SBStructuralModel(self: samson.SBStructuralModel)#

Bases: SBModel

This class describes a structural model.

Constructs a structural model.

Examples

Add a structural model to the active document and make this operation undoable.

>>> structural_model = SBStructuralModel()
>>> structural_model.name = 'Structural model'
>>> SAMSON.beginHolding('Add structural model')
>>> SAMSON.hold(structural_model)
>>> structural_model.create()
>>> SAMSON.getActiveDocument().addChild(structural_model)
True
>>> SAMSON.endHolding()
static bondExists(atom1: SBMStructuralModelNodeAtom, atom2: SBMStructuralModelNodeAtom) bool#

Checks whether the bond between atoms atom1 and atom2 exists.

Parameters:
Returns:

True if the bond exists, else False.

Return type:

bool

centerTransform(self: samson.SBStructuralModel) None#

Centers the pivot of the transform on the center of mass of the particles contained in the structural model

clearConnectivityAnnotationInformation(self: samson.SBStructuralModel) None#

Clears the model’s connectivity annotation information

clearCrystallographicAndTransformationInformation(self: samson.SBStructuralModel) None#

Clears the model’s transformation information

clearHeterogenInformation(self: samson.SBStructuralModel) None#

Clears the model’s heterogen information

clearMiscellaneousInformation(self: samson.SBStructuralModel) None#

Clears the model’s miscellaneous information

clearPrimaryStructureInformation(self: samson.SBStructuralModel) None#

Clears the model’s primary structure information

clearSecondaryStructureInformation(self: samson.SBStructuralModel) None#

Clears the model’s secondary structure information

clearTitleInformation(self: samson.SBStructuralModel) None#

Clears the model’s title information

static computeDomain(nodeIndexer: samson.SBNodeIndexer) samson.SBSpatialDomain#

Computes the domain containing the atoms and bond atoms in the node indexer

computeSecondaryStructure(self: samson.SBStructuralModel, forceUpdate: bool = False) tuple[bool, bool]#

Computes the secondary structure for all residues in the structural model.

Parameters:

forceUpdate (bool, default=False) – Whether to force the update of the secondary structure or not.

Returns:

1st element - True if everything went well; 2nd element - True if and only if the secondary structure was changed compared to the previous call.

Return type:

Tuple(bool, bool)

static createBond(atom1: SBMStructuralModelNodeAtom, atom2: SBMStructuralModelNodeAtom, bondOrder: float, bondType: SBMStructuralModelNodeBond::BondType) bool#

Creates a bond between atom1 and atom2 if there is none; sets the bond order to bondOrder and the bond type to bondType.

Parameters:
Returns:

Whether the bond has been created or not.

Return type:

bool

createCovalentBonds(*args, **kwargs)#

Overloaded function.

  1. createCovalentBonds(self: samson.SBStructuralModel) -> None

Creates covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances

  1. createCovalentBonds(self: samson.SBStructuralModel, additionalMargin: samson.SBQuantity.unitsSI) -> None

Creates covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances and the given additional margin.

Parameters:

additionalMargin (samson.SBQuantity) – A margin additional to the sum of covalent radii of atoms when checking for the covalent bond creation.

createCovalentBondsByResidueType(*args, **kwargs)#

Overloaded function.

  1. createCovalentBondsByResidueType(self: samson.SBStructuralModel) -> int

Creates covalent bonds for the atoms belonging to the structural model according to the residue types, regardless of inter-atomic distances. If the bonds are already present, it sets the order of covalent bonds for the atoms belonging to the structural model according to the residue types.

  1. createCovalentBondsByResidueType(self: samson.SBStructuralModel, residueIndexer: samson.SBNodeIndexer) -> int

Creates covalent bonds for the atoms belonging to the given residues of the structural model according to the residue types, regardless of inter-atomic distances. If the bonds are already present, it sets the order of covalent bonds for the atoms belonging to the structural model according to the residue types.

Parameters:

residueIndexer (samson.SBNodeIndexer) – An indexer with residues.

static findAtom(*args, **kwargs)#

Overloaded function.

  1. findAtom(nodeIndexer: samson.SBNodeIndexer, elementType: samson.SBElement.ElementType, name: str) -> SBMStructuralModelNodeAtom

Returns, if found, an atom from a node indexer nodeIndexer with the element type elementType and name name; else returns None.

  1. findAtom(nodeIndexer: samson.SBNodeIndexer, elementType: samson.SBElement.ElementType, name: str, altLoc: str) -> SBMStructuralModelNodeAtom

Returns, if found, an atom from a node indexer nodeIndexer with the element type elementType and name name, and an alternate location altLoc (if the atom has an alternate location); else returns None.

static getAsphericity(nodeIndexer: samson.SBNodeIndexer) float#

Returns True if all atoms in nodeIndexer are in the same plane

static getCenterOfFormalCharge(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalVector3#

Returns the center of formal charge of atoms in the nodeIndexer

static getCenterOfMass(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalVector3#

Returns the center of mass of atoms in the nodeIndexer

static getCenterOfPartialCharge(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalVector3#

Returns the center of partial charge of atoms in the nodeIndexer

static getCentroid(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalVector3#

Returns the centroid (the geometric center) of atoms in the nodeIndexer

getChildren(self: samson.SBStructuralModel) samson.SBNodeIndexer#

Returns the children of the structural model

static getDipoleMomentAtCenterOfCharge(nodeIndexer: samson.SBNodeIndexer) samson.SBQuantity.unitsSI#

Returns the dipole moment of atoms in nodeIndexer at their center of charge (based on partial charge)

static getDipoleMomentAtCenterOfMass(nodeIndexer: samson.SBNodeIndexer) samson.SBQuantity.unitsSI#

Returns the dipole moment of atoms in nodeIndexer at their center of mass

static getDipoleVectorAtCenterOfCharge(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalVector3#

Returns the dipole vector of atoms in nodeIndexer at their center of charge (based on partial charge)

static getDipoleVectorAtCenterOfMass(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalVector3#

Returns the dipole vector of atoms in nodeIndexer at their center of mass

static getInertiaTensor(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalMatrix33#

Returns the inertia tensor of the system of atoms (based on their positions and masses) in the nodeIndexer

static getMolecularWeightForNodeIndexer(nodeIndexer: samson.SBNodeIndexer) samson.SBQuantity.unitsSI#

Returns the cumulative molecular weight of atoms in the nodeIndexer

getOrientation(self: samson.SBStructuralModel) samson.SBPhysicalMatrix33#

Returns the orientation of the structural model

getPosition(self: samson.SBStructuralModel) samson.SBPhysicalVector3#

Returns the position of the structural model

static getPrincipalAxes(nodeIndexer: samson.SBNodeIndexer) samson.SBPhysicalMatrix33#

Returns the principal axes of the inertia tensor of the system of atoms (based on their positions and masses) in the nodeIndexer

static getRadiusOfGyration(nodeIndexer: samson.SBNodeIndexer) samson.SBQuantity.unitsSI#

Returns the radius of gyration based on atoms in the nodeIndexer

static getShapeParameter(nodeIndexer: samson.SBNodeIndexer) float#

Returns the shape parameter of the system of atoms (based on their positions and masses) in nodeIndexer. The shape parameter, S, changes in the [-0.25, 2] interval, where 0 corresponds to a sphere, negative values correspond to oblate ellipsoid, positive values correspond to prolate ellipsoid.

static getSolventAccessibleSurfaceArea(nodeIndexer: samson.SBNodeIndexer, probeRadius: samson.SBQuantity.unitsSI, numberOfPointsOnSphere: int) samson.SBQuantity.unitsSI#

Returns the Solvent-Accessible Surface Area (SASA) based on atoms in nodeIndexer with the probe radius probeRadius, and the number of points on a sphere numberOfPointsOnSphere.

Parameters:
Return type:

samson.SBQuantity.unitsSI

static getSpatialTransform(nodeIndexer: samson.SBNodeIndexer) samson.SBSpatialTransform#

Returns the spatial transform based on the inertia tensor of the system of atoms (based on their positions and masses) in the nodeIndexer

getStructuralRoot(self: samson.SBStructuralModel) SBMStructuralModelNodeRoot#

Returns the root

static getSumOfFormalCharges(nodeIndexer: samson.SBNodeIndexer) int#

Returns the sum of formal charges of nodes in nodeIndexer

static getSumOfPartialCharges(nodeIndexer: samson.SBNodeIndexer) float#

Returns the sum of partial charges of nodes in nodeIndexer

getTransform(self: samson.SBStructuralModel) samson.SBSpatialTransform#

Returns the spatial transform of the structural model

getWater(self: samson.SBStructuralModel) samson.SBNodeIndexer#

Finds water nodes in the structural model

static getWaterFromNodeIndexer(nodeIndexer: samson.SBNodeIndexer) samson.SBNodeIndexer#

Finds water nodes in the nodeIndexer

static isPlanar(nodeIndexer: samson.SBNodeIndexer) bool#

Returns True if all atoms in nodeIndexer are in the same plane.

populateChainIDs(self: samson.SBStructuralModel, forceRenumbering: bool = False) bool#

Populates the chain IDs for all chains in the structural model

static replaceAtom(oldAtom: SBMStructuralModelNodeAtom, newAtom: SBMStructuralModelNodeAtom, preserveOldAtomPosition: bool = False) None#

Replaces atom oldAtom with atom newAtom. All bonds from the old atom are transferred to the new atom.

static replaceBond(oldBond: SBMStructuralModelNodeBond, newBond: SBMStructuralModelNodeBond, flipBond: bool = False, preserveOldBondPosition: bool = False) None#

Replaces bond oldBond with bond newBond. All neighboring bonds from the old bond are transferred to the new bond

rotate(self: samson.SBStructuralModel, axis: samson.SBPhysicalVector3, angle: samson.SBQuantity.unitsSI) None#

Rotates the structural model

setOrientation(*args, **kwargs)#

Overloaded function.

  1. setOrientation(self: samson.SBStructuralModel, orientation: samson.SBPhysicalMatrix33) -> None

Sets the orientation of the structural model

  1. setOrientation(self: samson.SBStructuralModel, orientation: samson.SBPhysicalMatrix33, transformParticles: bool) -> None

Sets the orientation of the structural model

setPosition(*args, **kwargs)#

Overloaded function.

  1. setPosition(self: samson.SBStructuralModel, position: samson.SBPhysicalVector3) -> None

Sets the position of the structural model

  1. setPosition(self: samson.SBStructuralModel, position: samson.SBPhysicalVector3, transformParticles: bool) -> None

Sets the position of the structural model

setTransform(*args, **kwargs)#

Overloaded function.

  1. setTransform(self: samson.SBStructuralModel, transform: samson.SBSpatialTransform) -> None

Sets the spatial transform of the structural model

  1. setTransform(self: samson.SBStructuralModel, transform: samson.SBSpatialTransform, transformParticles: bool) -> None

Sets the spatial transform of the structural model

transform(self: samson.SBStructuralModel, transform: samson.SBSpatialTransform) None#

Applies a spatial transform to the structural model

translate(self: samson.SBStructuralModel, translation: samson.SBPhysicalVector3) None#

Translates the structural model

property connectivityAnnotationInformation#

The model’s connectivity annotation information

property crystallographicAndTransformationInformation#

The model’s transformation information

property hasConnectivityAnnotationInformation#

Returns True when the model’s connectivity annotation information is set. A read-only property.

property hasCrystallographicAndTransformationInformation#

Returns True when the model’s transformation information is set. A read-only property.

property hasHeterogenInformation#

Returns True when the model’s heterogen information is set. A read-only property.

property hasMiscellaneousInformation#

Returns True when the model’s miscellaneous information is set. A read-only property.

property hasPrimaryStructureInformation#

Returns True when the model’s primary structure information is set. A read-only property.

property hasSecondaryStructureInformation#

Returns True when the model’s secondary structure information is set. A read-only property.

property hasTitleInformation#

Returns True when the model’s title information is set. A read-only property.

property heterogenInformation#

The model’s heterogen information

property miscellaneousInformation#

The model’s miscellaneous information

property modelType#

Returns the model type. A read-only property.

property primaryStructureInformation#

The model’s primary structure information

property secondaryStructureInformation#

The model’s secondary structure information

property structuralSignalFlag#

A flag whether the model can send structural signals

property titleInformation#

The model’s title information