# rmgpy.molecule.GroupAtom¶

class rmgpy.molecule.GroupAtom(atomType=None, radicalElectrons=None, charge=None, label='', lonePairs=None)

An atom group. This class is based on the Atom class, except that it uses atom types instead of elements, and all attributes are lists rather than individual values. The attributes are:

Attribute Type Description
atomType list The allowed atom types (as AtomType objects)
radicalElectrons list The allowed numbers of radical electrons (as short integers)
charge list The allowed formal charges (as short integers)
label str A string label that can be used to tag individual atoms
lonePairs list The number of lone electron pairs

Each list represents a logical OR construct, i.e. an atom will match the group if it matches any item in the list. However, the radicalElectrons, and charge attributes are linked such that an atom must match values from the same index in each of these in order to match.

applyAction(self, list action)

Update the atom group as a result of applying action, a tuple containing the name of the reaction recipe action along with any required parameters. The available actions can be found here.

atomType

atomType: list

charge

charge: list

connectivity1

connectivity1: ‘short’

connectivity2

connectivity2: ‘short’

connectivity3

connectivity3: ‘short’

copy(self) → Vertex

Return a deep copy of the GroupAtom object. Modifying the attributes of the copy will not affect the original.

countBonds(self, wildcards=False) → list

Returns: list of the number of bonds currently on the :class:GroupAtom

If the argument wildcards is turned off then any bonds with multiple options for bond orders will not be counted

edges

edges: dict

equivalent(self, Vertex other) → bool

Returns True if other is equivalent to self or False if not, where other can be either an Atom or an GroupAtom object. When comparing two GroupAtom objects, this function respects wildcards, e.g. R!H is equivalent to C.

hasWildcards(self) → bool

Return True if the atom has wildcards in any of the attributes: atomtype, electronpairs, lone pairs, charge, and bond order. Returns ‘’False’’ if no attribute has wildcards.

ignore

ignore: ‘bool’

isOxygen(self) → bool

Return True if the atom represents an oxygen atom or False if not.

isSpecificCaseOf(self, Vertex other) → bool

Returns True if other is the same as self or is a more specific case of self. Returns False if some of self is not included in other or they are mutually exclusive.

isSulfur(self) → bool

Return True if the atom represents an sulfur atom or False if not.

label

label: str

lonePairs

lonePairs: list

makeSampleAtom(self) → Atom

Returns: a class :Atom: object analagous to the GroupAtom

This makes a sample, so it takes the first element when there are multiple options inside of self.atomtype, self.radicalElectrons, self.lonePairs, and self.charge

mapping

mapping: rmgpy.molecule.graph.Vertex

radicalElectrons

resetConnectivityValues(self)
sortingLabel
terminal