User 73531e86ff
29-06-2010 14:24:08
Hi,
We have some code which is calculating the tversky similarity between 2 structures. It has been working in the past but version 5.3.4 gives an error. I have extracted the code into the code snippet below:
CFParameters params = new CFParameters();
params.setLength(1024);
params.setBondCount(7);
params.setBitCount(4);
params.setNormalized(true);
ChemicalFingerprint fp1 = new ChemicalFingerprint(params);
ChemicalFingerprint fp2 = new ChemicalFingerprint(params);
fp1.generate(MolImporter.importMol("c1ccccc1", "smiles"));
fp2.generate(MolImporter.importMol("c1ccncc1", "smiles"));
final SimilarityCalculator sc = SimilarityCalculatorFactory.create("TVERSKY,0.5,0.5");
final int[] query = TverskyChemaxonInlineSimilarityFunction.byte2int(fp1.toData()) ; // bitstring represented as int array.
final int[] target = TverskyChemaxonInlineSimilarityFunction.byte2int(fp2.toData()); // bitstring represented as int array.
sc.setQueryFingerprint(query);
float sim = sc.getSimilarity(target);
The stack trace is:
java.lang.IllegalArgumentException: No enum const class chemaxon.descriptors.MetricsType.TVERSKY,0.5,0.5
at java.lang.Enum.valueOf(Enum.java:192)
at chemaxon.descriptors.MetricsType.valueOf(MetricsType.java:17)
at chemaxon.descriptors.SimilarityCalculatorFactory.setMetricsType(SimilarityCalculatorFactory.java:73)
at chemaxon.descriptors.SimilarityCalculatorFactory.(SimilarityCalculatorFactory.java:107)
at chemaxon.descriptors.SimilarityCalculatorFactory.create(SimilarityCalculatorFactory.java:180)
at chemaxon.descriptors.SimilarityCalculatorFactory.create(SimilarityCalculatorFactory.java:166)
at ...