e3fp.fingerprint.structs module

Class for defining 3D atom environments.

Author: Seth Axen E-mail: seth.axen@gmail.com

exception FormatError[source]

Bases: Exception

class Shell(center_atom, shells={}, radius=None, last_shell=None, identifier=None)[source]

Bases: object

A container for other Shells centered on an atom.

Shells represent all atoms explicitly within a container. Atoms are represented by their ids. If atoms are provided instead of shells, they are converted to single-atom shells. A Substruct is generated from a Shell on the fly by recursion through member shells. An optional identifier may be set.

property atoms

Get all atoms explicitly within the shell.

property center_atom
classmethod from_substruct(substruct)[source]

Create shell with one shell for each atom in the substruct.

property shells
property substruct

Get substruct with all atoms implicitly within the shell.

class Substruct(center_atom=None, atoms={})[source]

Bases: object

A container for atoms optionally centered on an atom.

A Substruct represents all atoms implicitly within a Shell. Two Substructs are equal if they contain the same atoms.

property atoms
property center_atom
classmethod from_shell(shell)[source]
shell_to_pdb(mol, shell, atom_coords, bound_atoms_dict, out_file=None, reorient=True)[source]

Append substructure within shell to PDB.

Parameters
  • mol (RDKit Mol) – Input mol

  • shell (Shell) – A shell

  • atom_coords (dict) – Dict matching atom id to coordinates.

  • bound_atoms_dict (dict) – Dict matching atom id to id of bound atoms.

  • out_file (str or None, optional) – File to which to append coordinates.

  • reorient (bool, optional) – Use the transformation matrix in the shell to align by the stereo quadrants. If no transformation matrix present, centers the center atom.

Returns

list of str

Return type

list of PDB file lines, if out_file not specified