rdkit / rdkit-js

A powerful cheminformatics and molecule rendering toolbelt for JavaScript, powered by RDKit .
https://rdkitjs.com
BSD 3-Clause "New" or "Revised" License
130 stars 35 forks source link

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

Open BenoitClaveau opened 3 months ago

BenoitClaveau commented 3 months ago

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

ptosco commented 3 months ago

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