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 ([ORtypes, ANDtypes, index, ring]) |
Atom representation, which may have some ORtypes and ANDtypes properties. | ||
Bond ([ORtypes, ANDtypes]) |
Bond representation, which may have ORtype and ANDtype descriptors. | ||
addAtom (bondToAtom[, bondORtypes, …]) |
Add an atom to the specified target atom. | ||
asSMIRKS ([smarts]) |
Returns a SMIRKS representation of the chemical environment | ||
getAlphaAtoms () |
Returns a list of atoms alpha to any indexed atom | ||
getAlphaBonds () |
Returns a list of Bond objects that connect | ||
getAtoms () |
|
||
getBetaAtoms () |
Returns a list of atoms beta to any indexed atom | ||
getBetaBonds () |
Returns a list of Bond objects that connect | ||
getBond (atom1, atom2) |
Get bond betwen two atoms | ||
getBondOrder (atom) |
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 | ||
getBonds ([atom]) |
|
||
getComponentList (component_type[, descriptor]) |
Returns a list of atoms or bonds matching the descriptor | ||
getIndexedAtoms () |
returns the list of Atom objects with an index | ||
getIndexedBonds () |
Returns a list of Bond objects that connect two indexed atoms | ||
getNeighbors (atom) |
Returns atoms that are bound to the given atom in the form of a list of Atom objects | ||
getType () |
Uses number of indexed atoms and bond connectivity to determine the type of chemical environment | ||
getUnindexedAtoms () |
returns a list of Atom objects that are not indexed | ||
getUnindexedBonds () |
Returns a list of Bond objects that connect | ||
getValence (atom) |
Returns the valence (number of neighboring atoms) around the given atom | ||
isAlpha (component) |
Takes an atom or bond are returns True if it is alpha to an indexed atom | ||
isBeta (component) |
Takes an atom or bond are returns True if it is beta to an indexed atom | ||
isIndexed (component) |
returns True if the atom or bond is indexed | ||
isUnindexed (component) |
returns True if the atom or bond is not indexed | ||
isValid ([smirks]) |
Returns if the environment is valid, that is if it creates a parseable SMIRKS string. | ||
removeAtom (atom[, onlyEmpty]) |
Remove the specified atom from the chemical environment. | ||
selectAtom ([descriptor]) |
Select a random atom fitting the descriptor. | ||
selectBond ([descriptor]) |
Select a random bond fitting the descriptor. | ||
validate (smirks[, ensure_valence_type, toolkit]) |
Validate the provided SMIRKS string is valid, and if requested, tags atoms appropriate to the specified valence type. |
__init__
(smirks=None, label=None, replacements=None, toolkit='openeye')[source]¶Initialize a chemical environment abstract base class.
Methods
__init__ ([smirks, label, replacements, toolkit]) |
Initialize a chemical environment abstract base class. | ||
addAtom (bondToAtom[, bondORtypes, …]) |
Add an atom to the specified target atom. | ||
asSMIRKS ([smarts]) |
Returns a SMIRKS representation of the chemical environment | ||
getAlphaAtoms () |
Returns a list of atoms alpha to any indexed atom | ||
getAlphaBonds () |
Returns a list of Bond objects that connect | ||
getAtoms () |
|
||
getBetaAtoms () |
Returns a list of atoms beta to any indexed atom | ||
getBetaBonds () |
Returns a list of Bond objects that connect | ||
getBond (atom1, atom2) |
Get bond betwen two atoms | ||
getBondOrder (atom) |
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 | ||
getBonds ([atom]) |
|
||
getComponentList (component_type[, descriptor]) |
Returns a list of atoms or bonds matching the descriptor | ||
getIndexedAtoms () |
returns the list of Atom objects with an index | ||
getIndexedBonds () |
Returns a list of Bond objects that connect two indexed atoms | ||
getNeighbors (atom) |
Returns atoms that are bound to the given atom in the form of a list of Atom objects | ||
getType () |
Uses number of indexed atoms and bond connectivity to determine the type of chemical environment | ||
getUnindexedAtoms () |
returns a list of Atom objects that are not indexed | ||
getUnindexedBonds () |
Returns a list of Bond objects that connect | ||
getValence (atom) |
Returns the valence (number of neighboring atoms) around the given atom | ||
isAlpha (component) |
Takes an atom or bond are returns True if it is alpha to an indexed atom | ||
isBeta (component) |
Takes an atom or bond are returns True if it is beta to an indexed atom | ||
isIndexed (component) |
returns True if the atom or bond is indexed | ||
isUnindexed (component) |
returns True if the atom or bond is not indexed | ||
isValid ([smirks]) |
Returns if the environment is valid, that is if it creates a parseable SMIRKS string. | ||
removeAtom (atom[, onlyEmpty]) |
Remove the specified atom from the chemical environment. | ||
selectAtom ([descriptor]) |
Select a random atom fitting the descriptor. | ||
selectBond ([descriptor]) |
Select a random bond fitting the descriptor. | ||
validate (smirks[, ensure_valence_type, toolkit]) |
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.
Attributes: |
|
---|
Methods
addANDtype (ANDtype) |
Adds ANDtype to the set for this atom. |
addORtype (ORbase, ORdecorators) |
Adds ORtype to the set for this atom. |
asSMARTS () |
Return the atom representation as SMARTS. |
asSMIRKS () |
Return the atom representation as SMIRKS. |
getANDtypes () |
returns a copy of the list of ANDtypes for this atom |
getORtypes () |
returns a copy of the dictionary of ORtypes for this atom |
setANDtypes (newANDtypes) |
sets new ANDtypes for this atom |
setORtypes (newORtypes) |
sets new ORtypes for this atom |
asSMARTS
()[source]¶Return the atom representation as SMARTS.
Returns: |
|
---|
asSMIRKS
()[source]¶Return the atom representation as SMIRKS.
Returns: |
|
---|
addORtype
(ORbase, ORdecorators)[source]¶Adds ORtype to the set for this atom.
Parameters: |
|
---|
addANDtype
(ANDtype)[source]¶Adds ANDtype to the set for this atom.
Parameters: |
|
---|
Bond
(ORtypes=None, ANDtypes=None)[source]¶Bond representation, which may have ORtype and ANDtype descriptors.
Attributes: |
|
---|
Methods
addANDtype (ANDtype) |
Adds ANDtype to the set for this atom. | ||
addORtype (ORbase, ORdecorators) |
Adds ORtype to the set for this atom. | ||
asSMARTS () |
Return the atom representation as SMARTS. | ||
asSMIRKS () |
|
||
getANDtypes () |
returns a copy of the list of ANDtypes for this atom | ||
getORtypes () |
returns a copy of the dictionary of ORtypes for this atom | ||
getOrder () |
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 | ||
setANDtypes (newANDtypes) |
sets new ANDtypes for this atom | ||
setORtypes (newORtypes) |
sets new ORtypes for this atom |
asSMARTS
()[source]¶Return the atom representation as SMARTS.
Returns: |
|
---|
getOrder
()[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
(ANDtype)¶Adds ANDtype to the set for this atom.
Parameters: |
|
---|
addORtype
(ORbase, ORdecorators)¶Adds ORtype to the set for this atom.
Parameters: |
|
---|
getANDtypes
()¶returns a copy of the list of ANDtypes for this atom
getORtypes
()¶returns a copy of the dictionary of ORtypes for this atom
setANDtypes
(newANDtypes)¶sets new ANDtypes for this atom
Parameters: |
|
---|
setORtypes
(newORtypes)¶sets new ORtypes for this atom
Parameters: |
|
---|
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.
Parameters: |
|
---|
isValid
(smirks=None)[source]¶Returns if the environment is valid, that is if it creates a parseable SMIRKS string.
asSMIRKS
(smarts=False)[source]¶Returns a SMIRKS representation of the chemical environment
Parameters: |
|
---|
selectAtom
(descriptor=None)[source]¶Select a random atom fitting the descriptor.
Parameters: |
|
---|---|
Returns: |
|
getComponentList
(component_type, descriptor=None)[source]¶Returns a list of atoms or bonds matching the descriptor
Parameters: |
|
---|
selectBond
(descriptor=None)[source]¶Select a random bond fitting the descriptor.
Parameters: |
|
---|---|
Returns: |
|
addAtom
(bondToAtom, bondORtypes=None, bondANDtypes=None, newORtypes=None, newANDtypes=None, newAtomIndex=None, newAtomRing=None, beyondBeta=False)[source]¶Add an atom to the specified target atom.
Parameters: |
|
---|---|
Returns: |
|
removeAtom
(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.
Parameters: |
|
---|---|
Returns: |
|
getBonds
(atom=None)[source]¶Parameters: |
|
---|---|
Returns: |
|
getBond
(atom1, atom2)[source]¶Get bond betwen two atoms
Parameters: |
|
---|---|
Returns: |
|
getAlphaAtoms
()[source]¶getBetaAtoms
()[source]¶getUnindexedBonds
()[source]¶isAlpha
(component)[source]¶Takes an atom or bond are returns True if it is alpha to an indexed atom
getType
()[source]¶Uses number of indexed atoms and bond connectivity to determine the type of chemical environment
Returns: |
|
---|