Closed bmiles closed 5 years ago
Working example here https://runkit.com/bmiles/runkit-npm-rdkit
I am not familiar enough with the project to explain the internals, but I have seen examples that include await RDKit.load()
. The following seems to work.
const RDKit = require('rdkit');
await RDKit.load();
var my_mol = "COc1ccc(CCN(C(=O)CCCBr)C2c3cc(NC(C)=O)c([N+](=O)[O-])cc3OC(C)(C)C2O)cc1";
var mol = RDKit.Mol.fromSmiles(my_mol);
mol.getNumAtoms();
I am not familiar enough with the project to explain the internals, but I have seen examples that include
await RDKit.load()
. The following seems to work.const RDKit = require('rdkit'); await RDKit.load(); var my_mol = "COc1ccc(CCN(C(=O)CCCBr)C2c3cc(NC(C)=O)c([N+](=O)[O-])cc3OC(C)(C)C2O)cc1"; var mol = RDKit.Mol.fromSmiles(my_mol); mol.getNumAtoms();
That works, thanks @JCorson
Error below when executing script in command line:
Script below launched in the terminal with node js
node application.js
If I open up a node js REPL and copy and paste in the script it works just fine. Any idea where this
bindings.SmilesToMol(
issue is arising?