new CompoundSearch(baseURL, appID, appKey)
Parameters:
Name | Type | Description |
---|---|---|
baseURL |
string | URL for the Open PHACTS API |
appID |
string | Application ID for the application being used. Created by https://dev.openphacts.org |
appKey |
string | Application Key for the application ID. |
- License:
- Source:
Methods
compoundClassifications(URI, tree, callback)
The classes the given compound URI has been classified with eg ChEBI
Parameters:
Name | Type | Description |
---|---|---|
URI |
string | The URI for the compound of interest |
tree |
string | Restrict results by hierarchy eg chebi |
callback |
requestCallback | Function that will be called with the result |
- Source:
compoundClassMembers(URI, pageopt, pageSizeopt, orderByopt, lensopt, callback)
Fetch compounds for the class represented by the URI provided.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
URI |
string | The URI for the compound class of interest | ||
page |
string |
<optional> |
1 | Which page of records to return. |
pageSize |
string |
<optional> |
10 | How many records to return. Set to 'all' to return all records in a single page |
orderBy |
string |
<optional> |
Order the records by this field eg ?assay_type or DESC(?assay_type) | |
lens |
string |
<optional> |
Which chemistry lens to apply to the records | |
callback |
requestCallback | Function that will be called with the result |
- Source:
Example
var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", "appID", "appKey");
var callback=function(success, status, response){
var classMembersResult == searcher.parseCompoundClassMembersResponse(response);
};
searcher.compoundClassMembers('http://purl.obolibrary.org/obo/CHEBI_24431', 1, 20, null, null, callback);
compoundClassMembersCount(URI, lensopt, callback)
Count the number of compounds classified with the class represented by the URI provided.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
URI |
string | The URI for the class of interest. | |
lens |
string |
<optional> |
An optional lens to apply to the result. |
callback |
requestCallback | Function that will be called with the result. |
- Source:
Example
var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", "appID", "appKey");
var callback=function(success, status, response){
var result = searcher.parseCompoundClassMembersCountResponse(response);
};
searcher.compoundClassMembersCount('http://purl.obolibrary.org/obo/CHEBI_24431', null, callback);
compoundPharmacology(URI, assayOrganismopt, targetOrganismopt, activityTypeopt, activityValueopt, minActivityValueopt, minExActivityValueopt, maxActivityValueopt, maxExActivityValueopt, activityUnitopt, activityRelationopt, pChemblopt, minpChemblopt, minExpChemblopt, maxpChemblopt, maxExpChemblopt, targetTypeopt, pageopt, pageSizeopt, orderByopt, lensopt, callback)
Fetch pharmacology records for the compound represented by the URI provided.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
URI |
string | The URI for the compound of interest | ||
assayOrganism |
string |
<optional> |
Filter by assay organism eg Homo Sapiens | |
targetOrganism |
string |
<optional> |
Filter by target organism eg Rattus Norvegicus | |
activityType |
string |
<optional> |
Filter by activity type eg IC50 | |
activityValue |
string |
<optional> |
Return pharmacology records with activity values equal to this number | |
minActivityValue |
string |
<optional> |
Return pharmacology records with activity values greater than or equal to this number | |
minExActivityValue |
string |
<optional> |
Return pharmacology records with activity values greater than this number | |
maxActivityValue |
string |
<optional> |
Return pharmacology records with activity values less than or equal to this number | |
maxExActivityValue |
string |
<optional> |
Return pharmacology records with activity values less than this number | |
activityUnit |
string |
<optional> |
Return pharmacology records which have this activity unit eg nanomolar | |
activityRelation |
string |
<optional> |
Return pharmacology records which have this activity relation eg = | |
pChembl |
string |
<optional> |
Return pharmacology records with pChembl equal to this number | |
minpChembl |
string |
<optional> |
Return pharmacology records with pChembl values greater than or equal to this number | |
minExpChembl |
string |
<optional> |
Return pharmacology records with pChembl values greater than this number | |
maxpChembl |
string |
<optional> |
Return pharmacology records with pChembl values less than or equal to this number | |
maxExpChembl |
string |
<optional> |
Return pharmacology records with pChembl values less than this number | |
targetType |
string |
<optional> |
Filter by one of the available target types. e.g. single_protein | |
page |
string |
<optional> |
1 | Which page of records to return. |
pageSize |
string |
<optional> |
10 | How many records to return. Set to 'all' to return all records in a single page |
orderBy |
string |
<optional> |
Order the records by this field eg ?assay_type or DESC(?assay_type) | |
lens |
string |
<optional> |
Which chemistry lens to apply to the records | |
callback |
requestCallback | Function that will be called with the result |
- Source:
Example
var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", "appID", "appKey");
var callback=function(success, status, response){
var pharmacologyResult == searcher.parseCompoundPharmacologyResponse(response);
};
searcher.compoundPharmacology('http://www.conceptwiki.org/concept/38932552-111f-4a4e-a46a-4ed1d7bdf9d5', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, 20, null, null, callback);
compoundPharmacologyCount(URI, assayOrganismopt, targetOrganismopt, activityTypeopt, activityValueopt, minActivityValueopt, minExActivityValueopt, maxActivityValueopt, maxExActivityValueopt, activityUnitopt, activityRelationopt, pChemblopt, minpChemblopt, minExpChemblopt, maxpChemblopt, maxExpChemblopt, targetTypeopt, lensopt, callback)
Fetch a count of the pharmacology records belonging to the compound represented by the URI provided.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
URI |
string | The URI for the compound of interest | |
assayOrganism |
string |
<optional> |
Filter by assay organism eg Homo Sapiens |
targetOrganism |
string |
<optional> |
Filter by target organism eg Rattus Norvegicus |
activityType |
string |
<optional> |
Filter by activity type eg IC50 |
activityValue |
string |
<optional> |
Return pharmacology records with activity values equal to this number |
minActivityValue |
string |
<optional> |
Return pharmacology records with activity values greater than or equal to this number |
minExActivityValue |
string |
<optional> |
Return pharmacology records with activity values greater than this number |
maxActivityValue |
string |
<optional> |
Return pharmacology records with activity values less than or equal to this number |
maxExActivityValue |
string |
<optional> |
Return pharmacology records with activity values less than this number |
activityUnit |
string |
<optional> |
Return pharmacology records which have this activity unit eg nanomolar |
activityRelation |
string |
<optional> |
Return pharmacology records which have this activity relation eg = |
pChembl |
string |
<optional> |
Return pharmacology records with pChembl equal to this number |
minpChembl |
string |
<optional> |
Return pharmacology records with pChembl values greater than or equal to this number |
minExpChembl |
string |
<optional> |
Return pharmacology records with pChembl values greater than this number |
maxpChembl |
string |
<optional> |
Return pharmacology records with pChembl values less than or equal to this number |
maxExpChembl |
string |
<optional> |
Return pharmacology records with pChembl values less than this number |
targetType |
string |
<optional> |
Filter by one of the available target types. e.g. single_protein |
lens |
string |
<optional> |
Which chemistry lens to apply to the records |
callback |
requestCallback | Function that will be called with the result |
- Source:
Example
var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", "appID", "appKey");
var callback=function(success, status, response){
var pharmacologyResult == searcher.parseCompoundPharmacologyCountResponse(response);
};
searcher.compoundPharmacologyCount('http://www.conceptwiki.org/concept/38932552-111f-4a4e-a46a-4ed1d7bdf9d5', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, callback);
fetchCompound(URI, lensopt, callback)
Fetch the compound represented by the URI provided.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
URI |
string | The URI for the compound of interest. | |
lens |
string |
<optional> |
An optional lens to apply to the result. |
callback |
requestCallback | Function that will be called with the result. |
- Source:
Example
var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", "appID", "appKey");
var callback=function(success, status, response){
var compoundResult = searcher.parseCompoundResponse(response);
};
searcher.fetchCompound('http://www.conceptwiki.org/concept/38932552-111f-4a4e-a46a-4ed1d7bdf9d5', null, callback);
fetchCompoundBatch(URIList, lensopt, callback)
Fetch the compounds matching the list of URIs provided.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
URIList |
Array | An array of URIs for the compounds of interest. | |
lens |
string |
<optional> |
An optional lens to apply to the result. |
callback |
requestCallback | Function that will be called with the result. |
- Source:
Example
var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", "appID", "appKey");
var callback=function(success, status, response){
var compoundResults = searcher.parseCompoundBatchResponse(response);
};
searcher.fetchCompoundBatch(['http://www.conceptwiki.org/concept/38932552-111f-4a4e-a46a-4ed1d7bdf9d5', 'http://www.conceptwiki.org/concept/dd758846-1dac-4f0d-a329-06af9a7fa413'], null, callback);
parseCompoundBatchResponse(response) → {FetchCompoundBatchResponse}
Parse the results from CompoundSearch#fetchCompoundBatch
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#fetchCompoundBatch |
- Source:
Returns:
Containing the flattened response
parseCompoundClassMembersCountResponse(response) → {Number}
Parse the results from CompoundSearch#compoundClassMembersCount
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#compoundClassMembersCount |
- Source:
Returns:
Count of the number of compounds classified for a particular class
- Type
- Number
parseCompoundClassMembersResponse(response) → {Number}
Parse the results from CompoundSearch#compoundClassMembers
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#compoundClassMembers |
- Source:
Returns:
Compounds classified for a particular class
- Type
- Number
parseCompoundLensResponse(response) → {FetchCompoundLensResponse}
Parse the results from CompoundSearch#fetchCompound which have a lens applied
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#fetchCompound |
- Source:
Returns:
Containing the flattened response
parseCompoundPharmacologyCountResponse(response) → {Number}
Parse the results from CompoundSearch#compoundPharmacologyCount
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#compoundPharmacologyCount |
- Source:
Returns:
Count of the number of pharmacology entries for the compound
- Type
- Number
parseCompoundPharmacologyResponse(response) → {FetchCompoundPharmacologyResponse}
Parse the results from CompoundSearch#fetchCompoundPharmacology
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#fetchCompoundPharmacology |
- Source:
Returns:
Containing the flattened response
parseCompoundResponse(response) → {FetchCompoundResponse}
Parse the results from CompoundSearch#fetchCompound
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | the JSON response from CompoundSearch#fetchCompound |
- Source:
Returns:
Containing the flattened response