Skip to content
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

Any way to search by Mass? #382

Open
mr-september opened this issue Nov 14, 2022 · 4 comments
Open

Any way to search by Mass? #382

mr-september opened this issue Nov 14, 2022 · 4 comments
Labels
enhancement New feature or enhancement

Comments

@mr-september
Copy link

For example, like this for PubChem: http://www.cheminfo.org/Chemistry/Database/PubChem/Search_by_exact_mass_in_PubChem/index.html

@stitam
Copy link
Contributor

stitam commented Nov 14, 2022

Thanks @mr-september for opening this issue. I think this functionality is not yet implemented in webchem, but PubChem does have a solution that might be relevant called PUG VIEW Annotations: https://pubchemdocs.ncbi.nlm.nih.gov/pug-view#_Toc495044630.

For molecular weight, the url would look like this:
https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/annotations/heading/JSON?heading=Molecular%20Weight

While the results are not filtered to a required range, you can extract the values and filter yourself. Since the format is JSON, extracting the data should be relatively simple. Does this help your problem?

@Aariq, my understanding is that with annotation, we could query any section on a PubChem page (similarly to pc_sect()) and then get the values in that section for all (?) PubChem entries. This mechanism is different from most other webchem functions where we query a compound or a list of compounds but the output looks quite useful. Do you think it would be worth implementing annotations as a new feature?

@Aariq
Copy link
Collaborator

Aariq commented Nov 14, 2022

I'm not sure... The cheminfo link above seems very helpful, but I'm not sure recreating that is 100% in scope for webchem. Definitely something to consider for the future though.

@Aariq Aariq added data source New data source enhancement New feature or enhancement and removed data source New data source labels Nov 14, 2022
@mr-september
Copy link
Author

Thanks for the replies.

@stitam would that PUG_REST api essentially return all entries with known Molecular Weight? Is that how a post-hoc filtering can work?

I found another database that was promising, but doesn't seem to have public-facing APIs... yet... HMDB, last known effort in setting up an API was in 2016. I've contacted HMDB's maintainers, hoping they just haven't publicly documented it yet.

@stitam
Copy link
Contributor

stitam commented Nov 15, 2022

Another alternative could be ChemSpider. With this API you can filter by mass:

https://developer.rsc.org/docs/compounds-v1-trial/1/types/FilterByIntrinsicPropertyRequestMass

webchem includes a number of ChemSpider functions, but it does not implement this API because it is not 100% in scope for webchem, as @Aariq mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants