rmgpy.molecule.AtomType

class rmgpy.molecule.AtomType(label='', generic=None, specific=None, single=None, allDouble=None, rDouble=None, oDouble=None, sDouble=None, triple=None, benzene=None, lonePairs=None, charge=None)

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
incrementBond list The atom type(s) that result when an adjacent bond’s order is incremented
decrementBond list The atom type(s) that result when an adjacent bond’s order is decremented
formBond list The atom type(s) that result when a new single bond is formed to this atom type
breakBond list The atom type(s) that result when an existing single bond to this atom type is broken
incrementRadical list The atom type(s) that result when the number of radical electrons is incremented
decrementRadical list The atom type(s) that result when the number of radical electrons is decremented
incrementLonePair list The atom type(s) that result when the number of lone electron pairs is incremented
decrementLonePair 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
‘allDouble’ ‘’list’‘ The total number of double bonds on the atom
‘rDouble’ ‘’list’‘ The number of double bonds to any non-oxygen, nonsulfur
‘oDouble’ ‘’list’‘ The number of double bonds to oxygen
‘sDouble’ ‘’list’‘ The number of double bonds to sulfur
‘triple’ ‘’list’‘ The total number of triple bonds on the atom
‘benzene’ ‘’list’‘ The total number of benzene bonds on the atom
‘lonePairs’ ‘’list’‘ The number of lone pairs on the atom
‘charge’ ‘’list’‘ The partial charge of the atom
allDouble

allDouble – list

benzene

benzene – list

breakBond

breakBond – list

charge

charge – list

decrementBond

decrementBond – list

decrementLonePair

decrementLonePair – list

decrementRadical

decrementRadical – list

equivalent(self, AtomType other) → bool

Returns True if two atom types atomType1 and atomType2 are equivalent or False otherwise. This function respects wildcards, e.g. R!H is equivalent to C.

formBond

formBond – list

generic

generic – list

getFeatures(self) → list

Returns a list of the features that are checked to determine atomtype

incrementBond

incrementBond – list

incrementLonePair

incrementLonePair – list

incrementRadical

incrementRadical – list

isSpecificCaseOf(self, AtomType other) → bool

Returns True if atom type atomType1 is a specific case of atom type atomType2 or False otherwise.

label

label – str

lonePairs

lonePairs – list

oDouble

oDouble – list

rDouble

rDouble – list

sDouble

sDouble – list

setActions(self, incrementBond, decrementBond, formBond, breakBond, incrementRadical, decrementRadical, incrementLonePair, decrementLonePair)
single

single – list

specific

specific – list

triple

triple – list

rmgpy.molecule.getAtomType(atom, dict bonds) → AtomType

