7tm Receptor Demo
This document describes the 7tm Receptor Demo, including compiling and running the source. This work done by the BioRDF task force in HCLS. For a broader description, please see the A journey to Semantic Web query federation in the life sciences.
Integrating 7TM GPCR data
7TM GPCRs play a significant role in cell signal transduction.
This demo integrates tabular laboratory data about 7tm receptors:
+----+-----------------+--------------------+-----------+----------------------+-----------------+---------+----------------------------+-------------------------+----------------------+-----------------+-------------------+---------------+------------------------+--------------------------+-----------------------+--------------------+---------------+-----------------+-----------------+-----------------------------+----------------------------+-------------------------+----------------------+-----------------+-------------------+ | ID | Family | Code | Ligand | Official_IUPHAR_name | Human_gene_name | HGNC_ID | Human_genetic_localisation | Human_nucleotide_RefSeq | Human_protein_RefSeq | Human_SwissProt | Human_Entrez_Gene | Rat_gene_name | Rat_Genome_Database_ID | Rat_genetic_localisation | Rat_nucleotide_RefSeq | Rat_protein_RefSeq | Rat_SwissProt | Rat_Entrez_Gene | Mouse_gene_name | Mouse_Genome_Informatics_ID | Mouse_genetic_localisation | Mouse_nucleotide_RefSeq | Mouse_protein_RefSeq | Mouse_SwissProt | Mouse_Entrez_Gene | +----+-----------------+--------------------+-----------+----------------------+-----------------+---------+----------------------------+-------------------------+----------------------+-----------------+-------------------+---------------+------------------------+--------------------------+-----------------------+--------------------+---------------+-----------------+-----------------+-----------------------------+----------------------------+-------------------------+----------------------+-----------------+-------------------+ | 3 | GABAB receptors | 2.3:GABA:1:GABAB1: | GABA | GABAB1 | GABBR1 | 4070 | 6p21.3 | NM_001470 | NP_001461 | Q9UBS5 | 2550 | Gabbr1 | 621537 | 20p12 | NM_031028 | NP_112290 | Q920D8 | 81657 | Gabbr1 | 46968 | 17B3 | NM_019439 | NP_062312 | Q9WV18 | 54393 | +----+-----------------+--------------------+-----------+----------------------+-----------------+---------+----------------------------+-------------------------+----------------------+-----------------+-------------------+---------------+------------------------+--------------------------+-----------------------+--------------------+---------------+-----------------+-----------------+-----------------------------+----------------------------+-------------------------+----------------------+-----------------+-------------------+
against structured data in wikipedia:
Identifiers | |
Symbol | GABBR1 |
Entrez | 2550 |
HUGO | 4070 |
OMIM | 603540 |
RefSeq | NM_021905 |
UniProt | Q9UBS5 |
Other data | |
Locus | Chr. 6 p21.3 |
Identifiers | |
Symbol | GABBR2 |
Alt. Symbols | GPR51 |
Entrez | 9568 |
HUGO | 4507 |
OMIM | 607340 |
RefSeq | NM_005458 |
UniProt | O75899 |
Other data | |
Locus | Chr. 9 q22.1-22.3 |
and assertions embedded in HTML embedded in HTML via ATAGs:
"Ethanol enhances GABA(B)-mediated inhibitory postsynaptic transmission on rat midbrain dopaminergic neurons by facilitating GIRK currents." aTags: Ethanol GABAB receptor Dopamine G protein-coupled inwardly-rectifying potassium channel (Source)
by executing a single SPARQL query with variables (?humanEntrez
and ?label
) shared between the sources:
… WHERE { SERVICE <http://localhost:8888/7tm_receptors> { ?iuphar iface:family ?family . ?iuphar iface:code ?code . ?iuphar iface:iupharName ?iupharNm . ?human iface:iuphar ?iuphar . ?human iface:geneName "GABBR1" . ?human iface:entrezGene ?humanEntrez . } SERVICE <http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=&> { _:gene dbp:entrezgene ?humanEntrez ; rdfs:label ?label ; FILTER (lang(?label) = "en") } GRAPH <http://hcls.deri.org/atag/data/gabab_example.html> { ?topic rdfs:label ?label . ?post sioc:topic ?topic } }
The 7tm_receptor
data is stored in a single SQL table constructed from a CSV file, though could also be represented in a spreadsheet.
SWObjects
(sourceforge) ⁃ (wikipedia)
SWObjects is a library for general RDF storage, query and query manipulation. After compilation, running the 7tm demo looks like:
INCLUDES=-I../dlib-17.11 make -k tests/7tm_receptors-flat.results ( cd tests/7tm_receptors/flat/ && ../../../bin/SPARQL_server --once http://localhost:8888/7tm_receptors receptors.map > ../../../tests/7tm_receptors-flat.results )& sleep 1 ( cd tests/7tm_receptors/flat/ && ../../../bin/SWtransformer -x -q --sparql-pattern http://dbpedia.org/.\* --sparql-pattern http://localhost:8888/.\* q.rq ) ┌─────────────────────┬───────────────────────────────────────────────────────────────────┬──────────────┬──────────────────────┬──────────────────────────────┬─────────────────────┐ │ ?label │ ?post │ ?humanEntrez │ ?code │ ?family │ ?iupharNm │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49d3249aec0b0> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49d230abda515> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49cab494999c6> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49cab3f287c53> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49c22f5a6faa9> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ └─────────────────────┴───────────────────────────────────────────────────────────────────┴──────────────┴──────────────────────┴──────────────────────────────┴─────────────────────┘
Compilation is easiest on a system with unix development tools:
# Check out version 781 of SWObjects into a director called SWObjects. svn co -r 781 https://swobjects.svn.sourceforge.net/svnroot/swobjects/trunk SWObjects # Install boost, expat and dlib-17.11 on your system. # Install gcc, bison and flex on your system. # Edit SWObjects/CONFIG # set HTTP_SERVER= DLIB # set XML_PARSER= EXPAT1 # make sure INCLUDES points to your dlib installation, e.g. INCLUDES += -I/usr/local/dlib-17.11 . # Install MySQL on your system. # Create the 7tm_receptor database. cd SWObjects/tests/7tm_receptors/flat/ emacs createDB.sh # and change "CREDS='-u root '" to whatever your MySQL requires. ./createDB.sh # Build and run the test. cd ../../.. make tests/7tm_receptors-flat.results
SWObjects should compile without warnings:
… touch lib/SWObjects.d makedepend -y -f lib/SWObjects.d lib/SWObjects.cpp config.h -DYYTEXT_POINTER=1 -I../dlib-17.11 -I/usr/local/dlib-17.11 -I/home/eric/checkouts/sparul -I/home/eric/checkouts/sparul/lib -I/home/eric/checkouts/sparul/MapSetParser -I/home/eric/checkouts/sparul/SPARQLfedParser -I/home/eric/checkouts/sparul/TrigSParser -I/home/eric/checkouts/sparul/TurtleSParser -I/home/eric/checkouts/sparul/lib 2>/dev/null … g++ -DYYTEXT_POINTER=1 -fPIC -g -O0 -W -Wall -Wextra -Wnon-virtual-dtor -ansi -std=c++98 -I../dlib-17.11 -I/usr/local/dlib-17.11 -I/home/eric/checkouts/sparul -I/home/eric/checkouts/sparul/lib -I/home/eric/checkouts/sparul/MapSetParser -I/home/eric/checkouts/sparul/SPARQLfedParser -I/home/eric/checkouts/sparul/TrigSParser -I/home/eric/checkouts/sparul/TurtleSParser -I/home/eric/checkouts/sparul/lib -pipe -c -o lib/SWObjects.o lib/SWObjects.cpp … g++ -o bin/SWtransformer bin/SWtransformer.o -L/home/eric/checkouts/sparul/lib -lSWObjects -lboost_regex-mt -lboost_system-mt -lexpat -lmysqlclient
and finish with the test output shown above. The output of the test is displayed. Additional process information is stored in tests/7tm_receptors-flat.results
.
Debugging flags can make it easier to see which pieces are connecting. SWtransformer will take a -d flag and generate a narrative describing connections to remote services:
# start server in background ../../../bin/SPARQL_server --once http://localhost:8888/7tm_receptors receptors.map > /dev/null & # start client with -d flag ../../../bin/SWtransformer -x -q --sparql-pattern http://dbpedia.org/.\* --sparql-pattern http://localhost:8888/.\* -d q.rq reading web resource http://hcls.deri.org/atag/data/gabab_example.html Querying <http://localhost:8888/7tm_receptors> for SELECT ?human ?humanEntrez ?code ?family ?iupharNm ?iuphar { ?iuphar <http://neuro.example/receptors#family> ?family . ?iuphar <http://neuro.example/receptors#code> ?code . ?iuphar <http://neuro.example/receptors#iupharName> ?iupharNm . ?human <http://neuro.example/receptors#iuphar> ?iuphar . ?human <http://neuro.example/receptors#geneName> "GABBR1" . ?human <http://neuro.example/receptors#entrezGene> ?humanEntrez . } yielded ┌──────────────────────┬──────────────────────────────┬────────┬──────────────┬─────────┬─────────────────────┐ │ ?code │ ?family │ ?human │ ?humanEntrez │ ?iuphar │ ?iupharNm │ │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ -- │ "2550" │ -- │ "GABA<sub>B1</sub>" │ └──────────────────────┴──────────────────────────────┴────────┴──────────────┴─────────┴─────────────────────┘ Querying <http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=&> for SELECT ?label ?humanEntrez { _:gene <http://dbpedia.org/ontology/entrezgene> ?humanEntrez . _:gene <http://www.w3.org/2000/01/rdf-schema#label> ?label . FILTER ( lang(?label) = "en" ) FILTER ((?humanEntrez="2550")) } yielded ┌──────────────┬─────────────────────┐ │ ?humanEntrez │ ?label │ │ "2550" │ "GABAB receptor"@en │ └──────────────┴─────────────────────┘ ┌─────────────────────┬───────────────────────────────────────────────────────────────────┬──────────────┬──────────────────────┬──────────────────────────────┬─────────────────────┐ │ ?label │ ?post │ ?humanEntrez │ ?code │ ?family │ ?iupharNm │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49d3249aec0b0> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49d230abda515> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49cab494999c6> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49cab3f287c53> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ │ "GABAB receptor"@en │ <http://hcls.deri.org/atag/data/gabab_example.html#49c22f5a6faa9> │ "2550" │ "2.3:GABA:1:GABAB1:" │ "GABA<sub>B</sub> receptors" │ "GABA<sub>B1</sub>" │ └─────────────────────┴───────────────────────────────────────────────────────────────────┴──────────────┴──────────────────────┴──────────────────────────────┴─────────────────────┘
Feel free to contact eric+7tm@w3.org with questions or comments.