Code Monkey home page Code Monkey logo

rdkitjs-legacy's Introduction

rdkitjs-legacy's People

Contributors

bmiles avatar cheminfo-bot avatar gmrandazzo avatar greglandrum avatar lpatiny avatar targos avatar thegodone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rdkitjs-legacy's Issues

cannot create molecule from pickle

implementation of molfrompickle done but issue to convert the moltobinary back to molecule using this function. 4879a12

we try to reproduce this python code

The RDKit pickle format is fairly compact and it is much, much faster to build a molecule from a pickle than from a Mol file or SMILES string, so storing molecules you will be working with repeatedly as pickles can be a good idea.

The raw binary data that is encapsulated in a pickle can also be directly obtained from a molecule:

binStr = m.ToBinary()
This can be used to reconstruct molecules using the Chem.Mol constructor:

m2 = Chem.Mol(binStr)
Chem.MolToSmiles(m2)
'c1ccncc1'
len(binStr)
123
len(pkl)
475

Substructure/similarity search functions?

I might be missing something, but the substructure and similarity functionality does not seem to be exposed in the current version of RDKitjs (it was accessible in the old version). Do you have plans to add this in the near future?

TypeError: bindings.SmilesToMol is not a function

Error below when executing script in command line:

/Users/ben/node_modules/RDKit/lib/Mol.js:183
        bindings.SmilesToMol(
                 ^

TypeError: bindings.SmilesToMol is not a function
    at Function.fromSmiles (/Users/ben/node_modules/RDKit/lib/Mol.js:183:18)
    at atoms (/Users/ben/Documents/dev/comp_chem/rdkitjs/application.js:6:23)
    at Object.<anonymous> (/Users/ben/Documents/dev/comp_chem/rdkitjs/application.js:13:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)

Script below launched in the terminal with node js node application.js

// applications.js
const RDKit = require('RDKit');
var my_mol = "COc1ccc(CCN(C(=O)CCCBr)C2c3cc(NC(C)=O)c([N+](=O)[O-])cc3OC(C)(C)C2O)cc1";

function atoms(smi) {
  var mol = RDKit.Mol.fromSmiles(smi);
  var num_atoms = mol.getNumAtoms();
  console.log( num_atoms );
}

atoms(my_mol)

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?

Cannot import the module with require('rdkit')

I wanted to test the library (would be really cool to have RDKit in the browser!), but unfortunately was unable to get it to work. I am using what I assume is the latest version (0.5.1) from npm.

When I execute the following code:

const RDKit = require('rdkit'); // using 'rdkit' because 'RDKit' from the README did not work for me

I am getting the following error:

TypeError: rdkit.wast is not a valid URL.

Callstack:

locateFile rdkit.js:21
    integrateWasmJS rdkit.js:63
    rdk rdkit.js:63
    js rdkit.js:77
    __WEBPACK_AMD_DEFINE_RESULT__ rdkit.js:52
    js rdkit.js:53
    js rdkit.js:59
    js 1.chunk.js:289967
    Webpack 28

Relevant code bit:

  18 | var path = getCurrentPathBrowser();
  19 | var Module = {
  20 |   locateFile(url) {
> 21 |     return new URL(url, path).href;
     | ^  22 |   },
  23 |   onRuntimeInitialized() {
  24 |     resolve();

Any idea? Thanks!

Proposed API

var molecule=RDK.Molecule.fromSmiles();
var molecule=RDK.Molecule.fromMolfile();
var smiles=molecule.toSmiles();
var molfile=molecule.toMolfile(v3000);

  • by default: v2000, v3000 true / false

var logP=RDK.Descriptors.logP(molecule);

Fingerprints ?
Minimisation ?

general comment on rdkit

The port of the python part is always more difficult ... we need to find a process for pure python code.

Compilation test pickle failed with RDKit 2018.09.1

after adding in compiler.js
'libRDKitDepictor.so',
'libRDKitcoordgenlib.so',
'libRDKitmaeparser.so',

and changing deps to 2018.09.1 there is an issue with pickle testcase:

FAIL tests/rdchem/pickle.js
โ— Console

console.log __tests__/rdchem/pickle.js:10
  mol from Smiles
console.log __tests__/rdchem/pickle.js:12
  toPickle
console.log __tests__/rdchem/pickle.js:15
  type of toPickle
console.log lib/Mol.js:52
  fromPickle
console.log lib/Mol.js:53

โ— from and to pickle

Error
  6070248 thrown

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.