Package schrodinger :: Package application :: Package desmond :: Package packages :: Package msys :: Class System
[hide private]
[frames] | no frames]

Class System

object --+
         |
        System



The `System` class holds all structure and forcefield data
for a single chemical system.  Create a new `System` using
``msys.CreateSystem()``, or from a file using ``msys.LoadDMS`` or
``msys.LoadMAE.``


A `System` organizes the information in a DMS file into several
different groups:

 * Tables - `TermTables` are grouped and accessed by name

 * cell - the unit cell vectors for the `System`, in the form of a 3x3
   NumPy array.

 * nonbonded_info - the NonbondedInfo object describing the type of
   nonbonded interactions.

 * provenance - a list of Provenance objects describing how the input
   file has been processed.

 * Auxiliary tables: Everything else in the DMS file that does not
   fit into one of the above categories finds its way into an auxiliary table.
   Notable denizens of this category include:

   - cmap tables

   - forcefield (annotation for parameters in the DMS file)

Instance Methods [hide private]
 
__init__(self, _ptr)
Construct from SystemPtr.
 
__eq__(self, x)
 
__ne__(self, x)
 
__hash__(self)
hash(x)
 
__repr__(self)
repr(x)
 
__reduce__(self)
Pickle support for System.
 
addAtom(self)
add and return a new Atom in its own residue
 
addResidue(self)
add and return a new Residue in its own chain
 
addChain(self, ct=4294967295)
add and return a new Chain.
 
addCt(self)
add and return a new Ct
 
_remove(self, elems, klass)
 
delAtoms(self, atoms)
remove the given Atoms from the System
 
delBonds(self, bonds)
remove the given Bonds from the System
 
delResidues(self, residues)
remove the given Residues from the System
 
delChains(self, chains)
remove the given Chains from the System
 
atom(self, id)
return the atom with the specified id
 
bond(self, id)
return the bond with the specified id
 
residue(self, id)
return the residue with the specified id
 
chain(self, id)
return the chain with the specified id
 
ct(self, id)
return the Ct with the specified id
 
findBond(self, a1, a2)
return the bond between the specified atoms, or None if not found
 
addAtomProp(self, name, type)
add a custom atom property with the given name and type.
 
delAtomProp(self, name)
remove the given custom atom property
 
atomPropType(self, name)
type of the given atom property
 
atomsGroupedBy(self, prop)
Return dictionary mapping representative values of the given atom property to lists of atoms having that property.
 
getPositions(self)
get copy of positions as Nx3 array
 
setPositions(self, pos)
set positions from Nx3 array
 
getVelocities(self)
get copy of velocities as N3x array
 
setVelocities(self, vel)
set velocities from Nx3 array
 
setCell(self, cell)
set unit cell from from 3x3 array
 
getCell(self)
return copy of unit cell as 3x3 numpy array
 
translate(self, xyz)
shift coordinates by given amount
 
addBondProp(self, name, type)
add a custom bond property with the given name and type.
 
delBondProp(self, name)
remove the given custom bond property
 
bondPropType(self, name)
type of the given bond property
 
table(self, name)
Get the TermTable with the given name, raising ValueError if not present.
 
getTable(self, name)
Return the TermTable with the given name, or None if not present.
 
addTable(self, name, natoms, params=None)
add a table with the given name and number of atoms.
 
addTableFromSchema(self, type, name=None)
Add a table to the system if it not already present, returning it.
 
coalesceTables(self)
Invoke TermTable.coalesce on each table
 
auxtable(self, name)
auxiliary table with the given name
 
addAuxTable(self, name, table)
add or replace extra table with the given name.
 
delAuxTable(self, name)
remove auxiliary table with the given name.
 
addNonbondedFromSchema(self, funct, rule='')
Add a nonbonded table to the system, and configure the nonbonded info according to funct and rule.
 
_update_atoms(self)
 
atomsel(self, sel)
Create and return an atom selection object (Atomsel).
 
select(self, seltext)
return a list of Atoms satisfying the given VMD atom selection.
 
selectIds(self, seltext, pos=None, box=None)
Return the ids of the Atoms satisfying the given VMD atom selection.
 
selectArr(self, seltext)
Return the ids of the Atoms satisfying the given VMD atom selection as a numpy array of type uint32.
 
