BioSimSpace._SireWrappers.Molecule

class BioSimSpace._SireWrappers.Molecule(molecule)

A container class for storing a molecule.

__init__(molecule)

Constructor.

Parameters

molecule (Sire.Mol.Molecule, Molecule) – A Sire or BioSimSpace Molecule object.

Methods

__add__(other)

Addition operator.

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__(other)

Equals to operator.

__format__

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__()

Hash operator.

__init__(molecule)

Constructor.

__init_subclass__

This method is called when a class is subclassed.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__(other)

Not equals to operator.

__new__

Create and return a new object.

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__()

Return a string showing how to instantiate the object.

__setattr__

Implement setattr(self, name, value).

__sizeof__

Size of object in memory, in bytes.

__str__()

Return a human readable string representation of the object.

__subclasshook__

Abstract classes can override this to customize issubclass().

_convertFromMergedMolecule()

Convert from a merged molecule.

_fixCharge([property_map])

Make the molecular charge an integer value.

_fromPertFile(filename)

Create a merged molecule from a perturbation file.

_getAABox([property_map])

Get the axis-aligned bounding box for the object.

_getPropertyMap0()

Generate a property map for the lambda = 0 state of the merged molecule.

_getPropertyMap1()

Generate a property map for the lambda = 1 state of the merged molecule.

_getSireObject()

Return the underlying Sire object.

_makeCompatibleWith(molecule[, …])

Make this molecule compatible with passed one, i.e.

_merge(other, mapping[, …])

Merge this molecule with ‘other’.

_toPertFile([filename, …])

Write the merged molecule to a perturbation file.

_toRegularMolecule([property_map, is_lambda1])

Internal function to convert a merged molecule to a regular molecule.

charge([property_map, is_lambda1])

Return the charge.

copy()

Return a copy of this object.

getAtoms()

Return a list containing the atoms in the molecule.

getAxisAlignedBoundingBox([property_map])

Get the axis-aligned bounding box enclosing the object.

getResidues()

Return a list containing the residues in the molecule.

isMerged()

Whether this molecule has been merged with another.

isWater()

Whether this is a water molecule.

molecule0()

Return the component of the merged molecule at lambda = 0.

molecule1()

Return the component of the merged molecule at lambda = 1.

nAtoms()

Return the number of atoms in the molecule.

nChains()

Return the number of chains in the molecule.

nResidues()

Return the number of residues in the molecule.

number()

Return the number of the molecule.

search(query)

Search the molecule for atoms and residues.

toSystem()

Convert a single Molecule to a System.

translate(vector[, property_map])

Translate the object.

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

charge(property_map={}, is_lambda1=False)

Return the charge.

Parameters
  • property_map (dict) – A dictionary that maps system “properties” to their user defined values. This allows the user to refer to properties with their own naming scheme, e.g. { “charge” : “my-charge” }

  • is_lambda1 (bool) – Whether to use the charge at lambda = 1 if the object is peturbable.

Returns

charge – The charge.

Return type

Charge

copy()

Return a copy of this object. The return type is same as the object on which copy is called.

Returns

system – A copy of the object.

Return type

Atom, Residue, Molecule, Molecules, System

getAtoms()

Return a list containing the atoms in the molecule.

Returns

atoms – The list of atoms in the molecule.

Return type

[Atom]

getAxisAlignedBoundingBox(property_map={})

Get the axis-aligned bounding box enclosing the object.

Parameters

property_map (dict) – A dictionary that maps system “properties” to their user defined values. This allows the user to refer to properties with their own naming scheme, e.g. { “charge” : “my-charge” }

Returns

  • box_min ([Length]) – The minimum coordinates of the axis-aligned bounding box in each dimension.

  • box_max ([Length]) – The minimum coordinates of the axis-aligned bounding box in each dimension.

getResidues()

Return a list containing the residues in the molecule.

Returns

residues – The list of residues in the molecule.

Return type

[Residue]

isMerged()

Whether this molecule has been merged with another.

Returns

is_merged – Whether the molecule has been merged.

Return type

bool

isWater()

Whether this is a water molecule.

Returns

is_water – Whether this is a water molecule.

Return type

bool

molecule0()

Return the component of the merged molecule at lambda = 0.

Returns

molecule – The component of the merged molecule at lambda = 0. Returns None if this isn’t a merged molecule.

Return type

Molecule

molecule1()

Return the component of the merged molecule at lambda = 1.

Returns

molecule – The component of the merged molecule at lambda = 1. Returns None if this isn’t a merged molecule.

Return type

Molecule

nAtoms()

Return the number of atoms in the molecule.

Returns

num_atoms – The number of atoms in the molecule.

Return type

int

nChains()

Return the number of chains in the molecule.

Returns

num_chains – The number of chains in the molecule.

Return type

int

nResidues()

Return the number of residues in the molecule.

Returns

num_residues – The number of residues in the molecule.

Return type

int

number()

Return the number of the molecule. Each molecule has a unique identification number.

Returns

mol_num – The unique number of the molecule.

Return type

int

search(query)

Search the molecule for atoms and residues. Search results will be reduced to their minimal representation, i.e. a residue containing a single atom will be returned as a atom.

Parameters

query (str) – The search query.

Returns

results – A list of objects matching the search query.

Return type

[Atom, Residue, …]

Examples

Search for all residues named ALA.

>>> result = molecule.search("resname ALA")

Search for all oxygen or hydrogen atoms.

>>> result = molecule.search("element oxygen or element hydrogen")

Search for atom index 23.

>>> result = molecule.search("atomidx 23")
toSystem()

Convert a single Molecule to a System.

Returns

system

Return type

System

translate(vector, property_map={})

Translate the object.

Parameters
  • vector ([Length]) – The translation vector in Angstroms.

  • property_map (dict) – A dictionary that maps system “properties” to their user defined values. This allows the user to refer to properties with their own naming scheme, e.g. { “charge” : “my-charge” }