schrodinger.application.matsci.order_parameter_mod module

Utilities for order parameter analysis.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.order_parameter_mod.Result(total_op, per_mol_op)

Bases: tuple

per_mol_op

Alias for field number 1

total_op

Alias for field number 0

class schrodinger.application.matsci.order_parameter_mod.PerMolOP(mol_numbers, mol_ops)

Bases: tuple

mol_numbers

Alias for field number 0

mol_ops

Alias for field number 1

schrodinger.application.matsci.order_parameter_mod.log(msg, **kwargs)

Add a message to the log file

Parameters

msg (str) – The message to log

Additional keyword arguments are passed to the textlogger.log_msg function

schrodinger.application.matsci.order_parameter_mod.get_name_w_mol_n(name, mol_n)

Return the name with the molecule number.

Parameters
  • name (str) – the name

  • mol_n (int) – the molecule number

Return type

str

Returns

the name with the molecule number

schrodinger.application.matsci.order_parameter_mod.get_name_wo_mol_n(name)

Return the name without the molecule number.

Parameters

name (str) – the name

Return type

(str, int) or (str, None)

Returns

the name without the molecule number and the molecule number if there is one

class schrodinger.application.matsci.order_parameter_mod.ReduceVecMixin

Bases: object

Manages reducing vectors.

reduce_vec(n, m)

Specify how to reduce the reference director vector, n, and all of the description vectors, m, into an order parameter.

Parameters
  • n (numpy.array) – the reference director vector (row vector of length 3)

  • m (numpy.array) – the description vectors (matrix of size N X 3), where N is the number of molecules

Return type

float

Returns

the order parameter

static reduceVector(n, m)

Calculate Legendre polynomial P2 using the inner product of n and m as the input.

schrodinger.application.matsci.order_parameter_mod.get_trj_from_cms_file(cms_file)

Return the trajectory from the given .cms file.

Parameters

cms_file (str) – the .cms file (can be a path)

Return type

list

Returns

contains the trajectory as a list of schrodinger.application.desmond.packages.traj.Frame

exception schrodinger.application.matsci.order_parameter_mod.AslException

Bases: Exception

exception schrodinger.application.matsci.order_parameter_mod.SmartsException

Bases: Exception

class schrodinger.application.matsci.order_parameter_mod.DipoleDirector(*args, **kwargs)

Bases: schrodinger.application.desmond.packages.analysis.DipoleDirector, schrodinger.application.matsci.order_parameter_mod.ReduceVecMixin

Manage a dipole director.

class schrodinger.application.matsci.order_parameter_mod.AcentricDipoleDirector(*args, **kwargs)

Bases: schrodinger.application.matsci.order_parameter_mod.DipoleDirector

Manage an acentric dipole director. Override the parent methods to change the equation for reducing vector.

static reduceVector(n, m)

Override the parent method to calculate cos^3 using the inner product of n and m as the input.

class schrodinger.application.matsci.order_parameter_mod.MomentOfInertiaDirector(*args, **kwargs)

Bases: schrodinger.application.desmond.packages.analysis.MomentOfInertiaDirector, schrodinger.application.matsci.order_parameter_mod.ReduceVecMixin

Manage a moment of inertia director.

class schrodinger.application.matsci.order_parameter_mod.UniqueSmartsDirector(*args, **kwargs)

Bases: schrodinger.application.desmond.packages.analysis.SmartsDirector, schrodinger.application.matsci.order_parameter_mod.ReduceVecMixin

Manage a unique SMARTS director.

__init__(msys_model, cms_model, asl, smarts)

Create an instance.

Parameters
  • msys_model (Desmond msys .System) – the msys object (from msys.LoadMAE)

  • cms_model (schrodinger.application.desmond.cms.Cms) – the cms object

  • asl (str) – the ASL for the descriptor

  • smarts (str) – the SMARTS for the descriptor

reduce_vec(n, m)

Specify how to reduce the reference director vector, n, and all of the description vectors, m, into an order parameter.

Parameters
  • n (numpy.array) – the reference director vector (row vector of length 3)

  • m (numpy.array) – the description vectors (matrix of size N X 3), where N is the number of molecules

Return type

float

Returns

the order parameter

class schrodinger.application.matsci.order_parameter_mod.SmartsDirector(*args, **kwargs)

Bases: schrodinger.application.desmond.packages.analysis.SmartsDirector, schrodinger.application.matsci.order_parameter_mod.ReduceVecMixin

Manage a SMARTS director.

class schrodinger.application.matsci.order_parameter_mod.Descriptor(name, group=None, asl=None, atype=None, smarts=None)

Bases: object

