-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow molecules to be searched with min/max values #131
Conversation
In the minValues parameter, one can pass in things like: ``` { "properties.heavyAtomCount": 4 } ``` and the results will only contain molecules that have at least 4 heavy atoms. The maxValues parameter can be used in a similar way. If both the minValues and maxValues parameters are used, then the results will satisfy both. Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
This works toward some of the content of this issue. |
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
This is ready for review. |
As a side note, this also provides an indirect way to search for exact values as well, because the user can specify something like |
Wouldn't it be more efficient to add an endpoint to search for an exact match? I don't know how clever MongoDB is about optimizing that, but it seems a little strange not to simply offer an equality query too. |
Yes, that makes sense. I can add it. |
Well, I actually just noticed that everything I added in this PR and more (equality comparisons included) are already available to use in the |
I thought you knew about that, I think it may need updating to our new document layout. We used it to great effect in a previous project, but it was kept around for reference. It would be nice to update it, and get it working again. |
Seems like, for the most part, it is working and in good condition. It worked for me for inchi, inchikey, name, formula, smiles, mass, atomCount, and heavyAtomCount. I also tried the The only thing that didn't work for me so far is more complex InChIs. For instance, the InChI that we get from Open Babel for butanol is |
In the minValues parameter, one can pass in things like:
and the results will only contain molecules that have at
least 4 heavy atoms. The maxValues parameter can be used
in a similar way.
If both the minValues and maxValues parameters are used, then
the results will satisfy both.
Signed-off-by: Patrick Avery patrick.avery@kitware.com