• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Dockerfile
  • License
    BSD 3-Clause "New...
  • Created over 3 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A powerful cheminformatics and molecule rendering toolbelt for JavaScript, powered by RDKit .


rdkit.js - Project Logo

A powerful cheminformatics and molecule rendering toolbelt for JavaScript


NPM Latest Version
NPM Weekly Downloads NPM Monthly Downloads NPM Yearly Downloads NPM Total Downloads
Build Status License DOI


Explore the docs Β»

Report Bug Β· Request Feature Β· Star Repository


Resources URL Contributor(s)
JavaScript Examples rdkitjs.com @greglandrum , @MichelML
React.js Examples react.rdkitjs.com @MichelML
Vue.js Examples vue.rdkitjs.com @adam-of-barrot, @MichelML
Angular.js Examples angular.rdkitjs.com @Phil-DS
Next.js Examples source code @bugzpodder
Node.js Examples source code @adam-of-barrot
API Docs docs.rdkitjs.com @adam-of-barrot, @MichelML
WASM Module source code @ptosco

space-1.jpg
Molecule Rendering Examples

Table of contents

Introduction

RDKit.js is a powerful cheminformatics and molecule rendering toolbelt for JavaScript.

It is the official JavaScript distribution of cheminformatics functionality from the RDKit - a C++ library for cheminformatics.

The project is leveraging web assembly to rollout a subset of the RDKit functionality that is relevant in any javascript context. The WASM module bundled with this package is compiled directly from the RDKit source code.

The functionality included in RDKit.js is decided by the RDKit core team and its community. Thus, if you use this package, your voice matters.

What is the scope of this repository

This repository is currently dedicated to:

  1. NPM builds and releases of the RDKit core wasm module
  2. Website deployment of examples using the RDKit core wasm module in JavaScript and web frameworks
  3. Any additional functionalities built on top of the RDKit core wasm module.

The scope of the project may change over time.

What is NOT the scope of this repository

