Coder Social home page Coder Social logo

hasihays / kekule.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from partridgejiang/kekule.js

0.0 0.0 0.0 108.9 MB

A Javascript cheminformatics toolkit.

Home Page: http://partridgejiang.github.io/Kekule.js

License: MIT License

JavaScript 67.67% Ruby 0.01% Python 0.17% PHP 2.01% R 0.03% CSS 5.26% Makefile 0.08% HTML 24.78% Limbo 0.01% EJS 0.01%

kekule.js's Introduction

Kekule.js

Kekule.js is an open source JavaScript toolkit for chemoinformatics released under MIT license. It can be used in both web applications and node applications to read, write, display and edit chemical objects (e.g. molecules) and to perform some chemical algorithms (e.g. molecule structure comparing, searching, aromatic detection).

More details about this project can be found in Kekule.js website.

Installation

For web applications, Kekule.js can be used in a traditional way by simply including it in the HTML page with <script> tag:

<script src="kekule.js?module=io,chemWidget,algorithm"></script>

Note the module param after "?". In the example above, module io, chemWidget and algorithm, as well as other prerequisite modules will be loaded.

If widget or chem widget modules are used, additional style sheet file also need to be linked in HTML page:

<link rel="stylesheet" type="text/css" href="themes/default/kekule.css" />

The whole package can also be installed by npm in both web and node applications:

$ npm install kekule

In Node or Webpack environment, the Kekule namespace should be imported into the application:

var Kekule = require('kekule').Kekule;

After installation (in web or in node.js environment), you can run a small test to ensure that the toolkit works properly:

// Create a simple CO2 molecule
var mol = new Kekule.Molecule();
var atomC = mol.appendAtom('C');
var atomO1 = mol.appendAtom('O');
var atomO2 = mol.appendAtom('O');
mol.appendBond([atomC, atomO1], 2);
mol.appendBond([atomC, atomO2], 2);

// Get formula
var formula = mol.calcFormula();
console.log('Formula: ', formula.getText());

// Output SMILES (IO module should be loaded in web application)
var smiles = Kekule.IO.saveFormatData(mol, 'smi');
console.log('SMILES: ', smiles);

// Output MOL2k (IO module should be loaded in web application)
var mol2k = Kekule.IO.saveFormatData(mol, 'mol');
console.log('MOL 2000: \n', mol2k);

Dynamic Module Loading

The Kekule.js package is divided into several independent modules. Instead of loading all of them at the beginning, a dynamic loading approach can be used for better performance in both web and Node environment. For example:

Kekule.modules(['algorithm', 'calculation'], function(error) {
    if (!error)
    {
        // algorithm and calculation modules loaded successfully, functions can be used now.
    }
});

Documentations and Demos

A set of tutorials and demos are built to explain the basic operations in Kekule.js (e.g. creating molecule, loading and saving chemical objects, getting molecule information and usage of chem widgets).

The full API documents can be found here.

License

The toolkit is released under MIT license.

kekule.js's People

Contributors

partridgejiang avatar dependabot[bot] avatar aaronllanos avatar imgbotapp avatar mrdarkhorse avatar idouble avatar jjwill avatar

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.