Skip to content

Commit

Permalink
Merge pull request #56 from mcneilco/bugfix/bingo-search-with-saltform
Browse files Browse the repository at this point in the history
Fixes #55 Indigo structure search breaks when salt form structure mat…
  • Loading branch information
jmcneil86043 committed May 4, 2018
2 parents e7f9e01 + 51bc7c6 commit ba2e606
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ public int[] searchMolStructures(String molfile, String structureTable, String p
logger.debug("Search type is " + searchType);
logger.debug("Max number of results is " + maxResults);

logger.debug("Dissimilarity similarity is " + simlarityPercent);

float indSimilarity = 1.0f - simlarityPercent;
logger.debug("Indigo search similarity is " + indSimilarity);


if (searchType.equalsIgnoreCase("EXACT")){
searchType = exactSearchDef;
Expand Down Expand Up @@ -257,8 +262,8 @@ public int[] searchMolStructures(String molfile, String structureTable, String p
if (searchType.equalsIgnoreCase("SUBSTRUCTURE")) {
query.setParameter("parameters", "");
}else if (searchType.equalsIgnoreCase("SIMILARITY")) {
query.setParameter("minSimilarity", simlarityPercent);
query.setParameter("maxSimilarity", null);
query.setParameter("minSimilarity", indSimilarity);
query.setParameter("maxSimilarity", 1.0);
query.setParameter("metric", "Tanimoto");
}else {
String parameters = null;
Expand Down Expand Up @@ -440,8 +445,8 @@ public CmpdRegMolecule[] searchMols(String molfile, String structureTable, int[]
query.setParameter("queryMol", mol.molfile());
query.setMaxResults(maxResults);

if (inputCdIdHitList != null && inputCdIdHitList.length > 0) query.setParameter("filterCdIds", Arrays.asList(inputCdIdHitList));
if (inputCdIdHitList != null && inputCdIdHitList.length > 0) query.setParameter("filterCdIds", Arrays.asList(ArrayUtils.toObject(inputCdIdHitList)));

//May need additional research / decisions around which options to use
//Basic Indigo search types corresponding to JChem search types
//CReg: "DUPLICATE" or "DUPLICATE_NO_TAUTOMER" :: JChem: "DUPLICATE", "TAUTOMER_SEARCH_OFF" :: Bingo.Exact, "ALL"
Expand Down

0 comments on commit ba2e606

Please sign in to comment.