openforcefield.typing.chemistry.
ChemicalEnvironment
(smirks=None, label=None, replacements=None, toolkit='openeye')[source]¶Chemical environment abstract base class that matches an atom, bond, angle, etc.
Warning
This class is largely redundant with the same one in the Chemper package, and will likely be removed.
Methods
|
Atom representation, which may have some ORtypes and ANDtypes properties. |
|
Bond representation, which may have ORtype and ANDtype descriptors. |
|
Add an atom to the specified target atom. |
|
Returns a SMIRKS representation of the chemical environment |
|
Returns a list of atoms alpha to any indexed atom |
|
Returns a list of Bond objects that connect |
|
|
|
Returns a list of atoms beta to any indexed atom |
|
Returns a list of Bond objects that connect |
|
Get bond betwen two atoms |
|
Returns minimum bond order around a given atom 0 if atom has no neighbors aromatic bonds count as 1.5 any bond counts as 1.0 |
|
|
|
Returns a list of atoms or bonds matching the descriptor |
|
returns the list of Atom objects with an index |
|
Returns a list of Bond objects that connect two indexed atoms |
|
Returns atoms that are bound to the given atom in the form of a list of Atom objects |
|
Uses number of indexed atoms and bond connectivity to determine the type of chemical environment |
|
returns a list of Atom objects that are not indexed |
|
Returns a list of Bond objects that connect |
|
Returns the valence (number of neighboring atoms) around the given atom |
|
Takes an atom or bond are returns True if it is alpha to an indexed atom |
|
Takes an atom or bond are returns True if it is beta to an indexed atom |
|
returns True if the atom or bond is indexed |
|
returns True if the atom or bond is not indexed |
|
Returns if the environment is valid, that is if it creates a parseable SMIRKS string. |
|
Remove the specified atom from the chemical environment. |
|
Select a random atom fitting the descriptor. |
|
Select a random bond fitting the descriptor. |
|
Validate the provided SMIRKS string is valid, and if requested, tags atoms appropriate to the specified valence type. |
__init__
(self, smirks=None, label=None, replacements=None, toolkit='openeye')[source]¶Initialize a chemical environment abstract base class.
if smirks is not None, a chemical environment is built from the provided SMIRKS string
intended to be used to label this chemical environment could be a string, int, or float, or anything
[substitution, smarts] form for parsing SMIRKS
Methods
|
Initialize a chemical environment abstract base class. |
|
Add an atom to the specified target atom. |
|
Returns a SMIRKS representation of the chemical environment |
|
Returns a list of atoms alpha to any indexed atom |
|
Returns a list of Bond objects that connect |
|
|
|
Returns a list of atoms beta to any indexed atom |
|
Returns a list of Bond objects that connect |
|
Get bond betwen two atoms |
|
Returns minimum bond order around a given atom 0 if atom has no neighbors aromatic bonds count as 1.5 any bond counts as 1.0 |
|
|
|
Returns a list of atoms or bonds matching the descriptor |
|
returns the list of Atom objects with an index |
|
Returns a list of Bond objects that connect two indexed atoms |
|
Returns atoms that are bound to the given atom in the form of a list of Atom objects |
|
Uses number of indexed atoms and bond connectivity to determine the type of chemical environment |
|
returns a list of Atom objects that are not indexed |
|
Returns a list of Bond objects that connect |
|
Returns the valence (number of neighboring atoms) around the given atom |
|
Takes an atom or bond are returns True if it is alpha to an indexed atom |
|
Takes an atom or bond are returns True if it is beta to an indexed atom |
|
returns True if the atom or bond is indexed |
|
returns True if the atom or bond is not indexed |
|
Returns if the environment is valid, that is if it creates a parseable SMIRKS string. |
|
Remove the specified atom from the chemical environment. |
|
Select a random atom fitting the descriptor. |
|
Select a random bond fitting the descriptor. |
|
Validate the provided SMIRKS string is valid, and if requested, tags atoms appropriate to the specified valence type. |
Atom
(ORtypes=None, ANDtypes=None, index=None, ring=None)[source]¶Atom representation, which may have some ORtypes and ANDtypes properties.
where bases and decorators are both strings The descriptor types that will be combined with logical OR
The descriptor types that will be combined with logical AND
Methods
|
Adds ANDtype to the set for this atom. |
|
Adds ORtype to the set for this atom. |
|
Return the atom representation as SMARTS. |
|
Return the atom representation as SMIRKS. |
|
returns a copy of the list of ANDtypes for this atom |
|
returns a copy of the dictionary of ORtypes for this atom |
|
sets new ANDtypes for this atom |
|
sets new ORtypes for this atom |
asSMARTS
(self)[source]¶Return the atom representation as SMARTS.
asSMIRKS
(self)[source]¶Return the atom representation as SMIRKS.
addORtype
(self, ORbase, ORdecorators)[source]¶Adds ORtype to the set for this atom.
addANDtype
(self, ANDtype)[source]¶Adds ANDtype to the set for this atom.
added to the list of ANDtypes for this atom
Bond
(ORtypes=None, ANDtypes=None)[source]¶Bond representation, which may have ORtype and ANDtype descriptors.
in form (base: [list of decorators]) The ORtype types that will be combined with logical OR
The ANDtypes that will be combined with logical AND
Methods
|
Adds ANDtype to the set for this atom. |
|
Adds ORtype to the set for this atom. |
|
Return the atom representation as SMARTS. |
|
|
|
returns a copy of the list of ANDtypes for this atom |
|
returns a copy of the dictionary of ORtypes for this atom |
|
Returns a float for the order of this bond for multiple ORtypes or ~ it returns the minimum possible order the intended application is for checking valence around a given atom |
|
sets new ANDtypes for this atom |
|
sets new ORtypes for this atom |
asSMARTS
(self)[source]¶Return the atom representation as SMARTS.
The SMARTS string for just this atom
getOrder
(self)[source]¶Returns a float for the order of this bond for multiple ORtypes or ~ it returns the minimum possible order the intended application is for checking valence around a given atom
addANDtype
(self, ANDtype)¶Adds ANDtype to the set for this atom.
added to the list of ANDtypes for this atom
addORtype
(self, ORbase, ORdecorators)¶Adds ORtype to the set for this atom.
getANDtypes
(self)¶returns a copy of the list of ANDtypes for this atom
getORtypes
(self)¶returns a copy of the dictionary of ORtypes for this atom
setANDtypes
(self, newANDtypes)¶sets new ANDtypes for this atom
strings that will be AND’d together in a SMARTS
setORtypes
(self, newORtypes)¶sets new ORtypes for this atom
for example: (‘#6’, [‘X4’,’H0’,’+0’]) –> ‘#6X4H0+0’
validate
(smirks, ensure_valence_type=None, toolkit='openeye')[source]¶Validate the provided SMIRKS string is valid, and if requested, tags atoms appropriate to the specified valence type.
The SMIRKS expression to validate
If specified, ensure the tagged atoms are appropriate to the specified valence type
isValid
(self, smirks=None)[source]¶Returns if the environment is valid, that is if it creates a parseable SMIRKS string.
asSMIRKS
(self, smarts=False)[source]¶Returns a SMIRKS representation of the chemical environment
if True, returns a SMARTS instead of SMIRKS without index labels
selectAtom
(self, descriptor=None)[source]¶Select a random atom fitting the descriptor.
None - returns any atom with equal probability int - will return an atom with that index ‘Indexed’ - returns a random indexed atom ‘Unindexed’ - returns a random unindexed atom ‘Alpha’ - returns a random alpha atom ‘Beta’ - returns a random beta atom
getComponentList
(self, component_type, descriptor=None)[source]¶Returns a list of atoms or bonds matching the descriptor
‘all’, ‘Indexed’, ‘Unindexed’, ‘Alpha’, ‘Beta’
selectBond
(self, descriptor=None)[source]¶Select a random bond fitting the descriptor.
None - returns any bond with equal probability int - will return an bond with that index ‘Indexed’ - returns a random indexed bond ‘Unindexed’ - returns a random unindexed bond ‘Alpha’ - returns a random alpha bond ‘Beta’ - returns a random beta bond
addAtom
(self, bondToAtom, bondORtypes=None, bondANDtypes=None, newORtypes=None, newANDtypes=None, newAtomIndex=None, newAtomRing=None, beyondBeta=False)[source]¶Add an atom to the specified target atom.
atom the new atom will be bound to
strings that will be used for the ORtypes for the new bond
strings that will be used for the ANDtypes for the new bond
strings that will be used for the ORtypes for the new atom
strings that will be used for the ANDtypes for the new atom
integer label that could be used to index the atom in a SMIRKS string
if True, allows bonding beyond beta position
removeAtom
(self, atom, onlyEmpty=False)[source]¶Remove the specified atom from the chemical environment. if the atom is not indexed for the SMIRKS string or used to connect two other atoms.
atom to be removed if it meets the conditions.
True only an atom with no ANDtypes and 1 ORtype can be removed
getBonds
(self, atom=None)[source]¶getBond
(self, atom1, atom2)[source]¶Get bond betwen two atoms
getAlphaAtoms
(self)[source]¶that are not also indexed
getBetaAtoms
(self)[source]¶that are not alpha or indexed atoms
getUnindexedBonds
(self)[source]¶an indexed atom to an unindexed atom two unindexed atoms
getAlphaBonds
(self)[source]¶an indexed atom to alpha atoms
isAlpha
(self, component)[source]¶Takes an atom or bond are returns True if it is alpha to an indexed atom
isBeta
(self, component)[source]¶Takes an atom or bond are returns True if it is beta to an indexed atom
getType
(self)[source]¶Uses number of indexed atoms and bond connectivity to determine the type of chemical environment
‘Atom’, ‘Bond’, ‘Angle’, ‘ProperTorsion’, ‘ImproperTorsion’ None if number of indexed atoms is 0 or > 4
getNeighbors
(self, atom)[source]¶Returns atoms that are bound to the given atom in the form of a list of Atom objects