navicatGA.chemistry_selfies¶
Attributes¶
Functions¶
|
Check if a list of selfies characters leads to a valid smiles string. Uses sanitize_smiles to check the smiles string from selfies.decoder. |
|
Count the number of selfie characters in a selfie string. Returns the number. |
|
Decode a list of smiles to a list of selfies using timed_decoder. |
|
Tries to identify and print to logger whatever was or is wrong with the chemistry_selfies of an rdkit.mol object. |
|
|
|
Encode a list of smiles to a list of selfies using selfies.encoder. |
|
|
|
|
|
|
|
Obtain an ordered list of all selfie characters in string selfie |
|
Generates a reasonable set of 3D structures |
Returns True if the rdkit.mol object passed as argument has a (transition)-metal atom, False if else. |
|
Returns True if the rdkit.Atom object passed as argument is a transition metal, False if else. |
|
|
|
|
|
|
|
|
Calls sanitize_smiles for every item in a list. |
|
Return a canonical smile representation of smi. |
|
Tries to replace bonds with metal atoms by dative bonds, while keeping valence rules enforced. Adapted from G. Landrum. |
|
Decode a selfies string to smiles using selfies.decoder, call exception and return None if decoder takes more than 10 seconds to run. |
|
Convert smiles string to rdkit.mol, call exception and return None if it takes more than 10 seconds to run. |
Module Contents¶
- navicatGA.chemistry_selfies.check_selfie_chars(chromosome)¶
Check if a list of selfies characters leads to a valid smiles string. Uses sanitize_smiles to check the smiles string from selfies.decoder.
Parameters: :param chromosome: list of selfie characters
Returns: :return: True if the smiles string is deemed valid by sanitize_smiles, False otherwise
- navicatGA.chemistry_selfies.count_selfie_chars(selfie)¶
Count the number of selfie characters in a selfie string. Returns the number.
- navicatGA.chemistry_selfies.decode_selfies_list(selfies_list)¶
Decode a list of smiles to a list of selfies using timed_decoder.
- navicatGA.chemistry_selfies.diagnose_mol(mol)¶
Tries to identify and print to logger whatever was or is wrong with the chemistry_selfies of an rdkit.mol object.
- navicatGA.chemistry_selfies.draw_selfies(selfies, root_name)¶
- navicatGA.chemistry_selfies.encode_smiles_list(smiles_list)¶
Encode a list of smiles to a list of selfies using selfies.encoder.
- navicatGA.chemistry_selfies.get_ECFP4(mol)¶
- navicatGA.chemistry_selfies.get_conformer_rmsd(mol)¶
- navicatGA.chemistry_selfies.get_confs_ff(mol, maxiters=250)¶
- navicatGA.chemistry_selfies.get_interatomic_distances(conf)¶
- navicatGA.chemistry_selfies.get_selfie_chars(selfie, maxchars=25)¶
Obtain an ordered list of all selfie characters in string selfie padded to maxchars with [nop]s.
Parameters: :param selfie: a selfie string representing a molecule :param maxchars: maximum number of elements in the list
Returns: :return chars_selfie: list of selfie characters present in molecule selfie
- navicatGA.chemistry_selfies.get_structure_ff(mol, n_confs=5)¶
Generates a reasonable set of 3D structures using forcefields for a given rdkit.mol object. It will try several 3D generation approaches in rdkit. It will try to sample several conformations and get the minima.
Parameters: :type mol: a rdkit.mol object :type n_confs: the number of conformations to sample
Returns: :return mol_structure: the same rdkit mol with 3D coordinates
- navicatGA.chemistry_selfies.has_transition_metals(mol)¶
Returns True if the rdkit.mol object passed as argument has a (transition)-metal atom, False if else.
- navicatGA.chemistry_selfies.is_transition_metal(at)¶
Returns True if the rdkit.Atom object passed as argument is a transition metal, False if else.
- navicatGA.chemistry_selfies.prune_mol_conformers(mol, energies_list)¶
- navicatGA.chemistry_selfies.randomize_selfies(selfies, num_random=1)¶
- navicatGA.chemistry_selfies.randomize_smiles(mol)¶
- navicatGA.chemistry_selfies.sanitize_multiple_smiles(smiles_list)¶
Calls sanitize_smiles for every item in a list.
Parameters: :param smiles_list list of smiles strings to be sanitized
Returns: :return sanitized_smiles: list of sanitized smile strings with None in errors
- navicatGA.chemistry_selfies.sanitize_smiles(smiles)¶
Return a canonical smile representation of smi. If there are metals, it will try to fix the bonds as dative.
Parameters: :param smi: smiles string to be sanitized :type smi: smiles string
Returns: :return mol: corresponding rdkit.mol object, None if exception caught :return smi_canon: canonicalized smile representation of smi, None if exception caught :return conversion_successful: True if no exception caught, False if exception caught
- navicatGA.chemistry_selfies.set_dative_bonds(mol, fromAtoms=(7, 8, 15, 16))¶
Tries to replace bonds with metal atoms by dative bonds, while keeping valence rules enforced. Adapted from G. Landrum.
- navicatGA.chemistry_selfies.timed_decoder(selfie)¶
Decode a selfies string to smiles using selfies.decoder, call exception and return None if decoder takes more than 10 seconds to run.
- navicatGA.chemistry_selfies.timed_sanitizer(smiles)¶
Convert smiles string to rdkit.mol, call exception and return None if it takes more than 10 seconds to run.
- navicatGA.chemistry_selfies.lg¶
- navicatGA.chemistry_selfies.logger¶