schrodinger.application.desmond.meta module

Module for all metadynamics backend functionality

schrodinger.application.desmond.meta.list2str(lst)
class schrodinger.application.desmond.meta.CmsModel(model: schrodinger.application.desmond.cms.Cms)

Bases: object

__init__(model: schrodinger.application.desmond.cms.Cms)
atid2atomsel(atid: (<class 'int'>, typing.List[int]))
class schrodinger.application.desmond.meta.CV(dim: int, width: float, wall: float, floor: float)

Bases: object

base class for collective variable

__init__(dim: int, width: float, wall: float, floor: float)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvid: str)
class schrodinger.application.desmond.meta.CVrgyr(atomlist: List[int], width: float)

Bases: schrodinger.application.desmond.meta.CV

Radius of Gyration Collective Variable

cvrgyr_template = '\n#radius of gyration definition\n%(cvname)s_sel = %(atomlist)s;\n%(cvname)s_cog = center_of_geometry(%(cvname)s_sel);\n%(cvname)s_coord_range = series (i=0:length(%(cvname)s_sel))\n        norm2(min_image(pos(%(cvname)s_sel[i])-%(cvname)s_cog));\n%(cvname)s=sqrt(%(cvname)s_coord_range/length(%(cvname)s_sel));\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
__init__(atomlist: List[int], width: float)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVrgyr_mass(atomlist: List[int], width: float)

Bases: schrodinger.application.desmond.meta.CV

Radius of Gyration Collective Variable

cvrgyr_mass_template = '\n#mass-weighted radius of gyration definition\n%(cvname)s_sel = %(atomlist)s;\n%(cvname)s_com = center_of_mass(%(cvname)s_sel);\n%(cvname)s_coord_range = series (i=0:length(%(cvname)s_sel))\n        mass(%(cvname)s_sel[i])*norm2(min_image(pos(%(cvname)s_sel[i])-%(cvname)s_com));\n%(cvname)s=sqrt(%(cvname)s_coord_range/sum(mass(%(cvname)s_sel)));\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n\n'
__init__(atomlist: List[int], width: float)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVrmsd(atomlist: List[int], xyz_coords_ref: List[float], width: float, wall: Optional[float] = None, rmsd_weights: Optional[List[float]] = None, superpos_weights: Optional[List[float]] = None)

Bases: schrodinger.application.desmond.meta.CV

rmsd collective variable

cvrmsd_template = '\n# rmsd definition\n%(cvname)s_sel = %(atomlist)s;\n%(cvname)s_ref = array( %(xyz_ref)s );\n%(cvname)s = rmsd( %(cvname)s_ref,  %(cvname)s_sel );\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
cvrmsd_weights_template = '\n# rmsd definition\n%(cvname)s_sel = %(atomlist)s;\n%(cvname)s_ref = array( %(xyz_ref)s );\n%(cvname)s_rmsd_weights = array( %(rmsd_weights)s );\n%(cvname)s_superpos_weights = array( %(superpos_weights)s );\n%(cvname)s = rmsd( %(cvname)s_ref,  %(cvname)s_sel, %(cvname)s_rmsd_weights, %(cvname)s_superpos_weights );\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
cvrmsd_wall_template = '\n# the upper bound, wall params for %(cvname)s are: width is 0.2;\n# location at %(wall)f; height is 1000\n%(cvname)s_wall = 1000 / (1 + exp(( %(wall)f - %(cvname)s) / 0.2) );\n'
__init__(atomlist: List[int], xyz_coords_ref: List[float], width: float, wall: Optional[float] = None, rmsd_weights: Optional[List[float]] = None, superpos_weights: Optional[List[float]] = None)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVrmsd_symm(atomlist: List[int], xyz_coords_ref_list: List[List[float]], width: float, wall: Optional[float] = None)

Bases: schrodinger.application.desmond.meta.CV

rmsd collective variable

