rmgpy.molecule.GroupAtom

class rmgpy.molecule.GroupAtom(atomtype=None, radical_electrons=None, charge=None, label='', lone_pairs=None, props=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)

radical_electrons

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

lone_pairs

list

The number of lone electron pairs

charge

list

The partial charge of the atom

props

dict

Dictionary for storing additional atom properties

reg_dim_atm

list

List of atom types that are free dimensions in tree optimization

reg_dim_u

list

List of unpaired electron numbers that are free dimensions in tree optimization

reg_dim_r

list

List of inRing values that are free dimensions in tree optimization

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 radical_electrons, and charge attributes are linked such that an atom must match values from the same index in each of these in order to match.

apply_action(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

list

Type:

atomtype

charge

list

Type:

charge

connectivity1

‘short’

Type:

connectivity1

connectivity2

‘short’

Type:

connectivity2

connectivity3

‘short’

Type:

connectivity3

copy(self) Vertex

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

count_bonds(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

dict

Type:

edges

equivalent(self, Vertex other, bool strict=True) 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.

has_wildcards(self) bool

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

ignore

‘bool’

Type:

ignore

is_bonded_to_surface(self) bool

Return True if the atom is bonded to a surface GroupAtom X False if it is not

is_bromine(self)

Return True if the atom represents a bromine atom or False if not.

is_carbon(self) bool

Return True if the atom represents a carbon atom or False if not.

is_chlorine(self)

Return True if the atom represents a chlorine atom or False if not.

is_fluorine(self)

Return True if the atom represents a fluorine atom or False if not.

is_nitrogen(self) bool

Return True if the atom represents a nitrogen atom or False if not.

is_oxygen(self) bool

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

is_specific_case_of(self, Vertex other) bool

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

is_sulfur(self) bool

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

is_surface_site(self) bool

Return True if the atom represents a surface site or False if not.

label

unicode

Type:

label

lone_pairs

list

Type:

lone_pairs

make_sample_atom(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.radical_electrons, self.lone_pairs, and self.charge

mapping

rmgpy.molecule.graph.Vertex

Type:

mapping

props

dict

Type:

props

radical_electrons

list

Type:

radical_electrons

reg_dim_atm

list

Type:

reg_dim_atm

reg_dim_r

list

Type:

reg_dim_r

reg_dim_u

list

Type:

reg_dim_u

reset_connectivity_values(self)

Reset the cached structure information for this vertex.

sorting_label

‘short’

Type:

sorting_label

terminal

‘bool’

Type:

terminal