Structure search using Marvin applet as editor

User dfeb81947d

05-07-2004 15:59:52

Hello,





I use Marvin Applet 3.3.0 as editor I make a substructure search.


Molfile is send to a servlet as a String with MDL Molfile format which send it to an Object which process the search as:





Code:
public ArrayList getMoleculeIdsByStructureViaJCHEM(String molfile, String type, Connection conn, String tableName) {


   ArrayList list=new ArrayList();


   try{


      int searchType = SearchConstants.SUBSTRUCTURE;


      if (type.equals("similarity")) {


         searchType = SearchConstants.DISSIMILARITY;


      }


      if (type.equals("exact")) {


         searchType = SearchConstants.EXACT;


      }


      String structureTableName =  tableName;


      JChemSearch searcher = new JChemSearch();


      searcher.setStructureCaching(true);


      ConnectionHandler ch = null;


      ch = new ConnectionHandler();


      ch.setConnection(conn);


      searcher.setQueryStructure(molfile);


      searcher.setConnectionHandler(ch);


      searcher.setStructureTable(structureTableName);


      searcher.setSearchType(searchType);


      if (searchType == SearchConstants.DISSIMILARITY) {


         searcher.setDissimilarityThreshold(treshold);


      }


      searcher.setWaitingForResult(true);


      searcher.setResultTableMode(DatabaseSearch.NO_RESULT_TABLE);


      searcher.setMaxResultCount(0);


      searcher.run();


      for (int i = 0; ((i<searcher.getResultCount())); i++) {


         list.add((new Integer(searcher.getResult(i))).toString());


      }


      searcher=null;


   } catch (MaxSearchFrequencyExceededException he){


      he.printStackTrace();


   }


   return list;


}






But the use of "Any" Atom, of Bond gives an error for the substructure search. Does the use of the Atom or Bond query does not work with MDL molfile as structure query?





with following exception:


Quote:
ava.lang.ArrayIndexOutOfBoundsException


at java.lang.System.arraycopy(Native Method)


at chemaxon.sss.screen.ScreenMol.ringcalculation(ScreenMol.java:431)


at


chemaxon.sss.screen.ScreenGraph.getFingerprint(ScreenGraph.java:77)


at


chemaxon.util.MolHandler.getFingerprintInBytes(MolHandler.java:392)


at


chemaxon.jchem.db.DatabaseSearch.getFingerprint(DatabaseSearch.java:779)


at


chemaxon.jchem.db.DatabaseSearch.init(DatabaseSearch.java:378)


at


chemaxon.jchem.db.DatabaseSearch.search1(DatabaseSearch.java:1542)


at


chemaxon.jchem.db.DatabaseSearch.search(DatabaseSearch.java:1861)


at


chemaxon.jchem.db.JChemSearch.setRunning(JChemSearch.java:777)


at chemaxon.jchem.db.JChemSearch.run(JChemSearch.java:796)
Does MDL molfile support atom or bond query?


Do I need to use Smart molecule format instead?


Will I loose informations in using Smart instead of MDL molfile (for example stereochemistry) for sending the structure to the servlet?

ChemAxon 9c0afc9aaf

06-07-2004 14:33:21

Hi Jacques,





I think you are using a relatively old version of JChem.


(please always report the version)





I have checked the latest stable release (version 2.2.1), and it has no problems with any atoms, or any bonds.


You can also try it at:





http://www.jchem.com/examples/jsp1_x/index.jsp





I suggest you to upgrade your JChem version.








For the other questions:





Q: "Does MDL molfile support atom or bond query?"





A: Yes, it supports both.


Please see http://www.chemaxon.com/marvin/doc/dev/formats.html for further information and links on formats.








Q: "Do I need to use Smart molecule format instead?"





A: There is no need to use SMARTS. (Of course you can use it, if you wish.)








Q: "Will I loose informations in using Smart instead of MDL molfile (for example stereochemistry) for sending the structure to the servlet?"





A: These formats can store a bit different set of stereochemical informations, although the common stereo features (double-bond stereo, chirality, etc.) are present in both, and preserved during JChem transformations.

User dfeb81947d

07-07-2004 13:52:50

Thank you very much.


I actually use JChem 2.1.


I'll upgrade version of Jchem later.


So for a mol query, using either molfile or Smart is the same.


Query bonds and query atoms are both indicated in the String...


Thank you for these informations.