Any changes to the core RDKit wasm module (also known as RDKit's MinimalLib) is out of scope of this project.

To contribute or keep track of the changes to the core RDKit wasm module, go here.

Install

npm i @rdkit/rdkit
# or yarn add @rdkit/rdkit

Usage

Using RDKit.js package assets

Option 1: Use the npm package distribution files

Once you have the RDKit package installed in your node modules, copy the following distribution files anywhere in your deployed assets.

  • node_modules/@rdkit/rdkit/dist/RDKit_minimal.js
  • node_modules/@rdkit/rdkit/dist/RDKit_minimal.wasm

NOTE: By default, both files must be copied at the same location in your deployed assets for the library to work properly. If you need the RDKIT_minimal.wasm file to be loaded from another location, use the locateFile option when invoking initRDKitModule.

// Load the RDKit WASM module from a specific path on your server.
window.initRDKitModule({ locateFile: () => '/path/to/RDKit_minimal.wasm' }).then(/* ... */);

Option 2: Use the remote distribution files from unpkg.com

  • https://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.js
  • https://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.wasm

Running RDKit.js in your JavaScript code

To use RDKit.js, load the javascript file and instantiate the wasm module inside the head tag of your index.html, before you run your application code:

<head>
  <!-- ...other files and HTML tags... -->
  <!-- Load the RDKit JS file -->
  <script src="https://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.js"></script>

  <!-- Instantiate the WASM module. The inline script below could live elsewhere inside your application code. -->
  <script>
    window
      .initRDKitModule()
      .then(function (RDKit) {
        console.log("RDKit version: " + RDKit.version());
        window.RDKit = RDKit;
        /**
         * The RDKit module is now loaded.
         * You can use it anywhere.
         */
      })
      .catch(() => {
        // handle loading errors here...
      });
  </script>
  <!-- ...your application code goes here... -->
</head>

Using RDKit.js with JavaScript

It is recommended to go through all the JavaScript examples available on the official website rdkitjs.com.

Source code

Using RDKit.js with React.js

If you are using React.js, several additional examples using React.js are available at react.rdkitjs.com.

Source code

Using RDKit.js with Next.js

If you are using Next.js, you can use a modified webpack config to build your app.

Source code

Using RDKit.js with Vue.js

If you are using Vue.js, several additional examples using Vue.js are available at vue.rdkitjs.com.

Source code

Using RDKit.js with Angular

If you are using Angular, several additional examples using Angular are available at angular.rdkitjs.com.

Source code

Usage in TypeScript

To see how to use RDKit.js with TypeScript, please go through the walkthrough here.

The full documentation related to type definitions is at docs.rdkitjs.com.

Note: This is still at an experimental stage.

Contributing

You are welcome to contribute to any GitHub issue currently open.

You are also welcome to log any issue or start a discussion on any topic related to RDKit.js.

To contribute to the plain javascript examples, read this sub-repository README.

To contribute to the React.js examples, read this sub-repository README.

To contribute to the Vue.js examples, read this sub-repository README.

To contribute to the Angular.js examples, read this sub-repository README.

Release process

NPM releases are currently semi-automated with the following azure pipeline:

https://dev.azure.com/rdkit-js/rdkit-js/_build?definitionId=1

Here are the guidelines to respect when releasing a new version of the package:

  1. Always release a new package from the master branch
  2. Use the following commit message format: "RDKit release <version of the main rdkit release>"

Example commit message: "RDKit release 2022.3.3-1.0.0"

  1. In Azure pipeline parameters, specify the RDKit version with underscores seperating major, minor, and patch version

Example: 2022_03_3

  1. In Azure pipeline parameters, specify the semver version with dots seperating major, minor, and patch version

Example: 1.0.0

  1. If you are releasing an official release, do not forget to uncheck the Is beta? checkbox in the Azure pipeline parameters.

Important note on npm versioning

The scope of this repository goes beyond the release of the RDKit wasm core module. Other utilities may eventually be included on top of the core module in the RDKit.js npm release.

Because of that, we need a versioning system that will keep track of

  1. The RDKit wasm core module version (exact match with its parent RDKit release)
  2. Multiple npm release versions that can be published on top of a same wasm core module version.

With this in mind, we will attempt the following versioning scheme of the package:

  1. For each RDKit release, a new version of the npm package will be released as -.

    Example: when the 2022.03.3 version of RDKit is released, its first NPM release will be 2022.03.3-1.0.0.

  2. On each subsequent npm release using the same core module, only the semver version will be modified according to semver conventions.

    Example: when a bug fix is made in a React component built on top of RDKit for version 2022.03.3, a new npm release 2022.03.3-1.0.1 will be published. Example: when a new React component is built on top of RDKit for version 2022.03.3, a new npm release 2022.03.3-1.1.0 will be published.

Website deployment

Website deployments for rdkitjs.com are automated via Vercel for each commit merged or pushed to the master branch.

Live demo URLs are also generated on each pull requests made to easily visualize changes before merging.

Maintainers

  • Michel Moreau @MichelML & the RDKit community

More Repositories

1

rdkit

The official sources for the RDKit library
HTML
2,632
star
2

rdkit-tutorials

Tutorials to learn how to work with the RDKit
Jupyter Notebook
191
star
3

mmpdb

A package to identify matched molecular pairs and use them to predict property changes.
Python
157
star
4

UGM_2020

Materials from the (virtual) 2020 RDKit UGM
Jupyter Notebook
51
star
5

django-rdkit

Python
51
star
6

conda-rdkit

Conda build recipe for the rdkit
C
46
star
7

UGM_2022

Materials from the 2022 UGM
Jupyter Notebook
42
star
8

homebrew-rdkit

Homebrew formula for rdkit
Ruby
40
star
9

UGM_2021

Materials from the (virtual) 2021 RDKit UGM
Jupyter Notebook
40
star
10

RDKitjs-legacy

Obsolete codebase, please do not use.
HTML
32
star
11

CheTo

CheTo - Chemical Topic Modeling
Jupyter Notebook
31
star
12

UGM_2016

Materials from the 2016 RDKit UGM
Jupyter Notebook
29
star
13

neo4j-rdkit

Java
26
star
14

shape-it

Updated version of Silicos-it's shape-based alignment tool
C++
26
star
15

knime-rdkit

The RDKit nodes for the KNIME Analytics Platform
Java
25
star
16

PREFER

Python
24
star
17

AutomatedSeriesClassification

Jupyter Notebook
22
star
18

rdkit-orig

Older clone of the RDKit subversion repository at http://sourceforge.net/projects/rdkit/
C++
22
star
19

benchmarking_platform

Python
22
star
20

rdkit-structure-renderer

JavaScript package for interactive rendering of 2D chemical structures in the browser.
HTML
18
star
21

mongo-rdkit

GSoC 2020 project to integrate the RDKit and MongoDb
Python
16
star
22

UGM_2019

HTML
15
star
23

org.rdkit.lucene

Lucene Chemical Index based on RDKit functionality.
Java
12
star
24

OCEAN

OCEAN - Optimized Cross rEActivity estimatioN
JavaScript
11
star
25

lmnb

LaplacianNB is a Python module developed at Novartis AG for Naive Bayes classifier for laplacian modified models based on scikit-learn Naive Bayes implementation.
Python
11
star
26

UGM_2013

9
star
27

rdkit_containers

Containers for building and working with the RDKit
Dockerfile
8
star
28

UGM_2015

Materials from the 2015 RDKit UGM
HTML
7
star
29

UGM_2014

Materials from the 2014 RDKit UGM
JavaScript
7
star
30

UGM_2017

2017 RDKit UGM
Jupyter Notebook
5
star
31

UGM_2023

Materials from the 2023 RDKit UGM
1
star
32

rdkit-build-helpers

Recipes to build RDKit artifacts (e.g., Java and C# libraries, NuGet packages) and some usage examples
C#
1
star