OpenEye

Following the template outlined, chemper Mol, Atom, and Bond objects can be created from OpenEye tools.

cp_openeye.py

Cheminformatics tools using OpenEye Toolkits

The classes provided here follow the structure in adapters. This is a wrapper allowing our actual package to use openeye toolkits

class chemper.mol_toolkits.cp_openeye.Atom(atom)[source]
atomic_number()[source]
Returns

atomic_number – atomic number for the atom

Return type

int

connectivity()[source]
Returns

connectivity – connectivity or total number of bonds (regardless of order) around the atom

Return type

int

degree()[source]
Returns

degree – degree or number of explicit bond orders around the atom

Return type

int

formal_charge()[source]
Returns

formal_charge – the atom’s formal charge

Return type

int

get_bonds()[source]
Returns

bonds – Bonds connected to this atom

Return type

list[ChemPer Bonds]

get_index()[source]
Returns

index – atom index in its molecule

Return type

int

get_molecule()[source]

Extracts the parent molecule this atom is from.

Returns

mol – Molecule this atom is stored in

Return type

ChemPer Mol

get_neighbors()[source]
Returns

neighbors – Atoms that are one bond away from this atom

Return type

list[ChemPer Atoms]

hydrogen_count()[source]
Returns

H_count – total number of hydrogen atoms connected to this Atom

Return type

int

is_aromatic()[source]
Returns

is_aromatic – True if the atom is aromatic otherwise False

Return type

boolean

is_connected_to(atom2)[source]
Parameters

atom2 (ChemPer Atom) – Atom to check if it is bonded to this atom

Returns

connected – True if atom2 is a bonded to atom1

Return type

boolean

min_ring_size()[source]
Returns

min_ring_size – size of the smallest ring this atom is a part of

Return type

int

ring_connectivity()[source]
Returns

ring_connectivity – number of bonds on the atom that are a part of a ring

Return type

int

valence()[source]
Returns

valence – the atoms valence (equivalent to degree when all bonds are explicit)

Return type

int

class chemper.mol_toolkits.cp_openeye.Bond(bond)[source]
get_atoms()[source]
Returns

atoms – The two atoms connected by this bond

Return type

list[ChemPer Atoms]

get_index()[source]
Returns

index – index of this bond in its parent molecule

Return type

int

get_molecule()[source]

Extracts the parent molecule this bond is from

Returns

mol – Molecule this bond is stored in

Return type

ChemPer Mol

get_order()[source]
Returns

order – This is the absolute order, returns 1.5 if bond is aromatic

Return type

int or float

is_aromatic()[source]
Returns

is_aromatic – True if it is an aromatic bond

Return type

boolean

is_double()[source]
Returns

is_double – True if it is a double bond

Return type

boolean

is_ring()[source]
Returns

is_ring – True if bond is a part of a ring, otherwise False

Return type

boolean

is_single()[source]
Returns

is_single – True if it is a single bond

Return type

boolean

is_triple()[source]
Returns

is_triple – True if it is a triple bond

Return type

boolean

class chemper.mol_toolkits.cp_openeye.Mol(mol)[source]
classmethod from_smiles(smiles)[source]

Creates a ChemPer Mol form a SMILES string

Parameters

smiles (str) – SMILES used to create molecule with wrapped toolkit

Returns

Mol

Return type

ChemPer Mol

get_atom_by_index(idx)[source]
Parameters

idx (int) – atom index

Returns

atom – atom with index idx

Return type

ChemPer Atom

get_atoms()[source]
Returns

atom_list – list of all atoms in the molecule

Return type

list[ChemPer Atoms]

get_bond_by_atoms(atom1, atom2)[source]

Finds a bond between two atoms

Parameters
  • atom1 (ChemPer Atom) –

  • atom2 (ChemPer Atom) –

Returns

bond – If atoms are connected returns bond otherwise None

Return type

ChemPer Bond or None

get_bond_by_index(idx)[source]
Parameters

idx (int) – bond index

Returns

bond – bond with index idx

Return type

ChemPer Bond

get_bonds()[source]
Returns

bond_list – list of all bonds in the molecule

Return type

list[ChemPer Bonds]

get_smiles()[source]
Returns

smiles – SMILES string for the molecule

Return type

str

set_aromaticity_mdl()[source]

Sets the aromaticity flags in this molecule to use the MDL model

Performs a substructure search on the molecule with the provided SMIRKS pattern. Note - this function expects SMIRKS patterns with indexed atoms that is with :n for at least some atoms.

Parameters

smirks (str) – SMIRKS pattern with indexed atoms (:n)

Returns

matches – match dictionaries have the form {smirks index: atom index}

Return type

list[match dictionary]

chemper.mol_toolkits.cp_openeye.mols_from_file(mol_file)[source]

Parses a standard molecule file into ChemPer molecules using OpenEye toolkits

Parameters

mol_file (str) – relative or full path to molecule containing the molecule file that is accessible from the current working directory

Returns

mols – list of molecules in the mol2 file as ChemPer Mols

Return type

list[ChemPer Mol]