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

Package msys

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

Submodules [hide private]

Classes [hide private]
  Handle
  Bond
  Atom
  Residue
  Chain
  Ct
  PropertyMap
  Param
  ParamTable
  Term
  TermTable
  System
  AnnotatedSystem
System that has been annotated with additional chemical information
  SmartsPattern
A class representing a compiled SMARTS pattern
  Graph
  InChI
InChI holds an the result of an inchi invocation for a structure
  SpatialHash
SpatialHash provides an interface for efficient spatial queries on particle positions.
  HydrogenBondFinder
Find hydrogen bonds in a system given a selection of donors and acceptors, along with a cutoff distance.
Functions [hide private]
 
__add_properties(cls, *names)
 
CreateSystem()
Create a new, empty System
 
_find_ids(atoms, klass=Atom)
return the SystemPtr and IdList for the given set of atoms.
 
CloneSystem(atoms)
create a new system from the given list of atoms, which must all be from the same System and have different ids.
 
CreateParamTable()
Create a new, empty ParamTable
 
LoadDMS(path=None, structure_only=False, buffer=None)
Load the DMS file at the given path and return a System containing it.
 
LoadMAE(path=None, ignore_unrecognized=False, buffer=None, structure_only=False)
load the MAE file at the given path and return a System containing it.
 
LoadPDB(path)
Load a PDB file at the given path and return a System.
 
LoadPrmTop(path, structure_only=False)
Load an Amber7 prmtop file at the given path and return a System.
 
LoadMol2(path, multiple=False)
Load a mol2 file at the given path.
 
LoadXYZ(path)
Load an xyz file at the given path.
 
LoadSDF(path=None, buffer=None)
Load an sdf file from either path or buffer
 
ScanSDF(path=None, buffer=None)
Iterate over SDF entries using the Molecule interface.
 
Load(path, structure_only=False, without_tables=None)
Infer the file type of path and load the file.
 
LoadMany(path, structure_only=False, error_writer=sys.stderr)
Iterate over structures in a file, if the file type supports iteration.
 
Save(mol, path, append=False, structure_only=False)
Save the given system to path, using a file format guessed from the path name.
 
ReadPDBCoordinates(mol, path)
Read coordinates and box from the given pdb file into the given System.
 
ReadCrdCoordinates(mol, path)
Read coordinates from the given Amber crd file into the given System.
 
SaveDMS(system, path, structure_only=False, unbuffered=False)
Export the System to a DMS file at the given path.
 
SerializeMAE(system, with_forcefield=True)
Return the MAE form of the System as a string.
 
SaveMAE(system, path, with_forcefield=True, append=False)
Export the System (or list of systems) to an MAE file at the given path.
 
SavePDB(system, path, append=False)
Export the System to a PDB file at the given path.
 
SaveMol2(system, path, append=False)
Export the System to a mol2 file at the given path.
 
SaveSDF(system, path_or_file, append=False)
Export the system to the given path or file.
 
FromSmilesString(smiles)
Construct a System from a smiles string
 
TableSchemas()
available schemas for System.addTableFromSchema
 
NonbondedSchemas()
available nonbonded schemas for System.addNonbondedFromSchema
 
GetSSSR(atoms, all_relevant=False)
Get smallest set of smallest rings (SSSR) for a system fragment.
 
AssignSybylTypes(system)
Assign Sybyl atom and bond types to the given system.
 
AssignBondOrderAndFormalCharge(system_or_atoms, total_charge=None)
Assign bond orders and formal charges to a molecular system.
 
AddHydrogens(system_or_atoms)
 
GuessHydrogenPositions(atoms)
 
FindDistinctFragments(system)
Return fragids of representative fragments.
 
ComputeTopologicalIds(system)
Compute and return the topological ids for the atoms or system
 
CalcDistance(a, b)
Distance between atoms or positions a and b
 
CalcAngle(a, b, c)
Angle in radians of atoms or positions a-b-c.
 
CalcDihedral(a, b, c, d)
Dihedral angle in radians of atoms or positions a-b-c-d
 
ApplyDihedralGeometry(a, b, c, r, theta, phi)
Return the position of atom d with cd length r, bcd angle theta, and abcd dihedral phi, all in radians.
 
CalcPlanarity(pos_or_atoms)
Planarity of positions or atoms
 
LineIntersectsTriangle(r, s, a, b, c)
True if line segment rs intersects triangle abc
Function Details [hide private]

_find_ids(atoms, klass=Atom)

 

return the SystemPtr and IdList for the given set of atoms. Raise ValueError if atoms come from multiple systems. Return None, [] if the input list is empty.

CloneSystem(atoms)

 

create a new system from the given list of atoms, which must all be from the same System and have different ids. The order of the atoms in the new system will be that of the input atoms.

LoadDMS(path=None, structure_only=False, buffer=None)

 

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.

LoadMAE(path=None, ignore_unrecognized=False, buffer=None, structure_only=False)

 

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.

LoadPDB(path)

 

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

LoadPrmTop(path, structure_only=False)

 

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

LoadMol2(path, multiple=False)

 

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.

LoadXYZ(path)

 

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

Load(path, structure_only=False, without_tables=None)

 

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.

LoadMany(path, structure_only=False, error_writer=sys.stderr)

 

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.

Save(mol, path, append=False, structure_only=False)

 

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.

SaveMol2(system, path, append=False)

 

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

SaveSDF(system, path_or_file, append=False)

 

Export the system to the given path or file. If path_or_file is a string, it is assumed to be a path; if None, the bytes are returned; otherwise, it is assumed to be a file object implementing the write() method.

GetSSSR(atoms, all_relevant=False)

 

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]]

AssignSybylTypes(system)

 

Assign Sybyl atom and bond types to the given system. Types will be stored in the "sybyl_type" property of each atom and bond. Invoke AssignBondOrderAndFormalCharge first if bond orders need to be recalculated.

AssignBondOrderAndFormalCharge(system_or_atoms, total_charge=None)

 

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. Also determines resonance forms and creates and populates a 'resonant_order' bond property and 'resonant_charge' atom property in the system, where resonant order/charge is the average of the bond order/formal charge over all resonant forms. 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