cvrmsd_setup_template = '\n# setting up rmsd_symm with total of %(nconfs)s conformations\n%(cvname)s_sel = %(atomlist)s;\n\n'
cvrmsd_conf_template = '\n# rmsd_symm definition #%(confnum)s\n%(cvname)s_ref_%(confnum)s = array( %(xyz_ref)s );\n%(cvname)s_%(confnum)s     = rmsd( %(cvname)s_ref_%(confnum)s, %(cvname)s_sel );\n'
cvrmsd_template = '\n%(cvname)s = min( array( %(confs)s ));\nprint ("%(cvname)s", %(cvname)s );\n# the width for %(cvname)s will be set to: %(width)s\n'
cvrmsd_wall_template = '\n# the upper bound, wall params for %(cvname)s are: width is 0.2;\n# location at %(wall)f; height is 1000\n%(cvname)s_wall = 1000 / (1 + exp(( %(wall)f - %(cvname)s) / 0.2) );\n'
__init__(atomlist: List[int], xyz_coords_ref_list: List[List[float]], width: float, wall: Optional[float] = None)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVwhim(atomlist: List[int], eigval, width: float)

Bases: schrodinger.application.desmond.meta.CV

whim collective variable

cvwhim_template = '\n#whim definition\n%(cvname)s_sel  = %(atomlist)s;\n%(cvname)s_whim = whim(%(cvname)s_sel, mass(%(cvname)s_sel));\n%(cvname)s = %(cvname)s_whim[%(eigval)i];\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
__init__(atomlist: List[int], eigval, width: float)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVzdist0(atomlist: List[int], width: float)

Bases: schrodinger.application.desmond.meta.CV

This collective variable reports an absolute Z-distance from the simulation box origin (Z==0). This cv is useful when for membrane penetration studies.

cvzdist0_template = '\n# Z-dist definition\n%(cvname)s_g0 = center_of_mass ( %(atomlist)s );\n%(cvname)s_z  = %(cvname)s_g0[2];\n%(cvname)s    = sqrt(%(cvname)s_z^2);\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
__init__(atomlist: List[int], width: float)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname) str
class schrodinger.application.desmond.meta.CVzdist(atomlist, width, wall, floor)

Bases: schrodinger.application.desmond.meta.CV

This collective variable reports an absolute Z-distance. this CV is used for membrane penetration studies.

cvzdist_template = '\n# Z-dist definition\n%(cvname)s_g0 = center_of_mass ( %(atomlist)s );\n%(cvname)s  = %(cvname)s_g0[2];\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
cvdist_wall_template = '\n# the upper bound, wall params for %(cvname)s are: width is 0.2;\n# location at %(wall)f; height is 1000\n%(cvname)s_wall = 1000 / (1 + exp(( %(wall)f - %(cvname)s) / 0.2) );\n'
cvdist_floor_template = "\n# lower bound wall or 'floor' params for %(cvname)s are: width is 0.2;\n# location at %(floor)f; # height is 1000\n%(cvname)s_floor = 1000 / (1 + exp((%(cvname)s - %(floor)f) / 0.2) );\n"
__init__(atomlist, width, wall, floor)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVDist(p0, p1, width, wall, floor)

Bases: schrodinger.application.desmond.meta.CV

distance collective variable

cvdist_template = '\n# distance definition\n%(cvname)s_p0 = %(p0_atomsel)s;\n%(cvname)s_p1 = %(p1_atomsel)s;\n%(cvname)s = dist(%(cvname)s_p0, %(cvname)s_p1);\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
cvdist_grp_template = '\n# distance definition for group of atoms\n%(cvname)s_g0 = center_of_mass ( %(p0_atomsel)s );\n%(cvname)s_g1 = center_of_mass ( %(p1_atomsel)s );\n%(cvname)s = norm(min_image(%(cvname)s_g0 - %(cvname)s_g1));\nprint ("%(cvname)s", %(cvname)s);\n# the width for %(cvname)s will be set to: %(width)s\n'
cvdist_wall_template = '\n# the upper bound, wall params for %(cvname)s are: width is 0.2;\n# location at %(wall)f; height is 1000\n%(cvname)s_wall = 1000 / (1 + exp(( %(wall)f - %(cvname)s) / 0.2) );\n'
cvdist_floor_template = "\n# lower bound wall or 'floor' params for %(cvname)s are: width is 0.2;\n# location at %(floor)f; # height is 1000\n%(cvname)s_floor = 1000 / (1 + exp((%(cvname)s - %(floor)f) / 0.2) );\n"
__init__(p0, p1, width, wall, floor)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVAngle(p0, p1, p2, width, wall, floor)

