schrodinger.application.matsci.order_parameter_mod module

Utilities for order parameter analysis.

Copyright Schrodinger, LLC. All rights reserved.

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

__cause__

exception cause

__class__

alias of builtins.type

__context__

exception context

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__weakref__': <attribute '__weakref__' of 'AslException' objects>, '__doc__': None})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__setstate__()
__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__suppress_context__
__traceback__
__weakref__

list of weak references to the object (if defined)

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.matsci.order_parameter_mod.SmartsException

Bases: Exception

__cause__

exception cause

__class__

alias of builtins.type

__context__

exception context

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__weakref__': <attribute '__weakref__' of 'SmartsException' objects>, '__doc__': None})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__setstate__()
__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__suppress_context__
__traceback__
__weakref__

list of weak references to the object (if defined)

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.matsci.order_parameter_mod.DipoleDirector(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis.DipoleDirector

Manage a dipole director.

__call__()

Call self as a function.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage a dipole director.\n ', '_dyninit': <function DipoleDirector._dyninit>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__(msys_model, cms_model, asl)
__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

static __new__(cls, *args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

disableDyncalc()

Disable the execution of _dyncalc(). This is used to avoid redundant _precalc() calculations delegated in _dyncalc().

isDynamic()
class schrodinger.application.matsci.order_parameter_mod.MomentOfInertiaDirector(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis.MomentOfInertiaDirector

Manage a moment of inertia director.

__call__()

Call self as a function.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage a moment of inertia director.\n ', '_dyninit': <function MomentOfInertiaDirector._dyninit>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__(msys_model, cms_model, asl)
__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

static __new__(cls, *args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

disableDyncalc()

Disable the execution of _dyncalc(). This is used to avoid redundant _precalc() calculations delegated in _dyncalc().

isDynamic()
class schrodinger.application.matsci.order_parameter_mod.UniqueSmartsDirector(msys_model, cms_model, asl, smarts)

Bases: schrodinger.application.desmond.packages.analysis.SmartsDirector

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
  • m (numpy.array) – the description vectors
Return type:

float

Returns:

the order parameter

__call__()

Call self as a function.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage a unique SMARTS director.\n ', '__init__': <function UniqueSmartsDirector.__init__>, '_dyninit': <function UniqueSmartsDirector._dyninit>, 'reduce_vec': <function UniqueSmartsDirector.reduce_vec>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

static __new__(cls, *args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

disableDyncalc()

Disable the execution of _dyncalc(). This is used to avoid redundant _precalc() calculations delegated in _dyncalc().

isDynamic()
class schrodinger.application.matsci.order_parameter_mod.SmartsDirector(msys_model, cms_model, asl, smarts)

Bases: schrodinger.application.desmond.packages.analysis.SmartsDirector

Manage a SMARTS director.

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
  • m (numpy.array) – the description vectors
Return type:

float

Returns:

the order parameter

__call__()

Call self as a function.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage a SMARTS director.\n ', '_dyninit': <function SmartsDirector._dyninit>, 'reduce_vec': <function SmartsDirector.reduce_vec>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__(msys_model, cms_model, asl, smarts)
__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

static __new__(cls, *args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

disableDyncalc()

Disable the execution of _dyncalc(). This is used to avoid redundant _precalc() calculations delegated in _dyncalc().

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

Bases: object

Manage a descriptor.

DIPOLE = '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'>, '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
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage a descriptor.\n ', 'DIPOLE': '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': {'dipole': <class 'schrodinger.application.matsci.order_parameter_mod.DipoleDirector'>, 'moment_of_inertia': <class 'schrodinger.application.matsci.order_parameter_mod.MomentOfInertiaDirector'>, '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'>}, '_SMARTS_MATCH_DICT': {'SMARTS_nonunique_bonds': 2, 'SMARTS_unique_pair': 2, 'SMARTS_unique_triple_normal': 3}, 'GROUP_KWARG': 'group', 'ASL_KWARG': 'asl', 'ATYPE_KWARG': 'atype', 'SMARTS_KWARG': 'smarts', '__init__': <function Descriptor.__init__>, 'getDescriptor': <function Descriptor.getDescriptor>, 'getFileName': <function Descriptor.getFileName>, '__dict__': <attribute '__dict__' of 'Descriptor' objects>, '__weakref__': <attribute '__weakref__' of 'Descriptor' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

schrodinger.application.matsci.order_parameter_mod.get_descriptors_from_file(descriptors_file)

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)
Return type:list
Returns:contains Descriptor
class schrodinger.application.matsci.order_parameter_mod.Director(vec)

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

Manage a director.

__init__(vec)

Create an instance.

Parameters:vec (numpy.array) – the director vector
__call__()

Call self as a function.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage a director.\n ', '__init__': <function Director.__init__>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

static __new__(cls, *args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

disableDyncalc()

Disable the execution of _dyncalc(). This is used to avoid redundant _precalc() calculations delegated in _dyncalc().

isDynamic()
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.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.order_parameter_mod', '__doc__': '\n Manage order parameter analysis.\n ', '__init__': <function OrderParameter.__init__>, 'getDirector': <staticmethod object>, '_getResults': <function OrderParameter._getResults>, '_writeResultFiles': <function OrderParameter._writeResultFiles>, '_writeOutputCMS': <function OrderParameter._writeOutputCMS>, 'run': <function OrderParameter.run>, '__dict__': <attribute '__dict__' of 'OrderParameter' objects>, '__weakref__': <attribute '__weakref__' of 'OrderParameter' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.order_parameter_mod'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)