My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

MX - Essential Cheminformatics

This site is no longer maintained. For the most up-to-date documentation and news on MX, visit http://metamolecular.com/mx .

Summary

MX is a suite of lightweight, general-purpose cheminformatics tools for building chemistry applications.

Fully-implemented features include:

  • Substructure Search/Mapping
  • Depth-first Traversal
  • Molfile Reader/Writer
  • Structure Data File (SD File) Reader/Writer
  • Implicit Hydrogen Detection
  • Complete System of Atomic Masses and Isotopes Linked to the Primary Literature
  • Exhaustive Ring Perception

Partially-implemented features include:

  • SMILES Parser

Features currently in-progress include:

  • Binary Fingerprint Generation

Example

import com.metamolecular.mx.calc.MassCalculator;
import com.metamolecular.mx.io.daylight.SMILESReader;
import com.metamolecular.mx.map.DefaultMapper;
import com.metamolecular.mx.model.Molecule;

public class Example
{
  public static void main(String[] args)
  {
    Molecule benzene = SMILESReader.read("C1=CC=CC=C1");
    Molecule naphthalene = SMILESReader.read("C1=CC=C2C=CC=CC2=C1");
    DefaultMapper mapper = new DefaultMapper(benzene);
    
    System.out.println(mapper.hasMap(naphthalene)); // true
    System.out.println(mapper.countMaps(naphthalene)); // 24
    
    MassCalculator calc = new MassCalculator();
    
    System.out.println(calc.findAveragedMass(naphthalene)); // 128.17052
  }
}

Background

MX was originally part of ChemWriter, the 2D chemical structure editor developed by Metamolecular, LLC. It was subsequently used to create ChemPhoto, the 2D chemical structure imaging application. The MX library was factored out of these applications, and is now offered to the cheminformatics community under the flexible MIT License.

Using MX With Scripting Languages

MX can be used directly in both Python and Ruby through the Jython and JRuby implementations. Because it's written in Java, MX can automatically be used in a variety of other scripting languages as well.

MX in Jython:

Jython 2.5b0 (trunk:5540, Oct 31 2008, 13:55:41) 
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.5.0_16
>>> import sys
>>> sys.path.append("mx-0.106.0.jar")
>>> from com.metamolecular.mx.io import Molecules
>>> benzene = Molecules.createBenzene()
>>> benzene.countAtoms()
6

MX in JRuby:

irb(main):001:0> require 'mx-0.106.0.jar'
=> true
irb(main):002:0> import com.metamolecular.mx.io.Molecules
=> Java::ComMetamolecularMxIo::Molecules
irb(main):003:0> benzene = Molecules.createBenzene
=> #<Java::ComMetamolecularMxModel::DefaultMolecule:0x9770a3 @java_object=com.metamolecular.mx.model.DefaultMolecule@1536eec>
irb(main):004:0> benzene.countAtoms
=> 6

Resources

Powered by Google Project Hosting