Bases: schrodinger.application.desmond.meta.CV

A class to define angle collective variable. Note that due to numerical instability, cosine of the angle is used instead of radian.

cvangle_template = '\n# angle definition\n%(cvname)s_p0 = %(p0_atomsel)s;\n%(cvname)s_p1 = %(p1_atomsel)s;\n%(cvname)s_p2 = %(p2_atomsel)s;\n%(cvname)s = angle_gid(%(cvname)s_p0, %(cvname)s_p1, %(cvname)s_p2);\nprint ("%(cvname)s", acos(%(cvname)s) );\n# the width for %(cvname)s will be set to: %(width)s\n'
cvangle_grp_template = '\n# angle definition for group of atoms\n%(cvname)s_g0 = center_of_mass ( %(p0_atomsel)s );\n%(cvname)s_g1 = center_of_mass ( %(p1_atomsel)s );\n%(cvname)s_g2 = center_of_mass ( %(p2_atomsel)s );\n%(cvname)s_v0 = min_image(%(cvname)s_g0 - %(cvname)s_g1);\n%(cvname)s_v1 = min_image(%(cvname)s_g2 - %(cvname)s_g1);\n%(cvname)s = angle(%(cvname)s_v0, %(cvname)s_v1);\nprint ("%(cvname)s", acos(%(cvname)s) );\n# the width for %(cvname)s will be set to: %(width)s\n    '
cvangle_wall_template = '\n# the upper bound, wall params for %(cvname)s are: width is 0.57 degree;\n# location at %(wall)f; height is 1000\n%(cvname)s_wall = 1000 / (1 + exp(( %(wall)f - acos(%(cvname)s))/0.05) );\n'
cvangle_floor_template = "\n# lower bound wall or 'floor' params for %(cvname)s are: width is 0.57 degree;\n# location at %(floor)f; # height is 1000\n%(cvname)s_floor = 1000/(1 + (exp((acos(%(cvname)s)- %(floor)f)/0.05)) );\n"
__init__(p0, p1, p2, width, wall, floor)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.CVDihedral(p0, p1, p2, p3, width, wall, floor)

Bases: schrodinger.application.desmond.meta.CV

A class to define dihedral collective variable. Note that this collective variable is a two dimensional one. The first element is the cosine of the dihedral, and the second element is the sine of the dihedral angle.

cvdihedral_template = '\n# dihedral definition\n%(cvname)s_p0 = %(p0_atomsel)s;\n%(cvname)s_p1 = %(p1_atomsel)s;\n%(cvname)s_p2 = %(p2_atomsel)s;\n%(cvname)s_p3 = %(p3_atomsel)s;\n%(cvname)s = dihedral_gid(%(cvname)s_p0, %(cvname)s_p1, %(cvname)s_p2, %(cvname)s_p3);\nprint ("%(cvname)s", atan2(%(cvname)s));\n# the width for %(cvname)s will be set to: %(width)s\n'
cvdihedral_grp_template = '\n# dihedral definition for group of atoms\n%(cvname)s_g0 = center_of_mass ( %(p0_atomsel)s);\n%(cvname)s_g1 = center_of_mass ( %(p1_atomsel)s);\n%(cvname)s_g2 = center_of_mass ( %(p2_atomsel)s);\n%(cvname)s_g3 = center_of_mass ( %(p3_atomsel)s);\n\n%(cvname)s_v0 = min_image(%(cvname)s_g1 - %(cvname)s_g0);\n%(cvname)s_v1 = min_image(%(cvname)s_g2 - %(cvname)s_g1);\n%(cvname)s_v2 = min_image(%(cvname)s_g3 - %(cvname)s_g2);\n\n%(cvname)s = dihedral(%(cvname)s_v0, %(cvname)s_v1, %(cvname)s_v2);\nprint ("%(cvname)s", atan2(%(cvname)s[1],%(cvname)s[0]));\n# the width for %(cvname)s will be set to: %(width)s\n'
__init__(p0, p1, p2, p3, width, wall, floor)
getMExpr(model: schrodinger.application.desmond.meta.CmsModel, cvname: str) str
class schrodinger.application.desmond.meta.Meta

