DataFire integration for Open Targets Platform
npm install @datafire/opentargetsClient library for Open Targets Platform
bash
npm install --save @datafire/opentargets
`
`js
let opentargets = require('@datafire/opentargets').create();.then(data => {
console.log(data);
});
`Description
$3
The Open Targets Platform API ('Application Programming Interface') allows programmatic retrieval of the Open Targets Platform data via a set of REST services.
You can make calls to the latest version of our API using the base URL
https://platform-api.opentargets.io/v3/platform. Please make sure you use https instead of the unencrypted http calls, which we do not accept.We list below the methods available to query our data directly from the API, followed by an interactive interface that you can use to try out the parameters and execute the REST-API calls.
For every request you create, the interactive interface will display both a curl command and a request URL that you can use to ensure you get the expected response before using your application or workflow.
Check our documentation for some API tutorials and get in touch if you have any questions.
$3
The available methods can be grouped in three types:
* __public__ - Methods that serve the core set of our data. These are stable and we fully supported them.
* __private__ - Methods used by the web app to serve additional data not specific to our platform. These methods
may change without notice and should be used with caution.
* __utils__ - Methods to get statistics and technical data about our API.
$3
The methods above are all available via a
GET request, and will serve outputs as JSON.Alternative output formats, such
xml, csv and tab, are also available for some of the methods. However alternative output formats are not supported in interactive interface below where the response will be always in JSON.If you have complex queries with large number of parameters, you should use a POST request instead of GET. POST methods require a body encoded as json. When querying for a specific disease using the latest version of the API, your call would look like the example below:
``sh`
curl -X POST -d '{"disease":["EFO_0000253"]}' --header 'Content-Type: application/json' https://platform-api.opentargets.io/v3/platform/public/evidence/filter$3
Each HTTPS response will serve data in headers and body. The headers will give you details about your query, such as how long it took to run.
In the body of the response, you will find the data you have requested for in JSON format. The jq program is a useful tool to parse the json response while on the command line.
`sh`
curl https://platform-api.opentargets.io/v3/platform/public/association/filter\?target\=ENSG00000157764 | jq
We do not analyse the nature of any specific API queries except for the purposes of improving the performance of our API.
Read more in our privacy section.
How can we make the Open Targets Platform API more useful to you? Would you like additional methods to be implemented?
Please get in touch and send your suggestions.
`js`
opentargets.getApiDocs(null, context)
#### Input
This action has no parameters
#### Output
Output schema unknown
`js`
opentargets.getApiSwaggerUI(null, context)
#### Input
This action has no parameters
#### Output
Output schema unknown
`js`
opentargets.getAutocomplete({
"q": ""
}, context)
#### Input
* input objectstring
* q required : A full text query.string
* size : Maximum amount of results to return. Defaults to 5.
#### Output
Output schema unknown
`js`
opentargets.postBestHitSearch({
"body": ""
}, context)
#### Input
* input objectstring
* body required
#### Output
Output schema unknown
objects.`js
opentargets.postDiseaseById({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
Get disease objects.`js
opentargets.getDiseaseById({
"disease": ""
}, context)
`#### Input
* input
object
* disease required string: An EFO identifier.#### Output
Output schema unknown
$3
Get drug objects.`js
opentargets.getDrugByID({
"DRUG_ID": ""
}, context)
`#### Input
* input
object
* DRUG_ID required string#### Output
Output schema unknown
$3
Get ECO objects.`js
opentargets.getECObyID({
"ECO_ID": ""
}, context)
`#### Input
* input
object
* ECO_ID required string: An evidence code ontology ID.#### Output
Output schema unknown
$3
Returns an enrichment analysis for a list of targets passed in the body`js
opentargets.postEnrichmentTarget({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
Get search-result objects. Enables search bar functionality.`js
opentargets.getQuickSearch({
"q": ""
}, context)
`#### Input
* input
object
* q required string: A full text query.
* size string: Maximum amount of results to return. Defaults to 5.#### Output
Output schema unknown
$3
Get relation objects.`js
opentargets.postRelation({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
Get relation objects starting from diseases.`js
opentargets.getRelationByEFOID({
"disease": ""
}, context)
`#### Input
* input
object
* disease required string: An EFO gene identifier.#### Output
Output schema unknown
$3
Get relation objects starting from diseases.`js
opentargets.getRelationByENSGID({
"target": ""
}, context)
`#### Input
* input
object
* target required string: An Ensembl gene identifier.#### Output
Output schema unknown
$3
Get target objects. Used for the target profile page.`js
opentargets.postTargetByENSGID({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
Get gene-expression objects.`js
opentargets.getTargetExpressionByENSGID({
"gene": ""
}, context)
`#### Input
* input
object
* gene required string: An Ensembl gene identifier.#### Output
Output schema unknown
$3
Get gene-expression objects.`js
opentargets.postTargetExpressionByENSGID({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
Get target objects.`js
opentargets.getTargetByENSGID({
"target": ""
}, context)
`#### Input
* input
object
* target required string: An Ensembl gene ID for the target of interest.#### Output
Output schema unknown
$3
Once we integrate all evidence connecting a target to a specific disease, we
compute an association score by the means of an harmonic sum. This association score provides
an indication of how strong the evidence behind each connection is and can be
used to rank genes in order of likelihood as drug targets.
The association ID is constructed by using the Ensembl ID of the gene and the
EFO ID for the disease (e.g. ENSG00000073756-EFO_0003767).
The method returns an association object, which contains the data and summary
on each evidence type included in the calculation of the score, as well as the score itself.`js
opentargets.getAssociationById({
"id": ""
}, context)
`#### Input
* input
object
* id required string: An association ID usually in the form of TARGET_ID-DISEASE_ID.#### Output
Output schema unknown
$3
More complex queries for associations scores and objects can be done using
this method, which allows to sort in different order, restrict to a specific class
of diseases or targets, as well as filtering results by score and associated pathways.`js
opentargets.getAssociationFilter({}, context)
`#### Input
* input
object
* target string: A target identifier listed as target.id.
* disease string: An EFO code listed as disease.id.
* therapeutic_area string: An EFO code of a therapeutic area.
* datasource string: Data source to consider.
* datatype string: Data type to consider.
* pathway string: A Reactome pathway identifier (returning only those targets linked to the specified pathway).
* target_class string: A ChEMBL target class identifier (returning only those targets belonging to the specified class).
* uniprotkw string: A UniProt keyword (meaning all the targets linked to that keyword).
* direct boolean: If true, it returns associations that have at least one direct evidence connecting the target and the disease. If false it only returns associations for which there is no direct evidence connecting the target and the disease, but only evidence connecting the target to a children of the disease in the EFO ontology.
* datastructure string: Type of data structure to return. Can be 'full', 'simple', 'ids', or 'count'.
* fields string: Fields you want to retrieve. This will get priority over the data structure requested.
* facets boolean: Returns facets
* scorevalue_min number: Filter by minimum score value. The default is 0, but using 0.2 is a good trade-off to filter lower quality data points.
* scorevalue_max number: Filter by maximum score value.
* scorevalue_types string: Score types to apply the score value min and max filters. The default is overall.
* size number: Maximum amount of results to return. Defaults to 10, max is 10000.
* from number: How many initial results should be skipped. Defaults to 0.
* format string: Format to get the data back. Can be 'json', 'xml', 'tab' or 'csv'. Note that this option can only be used when calling the API directly and will not work in this page. The response here will always be JSON.
* sort string: Sort by the given score type. Defaults to 'overall' and descending order. Use '~' prefix to do ascending
* search string: Restrict the filtered results to those matching the passed string. The matching is done with a#### Output
Output schema unknown
$3
Complex queries and filters for association objects can also be submitted using a JSON
object and the equivalent POST method.`js
opentargets.postAssociationFilter({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
We call evidence a unit of data that support a connection between a target and a disease.
The Open Targets Platform integrates multiple types of evidence including genetic associations,
somatic mutations, RNA expression and target-disease associations mined from the literature.
This method allows you to retrieve a single evidence item or a list of pieces of evidence by using their
targetvalidation.org ID.Evidence IDs are unique within each data release (e.g.
8ed3d7568a8c6cac9c95cfb869bac762 for release 1.2).
You can obtain a list of evidence and their IDs from other API calls such as /public/evidence/filter.Please note that a specific evidence ID may change between data releases. We can not guarantee that a specific evidence ID will refer to the same piece of evidence connecting a target and its diseases.
`js
opentargets.getEvidenceById({
"id": ""
}, context)
`#### Input
* input
object
* id required string: Internal unique ID of the evidence string to retrieve.#### Output
Output schema unknown
$3
This is the POST version of /public/evidence.
It allows to query for a list of evidence strings encoded in a json object to be passed in the body.`js
opentargets.postEvidenceById({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
The filter method allows to retrieve the specific data that supports a connection between targets and diseases.
Filters can be used to restrict the results by source and type of data,
or limit results to targets which are part of a particular pathway.
Minimum and maximum scores can be specified as well as the type of evidence linking target and disease.
Note that multiple genes and diseases can be specified in the same request.`js
opentargets.getEvidenceFilter({}, context)
`#### Input
* input
object
* target string: A target identifier listed as target.id.
* disease string: An EFO code listed as disease.id.
* data source string: Data source to consider.
* datatype string: Data type to consider.
* pathway string: A pathway identifier (meaning all the targets linked to that pathway).
* uniprotkw string: A UniProt keyword (meaning all the targets linked to that keyword).
* datastructure string: Type of data structure to return. Can be 'full', 'simple', 'ids', or 'count'.
* fields string: The fields you want to retrieve. This will get priority over the data structure requested.
* scorevalue_min number: Filter by minimum score value. The default is 0, but using 0.2 is a good trade-off to filter lower quality data points.
* scorevalue_max number: Filter by maximum score value.
* sort string: Sort by the given field. The default is 'scores.association_score' in descending order. Use '~' prefix to do ascending
* size number: Maximum amount of results to return. Defaults to 10, max is 10000.
* from number: How many initial results should be skipped. Defaults to 0.
* format string: Format to get the data back. Can be 'json', 'xml', 'tab' or 'csv'. Note that this option can only be used when calling the API directly and will not work in this page. The response here will always be JSON.#### Output
Output schema unknown
$3
POST version of /public/evidence/filter.
Filters can be specified as part of a json object in the body, simplifying the submission of queries.`js
opentargets.postEvidenceFilter({
"body": ""
}, context)
`#### Input
* input
object
* body required string#### Output
Output schema unknown
$3
This method allows you to look for gene or diseases of interest using a free text search,
replicating the functionality of the search box on our homepage. It should be used to identify
the best match for a disease or target of interest, rather than gathering a specific set of evidence.`js
opentargets.getSearch({
"q": ""
}, context)
`#### Input
* input
object
* q required string: A full text query.
* size string: Maximum amount of results to return. Defaults to 10, max is 10000.
* from string: How many initial results should be skipped. Defaults to 0.
* filter string: Restrict the search to the type requested. Eg. target or disease.#### Output
Output schema unknown
$3
Returns the metrics about associations and evidences, divided by datasource, genes and so on.`js
opentargets.getDataMetrics(null, context)
`#### Input
This action has no parameters
#### Output
Output schema unknown
$3
Check if the API is up`js
opentargets.getPing(null, context)
`#### Input
This action has no parameters
#### Output
Output schema unknown
$3
Returns the number of associations and evidences, divided by datasource.`js
opentargets.getDataStats(null, context)
`#### Input
This action has no parameters
#### Output
Output schema unknown
$3
Returns the list of therapeutic areas for the current data release`js
opentargets.getTherapeuticAreas(null, context)
`#### Input
This action has no parameters
#### Output
Output schema unknown
$3
Returns current API version.`js
opentargets.getVersion(null, context)
`#### Input
This action has no parameters
#### Output
Output schema unknown
$3
Get swagger.yaml specs for the API
`js
opentargets.getSwagger(null, context)
``#### Input
This action has no parameters
#### Output
Output schema unknown
This integration has no definitions