selectChain(self, name=None, segid=None)
Returns a single Chain with the matching name and/or segid, or raises an exception if no single such chain is present.
 
selectCt(self, name=None)
Return a single Ct with the matching name, or raises an exception if no single such Ct is present
 
append(self, system)
Appends atoms and forcefield from system to self.
 
clone(self, sel=None, share_params=False)
Clone the System, returning a new System.
 
sorted(self)
Return a clone of the system with atoms reordered based on their order of appearance in a depth-first traversal of the structure hierarchy.
 
guessBonds(self, replace=True, reanalyze=True)
Guess bond connectivity based on an atomic-number based atom radius.
 
analyze(self)
Assign atom and residue types.
 
updateFragids(self)
Find connected sets of atoms, and assign each a 0-based id, stored in the fragment property of the atom.
 
findContactIds(self, cutoff, ids=None, other=None, pos=None)
Find atoms not bonded to each other which are within cutoff of each other.

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  name
The name of the System, taken from the input file name
  cell
The GlobalCell for this System
  nonbonded_info
NonbondedInfo for this System
  natoms
number of atoms
  nbonds
number of bonds
  nresidues
number of residues
  nchains
number of chains
  ncts
number of Cts
  atoms
return list of all atoms in the system
  bonds
return list of all bonds in the system
  residues
return list of all residues in the system
  chains
return list of all chains in the system
  cts
return list of all cts in the system
  atom_props
return the list of custom atom properties.
  positions
Nx3 list of lists of positions of all atoms
  center
return geometric center of positions of all atoms
  bond_props
return the list of custom bond properties.
  topology
list of bonded atoms for each atom in the System
  table_names
names of the tables in the System
  tables
all the tables in the System
  auxtable_names
names of the auxiliary tables
  auxtables
all the auxiliary tables
  provenance
return a list of Provenance entries for this system
  _atoms
  _ptr

Inherited from object: __class__

Method Details [hide private]

__init__(self, _ptr)
(Constructor)

 

Construct from SystemPtr. Do not invoke directly; use CreateSystem() instead.

Overrides: object.__init__

__hash__(self)
(Hashing function)

 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__reduce__(self)

 

Pickle support for System.

Saves a copy of self in dms format to a temporary file, then reads the contents.

Overrides: object.__reduce__

addChain(self, ct=4294967295)

 

add and return a new Chain. If no ct is given, the chain will be added to the first ct, creating one if necessary.

addAtomProp(self, name, type)

 

add a custom atom property with the given name and type. type should be int, float, or str.

atomsGroupedBy(self, prop)

 

Return dictionary mapping representative values of the given atom property to lists of atoms having that property. If the property does not exist in this system, returns an empty dictionary.

addBondProp(self, name, type)

 

add a custom bond property with the given name and type. type should be int, float, or str.

addTable(self, name, natoms, params=None)

 

add a table with the given name and number of atoms. If a table with the same name already exists, it is returned, otherwise the newly created table is returned. If no ParamTable params is supplied, a new one is created.

addTableFromSchema(self, type, name=None)

 

Add a table to the system if it not already present, returning it. If optional name field is provided, the table will be added with the given name; otherwise the name is taken from the table schema.

addNonbondedFromSchema(self, funct, rule='')

 

Add a nonbonded table to the system, and configure the nonbonded info according to funct and rule. funct must be the name of recognized nonbonded type. rule is not checked; at some point in the future we might start requiring that it be one of the valid combining rules for the specified funct. If nonbonded_info's vdw_funct and vdw_rule are empty, they are overridden by the provided values; otherwise, the corresponding values must agree if funct and rule are not empty. A nonbonded table is returned.

atomsel(self, sel)

 

Create and return an atom selection object (Atomsel). sel can be a string or a list of GIDs if $SCHRODINGER is set.

selectIds(self, seltext, pos=None, box=None)

 

Return the ids of the Atoms satisfying the given VMD atom selection. This can be considerably faster than calling select().

if pos is supplied, it should be an Nx3 numpy array of positions, where N=self.natoms.

If box is supplied, it should be a 3x3 numpy array of cell vectors, like System.cell.

append(self, system)

 

Appends atoms and forcefield from system to self. Returns a list of of the new created atoms in self. Systems must have identical nonbonded_info.vdw_funct. Overwrites self.global_cell with system.global_cell only when self.global_cell is all zeros.