Manage a descriptor.

DIPOLE = 'dipole'
ACENTRIC_DIPOLE = 'acentric_dipole'
MOMENT_OF_INERTIA = 'moment_of_inertia'
SMARTS_NONUNIQUE_BONDS = 'SMARTS_nonunique_bonds'
SMARTS_UNIQUE_PAIR = 'SMARTS_unique_pair'
SMARTS_UNIQUE_TRIPLE_NORMAL = 'SMARTS_unique_triple_normal'
TYPES_TO_CLASSES = {'SMARTS_nonunique_bonds': <class 'schrodinger.application.matsci.order_parameter_mod.SmartsDirector'>, 'SMARTS_unique_pair': <class 'schrodinger.application.matsci.order_parameter_mod.UniqueSmartsDirector'>, 'SMARTS_unique_triple_normal': <class 'schrodinger.application.matsci.order_parameter_mod.UniqueSmartsDirector'>, 'acentric_dipole': <class 'schrodinger.application.matsci.order_parameter_mod.AcentricDipoleDirector'>, 'dipole': <class 'schrodinger.application.matsci.order_parameter_mod.DipoleDirector'>, 'moment_of_inertia': <class 'schrodinger.application.matsci.order_parameter_mod.MomentOfInertiaDirector'>}
GROUP_KWARG = 'group'
ASL_KWARG = 'asl'
ATYPE_KWARG = 'atype'
SMARTS_KWARG = 'smarts'
__init__(name, group=None, asl=None, atype=None, smarts=None)

Create an instance.

Parameters
  • name (str) – the name of the descriptor

  • group (str or None) – the group of the descriptor or None if there isn’t one

  • asl (str) – the ASL for the descriptor or None if there isn’t one

  • atype (str) – the type of descriptor or None if there isn’t one

  • smarts (str or None) – the SMARTS for the descriptor or None if there isn’t one

getDescriptor(msys_obj, cms_obj)

Get the descriptor.

Parameters
Return type

schrodinger.application.desmond.packages.staf.CompositeDynamicAslAnalyzer

Returns

descriptor subclasses of the given type

getFileName(basename)

Return a file name for this descriptor using the given base name.

Parameters

basename (str) – base name to use in naming the file

Return type

str

Returns

the descriptor file name

getPerMolFileName(basename)

Return a per molecule file name for this descriptor using the given base name.

Parameters

basename (str) – base name to use in naming the file

Return type

str

Returns

the descriptor per molecule file name

schrodinger.application.matsci.order_parameter_mod.get_descriptors_from_file(descriptors_file, logger=None)

Return a list of descriptors from the given descriptors file.

Parameters
  • descriptors_file (str) – .json file containing specifications for descriptors, i.e. ways to determine vectors used in computing the order parameters with respect to the director, a specification includes information like name, group, ASL, type, and SMARTS (can be a path)

  • logger (logging.Logger or None) – output logger or None if there isn’t one

Return type

list

Returns

contains Descriptor

class schrodinger.application.matsci.order_parameter_mod.Director(*args, **kwargs)

Bases: schrodinger.application.desmond.packages.staf.GeomAnalyzerBase

Manage a director.

__init__(vec)

Create an instance.

Parameters

vec (numpy.array) – the director vector

class schrodinger.application.matsci.order_parameter_mod.OrderParameter(cms_file, director_abc_coeffs, descriptors_file, logger=None)

Bases: object

Manage order parameter analysis.

__init__(cms_file, director_abc_coeffs, descriptors_file, logger=None)

Create an instance.

Parameters
  • cms_file (str) – the .cms file for the simulation on which to run the order parameter analysis (can be a path)

  • director_abc_coeffs (tuple) – coefficients of the static reference director vector in the lattice vector basis, for example (0, 0, 1) for the c-lattice vector or z-axis of a cubic cell

  • descriptors_file (str) – .json file containing specifications for descriptors, i.e. ways to determine vectors used in computing the order parameters with respect to the director, a specification includes information like name, group, ASL, type, and SMARTS (can be a path) (see get_descriptors_from_file for more information)

  • logger (logging.Logger or None) – output logger or None if there isn’t one

static getDirector(cms_obj, director_abc_coeffs)

Return the unit director vector object for the given cms (in Angstrom).

Parameters
  • cms_obj (schrodinger.application.desmond.cms.Cms) – the cms object

  • director_abc_coeffs (tuple) – coefficients of the static reference director vector in the lattice vector basis, for example (0, 0, 1) for the c-lattice vector or z-axis of a cubic cell

Return type

Director

Returns

the unit director vector object

run()

Run the order parameter analysis.