schrodinger.application.desmond.cms module

Classes and functions for dealing with *.cms files.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.desmond.cms.AtomGroup(atom=None, name=None, index=None)

Bases: object

class schrodinger.application.desmond.cms.Cms(file=None, string=None)

Bases: schrodinger.structure.Structure

ATOMGROUP_PREFIX = 'i_ffio_grp_'
META_ASL = {'solvent': "atom.s_ffio_ct_type 'solvent'", 'heavy_atom': 'not atom.elem H', 'membrane': "atom.s_ffio_ct_type 'membrane'", 'solute': "atom.s_ffio_ct_type 'solute'", 'solute_heavy_atom': "atom.s_ffio_ct_type 'solute' and not atom.elem H", 'solvent_heavy_atom': "atom.s_ffio_ct_type 'solvent' and not atom.elem H"}
MODEL_SYSTEM_TYPE = ['standard model system', 'model system for mutation FEP', 'model system for total free energy FEP']
PROP_CMS = 's_m_original_cms_file'
PROP_TRJ = 's_chorus_trajectory_file'
clear_restrain()

Deletes all existing restraints.

delete_all_atom_group(exception=[])
delete_atom_group(group_name)
ffio_refresh()

‘atom_index’ starts from 1.

fix_filenames(cms_fname=None, trj_fname=None)
get_atom_group()
get_constraint()
get_degrees_of_freedom()
get_fep_cts()

find ref and mut cts by fep_fragname property

get_fragname()
get_fullsys_ct_atom_index_range(comp_ct_index)

for a given component CT, return a map of that compontent CT in full_system CT

get_lambda_atom_indices(l)
Parameters:l – lambda value, 0 or 1
Returns:list of int (for atoms), list of list of int (for virtual sites)
get_num_constraint()
get_restrain()
get_vdw()

Returns the Vdw parameters for all atoms. The returned object is a list. Each element of the returned list is a Vdw object for the corresponding atom.

gid(atom_index)

`atom_index’ is the index of the atom in the ‘full_system’ CT.

gid_refresh()
merge_atom_group(atom_group)
merge_atom_group_from_asl(asl, group_name, group_index)
model_system_type()
sanitize_for_viparr()

Viparr’s custom mae file reader does not play well with certain characters like [ and ] (square brackets). This is also true when the these characters are ‘escaped’. Thus this method sanitizes offensive property names and their values by replacing them with forward slashes. This method checks if the CT properties are okay for viparr.

select_atom(asl)
select_atom_comp(asl)

Returns a list of lists. Each list element contains a list of atom indices of the corresponding component CT.

set_atom_group(atom_group)
set_atom_group_from_asl(asl, group_name, group_index)
set_restrain(restrain_list)

`restrain_list’ must be a list. Each element must be a list of `Restrain’ objects.

site(atom_index)

`atom_index’ starts from 1.

write(fname)
write_to_string()
class schrodinger.application.desmond.cms.Constraint(func, atom_i=0, atom_j=0, atom_k=0, atom_l=0, atom_m=0, c1=0, c2=0, c3=0, c4=0, c5=0, c6=0)

Bases: object

NUM_CONSTRAINT = {'HOH': 3, 'AH2': 2, 'AH3': 3, 'AH1': 1, 'AH4': 4, 'AH5': 5}
num_constraint()
class schrodinger.application.desmond.cms.Pseudo(x, y, z)

Bases: object

class schrodinger.application.desmond.cms.Restrain(atom, k, ref, sigma=None)

Bases: object

is_same(a)

Returns True if ‘self’ and ‘a’ are the same restraint (regardless the force constant).

merge_with(a)
class schrodinger.application.desmond.cms.Site(type, charge, mass, vdwtype)

Bases: object

class schrodinger.application.desmond.cms.Vdw(atom_type, func, c)

Bases: object

A class for handling VDW parameters.

c6()

c6 = 4 * epsilon * sigma**6

schrodinger.application.desmond.cms.aslselect_atom(struc, asl, should_mark_fullsystem=True)

