diff options
author | Pjotr Prins | 2021-11-17 04:20:01 -0600 |
---|---|---|
committer | Pjotr Prins | 2021-11-17 04:20:01 -0600 |
commit | 6a7530dc7528bd6db6cb2b9ea0d9fdc71fc6bd88 (patch) | |
tree | 6d25936ec3112c823a72e7b928e4fe79460c1a5e /story-boards/fetch-phenotype-data | |
parent | 0f240720048dc64ddb059d57cd63aef7fe75b826 (diff) | |
download | gn-docs-6a7530dc7528bd6db6cb2b9ea0d9fdc71fc6bd88.tar.gz |
API
Diffstat (limited to 'story-boards/fetch-phenotype-data')
-rw-r--r-- | story-boards/fetch-phenotype-data/index.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/story-boards/fetch-phenotype-data/index.md b/story-boards/fetch-phenotype-data/index.md new file mode 100644 index 0000000..bd0b8d1 --- /dev/null +++ b/story-boards/fetch-phenotype-data/index.md @@ -0,0 +1,39 @@ +# Storyboard: fetch phenotype data from GeneNetwork + +GeneNetwork contains data on thousands of experiments. +How do you fetch data from the database so it can be used in R, Python or a spreadsheet? + +# Using the REST API + +GeneNetwork comes with a flexible REST API which allows fetching standard datatypes from the database. Much of the output is in JSON format which can be parsed from R, Python etc. There is also the excellent jq tool which allows viewing output in color. E.g. + +```sh +curl https://genenetwork.org/api/v_pre1/datasets/bxd > bxd.json +jq -C -S . bxd.json |less -R +``` + +shows for example + +```js + { + "AvgID": 3, + "CreateTime": "Tue, 02 Nov 2021 00:00:00 GMT", + "DataScale": "log2", + "FullName": "UTHSC BXD Hippocampus Postnatal Day 7 Ethanol Both Sexes Affy Clarion S (Nov21) RMA", + "Id": 1041, + "Long_Abbreviation": "UTHSC_BXD_Hip_PostD7EtohBS_Nov21", + "ProbeFreezeId": 432, + "ShortName": "UTHSC BXD Hippocampus Postnatal Day 7 Ethanol Both Sexes Affy Clarion S (Nov21) RMA", + "Short_Abbreviation": "UTHSC_BXD_Hip_PostD7EtohBS_1121", + "confidentiality": 0, + "public": 1 + } +``` + +curl is a tool for fetching API data. You can also use wget or download with R or Python. + +Karl Broman wrote the [GNapi](https://github.com/kbroman/GNapi) R package for accessing the GN API. + +# Reading the API tutorial + +In the next step check out the [documentation](../../api/GN2-REST-API.md). |