-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
450 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
API Documentation | ||
================= | ||
|
||
Detailed documentation of the biothings_client package can be found on this page. | ||
|
||
get_client | ||
++++++++++ | ||
.. py:module:: biothings_client | ||
.. autofunction:: get_client | ||
|
||
MyGeneInfo | ||
++++++++++ | ||
.. autoclass:: MyGeneInfo | ||
:members: | ||
:inherited-members: | ||
|
||
MyVariantInfo | ||
+++++++++++++ | ||
.. autoclass:: MyVariantInfo | ||
:members: | ||
:inherited-members: | ||
|
||
MyChemInfo | ||
++++++++++ | ||
.. autoclass:: MyChemInfo | ||
:members: | ||
:inherited-members: | ||
|
||
MyDiseaseInfo | ||
+++++++++++++ | ||
.. autoclass:: MyDiseaseInfo | ||
:members: | ||
:inherited-members: | ||
|
||
MyTaxonInfo | ||
+++++++++++ | ||
.. autoclass:: MyTaxonInfo | ||
:members: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Instantiating a Client for a Custom BioThings API | ||
================================================= | ||
|
||
The Quick Start tutorial shows how to get clients for all publicly available BioThings APIs. What if you create your own custom BioThings API? | ||
|
||
With biothings_client, you can generate client settings for any future APIs created with BioThings API. The `BioThings API Single source tutorial <https://biothingsapi.readthedocs.io/en/latest/doc/single_source_tutorial.html>`_ explains how to set up a simple BioThings API from PharmGKB gene data. The following code snippet shows an example of how to setup biothings_client to access that custom API: | ||
|
||
.. code-block:: python | ||
In [1]: from biothings_client import get_client | ||
In [2]: pharmgkb_client = get_client('gene', url='http://35.164.95.182:8000/v1') | ||
In [3]: pharmgkb_client.query('ncbi_gene_id:1017', fields='pharmgkb_accession_id') | ||
Out[3]: | ||
{'hits': [{'_id': 'cOydWmcBViFqgJfo4gdM', | ||
'_score': 7.495912, | ||
'pharmgkb_accession_id': 'PA101'}], | ||
'max_score': 7.495912, | ||
'took': 10, | ||
'total': 1} | ||
The **url** parameter to **get_client** specifies where the BioThings API endpoint is located (the address above is temporary and is no longer serviced by us). The entity parameter is still 'gene' (as the entity type of PharmGKB gene is gene). |
Oops, something went wrong.