Similar as ‘aslselect_atom’, but the ‘struc’ must be a list of CTs (‘Structure’ objects) in the same order as in a .cms file (i.e., the first one must be a “full_system” CT, followed by component CTs). The periodic boundary condition will be taken into account. The “s_ffio_ct_type” and “i_ffio_ct_index” atom properties are recognized. This function returns a ‘dict’ object. The keys are CT index (‘full_system’ CT’s index is 0, component CT’s index starts from 1), and the values are list of selected atoms of the corresponding component CT.

schrodinger.application.desmond.cms.calc_average_vdw_coeff(struc)

Calculates and returns the average dispersion coefficient.

The unit of the coefficient is in the unit of the original ffio block.

Parameters:struc – A list of schrodinger.structure.Structure objects that have been pre-treated by the prep_struc function.
schrodinger.application.desmond.cms.check_sanity(struc)
schrodinger.application.desmond.cms.combine_vdw(v1, v2, comb_rule='geometric')

Given two homogenous Vdw objects ‘v1’ and ‘v2’ and a combination rule ‘comb_rule’, this function returns a Vdw object as a combination of ‘v1’ and ‘v2’.

schrodinger.application.desmond.cms.crossprod(v, u)

Returns the cross product of two 3-D vectors.

schrodinger.application.desmond.cms.decomp_rawfep_structure(struc)
schrodinger.application.desmond.cms.dotprod(v, u)

Returns the dot product of two 3-D vectors.

schrodinger.application.desmond.cms.find_next_residue(ct, residue)
schrodinger.application.desmond.cms.find_prev_residue(ct, residue)
schrodinger.application.desmond.cms.gen_alpha_helix_restraint(model, helix_asl, fc, sigma, ref)

Given a model (‘Cms’ object) and an optional ‘helix_asl’ expression, returns a string specifying the restraint settings.

schrodinger.application.desmond.cms.get_box(ct)
Given a CT, extract the following properties’ values:
“r_chorus_box_ax”, “r_chorus_box_ay”, “r_chorus_box_az”, “r_chorus_box_bx”, “r_chorus_box_by”, “r_chorus_box_bz”, “r_chorus_box_cx”, “r_chorus_box_cy”, “r_chorus_box_cz”,

and returns them as a list of float values. The order of the values in the list is the same as written above. A ‘KeyError’ exception will be raised if any property is missing in the CT.

schrodinger.application.desmond.cms.get_boxsize(box)

Given a simulation box in the form of a 3x3 matrix, this function returns the size of the box.

schrodinger.application.desmond.cms.get_boxvolume(box)
schrodinger.application.desmond.cms.get_gluepoints(model, cutoff=3.0)
schrodinger.application.desmond.cms.get_model_system_type(struc)

Returns 1 if the CTs in ‘struc’ have a fepio_fep block. Returns 2 if the CTs in ‘struc’ have a non-empty ligand atom group and do

not have an fepio_fep block.

Returns 0 otherwise.

Parameters:struc – A list of ffiostructure.FFIOStructure objects.
schrodinger.application.desmond.cms.has_fepio(ct)

Returns True if any of the ‘ct’ have a fepio_fep block, or False if they do not.

Parameters:ct – Either a FFIOStructure or a Structure object
schrodinger.application.desmond.cms.has_ffio(ct)

Returns 1 if ‘ct’ has an mmffio block, or 0 if it does not. ‘ct’ should be either a FFIOStructure or a Structure object.

schrodinger.application.desmond.cms.mark_fullsystem_ct(struc)

Marks atoms in the “full_system” CT with the “s_ffio_ct_type” and “i_ffio_ct_index” properties, and returns the marked full_system CT as a ‘Structure’ object.

Parameters:struc – A list of ‘Structure’ objects. The first object should be the “full_system” CT, followed by the component CTs in the same order as in the .cms file.

Note that the returned ‘Structure’ object will be a new one, not the same one as in ‘struc’.

schrodinger.application.desmond.cms.merge_relative_restraint(a, b)

The ‘a’ and ‘b’ must be a list. Each element is a list of ‘RelativeRestrain’ objects for the corresponding component CT.

schrodinger.application.desmond.cms.norm(v)

Returns the norm of the 3-D vector ‘v’.

schrodinger.application.desmond.cms.sort_posre(restr)