schrodinger.application.desmond.cms module¶
Classes and functions for dealing with *.cms files.
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.application.desmond.cms.
check_sanity
(struc)¶
-
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.
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.
dotprod
(v, u)¶ Returns the dot product of two 3-D vectors.
-
schrodinger.application.desmond.cms.
crossprod
(v, u)¶ Returns the cross product of two 3-D vectors.
-
schrodinger.application.desmond.cms.
norm
(v)¶ Returns the norm of the 3-D vector ‘v’.
-
schrodinger.application.desmond.cms.
get_boxvolume
(box)¶
-
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.
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.
delete_fepio
(ct)¶ Delete the fepio_fep block from the input structure, which should have the block (or the behavior is undefined).
-
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.
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.
decomp_rawfep_structure
(struc)¶
-
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)¶
-
-
schrodinger.application.desmond.cms.
sort_posre
(restr)¶
-
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.
-
class
schrodinger.application.desmond.cms.
AtomGroup
(atom=None, name=None, index=None)¶ Bases:
object
-
class
schrodinger.application.desmond.cms.
Site
(type, charge, mass, vdwtype)¶ Bases:
object
-
class
schrodinger.application.desmond.cms.
Pseudo
(x, y, z)¶ Bases:
object
-
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
= {'AH1': 1, 'AH2': 2, 'AH3': 3, 'AH4': 4, 'AH5': 5, 'HOH': 3}¶
-
num_constraint
()¶
-
-
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.
combine_vdw
(v1, v2, comb_rule='geometric')¶ Given two homogenous
Vdw
objects ‘v1’ and ‘v2’ and a combination rule ‘comb_rule’, this function returns aVdw
object as a combination of ‘v1’ and ‘v2’.
-
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 theprep_struc
function.
-
class
schrodinger.application.desmond.cms.
Cms
(file=None, string=None, remove_ghost_atoms_in_fsys=False)¶ Bases:
schrodinger.structure.Structure
-
ATOMGROUP_PREFIX
= 'i_ffio_grp_'¶
-
MODEL_SYSTEM_TYPE
= ['standard model system', 'model system for mutation FEP', 'model system for total free energy FEP']¶
-
META_ASL
= {'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': "atom.s_ffio_ct_type 'solvent'", 'solvent_heavy_atom': "atom.s_ffio_ct_type 'solvent' and not atom.elem H"}¶
-
PROP_CMS
= 's_m_original_cms_file'¶
-
PROP_TRJ
= 's_chorus_trajectory_file'¶
-
sanitize_for_viparr
()¶ Viparr’s custom mae file reader does not play well with certain characters like 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.
-
get_fep_cts
()¶ find ref and mut cts by fep_fragname property
-
get_solvent_cts
()¶ find any cts with ffio_ct_type solvent
-
ffio_refresh
()¶ ‘atom_index’ starts from 1.
-
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)
-
gid_refresh
()¶
-
allaid_gids
¶ Get the 0-indexed mapping between aids and gids as a view of the underlying numpy array. :return:
np.array
-
comp_atom_total
¶ Get the sum of the atom totals of the component CTs. For systems with ghost atoms, this will be different than the value of
self.atom_total
, as that value corresponds to the number of atoms in the fullsystem CT.
-
model_system_type
()¶
-
get_fragname
()¶
-
select_atom
(asl)¶ Evaluate ASL and meta-ASL. Ghost atoms are removed. Note that ghost atom removal does not work if they are spread across multiple component CTs.
Return type: list
of `int`s
-
select_atom_comp
(asl)¶ Returns a list of lists. Each list element contains a list of atom indices of the corresponding component CT.
-
get_restrain
()¶
-
set_restrain
(restrain_list)¶ `restrain_list’ must be a list. Each element must be a list of `Restrain’ objects.
-
clear_restrain
()¶ Deletes all existing restraints.
-
get_atom_group
()¶
-
set_atom_group
(atom_group)¶
-
merge_atom_group
(atom_group)¶
-
set_atom_group_from_asl
(asl, group_name, group_index)¶
-
merge_atom_group_from_asl
(asl, group_name, group_index)¶
-
delete_atom_group
(group_name)¶
-
delete_all_atom_group
(exception=[])¶
-
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.
-
get_constraint
()¶
-
get_num_constraint
()¶
-
set_nactive_gids
(nactive_gids, ntotal_gids)¶ Given a number of active gids, set the number of physical atoms that are active in the fullsystem and solvent CTs, ie
self.active_total
. Also stores thenactive_gids
so that it will be written to disk and can be used by msys models. Ifnactive_gids
==ntotal_gids
, this will setself.active_total
toself.atom_total
, thereby removing the underlying properties from the fullsystem and solvent CTs.Parameters: - nactive_gids (int) – the number of active gids
- ntotal_gids (int) – the total number of atoms (ie gids) in the frame
-
active_total_from_nactive_gids
(nactive_gids, ntotal_gids)¶
-
nactive_gids
¶
-
active_total
¶ Get the number of active physical atoms :return: The number of active physical atoms :rtype:
int
-
get_degrees_of_freedom
()¶
-
fix_filenames
(cms_fname=None, trj_fname=None)¶
-
write
(fname)¶
-
write_to_string
()¶
-
-
schrodinger.application.desmond.cms.
get_gluepoints
(model, cutoff=3.0)¶
-
schrodinger.application.desmond.cms.
find_prev_residue
(ct, residue)¶
-
schrodinger.application.desmond.cms.
find_next_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.