BioSimSpace._SireWrappers.System

class BioSimSpace._SireWrappers.System(system)

A container class for storing molecular systems.

__init__(system)

Constructor.

Parameters

system (Sire.System.System, System, Sire.Mol._Mol.Molecule, Molecule, Molecules [Molecule]) – A Sire or BioSimSpace System object, a Sire or BioSimSpace Molecule object, a BioSimSpace Molecules object, or a list of BioSimSpace molecule objects.

Methods

__init__(system)

Constructor.

addMolecules(molecules)

Add a molecule, or list of molecules to the system.

charge([property_map, is_lambda1])

Return the total molecular charge.

copy()

Return a copy of this object.

fileFormat([property_map])

Return the file formats associated with the system.

getAxisAlignedBoundingBox([property_map])

Get the axis-aligned bounding box enclosing the object.

getBox([property_map])

Get the size of the periodic simulation box.

getIndex(item)

Convert indices of atoms and residues to their absolute values in this system.

getMolecule(index)

Return the molecule at the given index.

getMolecules([group])

Return a list containing all of the molecules in the specified group.

getPerturbableMolecules()

Return a list containing all of the perturbable molecules in the system.

getWaterMolecules()

Return a list containing all of the water molecules in the system.

nAtoms()

Return the number of atoms in the system.

nChains()

Return the number of chains in the system.

nMolecules()

Return the number of molecules in the system.

nPerturbableMolecules()

Return the number of perturbable molecules in the system.

nResidues()

Return the number of residues in the system.

nWaterMolecules()

Return the number of water molecules in the system.

removeMolecules(molecules)

Remove a molecule, or list of molecules from the system.

removeWaterMolecules()

Remove all of the water molecules from the system.

search(query)

Search the system for atoms, residues, and molecules.

setBox(size[, property_map])

Set the size of the periodic simulation box.

translate(vector[, property_map])

Translate the system.

updateMolecules(molecules)

Update a molecule, or list of molecules in the system.

addMolecules(molecules)

Add a molecule, or list of molecules to the system.

Parameters

molecules (Molecule, Molecules, [Molecule], System) – A Molecule, Molecules object, a list of Molecule objects, or a System containing molecules.

charge(property_map={}, is_lambda1=False)

Return the total molecular 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 molecule is merged.

Returns

charge – The molecular 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

fileFormat(property_map={})

Return the file formats associated with the system.

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

format – The file formats associated with the system.

Return type

str

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.

getBox(property_map={})

Get the size of the periodic simulation box.

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_size – The size of the box in each dimension.

Return type

[Length]

getIndex(item)

Convert indices of atoms and residues to their absolute values in this system.

Parameters

item (Atom, Residue Molecule) – An Atom, Residue, or Molecule object from the System, or a list containing objects of these types.

Returns

index – The absolute index of the atom/residue/molecule in the system.

Return type

int, [int]

getMolecule(index)

Return the molecule at the given index.

Parameters

index (int) – The index of the molecule.

Returns

molecule – The requested molecule.

Return type

Molecule

getMolecules(group='all')

Return a list containing all of the molecules in the specified group.

Parameters

group (str) – The name of the molecule group.

Returns

molecules – The list of molecules in the group.

Return type

[Molecule]

getPerturbableMolecules()

Return a list containing all of the perturbable molecules in the system.

Returns

molecules – A list of perturbable molecules.

Return type

[Molecule]

getWaterMolecules()

Return a list containing all of the water molecules in the system.

Returns

molecules – A container of water molecule objects.

Return type

:class:`Molecules <BioSimSpace._SireWrappers.Molecules>

nAtoms()

Return the number of atoms in the system.

Returns

num_atoms – The number of atoms in the system.

Return type

int

nChains()

Return the number of chains in the system.

Returns

num_chains – The number of chains in the system.

Return type

int

nMolecules()

Return the number of molecules in the system.

Returns

num_molecules – The number of molecules in the system.

Return type

int

nPerturbableMolecules()

Return the number of perturbable molecules in the system.

Returns

num_perturbable – The number of perturbable molecules in the system.

Return type

int

nResidues()

Return the number of residues in the system.

Returns

num_residues – The number of residues in the system.

Return type

int

nWaterMolecules()

Return the number of water molecules in the system.

Returns

num_waters – The number of water molecules in the system.

Return type

int

removeMolecules(molecules)

Remove a molecule, or list of molecules from the system.

Parameters

molecules (Molecule, Molecules, [Molecule]) – A Molecule, Molecules object, or list of Molecule objects.

removeWaterMolecules()

Remove all of the water molecules from the system.

search(query)

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

Parameters

query (str) – The search query.

Returns

results – A list of objects matching the search query.

Return type

[Atom, Residue, Molecule, …]

Examples

Search for residues names ALA.

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

Search for residues names ALA using a case insensitive search.

>>> result = system.search("resname /ala/i")

Search for all carbon atoms in residues named ALA.

>>> result = system.search("resname ALA and atomname C")

Search for all oxygen or hydrogen atoms.

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

Search for atom index 23 in molecule index 10.

>>> result = system.search("molidx 10 and atomidx 23")
setBox(size, property_map={})

Set the size of the periodic simulation box.

Parameters
  • size ([Length]) – The size of the box in each dimension.

  • 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” }

translate(vector, property_map={})

Translate the system.

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” }

updateMolecules(molecules)

Update a molecule, or list of molecules in the system.

Parameters

molecules (Molecule, [Molecule]) – A Molecule, or list of Molecule objects.