rmgpy.molecule.AtomType¶
- class rmgpy.molecule.AtomType¶
A class for internal representation of atom types. Using unique objects rather than strings allows us to use fast pointer comparisons instead of slow string comparisons, as well as store extra metadata. In particular, we store metadata describing the atom type’s hierarchy with regard to other atom types, and the atom types that can result when various actions involving this atom type are taken. The attributes are:
Attribute
Type
Description
label
str
A unique label for the atom type
generic
list
The atom types that are more generic than this one
specific
list
The atom types that are more specific than this one
increment_bond
list
The atom type(s) that result when an adjacent bond’s order is incremented
decrement_bond
list
The atom type(s) that result when an adjacent bond’s order is decremented
form_bond
list
The atom type(s) that result when a new single bond is formed to this atom type
break_bond
list
The atom type(s) that result when an existing single bond to this atom type is broken
increment_radical
list
The atom type(s) that result when the number of radical electrons is incremented
decrement_radical
list
The atom type(s) that result when the number of radical electrons is decremented
increment_lone_pair
list
The atom type(s) that result when the number of lone electron pairs is incremented
decrement_lone_pair
list
The atom type(s) that result when the number of lone electron pairs is decremented
The following features are what are required in a given atomtype. Any int in the list is acceptable. An empty list is a wildcard
single
list
The total number of single bonds on the atom
all_double
list
The total number of double bonds on the atom
r_double
list
The number of double bonds to any non-oxygen, nonsulfur
o_double
list
The number of double bonds to oxygen
s_double
list
The number of double bonds to sulfur
triple
list
The total number of triple bonds on the atom
quadruple
list
The total number of quadruple bonds on the atom
benzene
list
The total number of benzene bonds on the atom
lone_pairs
list
The number of lone pairs on the atom
charge
list
The partial charge of the atom
- equivalent(other)¶
Returns
True
if two atom types atomType1 and atomType2 are equivalent orFalse
otherwise. This function respects wildcards, e.g.R!H
is equivalent toC
.
- get_features()¶
Returns a list of the features that are checked to determine atomtype
- is_specific_case_of(other)¶
Returns
True
if atom type atomType1 is a specific case of atom type atomType2 orFalse
otherwise.
- rmgpy.molecule.get_atomtype(atom, bonds)¶
Determine the appropriate atom type for an
Atom
object atom with local bond structure bonds, adict
containing atom-bond pairs.
The atom type of an atom describes the atom itself and (often) something about the local bond structure around that atom. This is a useful semantic tool for accelerating graph isomorphism queries, and a useful shorthand when specifying molecular substructure patterns via an RMG-style adjacency list.
We define the following basic atom types:
Atom type |
Description |
---|---|
General atom types |
|
|
any atom with any local bond structure |
|
any non-hydrogen atom with any local bond structure |
|
any non-hydrogen and non-halogen atom (a non-terminal atom) |
Hydrogen atom types |
|
|
hydrogen atom with up to one single bond |
Carbon atom types |
|
|
carbon atom with any local bond structure |
|
carbon atom with two lone pairs and no bonds |
|
carbon atom with up to four single bonds |
|
charged carbon atom with up to three single bonds |
|
carbon atom with one double bond (not to O or S) and up to two single bonds |
|
charged carbon atom with one double bond and up to one single bond |
|
carbon atom with one double bond to oxygen and up to two single bonds |
|
carbon atom with one double bond to sulfur and up to two single bonds |
|
carbon atom with two double bonds |
|
carbon atom with one triple bond and up to one single bond |
|
carbon atom with up to two benzene bonds and up to one single bond |
|
carbon atom with three benzene bonds |
|
carbon atom with one lone pair (valance 2) and up to two single bonds |
|
charged carbon atom with one lone pair (valance 2) and up to three single bonds |
|
carbon atom with one lone pair (valance 2) and one double bond |
|
charged carbon atom with one lone pair (valance 2), one double bond and up to one single bond |
|
charged carbon atom with one lone pair (valance 2), one triple bond |
Nitrogen atom types |
|
|
nitrogen atom with any local bond structure |
|
charged nitrogen atom with three lone pairs (valance 0) with up to one single bond |
|
nitrogen atom with two lone pairs (valance 1) and up to one single bond |
|
charged nitrogen atom with two lone pairs (valance 1) up to two single bonds |
|
charged nitrogen atom with two lone pairs (valance 1), one double bond |
|
nitrogen atom with one lone pair (valance 3) with up to three single bonds |
|
nitrogen atom with one lone pair (valance 3), one double bond and up to one single bond |
|
nitrogen atom with one lone pair (valance 3) and one triple bond |
|
nitrogen atom with one lone pair (valance 3) and two benzene bonds |
|
charged nitrogen atom with no lone pairs (valance 5) with up to four single bonds |
|
charged nitrogen atom with no lone pairs (valance 5), one double bond and up to two single bonds |
|
charged nitrogen atom with with no lone pairs (valance 5) and two double bonds |
|
charged nitrogen atom with with no lone pairs (valance 5) and three double bonds |
|
charged nitrogen atom with with no lone pairs (valance 5), one triple bond and up to one single bond |
|
nitrogen atom with with no lone pairs (valance 5) and two benzene bonds (one of the lone pairs also participates in the aromatic bond) and up to one single bond |
|
nitrogen atom with with no lone pairs (valance 5), two benzene bonds, and one double bond |
Oxygen atom types |
|
|
oxygen atom with any local bond structure |
|
oxygen atom with three lone pairs and no bonds |
|
charged oxygen with three lone pairs (valance 0) and up to one single bond |
|
charged oxygen atom with three lone pairs (valance 0) and one double bond |
|
oxygen atom with two lone pairs (valance 2) and up to two single bonds |
|
charged oxygen atom with two lone pairs (valance 2) and up to one single bond |
|
oxygen atom with two lone pairs (valance 2) and one doubel bond |
|
charged oxygen atom with one one pair (valance 4) and up to three single bonds |
|
charged oxygen atom with one one pair (valance 4), one double bond and up to one single bond |
|
charged oxygen atom with one one pair (valance 4) and one triple bond |
|
oxygen atom with one one pair (valance 4) and and two benzene bonds |
Silicon atom types |
|
|
silicon atom with any local bond structure |
|
silicon atom with four single bonds |
|
silicon atom with one double bond (to carbon) and two single bonds |
|
silicon atom with one double bond (to oxygen) and two single bonds |
|
silicon atom with two double bonds |
|
silicon atom with one triple bond and one single bond |
|
silicon atom with two benzene bonds and one single bond |
|
silicon atom with three benzene bonds |
Phosphorus atom types |
|
|
phosphorus atom with any local bond structure |
|
charged phosphorus atom with three lone pairs (valence 0) and up to 1 single bond |
|
phosphorus atom with two lone pairs (valence 1) and up to 1 single bond |
|
charged phosphorus atom with two lone pairs (valence 1) and up to 2 single bonds |
|
charged phosphorus atom with two lone pairs (valence 1) and 1 double bond |
|
phosphorus atom with one lone pair (valence 3) and up to 3 single bonds |
|
phosphorus atom with one lone pair (valence 3), 1 double bond and up to 1 single bond |
|
phosphorus atom with one lone pair (valence 3) and 1 triple bond |
|
phosphorus atom with one lone pair (valence 3) and 2 benzene bonds |
|
phosphorus atom with no lone pairs (valence 5) and up to 5 single bonds |
|
charged phosphorus atom with no lone pairs (valence 5) and up to 6 single bonds |
|
phosphorus atom with no lone pairs (valence 5), 1 double bond and up to 3 single bonds |
|
phosphorus atom with no lone pairs (valence 5), 2 double bonds and up to 1 single bond |
|
charged phosphorus atom with no lone pairs (valence 5), 1 double bond and up to 2 single bonds |
|
charged phosphorus atom with no lone pairs (valence 5) and 2 double bonds |
|
phosphorus atom with no lone pairs (valence 5), 1 triple bond and up to 2 single bonds |
|
phosphorus atom with no lone pairs (valence 5), 1 triple bond and 1 double bond |
|
charged phosphorus atom with no lone pairs (valence 5), 1 triple bond and up to 1 single bond |
|
phosphorus atom with no lone pairs (valence 5), 2 benzene bonds and up to 1 single bond |
|
phosphorus atom with no lone pairs (valence 5), 2 benzene bonds and 1 double bond |
Sulfur atom types |
|
|
sulfur atom with any local bond structure |
|
sulfur atom with three lone pairs and no bonds |
|
charged sulfur atom with three lone pairs (valance 0) and up to one single bonds |
|
sulfur atom with two lone pairs (valance 2) and up to two single bonds |
|
charged sulfur atom with two lone pairs (valance 2) and up to three single bonds |
|
sulfur atom with two lone pairs (valance 2) and one double bond |
|
charged sulfur atom with two lone pairs (valance 2), one double bond and up to one single bond |
|
charged sulfur atom with two lone pairs (valance 2) and one triple bond |
|
sulfur atom with one lone pair (valance 4) and up to four single bonds |
|
charged sulfur atom with one lone pair (valance 4) and up to five single bonds |
|
sulfur atom with one lone pair (valance 4), one double bond and up to two single bonds |
|
sulfur atom with one lone pair (valance 4) and two double bonds |
|
charged sulfur atom with one lone pair (valance 4), one to three double bonds and up to three single bonds |
|
sulfur atom with one lone pair (valance 4) and two benzene bonds (one of the lone pairs also participates in the aromatic bond) |
|
sulfur atom with one lone pair (valance 4), one triple bond and up to one single bond |
|
charged sulfur atom with one lone pair (valance 4) one to two triple bonds, up to two double bonds, and up to three single bonds |
|
sulfur atom with no lone pairs (valance 6) and up to six single bonds |
|
charged sulfur atom with no lone pairs (valance 6) and up to seven single bonds |
|
sulfur atom with no lone pairs (valance 6), one double bond and up to four single bonds |
|
sulfur atom with no lone pairs (valance 6), two double bonds and up to two single bonds |
|
sulfur atom with no lone pairs (valance 6) and three double bonds |
|
charged sulfur atom with no lone pairs (valance 6), one to three double bonds and up to five single bonds |
|
sulfur atom with no lone pairs (valance 6), one triple bond and up to three single bonds |
|
sulfur atom with no lone pairs (valance 6), one triple bond, one double bond and up to one single bond |
|
sulfur atom with no lone pairs (valance 6) and two triple bonds |
|
charged sulfur atom with no lone pairs (valance 6), one to two triple bonds, up to two double bonds, and up to four single bonds |
Chlorine atom types |
|
|
chlorine atom with any local bond structure |
|
chlorine atom with three lone pairs and zero to one single bonds |
Bromine atom types |
|
|
bromine atom with any local bond structure |
|
bromine atom with three lone pairs and zero to one single bonds |
Iodine atom types |
|
|
iodine atom with any local bond structure |
|
iodine atom with three lone pairs and zero to one single bonds |
Fluorine atom types |
|
|
fluorine atom with any local bond structure |
|
fluorine atom with three lone pairs and zero to one single bonds |