matchms.filtering.filter_utils.smile_inchi_inchikey_conversions module

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.convert_inchi_to_inchikey(inchi: str) str | None[source]

Convert inchi to inchikey using rdkit.

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.convert_inchi_to_smiles(inchi: str) str | None[source]

Convert inchi to smiles using rdkit.

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.convert_smiles_to_inchi(smiles: str) str | None[source]

Convert smiles to inchi using rdkit.

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.is_valid_inchi(inchi: str) bool[source]

Return True if input string is valid InChI.

This functions test if string can be read by rdkit as InChI. Requires conda package rdkit to be installed.

Parameters:

inchi – Input string to test if it has format of InChI.

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.is_valid_inchikey(inchikey: str) bool[source]

Return True if string has format of inchikey.

Parameters:

inchikey – Input string to test if it format of an inchikey.

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.is_valid_smiles(smiles: str) bool[source]

Return True if input string is valid smiles.

This functions test if string can be read by rdkit as smiles. Requires conda package rdkit to be installed.

Parameters:

smiles – Input string to test if it can be imported as smiles.

matchms.filtering.filter_utils.smile_inchi_inchikey_conversions.mol_converter(mol_input: str, input_type: str, output_type: str) str | None[source]

Convert molecular representations using rdkit.

Convert from “smiles” or “inchi” to “inchi”, “smiles”, or “inchikey”. Requires conda package rdkit to be installed.

Parameters:
  • mol_input – Input data in “inchi” or “smiles” molecular representation.

  • input_type – Define input type: “smiles” for smiles and “inchi” for inchi.

  • output_type – Define output type: “smiles”, “inchi”, or “inchikey”.

  • Returns

  • --------

  • occurs. (Mol string in output type or None when conversion failure) –