torch_pgn.featurization package

Submodules

torch_pgn.featurization.featurize module

torch_pgn.featurization.simple_featurization module

torch_pgn.featurization.simple_featurization.featurize_atoms_ECFP_like(molecule, index_list, is_ligand, translate=None)

Outputs a list of reps for each atom in the molecule that is contained in the index list.

Parameters:
  • molecule -- (oddt.toolkit.Molecule object) Molecules, which is analysed in order to calculate representations

  • index_list -- List of atom numbers to extract features

  • is_ligand -- (bool) is in ligand

  • translate -- (dict) If the nodes have already been translated then this will allow for going back to previous rep.

Returns:

a dictionary with the key, value pairs corresponding to node, ECFP_like rep.

The default output features are:

(atomic number (int), isotope_id, total degree (excl_Hs), N_hydrogens, formal charge, ring, is aromatic, ligand (1) protein(0)

torch_pgn.featurization.simple_featurization.featurize_edges_simple(bond_list, molecule, translate, position_dict)

A typesafe way of retrieving bond information from ODDT molecule objects or interaction_edges.

Parameters:
  • bond_list -- a list of bonds in (u, v) format

  • molecule -- molecule of type oddt.toolkit.Molecule to retrive bonds from

  • translate -- Translation dictionary to store the nodes in

Returns:

A dictionary of bond objects for further processing. Each bond will be stored in both (u, v) and (v, u) regardless of whether both are passed in the bond_list Note: OB bond docs: http://openbabel.org/dev-api/classOpenBabel_1_1OBBond.shtml#a892ffd8f4ddd7adbe285b6bf7133aa7a Note: Rdkit bond docs: https://www.rdkit.org/docs/cppapi/classRDKit_1_1Bond.html

Module contents