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]¶
-
- 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
- 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
- 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_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
- 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]
- smirks_search(smirks)[source]¶
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]