Giter Club home page Giter Club logo

viatropos-mol-parser's Introduction

This repository is a mirror of the component module viatropos/mol-parser. It has been modified to work with NPM+Browserify. You can install it using the command npm install npmcomponent/viatropos-mol-parser. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to npmcomponent.

Mol Parser

Installation

node.js:

npm install mol-parser

browser:

component install viatropos/mol-parser

Example

var mol = require('mol-parser');
var glucose = mol(theStringBelow);

input:

1772-03-8.mol
  ChemDraw06210908192D

 12 11  0  0  0  0  0  0  0  0999 V2000
   -1.8563   -0.3572    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0313   -0.3572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.6187    0.3572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0313    1.0717    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.2062    0.3572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.6187    1.0717    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.6187   -0.3572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.2062   -1.0717    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.4437   -0.3572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.8563   -1.0717    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.8563    0.3572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.4437    1.0717    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0      
  2  3  1  0      
  3  4  1  6      
  3  5  1  0      
  5  6  1  1      
  5  7  1  0      
  7  8  1  1      
  7  9  1  0      
  9 10  1  1      
  9 11  1  0      
 11 12  1  0      
M  END

output:

{ nodes:
   [ { x: -1.8563, y: -0.3572, z: 0, symbol: 'O' },
     { x: -1.0313, y: -0.3572, z: 0, symbol: 'C' },
     { x: -0.6187, y: 0.3572, z: 0, symbol: 'C' },
     { x: -1.0313, y: 1.0717, z: 0, symbol: 'O' },
     { x: 0.2062, y: 0.3572, z: 0, symbol: 'C' },
     { x: 0.6187, y: 1.0717, z: 0, symbol: 'O' },
     { x: 0.6187, y: -0.3572, z: 0, symbol: 'C' },
     { x: 0.2062, y: -1.0717, z: 0, symbol: 'O' } ],
  edges:
   [ { source: 0, target: 1, count: 2 },
     { source: 1, target: 2, count: 1 },
     { source: 2, target: 3, count: 1 },
     { source: 2, target: 4, count: 1 },
     { source: 4, target: 5, count: 1 },
     { source: 4, target: 6, count: 1 },
     { source: 6, target: 7, count: 1 },
     { source: 6, target: 8, count: 1 },
     { source: 8, target: 9, count: 1 },
     { source: 8, target: 10, count: 1 },
     { source: 10, target: 11, count: 1 } ],
  name: '1772-03-8.mol',
  program: 'ChemDraw06210908192D' }

Notes

  • MIME type: chemical/x-mdl-molfile

Licence

MIT

viatropos-mol-parser's People

Contributors

lancejpollard avatar airportyh avatar

Watchers

James Cloos avatar npm <3 component 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.