Difference between revisions of "Pharmacoracle"

(Hints on how to use it (see also example section below))
(Pharmacoracle - a REST API based on the OWLAPI)
Line 1: Line 1:
 
==Pharmacoracle - a REST API based on the OWLAPI==
 
==Pharmacoracle - a REST API based on the OWLAPI==
The Pharmacoracle contains OWL ontologies that are based on CPIC recommendations provided by the [https://api.pharmgkb.org PharmGKB API], and which have been further curated to fit the needs of the Department of Pharmacology at Oslo University Hospital.
+
The Pharmacoracle contains OWL ontologies that are based on CPIC recommendations provided by the [https://api.pharmgkb.org PharmGKB API], and which have been further adapted to the needs of the Department of Pharmacology at Oslo University Hospital.
  
 
Queries to Pharmacoracle are written in the [https://www.w3.org/TR/owl2-manchester-syntax/ Manchester syntax] in the same way as for the [https://protegewiki.stanford.edu/wiki/DLQueryTab DL Query Tab] of [https://protege.stanford.edu/ Stanford's desktop Protégé].  
 
Queries to Pharmacoracle are written in the [https://www.w3.org/TR/owl2-manchester-syntax/ Manchester syntax] in the same way as for the [https://protegewiki.stanford.edu/wiki/DLQueryTab DL Query Tab] of [https://protege.stanford.edu/ Stanford's desktop Protégé].  

Revision as of 08:41, 8 August 2018

Pharmacoracle - a REST API based on the OWLAPI

The Pharmacoracle contains OWL ontologies that are based on CPIC recommendations provided by the PharmGKB API, and which have been further adapted to the needs of the Department of Pharmacology at Oslo University Hospital.

Queries to Pharmacoracle are written in the Manchester syntax in the same way as for the DL Query Tab of Stanford's desktop Protégé.

Hints on how to use it (see also example section below)

In order to do queries to an OWL ontology we need to know the names of the elements (publication of this is still pending). In addition we need to know the Manchester expressions of cardinality that are used to connect OWL Properties (e.g. has_haplotype) and OWL Classes (e.g. TPMT*3A), in particular:

Cardinality word Cardinality Explanation
some Connects a property to at least one class
exactly number Connects a property to an exact number of classes
min number Connects a property to a minimum number of classes


For each query we add a code word to indicate the relationship between our query and the desired answer (cf. the DL Query tab in the desktop version of Stanford's Protégé), as explained in this table:

Code word Relationship
SubClasses Get elements that contain the query (but not equivalent to the query)
DirectSubClasses Get only the SubClasses that are closest to the query
EquivalentClasses Get only elements equivalent to the query
SuperClasses Get elements that contain parts of the query (but not the entire query and not equivalent)
DirectSuperClasses Get only the SuperClasses that are closest to the query

In order to query the Pharmacoracle automatically, we have made a Python script Pharmacolyzer that returns dosing recommendation based on a pharmacotyped patient VCF.

Examples of use

Find the PGx alleles that contain the variant snpC>T at chr6:18139228

curl https://www.pgx.no/api/pharmacoracle -d "query=SubClasses:snpCtoT_at some chr6_18139228"

Find the PGx allele that is identical to the variants snpC>T at chr6:18139228 and snpT>C at chr6:18130918

curl https://www.pgx.no/api/pharmacoracle -d "query=EquivalentClasses:(snpCtoT_at some chr6_18139228) and (snpTtoC_at some chr6_18130918)"

Find the PGx alleles that contain either snpC>T at chr6:18139228 or snpT>C at chr6:18130918

curl https://www.pgx.no/api/pharmacoracle -d "query=DirectSuperClasses:(snpCtoT_at some chr6_18139228) and (snpTtoC_at some chr6_18130918)"

Find the Azathioprine TPMT functional status of the TPMT*3B allele:

curl https://www.pgx.no/api/pharmacoracle -d "drugs=azathioprine&query=SuperClasses:has_haplotype some TPMTstar3B"

Find the Azathioprine dosing recommendations for a patient with two Azathioprine TPMT No Function alleles:

curl https://www.pgx.no/api/pharmacoracle -d "drugs=azathioprine&query=EquivalentClasses:has_phenotype some (has_function exactly 2 AzathioprineTPMT_NoFunction)"