/** * Generate InChI for a given atom container.<BR> * Take current user's home directory as temporary dir.<BR> * Overloads {@linkplain #generateInchi(org.openscience.cdk.interfaces.IAtomContainer, String)} * * @param molfile * @return InChI generated from Molfile * @throws java.io.IOException * @throws org.openscience.cdk.exception.CDKException */ public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
@Override public InChI generate(IAtomContainer container) throws CDKException { try { return new StdInChIGenerator().generateInchi(container); } catch (CDKException e) { throw new CDKException("Could not generate InChI", e); } catch (IOException e) { throw new CDKException("Could not generate InChI", e); } } }
public static void main(String[] args) throws Exception { StdInChIParser parser = new StdInChIParser(); IAtomContainer m = parser.parseInchi("InChI=1S/C2H6/c1-2/h1-2H3"); for (int i = 0; i < 10; i++) { StdInChIGenerator gen = new StdInChIGenerator(); gen.generateInchi(m); } }