@cript-web/bigsmiles-toolkit
v1.1.1
Published
JavaScript parser and serializer for BigSMILES line notation.
Downloads
18
Readme
BigSMILES Tookit
JavaScript* parser and serializer for BigSMILES line notation.
* basic TS typings are provided (*.d.ts), but they're just there to provide Typescript compatibility.
Usage
First, you need to install the package and RDKit (the later may be optional depending on the functions you'll use)
npm i @cript-web/bigsmiles-toolkit @rdkit/rdkit
Then import the package and RDKit it in your code:
import * as toolkit from "@cript-web/bigsmiles-toolkit";
import RDKit from '@rdkit/rdkit';
Finally, you can use the library. Below, an example to convert a BigSMILES to a molblock.
// 2. Instantiate RDKit module (required to compute atom coordinates)
rdkit = await RDKit();
// 3. Use bigsmiles-toolkit to convert a bigsmiles string to a molblock
const bigsmiles = "...";
const molblock = toolkit.bigsmiles_to_molfile(rdkit, bigsmiles);
console.log(`${bigsmiles} converted to:\n${molblock}`);