Older version

User e7455c8684

22-04-2008 21:44:37

Is there any way to import a "smarts" string as a smarts in older version?


We are still using older version of JChem, but found a lot of problems with MolImporter.importMol(smiles). Upgrading is not an option right now, I think.

User e7455c8684

22-04-2008 22:20:12

it seems this works fine without using new feature from 5.0, just FYI


Code:



MolHandler mh = new MolHandler("[c:1][c:2]CC",true);


Molecule mol = mh.getMolecule();


ChemAxon a3d59b832c

23-04-2008 09:35:50

Yes, you should import that way from smarts. Alternatively, you could use:





mol = MolImporter.importMol(smarts_expression, "smarts", null)





http://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/formats/MolImporter.html#importMol(java.lang.String,%20java.lang.String,%20java.lang.String)





Best regards,


Szabolcs

User e7455c8684

23-04-2008 13:38:45

Older version I mean JChem 3.2.11, which I cannot find this function.
Szabolcs wrote:
Yes, you should import that way from smarts. Alternatively, you could use:





mol = MolImporter.importMol(smarts_expression, "smarts", null)





http://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/formats/MolImporter.html#importMol(java.lang.String,%20java.lang.String,%20java.lang.String)





Best regards,


Szabolcs

ChemAxon a3d59b832c

23-04-2008 13:55:38

You are right, the only way in that version is to use MolHandler or instantiate MolImporter and set the import format to "smarts" or query mode to true on the instance:





http://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/formats/MolImporter.html#setOptions(java.lang.String)


http://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/formats/MolImporter.html#setQueryMode(boolean)





Thanks,


Szabolcs