Skip to main content
added 99 characters in body
Source Link
Raven
  • 607
  • 3
  • 7

If you are willing to put a little programming effort into this you could have a look at the Chemistry Development Kit (CDK) that is easily capable of converting a SMILES string into a 2D render of the molecule.

An example (taken from here) that will produce the depiction as a PNG image looks like this:

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
import org.openscience.cdk.smiles.SmilesParser;
import java.awt.Color;
 
public class Main {
public static void main(String[] args) throws Exception {
    IChemObjectBuilder bldr   = SilentChemObjectBuilder.getInstance();
    SmilesParser       smipar = new SmilesParser(bldr);
 
    IAtomContainer mol = smipar.parseSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C");
    mol.setProperty(CDKConstants.TITLE, "caffeine");
 
    DepictionGenerator dptgen = new DepictionGenerator();
    // size in px (raster) or mm (vector)
    // annotations are red by default
    dptgen.withSize(200, 250)                 
          .withMolTitle()
          .withTitleColor(Color.DARK_GRAY);
    dptgen.depict(mol)
          .writeTo("~/caffeine.png");
}
}

The result can be seen here

If you are willing to put a little programming effort into this you could have a look at the Chemistry Development Kit (CDK) that is easily capable of converting a SMILES string into a 2D render of the molecule.

An example (taken from here) that will produce the depiction as a PNG image looks like this:

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
import org.openscience.cdk.smiles.SmilesParser;
import java.awt.Color;
 
public class Main {
public static void main(String[] args) throws Exception {
    IChemObjectBuilder bldr   = SilentChemObjectBuilder.getInstance();
    SmilesParser       smipar = new SmilesParser(bldr);
 
    IAtomContainer mol = smipar.parseSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C");
    mol.setProperty(CDKConstants.TITLE, "caffeine");
 
    DepictionGenerator dptgen = new DepictionGenerator();
    // size in px (raster) or mm (vector)
    // annotations are red by default
    dptgen.withSize(200, 250)                 
          .withMolTitle()
          .withTitleColor(Color.DARK_GRAY);
    dptgen.depict(mol)
          .writeTo("~/caffeine.png");
}
}

If you are willing to put a little programming effort into this you could have a look at the Chemistry Development Kit (CDK) that is easily capable of converting a SMILES string into a 2D render of the molecule.

An example (taken from here) that will produce the depiction as a PNG image looks like this:

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
import org.openscience.cdk.smiles.SmilesParser;
import java.awt.Color;
 
public class Main {
public static void main(String[] args) throws Exception {
    IChemObjectBuilder bldr   = SilentChemObjectBuilder.getInstance();
    SmilesParser       smipar = new SmilesParser(bldr);
 
    IAtomContainer mol = smipar.parseSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C");
    mol.setProperty(CDKConstants.TITLE, "caffeine");
 
    DepictionGenerator dptgen = new DepictionGenerator();
    // size in px (raster) or mm (vector)
    // annotations are red by default
    dptgen.withSize(200, 250)                 
          .withMolTitle()
          .withTitleColor(Color.DARK_GRAY);
    dptgen.depict(mol)
          .writeTo("~/caffeine.png");
}
}

The result can be seen here

Source Link
Raven
  • 607
  • 3
  • 7

If you are willing to put a little programming effort into this you could have a look at the Chemistry Development Kit (CDK) that is easily capable of converting a SMILES string into a 2D render of the molecule.

An example (taken from here) that will produce the depiction as a PNG image looks like this:

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
import org.openscience.cdk.smiles.SmilesParser;
import java.awt.Color;
 
public class Main {
public static void main(String[] args) throws Exception {
    IChemObjectBuilder bldr   = SilentChemObjectBuilder.getInstance();
    SmilesParser       smipar = new SmilesParser(bldr);
 
    IAtomContainer mol = smipar.parseSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C");
    mol.setProperty(CDKConstants.TITLE, "caffeine");
 
    DepictionGenerator dptgen = new DepictionGenerator();
    // size in px (raster) or mm (vector)
    // annotations are red by default
    dptgen.withSize(200, 250)                 
          .withMolTitle()
          .withTitleColor(Color.DARK_GRAY);
    dptgen.depict(mol)
          .writeTo("~/caffeine.png");
}
}