rdkit-js icon indicating copy to clipboard operation
rdkit-js copied to clipboard

It is not possible to obtain an InChI Key from a molecule with the same options as in Python

Open BenoitClaveau opened this issue 11 months ago • 1 comments

Is your feature request related to a problem? Please describe. It seems that it is not possible to obtain an InChI Key from a molecule with the same options as in Python.

Describe the solution you'd like In python I can pass options in MolToInchiKey

from rdkit.Chem import MolToInchiKey, SmilesParserParams, MolFromSmiles

params = SmilesParserParams()
params.removeHs = True
mol = MolFromSmiles(smiles, params)
inchi_key = MolToInchiKey(mol, options="-FixedH") 

In javascript not.

import initRDKitModule, { JSMol, RDKitModule } from "@rdkit/rdkit";

export const rdkit: RDKitModule = await initRDKitModule();

const mol = rdkit.get_mol(smiles, JSON.stringify({ removeHs: true }));
const inchiKey = rdkit.get_inchikey_for_inchi(mol.get_inchi());

Describe alternatives you've considered I want to pass the same options

BenoitClaveau avatar Mar 12 '24 15:03 BenoitClaveau

@BenoitClaveau I will expose the standard InChI options to JS, I can see how that can be useful.

ptosco avatar Mar 12 '24 16:03 ptosco