schrodinger.application.desmond.packages.msys package

This is the high-level Python interface for msys, intended for use by chemists.

class schrodinger.application.desmond.packages.msys.Handle(_ptr, _id)[source]

Bases: object

__init__(_ptr, _id)[source]
property id

id of this object in the parent System

property system

parent System

class schrodinger.application.desmond.packages.msys.Bond(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

Represents a bond in a System

data()[source]
remove()[source]

remove this Bond from the System

property first

first Atom in the bond (the one with lower id)

property second

second Atom in the bond (the one with higher id)

other(atom)[source]

atom in bond not the same as given atom

property atoms

Atoms in this Bond

__contains__(key)[source]

does custom Bond property exist?

property order

bond order (int)

__init__(_ptr, _id)
property id

id of this object in the parent System

property system

parent System

class schrodinger.application.desmond.packages.msys.Atom(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

Represents an atom (or pseudoparticle) in a chemical system

property fullname
data()[source]
remove()[source]

remove this Atom from the System

__contains__(key)[source]

does atom property key exist?

addBond(other)[source]

create and return a Bond from self to other

findBond(other)[source]

Find the bond between self and Atom other; None if not found

property pos

position

property vel

velocity

property residue
property bonds

Bonds connected to this atom

property bonded_atoms

Atoms bonded to this atom

property nbonds

number of bonds to this atom

property nhydrogens

number of bonded hydrogens

property valence

sum of bond orders

__init__(_ptr, _id)
property aromatic
property atomic_number
property charge
property formal_charge
property fragid
property id

id of this object in the parent System

property mass
property name
property system

parent System

property vx
property vy
property vz
property x
property y
property z
class schrodinger.application.desmond.packages.msys.Residue(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

Represents a residue (group of Atoms) in a System

data()[source]
remove()[source]

remove this Residue from the System

addAtom()[source]

append a new Atom to this Residue and return it

property atoms

list of Atoms in this Residue

property natoms

number of atoms in this residue

property chain

parent chain

property resid

the PDB residue identifier

property name

residue name

property insertion

insertion code

property center

return geometric center of positions of atoms in residue

selectAtom(name=None)[source]

Returns a single Atom from this residue with the given name, or None if no such atom is present. If multiple atoms in the residue have that name, raise an exception.

__init__(_ptr, _id)
property id

id of this object in the parent System

property system

parent System

class schrodinger.application.desmond.packages.msys.Chain(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

Represents a chain (of Residues) in a System

data()[source]
remove()[source]

remove this Chain from the System

addResidue()[source]

append a new Residue to this Chain and return it

property residues

list of Residues in this Chain

property nresidues

number of residues in this chain

selectResidue(resid=None, name=None, insertion=None)[source]

Returns a single Residue with the given resid, name, and/or insertion code. If no such residue is found, returns None. If multiple such residues are found within this chain, raises an exception.

property ct

Return the Ct for this chain

__init__(_ptr, _id)
property id

id of this object in the parent System

property name
property segid
property system

parent System

class schrodinger.application.desmond.packages.msys.Ct(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

Represents a list of Chains in a System

The Ct class exists mainly to provide a separate namespace for chains. If you merge two systems each of which has a chain A, you probably want the chains to remain separate. Cts accomplish this.

The Ct class also provides a key-value namespace for assigning arbitrary properties to Systems.

data()[source]
remove()[source]

remove this Ct from the System

addChain()[source]

append a new Chain to this Ct and return it

property chains

list of Chains in this Ct

property nchains

number of Chains in this Ct

property natoms

number of Atoms in the Ct

property atoms

list of Atoms in this Ct

property bonds

list of Bonds in this Ct

append(system)[source]

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. Does not overwrite the global cell information in self.

property name

Name of Ct

keys()[source]

available Ct properties

get(key, d=None)[source]

get ct property key, else d, which defaults to None

__init__(_ptr, _id)
property id

id of this object in the parent System

property system

parent System

class schrodinger.application.desmond.packages.msys.PropertyMap(ptr)[source]

Bases: object

__init__(ptr)[source]
keys()[source]
class schrodinger.application.desmond.packages.msys.Param(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

A Param instance is a reference to a row in a ParamTable. Use the dict-style interface to get and set values in the row. Msys will take care of converting input values to the type of the corresponding column, and raise an exception if the conversion cannot be performed.

property id

id in parent table

property table

parent ParamTable

property system

parent System

keys()[source]

sorted list of available properties

duplicate()[source]

create a new entry in the parent parameter table with the same values as this one, returning it.

__init__(_ptr, _id)
class schrodinger.application.desmond.packages.msys.ParamTable(_ptr)[source]

Bases: object

The ParamTable class is a 2d table, whose rows are indexed by id and whose columns are properties; see the discussion of properties in the Overview. A ParamTable is used by TermTables to hold the shared parameters for its Terms.

__init__(_ptr)[source]
addParam(**kwds)[source]

add and return a new Param().

If keyword arguments are supplied, they will be assigned to the newly created Param before returning it.

addProp(name, type)[source]

add a new property of the given type, which must be int, float, or str.

property props

names of the properties

property nprops

number of properties

propType(name)[source]

type of the property with the given name

delProp(name)[source]

removes the property with the given name.

param(id)[source]

fetch the Param with the given id

property nparams

number of Params

property params

list of all Params in table

find(name, value)[source]

return the Params with the given value for name

class schrodinger.application.desmond.packages.msys.Term(_ptr, _id)[source]

Bases: schrodinger.application.desmond.packages.msys.Handle

A Term is a handle for an entry in a TermTable.

The properties of a Term can be read and updated using a dictionary like interface. Both “term properties” and properties from the ParamTable are accessed through the same interface. To add or remove properties, use the provided methods in the TermTable or ParamTable instance. If a Term’s param is shared by another Term in any other TermTable, Msys will take care of providing the Term with its own Param containing a copy of the original properties before applying the changes. However, if you a modify a Param through its dictionary interface, you will affect all Terms that happen to share that Param:

# fetch the stretch_harm table
table = mol.table('stretch_harm')
# update the properties of just the first Term
table.term(0)['fc'] = 320
# update the properties of all terms that use this param!
table.term(0).param['fc'] = 320
property paramid
remove()[source]

remove the given Term from its TermTable

property id

id of this term in its TermTable

property system

parent System of parent TermTable

property param

The Param corresponding to this Term’s parameters

property atoms

list of Atoms for this Term

property table

parent TermTable

keys()[source]

union of table.params.props and table.term_props

__init__(_ptr, _id)
class schrodinger.application.desmond.packages.msys.TermTable(_ptr)[source]

Bases: object

Each TermTable is intended to describe a specific type of interaction, e.g. stretch, angle, Lennard-Jones, constraint_hoh, etc. A TermTable has an arity (given by the natoms property) which specifies how many atoms are involved in each interaction: one for nonbonded terms, two for stretch terms, etc. Each interaction instance is described by a Term. Each Term references the appropriate number of atoms, and exactly one Param, which lives in a ParamTable owned (or possible shared) by the TermTable.

The functional form described by a TermTable is not part of msys; all msys does is represent the forcefield parameters in a generic way.

__init__(_ptr)[source]

Construct from TermTablePtr. Do not invoke directly; use System.addTable or System.table instead

remove()[source]

Remove this table from its parent system

coalesce()[source]

Reassign param for each Term in this Table to a member of the distinct set of Params used by those Terms.

property props

Table properties

property name

name of this table

property params

The ParamTable for terms in this table.

property system

The System whose atoms are referenced by this table.

property term_props

names of the custom properties

property natoms

number of atoms in each term

property category

A string describing what kind of TermTable this is. Possibilities are: bond, constraint, virtual, polar, nonbonded, and exclusion.

property nterms

number of terms

delTermsWithAtom(atom)[source]

remove all terms whose atoms list contains the given Atom

findWithAll(atoms)[source]

return the terms that contain all the given atoms in any order

findWithAny(atoms)[source]

return the terms that contain at least one of the given atoms

findWithOnly(atoms)[source]

return the terms that contain only the given atoms

findExact(atoms)[source]

return the terms that contain precisely the given atoms in the given order.

property terms

returns a list of all the Terms in the table

term(id)[source]

returns the Term in the table with the given id

hasTerm(id)[source]

Does a Term with the given id exist in the table?

addTermProp(name, type)[source]

add a custom Term property of the given type

delTermProp(name)[source]

remove the custom Term property

termPropType(name)[source]

type of the given Term property

addTerm(atoms, param=None)[source]

Add a Term to the table, with given initial param. The atoms list must have natoms elements, and each Atom must belong to the same System as the TermTable. If param is not None, it must belong to the ParamTable held by the TermTable.

property override_params

parameter table containing override values

property noverrides

number of parameter overrides

overrides()[source]

return a mapping from pairs of Params in self.params to a Param in self.override_params.

setOverride(pi, pj, op)[source]

override the interaction between params pi and pj with the interaction given by op. pi and pj must be Params from self.params; op must be a param from self.override_params, or None to remove the override.

getOverride(pi, pj)[source]

get override for given pair of params, or None if not present.

class schrodinger.application.desmond.packages.msys.System(_ptr, glued_topology=None)[source]

Bases: object

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)

__init__(_ptr, glued_topology=None)[source]

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

property name

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

addAtom()[source]

add and return a new Atom in its own residue

addResidue()[source]

add and return a new Residue in its own chain

addChain(ct=4294967295)[source]

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

addCt()[source]

add and return a new Ct

delAtoms(atoms)[source]

remove the given Atoms from the System

delBonds(bonds)[source]

remove the given Bonds from the System

delResidues(residues)[source]

remove the given Residues from the System

delChains(chains)[source]

remove the given Chains from the System

atom(id)[source]

return the atom with the specified id

bond(id)[source]

return the bond with the specified id

residue(id)[source]

return the residue with the specified id

chain(id)[source]

return the chain with the specified id

ct(id)[source]

return the Ct with the specified id

findBond(a1, a2)[source]

return the bond between the specified atoms, or None if not found

property cell

The GlobalCell for this System

property nonbonded_info

NonbondedInfo for this System

property natoms

number of atoms

property nactive

Number of active atoms

property nbonds

number of bonds

property nresidues

number of residues

property nchains

number of chains

property ncts

number of Cts

property atoms

return list of all atoms in the system

property bonds

return list of all bonds in the system

property residues

return list of all residues in the system

property chains

return list of all chains in the system

property cts

return list of all cts in the system

addAtomProp(name, type)[source]

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

delAtomProp(name)[source]

remove the given custom atom property

property atom_props

return the list of custom atom properties.

atomPropType(name)[source]

type of the given atom property

atomsGroupedBy(prop)[source]

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.

property positions

Nx3 list of lists of positions of all atoms

getPositions()[source]

get copy of positions as Nx3 array

setPositions(pos)[source]

set positions from Nx3 array

getVelocities()[source]

get copy of velocities as N3x array

setVelocities(vel)[source]

set velocities from Nx3 array. vel can be None, and in this case this function has no effects.

setCell(cell)[source]

set unit cell from from 3x3 array

getCell()[source]

return copy of unit cell as 3x3 numpy array

property center

return geometric center of positions of all atoms

translate(xyz)[source]

shift coordinates by given amount

addBondProp(name, type)[source]

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

delBondProp(name)[source]

remove the given custom bond property

property bond_props

return the list of custom bond properties.

bondPropType(name)[source]

type of the given bond property

property topology

list of bonded atoms for each atom in the System

property table_names

names of the tables in the System

property tables

all the tables in the System

table(name)[source]

Get the TermTable with the given name, raising ValueError if not present.

getTable(name)[source]

Return the TermTable with the given name, or None if not present.

addTable(name, natoms, params=None)[source]

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(type, name=None)[source]

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.

coalesceTables()[source]

Invoke TermTable.coalesce on each table

property auxtable_names

names of the auxiliary tables

property auxtables

all the auxiliary tables

auxtable(name)[source]

auxiliary table with the given name

addAuxTable(name, table)[source]

add or replace extra table with the given name.

delAuxTable(name)[source]

remove auxiliary table with the given name.

addNonbondedFromSchema(funct, rule='')[source]

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(sel)[source]

Create and return an atom selection object (Atomsel).

Parameters

sel – str atom selection, or list of GIDs (possibly empty).

Note

Even if ids are provided, the ids of the selection are in sorted order.

select(seltext)[source]

return a list of Atoms satisfying the given VMD atom selection.

selectIds(seltext, pos=None, box=None)[source]

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.

selectArr(seltext)[source]

Return the ids of the Atoms satisfying the given VMD atom selection as a numpy array of type uint32.

selectChain(name=None, segid=None)[source]

Returns a single Chain with the matching name and/or segid, or raises an exception if no single such chain is present.

selectCt(name=None)[source]

Return a single Ct with the matching name, or raises an exception if no single such Ct is present

append(system)[source]

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(sel=None, share_params=False)[source]

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.

property glued_topology
glue(glue_pts, start_fresh=False)[source]
sorted()[source]

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(replace=True, reanalyze=True)[source]

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()[source]

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()[source]

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.

property provenance

return a list of Provenance entries for this system

findContactIds(cutoff, ids=None, other=None, pos=None)[source]

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.

class schrodinger.application.desmond.packages.msys.AnnotatedSystem(sys, allow_bad_charges=False)[source]

Bases: object

System that has been annotated with additional chemical information

The AnnotatedSystem class provides chemical annotation useful primarily for evaluating smarts patterns. The system is expected to already have have chemical reasonable bond orders and formal charges, and to have no missing atoms (e.g. hydrogens). If these criteria cannot be met, set allow_bad_charges=True in the constructor to bypass these checks; in that case the AnnotatedSystem can still be used to evaluate smarts patterns, but patterns making use of the electronic state of the system (e.g. aromaticity, hybridization, etc.) will not be correct (the system will appear to be entirely aliphatic). You may also use the AssignBondOrderAndFormalCharge function to assign reasonable bond orders and formal charges, assuming there are no missing atoms.

The AnnotatedSystem defines a model for aromaticity. First, the SSSR (smallest set of smallest rings) is determined. Next, rings which share bonds are detected and grouped into ring systems. Rings are initially marked as nonaromatic. If the ring system taken as a whole is deemed to be aromatic, then all rings within it are aromatic as well; otherwise, individual rings are checked for aromaticity. Rings are checked in this fashion until no new rings are found to be aromatic.

A ring system is deemed to be aromatic if it satisfies Huckel’s 4N+2 rule for the number of electrons in the ring(s). An internal double bond (i.e. a bond between two atoms in the ring) adds 2 to the electron count. An external double bond (a bond between a ring atom and an atom not in that ring) adds 1 to the electron count. An external double bond between a carbon and a nonaromatic carbon makes the ring unconditionally nonaromtic. An atom with a lone pair and no double bonds adds 2 to the electron count.

__init__(sys, allow_bad_charges=False)[source]

Construct from System. AnnotatedSystem is not updated if System is subsequently modified.

property errors

List of errors found during system analysis if allow_bad_charges=True

aromatic(atom_or_bond)[source]

Is atom or bond aromatic

hcount(atom)[source]

Number of bonded hydrogens

degree(atom)[source]

Number of (non-pseudo) bonds

valence(atom)[source]

Sum of bond orders of all (non-pseudo) bonds

loneelectrons(atom)[source]

Number of lone electrons

hybridization(atom)[source]

Atom hybridization – 1=sp, 2=sp2, 3=sp3, 4=sp3d, etc.

Equal to 0 for hydrogen and atoms with no bonds, otherwise max(1, a.degree() + (a.lone_electrons+1)/2 - 1).

ringbondcount(atom)[source]

Number of ring bonds

class schrodinger.application.desmond.packages.msys.SmartsPattern(pattern)[source]

Bases: object

A class representing a compiled SMARTS pattern

The Msys smarts implementation is similar to that of Daylight smarts, with support for arbitrarily nested recursive smarts. A few features are not currently supported; warnings will be generated when these constructs are used in a smarts pattern.

  • Directional bonds; e.g. \ and /; these are treated as single bonds (i.e. as a - character).

  • Chiral specification (@, @@, etc); ignored.

  • Implicit hydrogen (h): treated as explicit H.

  • Explicit degree (D): treated as bond count X.

  • Isotopes: ([12C]): ignored.

  • Atom class ([C:6]): ignored.

On the other hand, Msys does support hybridization using the ^ token, as in OpenBabel:

[c^2]       select sp2 aromatic carbon
__init__(pattern)[source]

Initialize with SMARTS pattern

property natoms

Number of atoms in the compiled smarts pattern

property pattern

The pattern used to initialize the object

property warnings

Warnings, if any, emitted during compilation

findMatches(annotated_system, atoms=None)[source]

Return list of lists representing ids of matches of this pattern in this system, optionally requiring that the first atom match belongs to the given set of atoms. An AnnotatedSystem must be used here, which can be constructed from a System after calling AssignBondOrderAndFormalCharge.

match(annotated_system)[source]

Return True if a match is found anywhere; False otherwise.

This is much faster than checking for an empty result from findMatches.

schrodinger.application.desmond.packages.msys.CreateSystem()[source]

Create a new, empty System

schrodinger.application.desmond.packages.msys.CreateParamTable()[source]

Create a new, empty ParamTable

schrodinger.application.desmond.packages.msys.LoadDMS(path=None, structure_only=False, buffer=None)[source]

Load the DMS file at the given path and return a System containing it. If structure_only is True, only Atoms, Bonds, Residues and Chains will be loaded, along with the GlobalCell, and no pseudos (atoms with atomic number less than one) will be loaded.

If the buffer argument is provided, it is expected to hold the contents of a DMS file, and the path argument will be ignored.

schrodinger.application.desmond.packages.msys.LoadMAE(path=None, ignore_unrecognized=False, buffer=None, structure_only=False)[source]

load the MAE file at the given path and return a System containing it. Forcefield tables will be created that attempt to match as closely as possible the force terms in the MAE file; numerical differences are bound to exist. If ignore_unrecognized is True, ignore unrecognized force tables.

If the buffer argument is provided, it is expected to hold the contents of an MAE file, and the path argument will be ignored.

If the contents of the file specified by path, or the contents of buffer, are recognized as being gzip-compressed, they will be decompressed on the fly.

If structure_only is True, no forcefield components will be loaded.

schrodinger.application.desmond.packages.msys.LoadPDB(path)[source]

Load a PDB file at the given path and return a System. No bonds will be created, even if CONECT records are parent.

schrodinger.application.desmond.packages.msys.LoadPrmTop(path, structure_only=False)[source]

Load an Amber7 prmtop file at the given path and return a System. Coordinates and global cell information are not present in the file.

schrodinger.application.desmond.packages.msys.LoadMol2(path, multiple=False)[source]

Load a mol2 file at the given path. If multiple is True, return a list of Systems, one for each MOLECULE record. Otherwise, return just one System corresponding to the first MOLECULE record.

schrodinger.application.desmond.packages.msys.LoadXYZ(path)[source]

Load an xyz file at the given path. Guesses bonds based on guessed atomic numbers based on atom name.

schrodinger.application.desmond.packages.msys.Load(path, structure_only=False, without_tables=None)[source]

Infer the file type of path and load the file. If without_tables is True or False, it specifies whether TermTables should be loaded along with the structure; by default it takes the value of structure_only.

Returns a new System.

class schrodinger.application.desmond.packages.msys.IndexedFileLoader(path, idx_path=None)[source]

Bases: object

Supports random access to multi-structure files

__init__(path, idx_path=None)[source]

Open an indexed file loader, creating an index file if needed.

Parameters
  • path (str) – file path. File type is inferred from the extension.

  • idx_path (str) – index file path. Defaults to $path.idx.

Note

You need write permission to the location of the index file.

property path

path to source file

__len__()[source]

number of entries

schrodinger.application.desmond.packages.msys.ConvertToRdkit(mol)[source]

Construct an RDKit ROMol from the given System

Args:

mol (System): System

Returns:

rdkit.ROMol

schrodinger.application.desmond.packages.msys.LoadMany(path, structure_only=False, error_writer=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)[source]

Iterate over structures in a file, if the file type supports iteration.

for mol in LoadMany(‘input.mol2’): …

If there was an error reading a structure, LoadMany returns None for that iteration. If error_writer is not None, it’s write() method is invoked with the contents of the exception message as argument. error_writer defaults to sys.stderr.

schrodinger.application.desmond.packages.msys.Save(mol, path, append=False, structure_only=False)[source]

Save the given system to path, using a file format guessed from the path name. Not all formats support both append and structure_only options; see the corresponding SaveXXX functions.

schrodinger.application.desmond.packages.msys.FormatSDF(mol)[source]

Return System in sdf format

schrodinger.application.desmond.packages.msys.ParseSDF(text)[source]

Iterate over blocks in sdf format text. Accepts normal and gzipped text.

schrodinger.application.desmond.packages.msys.ReadPDBCoordinates(mol, path)[source]

Read coordinates and box from the given pdb file into the given System.

schrodinger.application.desmond.packages.msys.ReadCrdCoordinates(mol, path)[source]

Read coordinates from the given Amber crd file into the given System.

schrodinger.application.desmond.packages.msys.SaveDMS(system, path, structure_only=False, unbuffered=False)[source]

Export the System to a DMS file at the given path.

schrodinger.application.desmond.packages.msys.SerializeMAE(system, with_forcefield=True)[source]

Return the MAE form of the System as a string.

schrodinger.application.desmond.packages.msys.SaveMAE(system, path, with_forcefield=True, append=False)[source]

Export the System (or list of systems) to an MAE file at the given path.

schrodinger.application.desmond.packages.msys.SavePDB(system, path, append=False)[source]

Export the System to a PDB file at the given path.

schrodinger.application.desmond.packages.msys.SaveMol2(system, path, selection='none', append=False)[source]

Export the System to a mol2 file at the given path. You should probably call AssignBondOrderAndFormalCharge() before exporting the system.

schrodinger.application.desmond.packages.msys.FromSmilesString(smiles, forbid_stereo=True)[source]

Construct a System from a smiles string.

Args:

smiles (str): the smiles string forbid_stereo (bool): if True, raise exception if smiles has stereo

EXPERIMENTAL. In particular, stereo information in the smiles string is ignored. Set forbid_stereo=False to permit stereo specifications to be silently ignored. This flag may be removed at a later date once stereo support has been added.

schrodinger.application.desmond.packages.msys.TableSchemas()[source]

available schemas for System.addTableFromSchema

schrodinger.application.desmond.packages.msys.NonbondedSchemas()[source]

available nonbonded schemas for System.addNonbondedFromSchema

schrodinger.application.desmond.packages.msys.GetSSSR(atoms, all_relevant=False)[source]

Get smallest set of smallest rings (SSSR) for a system fragment.

The SSSR is in general not unique; the SSSR of a tetrahedron is any three of its four triangular faces. The set of rings that is the union of all SSSR’s (all relevant rings) may be obtained by setting all_relevant to True.

Arguments: atoms – [msys.Atom, …, msys.Atom] from a single system all_relevant – bool Returns: [[msys.Atom, …, msys.Atom], …, [msys.Atom, …, msys.Atom]]

schrodinger.application.desmond.packages.msys.GetRingSystems(atoms)[source]

Get ring systems for the given atoms

schrodinger.application.desmond.packages.msys.AssignBondOrderAndFormalCharge(system_or_atoms, total_charge=None)[source]

Assign bond orders and formal charges to a molecular system.

Determines bond orders and formal charges by preferring neutral charges and placing negative charges with more electronegative atoms, under octet constraints and the total system charge constraint. Assigns the bond orders and formal charges to the system. Can assign to a subset of atoms of the system, provided these atoms form complete connected fragments.

WARNING: calling this function on a chemically incomplete system, i.e. just protein backbone, may cause msys to hang indefinitely.

Arguments: system_or_atoms: either a System or a list of Atoms total_charge: if not None, integral total charge

class schrodinger.application.desmond.packages.msys.Graph(system_or_atoms)[source]

Bases: object

Represents the chemical topology of a System

Used mainly to implement graph isomorphism; see the match() method

__init__(system_or_atoms)[source]
size()[source]

number of atoms in graph

atoms()[source]

ordered atoms in graph

hash()[source]

string hash of atoms and bonds in graph

match(graph)[source]

Find a graph isomorphism between self and the given Graph. If no isomorphism could be found, return None; otherwise return mapping from atoms in this graph to atoms in that graph.

matchAll(graph, substructure=False)[source]

Find all graph isomorphisms between self and the given Graph. If no isomorphism could be found, return empty list; otherwise return list of dicts mapping atoms in this graph to atoms in that graph. If substructure is True, return isomorphisms between self and any subgraph of the given Graph.

schrodinger.application.desmond.packages.msys.FindDistinctFragments(system)[source]

Return fragids of representative fragments.

schrodinger.application.desmond.packages.msys.ComputeTopologicalIds(system)[source]

Compute and return the topological ids for the atoms or system

schrodinger.application.desmond.packages.msys.CalcDistance(a, b)[source]

Distance between atoms or positions a and b

schrodinger.application.desmond.packages.msys.CalcAngle(a, b, c)[source]

Angle in radians of atoms or positions a-b-c.

schrodinger.application.desmond.packages.msys.CalcDihedral(a, b, c, d)[source]

Dihedral angle in radians of atoms or positions a-b-c-d

schrodinger.application.desmond.packages.msys.ApplyDihedralGeometry(a, b, c, r, theta, phi)[source]

Return the position of atom d with cd length r, bcd angle theta, and abcd dihedral phi, all in radians.

schrodinger.application.desmond.packages.msys.CalcPlanarity(pos_or_atoms)[source]

Planarity of positions or atoms

schrodinger.application.desmond.packages.msys.LineIntersectsTriangle(r, s, a, b, c)[source]

True if line segment rs intersects triangle abc

class schrodinger.application.desmond.packages.msys.InChI(system, DoNotAddH=True, SNon=True, FixedH=True)[source]

Bases: object

InChI holds an the result of an inchi invocation for a structure

__init__(system, DoNotAddH=True, SNon=True, FixedH=True)[source]
property string

Computed inchi string

property auxinfo

Auxiliary info

property message

Message returned by inchi during calculation

property ok

Was an inchi computed successfully?

property key

inchi key for this object’s string.

schrodinger.application.desmond.packages.msys.CloneSystem(atoms)[source]

Call System.clone(atoms) using the System from the first atom.

DEPRECATED. Use System.clone directly instead.

class schrodinger.application.desmond.packages.msys.SpatialHash(pos, ids=None, box=None)[source]

Bases: object

SpatialHash provides an interface for efficient spatial queries on particle positions.

__init__(pos, ids=None, box=None)[source]

Construct from particle positions. If ids are provided, they should be a numpy array of type uint32 and specify which rows of the Nx3 pos array are to be hashed. If box is provided, it must be a 3x3 array of doubles, and the search will be performed using periodic boundary conditions.

voxelize(radius)[source]

Perform voxelization such that findWithin queries with reuse_voxels=True at a radius equal to or less than the given radius can be performed accurately. For queries at radius less than the voxelization, it may be worthwhile to revoxelize at a smaller radius. Note that, by default, findWithin calls voxelize with the query radius as argument, so it is not strictly necessary ever to use this method.

findWithin(radius, pos, ids=None, reuse_voxels=False)[source]

Find particles from pos which are within the given radius of some particle in the spatial hash (i.e. provided in the SpatialHash constructor). By default, voxelization is performed at the same resolution as the query radius, but this can be overridden by calling voxelize() manually, then calling findWithin() with reuse_voxels=True. pos is expected to be an Nx3 array of floats. The ids parameter defaults to arange(len(pos)); supply an array of ids to limit the search to a subset of rows in pos.

findNearest(k, pos, ids=None)[source]

Find at most k particles from pos with the smallest minimum distance to some particle in the spatial hash. If ids is not provided, it defaults to arange(len(pos)).

findContacts(radius, pos, ids=None, reuse_voxels=False)[source]

Find pairs of particles within radius of each other.

Args:

radius (float): search radius pos (array[float]): positions ids (array[uint]): particle indices reuse_voxels (bool): assume voxelize(R>=radius) has already been called

Returns:

i, j, dists (tuple): Mx1 arrays of ids and distances.

The first array corresponds to ids in the call to findContacts; the second column to the ids passed to the SpatialHash constructor.

IMPORTANT: pairs with the same id in the constructor and the call the findContacts are excluded from the output set. Therefore, the positions passsed to findContacts should correspond to the same atom indices as the positions passed to the SpatialHash constructor.

class schrodinger.application.desmond.packages.msys.HydrogenBondFinder(system, donors, acceptors, cutoff=3.5)[source]

Bases: object

Find candidate hydrogen bonds.

More hbonds will be found than are “realistic”; further filtering may be performed using the energy attribute of the returned hbonds. A reasonable filter seems to be around -1.0 (more negative is stronger); i.e. energies greater than that are more likely than not to be spurious.

The HydrogenBond class can also be used directly to compute hydrogen bond geometry and energies by supplying donor, acceptor and hydrogen positions.

__init__(system, donors, acceptors, cutoff=3.5)[source]
Args:

system (System): msys system donors: selection string, list of ids, or list of Atoms acceptors: selection string, list of ids, or list of Atoms cutoff (float): distance cutoff for donor and acceptor

Note:

If Atoms are provided, they must be members of system.

find(pos=None)[source]

Find hydrogen bonds for the given positions, defaulting to the current positions of the input system.

Subpackages

Submodules