This repository is a modified version of the Beacon2 Reference Implementation (B2RI) and contains a stand-alone Beacon instance designed to allow for the sharing of metadata of datasets.
This repo contains:
- The (Python 3.9+) source code for beacon,
- A docker-less version of the B2RI
To import metadata into your Beacon instance please use the Beacon-import-tools.
You can query the beacon using GET or POST. Below, you can find some examples of usage:
For simplicity (and readability), we will be using HTTPie.
Querying this endpoit it should return the 13 variants of the beacon (paginated):
http GET http://localhost:5050/api/g_variants/You can also add request parameters to the query, like so:
http GET http://localhost:5050/api/g_variants/?start=9411499,9411644&end=9411609This should return 3 genomic variants.
You can use POST to make the previous query. With a request.json file like this one:
{
"meta": {
"apiVersion": "2.0"
},
"query": {
"requestParameters": {
"start": [ 9411499, 9411644 ],
"end": [ 9411609 ]
},
"filters": [],
"includeResultsetResponses": "HIT",
"pagination": {
"skip": 0,
"limit": 10
},
"testMode": false,
"requestedGranularity": "count"
}
}You can execute:
http POST http://localhost:5050/api/g_variants/ --json < request.jsonBut you can also use complex filters:
{
"meta": {
"apiVersion": "2.0"
},
"query": {
"filters": [
{
"id": "UBERON:0001256",
"scope": "biosamples",
"includeDescendantTerms": false
}
],
"includeResultsetResponses": "HIT",
"pagination": {
"skip": 0,
"limit": 10
},
"testMode": false,
"requestedGranularity": "count"
}
}You can execute:
http POST http://localhost:5050/api/biosamples/ --json < request.jsonAnd it will use the ontology filter to filter the results.
- Fusions (
mateName) are not supported.