error importing simple smiles reaction and molecules

User 56c4fc7140

12-06-2007 17:31:03

Hi,





I receive the following exception when trying to create a molecule from a smiles string using MolImporter.importMol(smilesString) where smilesString = {C[C:1](=[O:2])[OH:3]>>CC(=O)OCC, CN, anything actually}... the exception message is "Cannot import cxsmiles format".





context:


I'm trying to create an mdocument instance using a molecule instance. But I can't even instantiate a simple molecule.


...


Molecule mol = MolImporter.importMol("CN");


MDocument doc = mol.getDocument();


if(doc==null)


doc = MDocument(mol);


...





thanks!

User f359e526a1

13-06-2007 16:14:20

Hello, why do you need the


Code:
MDocument doc = mol.getDocument();


if(doc==null) {


    doc = MDocument(mol);


}





part, when


Code:



MDocument doc = new MDocument(MolImporter.importMol("CN"));





would suffice? Could you please show a longer part of the code as it is loading the molecule for me without problems.

User 56c4fc7140

13-06-2007 16:58:34

Hi,





I'm instantiating and manipulating the molecule somewhere else before this line of code. But I just need to place the jars in the sjars in my classpath. That particular line of code now works. The offending 'missing' class was CxSmilesFormat...





Thanks!