learn-neuroimaging / hitchhackers_guide_brain

A list of tutorials and other resources useful to learn open science and neuroimaging, EEG and MEG
https://learn-neuroimaging.github.io/hitchhackers_guide_brain/
Other
114 stars 42 forks source link

Research Resource Identifiers to collect information about resources #59

Open Remi-Gau opened 4 years ago

Remi-Gau commented 4 years ago

I just realized that there should be a way to rely on RRID to collect metadata about some resources.

For example SPM has the following RRID : SCR_007037.

And if you check what is linked to this there is plenty of info we would not have to enter manually if you could grab them there.

https://scicrunch.org/resources/Tools/record/nlx_144509-1/SCR_007037/resolver?q=%22Statistical%20Parametric%20Mapping%22&l=%22Statistical%20Parametric%20Mapping%22

Remi-Gau commented 4 years ago

Possibly we could use this repo to query the scicrunch database:

https://github.com/SciCrunch/scibot

Remi-Gau commented 4 years ago

How to query the RRID database with the scicrunch API

We want to query the resource database. So we can look up the command in the resource section of the API documentation. The doc to use the API can be found here

For example the RID for FSL is : SCR_002823

We can use that directly in the UI provided by the doc at the section

Get all versions of resources
/resource/versions/all/{rid}

Input the FSL RID and click execute to have the API list all the versions of FSL that are stored in the database.

It also tells us the command to type in the shell to use the API

curl -X GET "https://scicrunch.org/api/1/resource/versions/all/SCR_002823" -H  "accept: application/json"

We can us that extra information about the version in the UI at the section to get all the details we want about a version of FSL

Get single resource
/resource/fields/view/{rid}

From the output we can extract the keywords and the URL.

Command line:

curl -X GET "https://scicrunch.org/api/1/resource/fields/view/SCR_002823?version=12" -H  "accept: application/json"

If we want to use it from the command line we need an API key. To create one:

Then add this key in your commands from the shell like so:

curl -X GET "https://scicrunch.org/api/1/resource/fields/view/SCR_002823?version=12&key={INSERT_YOUR_KEY_HERE}" -H  "accept: application/json"