Open jonrkarr opened 4 years ago
Did you mean /ftx/text_search/num_of_index/
or /metabolites/concentrations/similar_compounds/
?
With regards to /ftx/text_search/num_of_index/
, it should return results regardless of if the metabolite itself contains concentration information or not precisely because of the function offered by /metabolites/concentrations/similar_compounds/
endpoint. An abstract example would be if a user searches for glucose
, for which we don't have concentration information. However, we do have concentration information for fructose
, and presumably fructose
is structually similar to glucose
. If we filtered out glucose
at the full-text stage, the user would not have seen glucose
in the intermediate stage under Metabolites
, which could lead the user to believe we have absolutely no information, including various meta info, on glucose
. It would also remove the possibility for the user to choose concentration information from the structually similar compound, fructose
With regards to /metabolites/concentrations/similar_compounds/
. https://api.datanator.info/metabolites/concentrations/similar_compounds/?inchikey=BJHIKXHVCXFQLS-UYFOZJQFSA-N&threshold=0.6&taxon_distance=false returns an empty array because none of the similar compounds, including the compound itself (BJHIKXHVCXFQLS-UYFOZJQFSA-N), within the tanimoto threshold value have concentration information. But it cannot be known at the full-text search stage. It was originally conceived that the threshold value is user defined, which isn't done until the metabolite-specific page.
This is similar to #89. Upon further reflection, I think its useful for Datanator to explicitly communicate to users that we do not have relevant data about a metabolite.
After we finish debugging, we can add an option to the full text search and UI to only return results that have data.
Example:
If there's no data, shouldn't this be excluded from the full-text search results?