clone(self, sel=None, share_params=False)

 

Clone the System, returning a new System. If selection is provided, it should be an atom selection string, a list of ids, or a list of Atoms.

If share_params is True, then ParamTables will be shared between the old and new systems. By default, copies of the ParamTables are made, but ParamTables shared _within_ the old system will also be shared in the new system.

guessBonds(self, replace=True, reanalyze=True)

 

Guess bond connectivity based on an atomic-number based atom radius.

Replaces any existing bonds, unless replace=False is specified.

Reanalyzes fragids and atom types unless reanalyze=False is specified. In that case, you MUST call updateFragids() manually before making any use of the fragment assignment (fragids will be out of date).

analyze(self)

 

Assign atom and residue types. This needs to be called manually only if you create a system from scratch, using msys.CreateSystem(); in that case, analyze() should be called before performing any atom selections.

updateFragids(self)

 

Find connected sets of atoms, and assign each a 0-based id, stored in the fragment property of the atom. Return a list of fragments as a list of lists of atoms.

findContactIds(self, cutoff, ids=None, other=None, pos=None)

 

Find atoms not bonded to each other which are within cutoff of each other. If ids is not None, consider only atoms with the given ids. If other is not None, consider only atom pairs such that one is in ids and the other is in other. If pos is not None, use pos as positions, which should be natoms x 3 regardless of the size of ids or other. pos may be supplied only when there are no deleted atoms in the structure.

Returns a list of (id 1, id 2, distance) tuples for each contact found.


Property Details [hide private]

name

The name of the System, taken from the input file name

Get Method:
unreachable.name(self) - The name of the System, taken from the input file name
Set Method:
unreachable.name(self, s)

cell

The GlobalCell for this System

Get Method:
unreachable.cell(self) - The GlobalCell for this System

nonbonded_info

NonbondedInfo for this System

Get Method:
unreachable.nonbonded_info(self) - NonbondedInfo for this System
Set Method:
unreachable.nonbonded_info(self, nbinfo)

natoms

number of atoms

Get Method:
unreachable.natoms(self) - number of atoms

nbonds

number of bonds

Get Method:
unreachable.nbonds(self) - number of bonds

nresidues

number of residues

Get Method:
unreachable.nresidues(self) - number of residues

nchains

number of chains

Get Method:
unreachable.nchains(self) - number of chains

ncts

number of Cts

Get Method:
unreachable.ncts(self) - number of Cts

atoms

return list of all atoms in the system

Get Method:
unreachable.atoms(self) - return list of all atoms in the system

bonds

return list of all bonds in the system

Get Method:
unreachable.bonds(self) - return list of all bonds in the system

residues

return list of all residues in the system

Get Method:
unreachable.residues(self) - return list of all residues in the system

chains

return list of all chains in the system

Get Method:
unreachable.chains(self) - return list of all chains in the system

cts

return list of all cts in the system

Get Method:
unreachable.cts(self) - return list of all cts in the system

atom_props

return the list of custom atom properties.

Get Method:
unreachable.atom_props(self) - return the list of custom atom properties.

positions

Nx3 list of lists of positions of all atoms

Get Method:
unreachable.positions(self) - Nx3 list of lists of positions of all atoms
Set Method:
unreachable.positions(self, pos)

center

return geometric center of positions of all atoms

Get Method:
unreachable.center(self) - return geometric center of positions of all atoms

bond_props

return the list of custom bond properties.

Get Method:
unreachable.bond_props(self) - return the list of custom bond properties.

topology

list of bonded atoms for each atom in the System

Get Method:
unreachable.topology(self) - list of bonded atoms for each atom in the System

table_names

names of the tables in the System

Get Method:
unreachable.table_names(self) - names of the tables in the System

tables

all the tables in the System

Get Method:
unreachable.tables(self) - all the tables in the System

auxtable_names

names of the auxiliary tables

Get Method:
unreachable.auxtable_names(self) - names of the auxiliary tables

auxtables

all the auxiliary tables

Get Method:
unreachable.auxtables(self) - all the auxiliary tables

provenance

return a list of Provenance entries for this system

Get Method:
unreachable.provenance(self) - return a list of Provenance entries for this system