export similarity searches output

User e34a92cce5

06-04-2005 15:13:51

Hi,


I was wondering if the exporter class can be used to generate an SDF output of a similarity search that captures the similarity threshold and other parameters that appears in the search results output. So then my sdf output would have a metatag for <similarity>


Thanks!

ChemAxon 9c0afc9aaf

07-04-2005 15:27:26

Hi,





Currently it's not possible to do with Exporter.





You can achieve this though by using some lower level API:





1. After a search you have a list of cd_id and similarity values.





2. Start to fetch all cd_structure fields (by cd_id value)


Use DatabaseTools.readBytes() for maximum compatibility:





http://www.jchem.com/doc/api/chemaxon/util/DatabaseTools.html#readBytes(java.sql.ResultSet,%20int)





3. You can convert bytes to a Molecule with :





new MolHandler(bytes).getMolecule()





4. Set the similarity value as an SDF property for the Molecule with:





http://www.jchem.com/doc/api/chemaxon/struc/Molecule.html#setProperty(java.lang.String,%20java.lang.String)





5. You can write the structures to the export file by using MolExporter:





http://www.jchem.com/doc/api/chemaxon/formats/MolExporter.html





In the long term we plan to enable Exporter to export field from other tables, so it will be possible for you to insert the similarity values into a temporary table, and Exporter can fetch the values from there.


(in this case less programming will be needed)





Best regards,





Szilard