use of org.openscience.cdk.smiles.SmilesParser in project MassBank-web by MassBank.
the class StructureToSvgStringGenerator method structureFromSMILES.
public static IAtomContainer structureFromSMILES(String smiles) {
IAtomContainer mol = null;
try {
// get atom container
SmilesParser smipar = new SmilesParser(DefaultChemObjectBuilder.getInstance());
mol = smipar.parseSmiles(smiles);
} catch (CDKException e) {
System.out.println("Warning: " + e.getLocalizedMessage());
}
return mol;
}
use of org.openscience.cdk.smiles.SmilesParser in project Smiles2Monomers by yoann-dufresne.
the class CDKMoleculesTests method setUp.
@Before
public void setUp() throws Exception {
this.testFile = new File("data_tests/pictureTest.png");
if (this.testFile.exists())
this.testFile.delete();
this.smiles = "c1ccccc1";
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
this.imol = null;
try {
this.imol = sp.parseSmiles(this.smiles);
} catch (InvalidSmilesException e) {
e.printStackTrace();
}
}
Aggregations