rmgpy.molecule.Atom

class rmgpy.molecule.Atom(element=None, radical_electrons=0, charge=0, label='', lone_pairs=- 100, coords=np.array([]), id=- 1, props=None)

An atom. The attributes are:

Attribute

Type

Description

atomtype

AtomType

The atom type

element

Element

The chemical element the atom represents

radical_electrons

short

The number of radical electrons

charge

short

The formal charge of the atom

label

str

A string label that can be used to tag individual atoms

coords

numpy array

The (x,y,z) coordinates in Angstrom

lone_pairs

short

The number of lone electron pairs

id

int

Number assignment for atom tracking purposes

bonds

dict

Dictionary of bond objects with keys being neighboring atoms

props

dict

Dictionary for storing additional atom properties

mass

int

atomic mass of element (read only)

number

int

atomic number of element (read only)

symbol

str

atomic symbol of element (read only)

Additionally, the mass, number, and symbol attributes of the atom’s element can be read (but not written) directly from the atom object, e.g. atom.symbol instead of atom.element.symbol.

apply_action(self, action)

Update the atom pattern 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

rmgpy.molecule.atomtype.AtomType

Type:

atomtype

charge

‘short’

Type:

charge

connectivity1

‘short’

Type:

connectivity1

connectivity2

‘short’

Type:

connectivity2

connectivity3

‘short’

Type:

connectivity3

coords

numpy.ndarray

Type:

coords

copy(self) Vertex

Generate a deep copy of the current atom. Modifying the attributes of the copy will not affect the original.

decrement_lone_pairs(self)

Update the lone electron pairs pattern as a result of applying a LOSE_PAIR action.

decrement_radical(self)

Update the atom pattern as a result of applying a LOSE_RADICAL action, where radical specifies the number of radical electrons to remove.

edges

dict

Type:

edges

element

rmgpy.molecule.element.Element

Type:

element

equivalent(self, Vertex other, bool strict=True) bool

Return True if other is indistinguishable from this atom, or False otherwise. If other is an Atom object, then all attributes except label and ‘ID’ must match exactly. If other is an GroupAtom object, then the atom must match any of the combinations in the atom pattern. If strict is False, then only the element is compared and electrons are ignored.

get_total_bond_order(self)

This helper function is to help calculate total bond orders for an input atom.

Some special consideration for the order B bond. For atoms having three B bonds, the order for each is 4/3.0, while for atoms having other than three B bonds, the order for each is 3/2.0

id

‘int’

Type:

id

ignore

‘bool’

Type:

ignore

increment_lone_pairs(self)

Update the lone electron pairs pattern as a result of applying a GAIN_PAIR action.

increment_radical(self)

Update the atom pattern as a result of applying a GAIN_RADICAL action, where radical specifies the number of radical electrons to add.

is_bonded_to_halogen(self) bool

Return True if the atom is bonded to at least one halogen (F, Cl, Br, or I) False if it is not

is_bonded_to_surface(self) bool

Return True if the atom is bonded to a surface atom 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) bool

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

is_fluorine(self) bool

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

is_halogen(self) bool

Return True if the atom represents a halogen atom (F, Cl, Br, I) False if it does.

is_hydrogen(self) bool

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

is_iodine(self) bool

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

is_nitrogen(self)

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

is_non_hydrogen(self) bool

Return True if the atom does not represent a hydrogen atom or False if it does.

is_nos(self) bool

Return True if the atom represent either nitrogen, sulfur, or oxygen False if it does not.

is_oxygen(self) bool

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

is_phosphorus(self) bool

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

is_silicon(self) bool

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

is_specific_case_of(self, Vertex other) bool

Return True if self is a specific case of other, or False otherwise. If other is an Atom object, then this is the same as the equivalent() method. If other is an GroupAtom object, then the atom must match or be more specific than any of the combinations in the atom pattern.

is_sulfur(self) bool

Return True if the atom represents a 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

‘short’

Type:

lone_pairs

mapping

rmgpy.molecule.graph.Vertex

Type:

mapping

props

dict

Type:

props

radical_electrons

‘short’

Type:

radical_electrons

reset_connectivity_values(self)

Reset the cached structure information for this vertex.

set_lone_pairs(self, int lone_pairs)

Set the number of lone electron pairs.

sorting_key

Returns a sorting key for comparing Atom objects. Read-only

sorting_label

‘short’

Type:

sorting_label

terminal

‘bool’

Type:

terminal

update_charge(self)

Update self.charge, according to the valence, and the number and types of bonds, radicals, and lone pairs.