Utils

mdfptools.utils.get_data_filename(relative_path)[source]

Get the full path to one of the reference files in testsystems. In the source distribution, these files are in mdfptools/data/, but on installation, they’re moved to somewhere in the user’s python site-packages directory.

Parameters

name (str) – Name of the file to load (with respect to the repex folder).

Returns

fn – filename

Return type

str

mdfptools.utils.canonical_smiles_from_smiles(smiles, sanitize=True)[source]

Apply canonicalisation with rdkit

Parameters
  • smiles (str) –

  • sanitize (bool) – Wether to apply rdkit sanitisation, default yes.

Returns

canonical_smiles – Returns None if canonicalisation fails

Return type

str

mdfptools.utils.hashing(smiles)[source]

Converts a string to hexdecimal representation (length 32). Specifically, it is used in mdfptools to convert canonical smiles to hex so it can be used as filename when store to disk.

Parameters

smiles (str) –

Returns

hex_str – Hexdecimal representation

Return type

str

mdfptools.utils.screen_organic(smiles)[source]

Heuristic to determine if a input SMILES string is considered as only organic matter.

Parameters

smiles (str) –

Returns

is_organic

Return type

bool