private IAtomContainer parseSmiles(String smiles, boolean isRxnPart) throws InvalidSmilesException {
try {
Set<String> warnings = new HashSet<>();
Graph g = Graph.parse(smiles, strict, warnings);
for (String warning : warnings)
logger.warn(warning);
IAtomContainer mol = beamToCDK.toAtomContainer(kekulise ? g.kekule() : g,
kekulise);
if (!isRxnPart) {
try {
parseMolCXSMILES(g.getTitle(), mol);
} catch (Exception e) {
e.printStackTrace();
throw new InvalidSmilesException("Error parsing CXSMILES:" + e.getMessage());
}
}
return mol;
} catch (IOException e) {
throw new InvalidSmilesException("could not parse '" + smiles + "', " + e.getMessage());
} catch (Exception e) {
throw new InvalidSmilesException("could not parse '" + smiles + "'");
}
}