schrodinger.application.qsite.input module

Module for reading and writing QSite input files.

See QSiteInput class for more documentation.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.qsite.input.Cut(molid=None, chain=None, resnum=None, inscode=None, qmatom=None, mmatom=None, theory='qm')

Bases: object

A class to handle representation and printing of general qm region cuts.

To avoid having to update individual attributes in the back end, attributes are read-only. To modify attributes, make a new Cut instance with the desired values. The clone method is provided as a convenience method to ease creation of a Cut with modified values.

__init__(molid=None, chain=None, resnum=None, inscode=None, qmatom=None, mmatom=None, theory='qm')

Initializer for a qmregion cut specification.

At least one of molid or qmatom to be defined.

Parameters:
  • molid (int) – A molecule id.
  • chain (str) – A chain id.
  • resnum (int) – A residue number.
  • inscode (str) – An insertion code.
  • qmatom (str) – The name of an atom to place on the quantum mechanical side of the cut.
  • mmatom (str) – The name of an atom to place on the molecular mechanical side of the cut.
  • theory (str) – The theoretical method to use for this cut (“nddo” or “qm” and case-insensitive)
molid

Read-only access to the molid attribute.

chain

Read-only access to the chain attribute.

resnum

Read-only access to the resnum attribute.

inscode

Read-only access to the resnum attribute.

qmatom

Read-only access to the qmatom attribute.

mmatom

Read-only access to the mmatom attribute.

theory

Read-only access to the theory attribute.

clone(**kwargs)

Create a copy of the current instance, modifying any attributes provided as keywords.

header()

Return the header definition for this cut that would be used in the QSite input file’s &qmregion section.

__str__()

Return str(self).

__repr__()

Return repr(self).

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.qsite.input', '__doc__': '\n A class to handle representation and printing of general qm region cuts.\n\n To avoid having to update individual attributes in the back end,\n attributes are read-only. To modify attributes, make a new Cut instance\n with the desired values. The clone method is provided as a convenience\n method to ease creation of a Cut with modified values.\n\n ', '_attrs': [('molid', -9999), ('chain', ''), ('resnum', -9999), ('inscode', ''), ('qmatom', ''), ('mmatom', ''), ('theory', '')], '__init__': <function Cut.__init__>, 'molid': <property object>, 'chain': <property object>, 'resnum': <property object>, 'inscode': <property object>, 'qmatom': <property object>, 'mmatom': <property object>, 'theory': <property object>, 'clone': <function Cut.clone>, '_definedAttrs': <function Cut._definedAttrs>, 'header': <function Cut.header>, '__str__': <function Cut.__str__>, '__repr__': <function Cut.__repr__>, '__dict__': <attribute '__dict__' of 'Cut' objects>, '__weakref__': <attribute '__weakref__' of 'Cut' 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.qsite.input'
__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

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__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)

class schrodinger.application.qsite.input.HydrogenCap(qm=None, mm=None, distance=0.0, theory='qm')

Bases: object

A class to handle representation and printing of hydrogen caps for the qm region.

__init__(qm=None, mm=None, distance=0.0, theory='qm')

Initialize the hydrogen cap. A quantum mechanical atom and molecular mechanical atom must always be specified.

Parameters:
  • qm (str) – The name of the quantum mechanical atom.
  • mm (str) – The name of the molecular mechanical atom.
  • distance (float) – The hydrogen cap distance.
  • theory (str) – The theoretical model to use for the QM atom (Either “nddo” or “qm”, case-insensitive)
qm

Read-only access to the _qm attribute.

mm

Read-only access to the _mm attribute.

theory

Read-only access to the _theory attribute.

distance

Read-only access to the distance attribute.

clone(**kwargs)

Create a copy of the current instance, modifying any attributes provided as keywords.

header()

Return the header definition for this hydrogen cap that would be used in the QSite input file’s &qmregion section.

__str__()

Return str(self).

__repr__()

Return repr(self).

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.qsite.input', '__doc__': '\n A class to handle representation and printing of hydrogen caps for the\n qm region.\n\n ', '__init__': <function HydrogenCap.__init__>, 'qm': <property object>, 'mm': <property object>, 'theory': <property object>, 'distance': <property object>, 'clone': <function HydrogenCap.clone>, 'header': <function HydrogenCap.header>, '__str__': <function HydrogenCap.__str__>, '__repr__': <function HydrogenCap.__repr__>, '__dict__': <attribute '__dict__' of 'HydrogenCap' objects>, '__weakref__': <attribute '__weakref__' of 'HydrogenCap' 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.qsite.input'
__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

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__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)

