partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

export smiles #235

Closed TangTangJia closed 3 years ago

TangTangJia commented 3 years ago

Thanks for your contribution !

I want to export smiles , but it's always export empty. I try to export 'cml' and it works.

const Kekule = require('kekule')
const mol = new Kekule.Molecule()
const smiles = Kekule.IO.saveFormatData(mol, 'smi')
console.log('SMILES: ', smiles)
niuzhenjiang commented 3 years ago

let molecule = composer.getChemObj(); smiles_data = Kekule.IO.saveFormatData(molecule, 'smi'); console.log(smiles_data)

TangTangJia commented 3 years ago

let molecule = composer.getChemObj(); smiles_data = Kekule.IO.saveFormatData(molecule, 'smi'); console.log(smiles_data)

thanks for your answer, it works!