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.

getAtom(index)

Return the atom specified by the absolute index.

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.

getResidue(index)

Return the residue specified by the absolute index.

getRestraintAtoms(restraint[, mol_index, …])

Get the indices of atoms involved in a restraint.

getWaterMolecules([property_map])

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.

repartitionHydrogenMass([factor, water, …])

Redistrubute mass of heavy atoms connected to bonded hydrogens into the hydrogen atoms.

search(query[, property_map])

Search the system for atoms, residues, and molecules.

setBox(box[, angles, property_map])

Set the size of the periodic simulation box.

translate(vector[, property_map])

Translate the system.

updateMolecule(index, molecule)

Updated the molecule at the given index.

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

object – 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

getAtom(index)

Return the atom specified by the absolute index.

Parameters

index (int) – The absolute index of the atom in the system.

Returns

atom – The atom at the specified index.

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.

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 ([Length]) – The box vector magnitudes in each dimension.

  • angles ([Angle]) – The box vector angles: yz, xz, and xy.

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 container of perturbable molecule objects. The container will be empty if no perturbable molecules are present.

Return type

Molecules

getResidue(index)

Return the residue specified by the absolute index.

Parameters

index (int) – The absolute index of the residue in the system.

Returns

atom – The residue at the specified index.

Return type

Atom

getRestraintAtoms(restraint, mol_index=None, is_absolute=True, allow_zero_matches=False, property_map={})

Get the indices of atoms involved in a restraint.

Parameters
  • restraint (str) – The type of restraint.

  • mol_index (int) – The index of the molecule of interest. If None, then the entire system is searched.

  • is_absolute (bool) – Whether the indices are absolute, i.e. indexed within the entire system. If False, then indices are relative to the molecule in which the atom is found.

  • allow_zero_matches (bool) – Whether to raise an exception when no atoms match the restraint. Setting to false is useful if you need to determine restraints on a per-molecule basis, i.e. so molecules won’t contain atoms matching the restraint, but the entire system will.

  • property_map (dict) – A dictionary that maps system “properties” to their user defined values. This allows the user to refer to properties with their

Returns

indices – A list of the backbone atom indices.

Return type

[int]

getWaterMolecules(property_map={})

Return a list containing all of the water molecules in 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

molecules – A container of water molecule objects. The container will be empty if no water molecules are present.

Return type

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.

repartitionHydrogenMass(factor=4, water='no', use_coordinates=False, property_map={})

Redistrubute mass of heavy atoms connected to bonded hydrogens into the hydrogen atoms. This allows the use of larger simulation integration time steps without encountering instabilities related to high-frequency hydrogen motion.

Parameters
  • factor (float) – The repartioning scale factor. Hydrogen masses are scaled by this amount.

  • water (str) – Whether to repartition masses for water molecules. Options are “yes”, “no”, and “exclusive”, which can be used to repartition masses for water molecules only.

  • use_coordinates (bool) – Whether to use the current molecular coordinates to work out the connectivity before repartitioning. If False, the information from the molecular topology, e.g. force field, will be used, if present.

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

search(query, property_map={})

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.

  • 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

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(box, angles=[90.0000 degrees, 90.0000 degrees, 90.0000 degrees], property_map={})

Set the size of the periodic simulation box.

Parameters
  • box ([Length]) – The box vector magnitudes in each dimension.

  • angles ([Angle]) – The box vector angles: yz, xz, and xy.

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

updateMolecule(index, molecule)

Updated the molecule at the given index.

Parameters
  • index (int) – The index of the molecule.

  • molecule (Molecule) – The updated (or replacement) molecule.

updateMolecules(molecules)

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

Parameters

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