Bases: object

declare_template = '\ndeclare_meta(\n    dimension = %(dimension)d,\n    cutoff    = %(cutoff)f,\n    first     = %(first)f,\n    interval  = %(interval)f,\n    name      = "%(meta_name)s",\n    initial   = "");\n\ndeclare_output(\n    name = "%(output_name)s",\n    first = %(first)f,\n    interval= %(interval)f);\n'
meta_template = '\n# height used for this run is: %(height)f\nmeta(0, %(height_width)s,\n        %(cv)s);\n'
meta_well_tempered_template = '\n# height used for this run is: %(height)f, sampling temperature kT is: %(kTemp)f.\nmeta(0,\n     array( %(height)f * exp( meta(0, %(height_width)s, %(cv)s )/(-1.0 * %(kTemp)f) ), %(width)s ),\n     %(cv)s);\n'
__init__()
generateCfg(model=None)
addCV(cv)
schrodinger.application.desmond.meta.parse_meta(m, model)
schrodinger.application.desmond.meta.generate_meta_cfg(meta_def, model)

Generate part of the config file for metadynamics simulation :param meta_def: The content of definition file for collective variables. :param model: topology file. :type meta_def: sea.Sea object :type model: cms.Cms object :return a string. Exception will be raised if encounting any errors.

schrodinger.application.desmond.meta.get_meta_cfg_filename(meta_def)

Returns the name of the kerseq and cvseq files given a metadynamics definition file :param meta_def: The content of definition file for collective variables. :param model: topology file.

class schrodinger.application.desmond.meta.MetaDynamicsAnalysis(data_fname, inp_fname=None, key=None)

Bases: object

Analysis tools for Desmond’s metadynamics jobs. The class can be used and run from the command-line or as a module.

__init__(data_fname, inp_fname=None, key=None)
evaluate(x)
computeFES(out_fname='', units='degrees', progress_callback=None)

This function figures out the grid from the ranges and the bins given the cfg. For each gaussian, add it to the previous gaussian sum for each grid point.

static convertDataToPlot(bins, data)

Converts data, usually read in from an exported plot result, to structures usable by the plot.

Parameters
  • bins (list or tuple) – The FES shape

  • data – List of lists containing cv and FES values

Returns

list of x and y values

Returns

array of FES

static convertPlotToData(bins, edges, FES)

Takes data used to plot FES values and converts it to a list of lists for exporting purposes.

Parameters
  • bins (list or tuple) – The FES shape

  • edges (List of lists) – The x and y values for the plot

  • FES (numpy.array) – The FES values for the plot

Returns

List of lists containing cv and FES values

static writeFES(fname, data, fes_shape, cvs, units)

Write out the free energy distribution in a common way. The GUI utilizing this class needs to write out data from self.computeFES

schrodinger.application.desmond.meta.read_meta_cfg(config, model)

Read config file for metadynamics simulation :param meta_def: The content of definition file for collective variables. :param model: topology file. :type meta_def: string :type model: cms.Cms object :return a Meta

schrodinger.application.desmond.meta.get_distance(model, atom_list)

Check distance of the two groups of atoms defined in the atom list :param model: topology file :type model: cms.Cms object :param atom_list: atom list :type atom_list: list

schrodinger.application.desmond.meta.get_local_symmetry(st, atom_list)
schrodinger.application.desmond.meta.parse_cvseq(cvseq_filename: str) Dict[str, Union[List[float], List[List[float]]]]

Parse cvseq file from infrequent metadynamics run Examples cvseq file content. Values are stored next to their keys in a list in cvseq files. —————- [[time [0]] [cv_00 [27.3396]] [rest [294.7610]] [umb [1.34647]] [rest_stat [0.00044413]] [potential [296.1079]]] [[time [0.09]] [cv_00 [27.2076]] [rest [280.3545]] [umb [1.670]] [rest_stat [0.0002631]] [potential [282.0250]]] —————-

Parameters

cvseq_filename – path to cvseq file

Raises

ValueError – raise if cvseq file has malformed data

Returns

dictionary of cvseq data