Determine the appropriate atom type for an Atom object atom with local bond structure bonds, a dict 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
R any atom with any local bond structure
R!H any non-hydrogen atom with any local bond structure
Hydrogen atom types
H hydrogen atom with up to one single bond
Carbon atom types
C carbon atom with any local bond structure
Ca carbon atom with two lone pairs and no bonds
Cs carbon atom with up to four single bonds
Csc charged carbon atom with up to three single bonds
Cd carbon atom with one double bond (not to O or S) and up to two single bonds
Cdc charged carbon atom with one double bond and up to one single bond
CO carbon atom with one double bond to oxygen and up to two single bonds
CS carbon atom with one double bond to sulfur and up to two single bonds
Cdd carbon atom with two double bonds
Ct carbon atom with one triple bond and up to one single bond
Cb carbon atom with up to two benzene bonds and up to one single bond
Cbf carbon atom with three benzene bonds
C2s carbon atom with one lone pair (valance 2) and up to two single bonds
C2sc charged carbon atom with one lone pair (valance 2) and up to three single bonds
C2d carbon atom with one lone pair (valance 2) and one double bond
C2dc charged carbon atom with one lone pair (valance 2), one double bond and up to one single bond
C2tc charged carbon atom with one lone pair (valance 2), one triple bond
Nitrogen atom types
N nitrogen atom with any local bond structure
N0sc charged nitrogen atom with three lone pairs (valance 0) with up to one single bond
N1s nitrogen atom with two lone pairs (valance 1) and up to one single bond
N1sc charged nitrogen atom with two lone pairs (valance 1) up to two single bonds
N1dc charged nitrogen atom with two lone pairs (valance 1), one double bond
N3s nitrogen atom with one lone pair (valance 3) with up to three single bonds
N3d nitrogen atom with one lone pair (valance 3), one double bond and up to one single bond
N3t nitrogen atom with one lone pair (valance 3) and one triple bond
N3b nitrogen atom with one lone pair (valance 3) and two benzene bonds
N5sc charged nitrogen atom with no lone pairs (valance 5) with up to four single bonds
N5dc charged nitrogen atom with no lone pairs (valance 5), one double bond and up to two single bonds
N5ddc charged nitrogen atom with with no lone pairs (valance 5) and two double bonds
N5dddc charged nitrogen atom with with no lone pairs (valance 5) and three double bonds
N5t nitrogen atom with with no lone pairs (valance 5), one triple bond and up to two single bonds
N5tc charged nitrogen atom with with no lone pairs (valance 5), one triple bond and up to one single bond
N5b 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
N5bd nitrogen atom with with no lone pairs (valance 5), two benzene bonds, and one double bond
Oxygen atom types
O oxygen atom with any local bond structure
Oa oxygen atom with three lone pairs and no bonds
O0sc charged oxygen with three lone pairs (valance 0) and up to one single bond
O0dc charged oxygen atom with three lone pairs (valance 0) and one double bond
O2s oxygen atom with two lone pairs (valance 2) and up to two single bonds
O2sc charged oxygen atom with two lone pairs (valance 2) and up to one single bond
O2d oxygen atom with two lone pairs (valance 2) and one doubel bond
O4sc charged oxygen atom with one one pair (valance 4) and up to three single bonds
O4dc charged oxygen atom with one one pair (valance 4), one double bond and up to one single bond
O4tc charged oxygen atom with one one pair (valance 4) and one triple bond
O4b oxygen atom with one one pair (valance 4) and and two benzene bonds
Silicon atom types
Si silicon atom with any local bond structure
Sis silicon atom with four single bonds
Sid silicon atom with one double bond (to carbon) and two single bonds
SiO silicon atom with one double bond (to oxygen) and two single bonds
Sidd silicon atom with two double bonds
Sit silicon atom with one triple bond and one single bond
Sib silicon atom with two benzene bonds and one single bond
Sibf silicon atom with three benzene bonds
Sulfur atom types
S sulfur atom with any local bond structure
Sa sulfur atom with three lone pairs and no bonds
S0sc charged sulfur atom with three lone pairs (valance 0) and up to one single bonds
S2s sulfur atom with two lone pairs (valance 2) and up to two single bonds
S2sc charged sulfur atom with two lone pairs (valance 2) and up to three single bonds
S2d sulfur atom with two lone pairs (valance 2) and one double bond
S2dc charged sulfur atom with two lone pairs (valance 2), one double bond and up to one single bond
S2tc charged sulfur atom with two lone pairs (valance 2) and one triple bond
S4s sulfur atom with one lone pair (valance 4) and up to four single bonds
S4sc charged sulfur atom with one lone pair (valance 4) and up to five single bonds
S4d sulfur atom with one lone pair (valance 4), one double bond and up to two single bonds
S4dd sulfur atom with one lone pair (valance 4) and two double bonds
S4dc charged sulfur atom with one lone pair (valance 4), one to three double bonds and up to three single bonds
S4b sulfur atom with one lone pair (valance 4) and two benzene bonds (one of the lone pairs also participates in the aromatic bond)
S4t sulfur atom with one lone pair (valance 4), one triple bond and up to one single bond
S4tdc 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
S6s sulfur atom with no lone pairs (valance 6) and up to six single bonds
S6sc charged sulfur atom with no lone pairs (valance 6) and up to seven single bonds
S6d sulfur atom with no lone pairs (valance 6), one double bond and up to four single bonds
S6dd sulfur atom with no lone pairs (valance 6), two double bonds and up to two single bonds
S6ddd sulfur atom with no lone pairs (valance 6) and three double bonds
S6dc charged sulfur atom with no lone pairs (valance 6), one to three double bonds and up to five single bonds
S6t sulfur atom with no lone pairs (valance 6), one triple bond and up to three single bonds
S6td sulfur atom with no lone pairs (valance 6), one triple bond, one double bond and up to one single bond
S6tt sulfur atom with no lone pairs (valance 6) and two triple bonds
S6tdc 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
Cl chlorine atom with any local bond structure
Cl1s chlorine atom with three lone pairs and zero to one single bonds
Iodine atom types
I iodine atom with any local bond structure
I1s iodine atom with three lone pairs and zero to one single bonds