-
Notifications
You must be signed in to change notification settings - Fork 1
Examples
See examples of API usage for:
http://giant-api.princeton.edu/networks/osteoblast/LEF1
See tissues below for a list of valid tissues, and genes for a list of valid genes.
http://giant-api.princeton.edu/networks/brain/park2+park7
Optionally enumerate gene names for more compact graph representation:
http://giant-api.princeton.edu/networks/brain/park2+park7?enum=1
$ curl giant-api.princeton.edu/networks/brain/park2+park7
[
{
"source": "NDUFA1",
"target": "NDUFA4",
"weight": 0.8009668759023012
},
{
"source": "NDUFA1",
"target": "TBCA",
"weight": 0.3142691606402427
},
{
"source": "NDUFA1",
"target": "UQCRH",
"weight": 0.8241241833240858
},
...
]
Same example using POST syntax and enumerated gene names:
$ curl giant-api.princeton.edu/networks -d tissue=brain \
-d genes=park2,park7 \
-d enum=true
{
"nodes": [
{
"name": "NDUFA1"
},
{
"name": "NDUFA4"
},
{
"name": "TBCA"
},
...
],
"edges": [
{
"source": 0,
"target": 1,
"weight": 0.8009668759023012
},
{
"source": 0,
"target": 2,
"weight": 0.3142691606402427
},
{
"source": 0,
"target": 3,
"weight": 0.8241241833240858
},
...
]
}
Predict functional relationships for BRCA1 and BRCA2 using the global network (i.e., not tissue specific) and also specify:
- number of genes to be returned in the JSON response
- prior probability of having a functional relationship between gene pairs
-
enum
option for more compact graph representation.
$ curl giant-api.princeton.edu/networks -d tissue=global \
-d genes=brca1,brca2 \
-d num_genes=10 \
-d prior=0.15 \
-d enum=true
{
"nodes": [
{
"name": "TP53BP1"
},
{
"name": "ACACA"
},
{
"name": "BRAP"
},
...
],
"edges": [
{
"source": 0,
"target": 1,
"weight": 0.24166657087771248
},
{
"source": 0,
"target": 2,
"weight": 0.13069679725976338
},
{
"source": 0,
"target": 3,
"weight": 0.24443552437697139
},
...
]
}
Same example using the web API:
http://giant-api.princeton.edu/networks/global/BRCA1+BRCA2?num_genes=10&prior=0.15&enum=1
When enum=true
is used, the structure of the JSON response returned by the API makes it easy to construct network graphs using the D3 visualization library. A sample graph using the force layout is given above, which makes predictions for the PARK2 gene in the brain tissue.
GIANT BioJS uses API calls to query gene network data, which is then plotted. This is similar to the preceding D3 example except additional controls are available in the BioJS module such as (i) filtering for the number of genes displayed, (ii) filtering for a minimum relationship confidence between gene pairs, and (iii) displaying datasets that most strongly support the predicted functional relationship.
A sample input GWAS file aloof_vegas.txt
can be downloaded here. Assuming aloof_vegas.txt
is in the current working directory:
$ curl http://giant-api.princeton.edu/netwas/jobs \
-F gwas_file="@aloof_vegas.txt" \
-F gwas_format="vegas" \
-F tissue="api-demo" \
-F p_value=0.01
{
"id": "3a3ef256-1183-44bd-9337-538ab41c333a",
"created": "2015-11-09T17:25:10.181923Z",
...
"status": "not_started"
}
Referencing the same job created in the previous example with ID 3a3ef256-1183-44bd-9337-538ab41c333a
:
$ curl -X POST http://giant-api.princeton.edu/netwas/jobs/3a3ef256-1183-44bd-9337-538ab41c333a/start
{
"id": "3a3ef256-1183-44bd-9337-538ab41c333a",
...
"log_file": null,
"results_file": null,
"status": "queued"
}
Referencing the same job started in the previous example:
$ curl http://giant-api.princeton.edu/netwas/jobs/3a3ef256-1183-44bd-9337-538ab41c333a
{
"id": "3a3ef256-1183-44bd-9337-538ab41c333a",
...
"log_file": "http://giant-api.princeton.edu/media/results/.../log.txt",
"results_file": null,
"status": "running"
}
Referencing the same job started in the previous example:
http://giant-api.princeton.edu/tissues
Optionally request raw JSON response:
http://giant-api.princeton.edu/tissues?format=json
$ curl giant-api.princeton.edu/tissues?container=object
{
"nervous_system": null,
"cornea": null,
"skin": null,
"artery": null,
"t_lymphocyte": null,
...
}
Same example using POST syntax and a modified print format:
$ curl giant-api.princeton.edu/tissues -d case=t
[
"Adipose Tissue",
"Adrenal Cortex",
"Adrenal Gland",
"Amygdala",
"Aorta",
...
]
[http://giant-api.princeton.edu/tissues/check/LUng+cardiac mUSCle+hearTT?verbose=1](http://giant-api.princeton.edu/tissues/check/LUng+cardiac mUSCle+hearTT?verbose=1)
$ curl giant-api.princeton.edu/tissues/check -d tissue=liver,retiina,muscle
[
"liver",
null,
"muscle"
]
$ curl giant-api.princeton.edu/genes
[
"A1BG",
"A1CF",
"A2M",
"A2ML1",
"A3GALT2",
...
]
http://giant-api.princeton.edu/genes/check/brca1+BRCA2+brca3
$ curl giant-api.princeton.edu/genes/check -d gene=ABCD,C10ORF10,ba395l14.13 \
-d verbose=1
[
{
"entrez_id": null,
"query_name": "ABCD",
"standard_name": null,
"systematic_name": null,
"valid": false
},
{
"entrez_id": 11067,
"query_name": "C10ORF10",
"standard_name": "C10orf10",
"systematic_name": "C10orf10",
"valid": true
},
{
"entrez_id": 284967,
"query_name": "ba395l14.13",
"standard_name": "bA395L14.13",
"systematic_name": "bA395L14.13",
"valid": true
}
]