User 173254b396
10-04-2008 12:37:14
Hi,
I wonder what is the value of maximum level of recursion for cd_hash when a jchem table is created? I would like to match cd_hash with a hash code value of a compound generated by chemaxon.sss.screen.HashCode. I would think that it makes sense if the maximum level of recursion is the same.
Cheers, Péter
ChemAxon 9c0afc9aaf
10-04-2008 18:10:03
Hi Peter,
We use the HashCode.DEFAULT_RECURSION_LEVEL, which has a value of 4.
http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/screen/HashCode.html#DEFAULT_RECURSION_LEVEL
However things are a little bit more complicated, as we also use the information in the fingerprints to make the hash code yet a little more selective.
Please see the following methods where the fingerprint can also be specified:
http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/screen/HashCode.html#getHashCode(chemaxon.struc.Molecule,%20int[])
http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/screen/HashCode.html#getHashCode(chemaxon.struc.Molecule,%20int[],%20int)
Obtaining the fingerprints requires a little bit more code.
The class generating the fingerprints on insert (CombinedFingerprint) is not part of the public API at the moment (we will fix this).
Quick example code for a regular (molecule) table with no structural keys:
Code: |
chemaxon.util.ConenctionHandler conh = ...; // the connection to the database
String tableName = ... ; //the name of the table
Moelcule mol = ...; //the Molecule
chemaxon.reaction.Standardizer standardizer=TableInfo.getStandardizer(conh, tableName);
chemaxon.sss.screen.CombinedFingerprint cfp=new CombinedFingerprint(numberOfStrucFPCols, null, standardizer,
numberOfCFpCols, numberOfEdges, numberOfOnes,
false);
int[][] fingerprints = cfp.getCombinedFingerprints(mol, null, false, false, true);
//checking for timeout in ring calculation:
boolean noRingInfoInFP = cfp.isRingInfoIncomplete();
int[] fingerprint = noRingInfoInFP ? fingerprints[0] : fingerprints[1];
|
You can check the fingerprint parameters for any table using the following command:
Code: |
jcman t <table_name> |
Best regards,
Szilard
User 173254b396
16-04-2008 12:31:27
Hi Szilard,
Thanks, this works fine. I could get the fingerprints and the hashcode.
Cheers, Péter