geometry

class isicle.geometry.Geometry(**kwargs)[source]

Molecule information, specialized for 3D representations. It is not recommended to manipulate or retrieve attributes of this class without using class functions.

_abc_impl = <_abc._abc_data object>
_default_value = None
_defaults = ['mol', 'basename', '_energy', '_shielding', '_spin', '_frequency', '_molden', '_charge', '_connectivity', '_formal_charge', '_ccs']
_is_embedded(mol)[source]

Check if molecule has embedded 3D coordinates.

Returns:

Indication of 3D coordinate presence.

Return type:

bool

addHs()[source]

Add implicit hydrogens to molecule.

Returns:

Molecule representation.

Return type:

Geometry

add___dict__(d, override=False)[source]

Accepts a dictionary of values and adds any non-conflicting information to the attribute dictionary.

Parameters:
  • d (dict) – Attribute dictionary.

  • override (bool) – Singal whether to override existing attributes.

property ccs

Get CCS of the molecule.

Returns:

Collision cross section.

Return type:

float

property charge

Get per-atoms charges of the molecule.

Returns:

list – Per-atom charges.

Return type:

float

property connectivity

Get molecule connectivity.

Returns:

Pairwise atom connectivity.

Return type:

list

desalt(salts=None)[source]

Desalts RDKit mol object using Chem.SaltRemover module.

Parameters:

salts (str (optional)) – Salt type to remove. Ex: ‘Cl’, ‘Br’, ‘[Na+]’. Default: None.

Returns:

Moleculerepresentation.

Return type:

Geometry

dft(backend='NWChem', **kwargs)[source]

Perform density functional theory calculations according to supplied task list and configuration parameters for specified backend.

Parameters:
  • backend (str) – Alias for backend selection (NWChem, ORCA).

  • kwargs – Keyword arguments supplied to selected program. See run method of relevant wrapper for configuration parameters, e.g. run().

Returns:

Wrapper object containing relevant outputs from the simulation.

Return type:

{program}Wrapper

property energy

Get total energy of the molecule.

Returns:

Total energy.

Return type:

float

property formal_charge

Get formal charge of the molecule.

Returns:

Formal charge.

Return type:

int

property frequency

Get frequency values of the molecule.

Returns:

Frequency values.

Return type:

dict

get___dict__()[source]

Return a copy of this object’s attributes as a dictionary.

Returns:

Instance attributes.

Return type:

dict

get_atom_indices(atoms=['C', 'H'], lookup={'C': 6, 'F': 9, 'H': 1, 'N': 7, 'O': 8, 'P': 15})[source]

Extract indices of each atom from the internal geometry.

Parameters:
  • atoms (list of str) – Atom types of interest.

  • lookup (dict) – Mapping between atom symbol and atomic number.

Returns:

Atom indices.

Return type:

list of int

get_basename()[source]

Returns a copy of this object’s basename (original filename).

Returns:

Basename of original filepath.

Return type:

str

get_natoms()[source]

Calculate total number of atoms.

Returns:

Number of atoms.

Return type:

int

get_total_partial_charge()[source]

Sum the partial charge across all atoms.

Returns:

Total partial charge.

Return type:

float

initial_optimize(embed=False, forcefield='UFF', ff_iter=200)[source]

Initial molecule optimization by basic force field to establish rough 3D coordinates. Further optimization (molecular dynamics, density functional theory) recommended.

Parameters:
  • embed (bool) – Attempt molecule embedding with eigenvalues of distance matrix. Failure results in seeding with random coordinates.

  • forcefield (str) – Specify “UFF” for universal force field, “MMFF” or “MMFF94” for Merck molecular force field 94, or “MMFF94s” for the MMFF94 s variant.

Returns:

Molecule representation.

Return type:

Geometry

ionize(ion_path=None, ion_list=None, method='explicit', **kwargs)[source]

Ionize geometry, using specified list of ions and method of ionization.

Parameters:
  • ion_path (str) – Filepath to text file containing ions with charge (eg. H+) to be considered. Either ion_path or ion_list must be specified.

  • ion_list (list) – List of strings of adducts to be considered. Must be specifed in syntax Atom+ or Atom-, eg. H+, Na+, H-Na+. Either ion_path or ion_list must be specified

  • method (str) – Method of ionization to be used, ‘explicit’ or ‘crest’ is accepted

  • ensembl (bool (optional)) – Returns instead a list of adduct geometries

  • kwargs

    see :meth: ~isicle.adducts.ExplicitIonizationWrapper.submit or

    ~isicle.adducts.CRESTIonizationWrapper.submit

    for more options

Returns:

Ionization result.

Return type:

IonizationWrapper

kekulize()[source]

Kekulizes the molecule if possible. Otherwise the molecule is not modified. This is recommended for aromatic molecules undergoing explicit ionization. Aromatic bonds are explicitly defined and aromatic flags are cleared.

md(backend='xtb', **kwargs)[source]

Optimize geometry or generate conformers or adducts using stated forcefield.

Parameters:

kwargs – Keyword arguments supplied to selected program. See run method of relevant wrapper for configuration parameters, e.g. run().

Returns:

Wrapper object containing relevant outputs from the simulation.

Return type:

{program}Wrapper

property molden

Get Molden values of the molecule.

Returns:

Frequency values.

Return type:

dict

neutralize()[source]

Neutralizes RDKit mol object using neutralization reactions.

Returns:

Molecule representation.

Return type:

Geometry

property orbital_energies

Get orbital energies of the molecule.

Returns:

Orbital energies.

Return type:

DataFrame

property shielding

Get orbital energies of the molecule.

Returns:

Shielding values.

Return type:

dict

property spin

Get spin couplings of the molecule.

Returns:

Spin couplings.

Return type:

DataFrame

tautomerize(return_all=False)[source]

Generate tautomers according to RDKit TautomerEnumerator() method.

Parameters:

return_all (boolean (optional)) – If true, return all tautomers generated. Otherwise, only return the most common. Default=False

Returns:

Tautomer(s) of starting structure.

Return type:

Geometry or list of Geometry

to_inchi()[source]

Get InChI for this structure.

Returns:

InChI string.

Return type:

str

to_mol()[source]

Returns Mol instance for this Geometry.

Returns:

RDKit Mol instance.

Return type:

Mol

to_molblock()[source]

Get Mol text for this structure.

Returns:

Mol representation as string.

Return type:

str

to_pdbblock()[source]

Get PDB text for this structure.

Returns:

PDB representation as string.

Return type:

str

to_smarts()[source]

Get SMARTS for this structure.

Returns:

SMARTS string.

Return type:

str

to_smiles()[source]

Get SMILES for this structure.

Returns:

SMILES string.

Return type:

str

to_xyzblock()[source]

Get XYZ text for this structure.

Returns:

XYZ representation as string.

Return type:

str

update_coordinates(other)[source]

Update atom coordinates using another geometry as reference.

Parameters:

other (Geometry) – Geometry with reference coordinates.

Returns:

Molecule representation.

Return type:

Geometry

view()[source]

View internal rdkit mol object representation.

Returns:

RDKit Mol instance.

Return type:

Mol