class schrodinger.application.qsite.input.QMRegion(handle)

Bases: object

A class to provide access to a &qmregion specification and the ability to create one on the fly.

__init__(handle)
Parameters:
  • handle – An MMIM handle.
  • type – int
__len__()
__getitem__(index)
__setitem__(index, qmregion)
modify(index, **kwargs)

A method to modify attributes of a specific element in the qmregion list in-place.

This method is provided because Cut and HydrogenCap instances have read-only values.

append(qmregion)

Add a new QM region to the list.

Parameters:qmregion (Cut or HydrogenCap) – A specification of a QM region cut or hydrogen cap.
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.qsite.input', '__doc__': '\n A class to provide access to a &qmregion specification and the ability\n to create one on the fly.\n\n ', '_list_defaults': {'molid': -9999, 'chain': '', 'resnum': -9999, 'inscode': '', 'qmatom': '', 'seatom': '', 'mmatom': '', 'hcap': 0, 'hcap_distance': 0.0, 'theory': 'qm'}, '__init__': <function QMRegion.__init__>, '__len__': <function QMRegion.__len__>, '__getitem__': <function QMRegion.__getitem__>, '__setitem__': <function QMRegion.__setitem__>, '_growLists': <function QMRegion._growLists>, 'modify': <function QMRegion.modify>, 'append': <function QMRegion.append>, '__dict__': <attribute '__dict__' of 'QMRegion' objects>, '__weakref__': <attribute '__weakref__' of 'QMRegion' 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.qsite.input'
__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)

class schrodinger.application.qsite.input.QSiteInput(name)

Bases: object

__init__(name)

Create a QSite input object, either from a jobname or QSite input file path.

Parameters

name (str)
One of:
jobname - Default parameters are used.
or
file path - Parameters are read from specified file.
File must be in current working directory.
__del__()

Delete the mmjag handle and clean up the mmlibs.

gen

Provide dictionary-like access to &gen section

mmkey

Provide dictionary-like access to the &mmkey section.

mopac

Provide dictionary-like access to &mopac section

qmregion

Provide access to the &qmregion section.

setStructureFile(filename)

Set the mae structure file to be used. If the structure file name doesn’t match the current job/file name it will be copied to the current directory and renamed to <jobname>.<ext>.

getStructureFile()

Return the mae structure that is used.

addQMMolecule(index, theory='qm')

Add a QM molecule to the QM region specification.

This creates a Cut instance and adds it to the qmregion attribute.

addQMCut(**kwargs)

Add a QM cut to the QM region specification.

The keywords here are the same as the Cut class constructor. Calling this method is equivalent to creating a Cut instance and adding it to the QSiteInput instance by calling qmregion.append().

addHydrogenCap(qm=None, mm=None, distance=0.0, theory='qm')

Add a hydrogen cap to the QM region specification.

The keywords here are the same as the HydrogenCap class constructor. Calling this method is equivalent to creating a HydrogenCap instance and adding it to the QSiteInput instance by calling qmregion.append().

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.qsite.input', '__init__': <function QSiteInput.__init__>, '__del__': <function QSiteInput.__del__>, 'gen': <property object>, 'mmkey': <property object>, 'mopac': <property object>, 'qmregion': <property object>, 'setStructureFile': <function QSiteInput.setStructureFile>, 'getStructureFile': <function QSiteInput.getStructureFile>, 'addQMMolecule': <function QSiteInput.addQMMolecule>, 'addQMCut': <function QSiteInput.addQMCut>, 'addHydrogenCap': <function QSiteInput.addHydrogenCap>, '_setJobName': <function QSiteInput._setJobName>, '_getJobName': <function QSiteInput._getJobName>, 'jobname': <property object>, 'write': <function QSiteInput.write>, '__dict__': <attribute '__dict__' of 'QSiteInput' objects>, '__weakref__': <attribute '__weakref__' of 'QSiteInput' 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_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.qsite.input'
__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)

jobname

get/set the jobname; setting the jobname also sets the filename

write()

Write the input file to <jobname>.in. The structure file will also be written to <jobname>.<ext>, where <ext> is the extension of the specified structure file.

Structure file must be specified via setStructureFile() first.

Previous file with this name is overwritten.