Examples

Which graphs can be queried on an endpoint like Pathway Commons?

BioPAX (Biological Pathway Exchange) is a RDF (Resource Description Framework)/OWL (Web Ontology Language) knowledge representation that can be stored on endpoints in two forms of graphs.

  • as Named Graph for each source of data; for example one named graph for Reactome, another for PID, etc.
  • or as an unique graph combining all data sources.

A module has been developped to provide a quick description of what users can query on an endpoint in order to forge their queries in consequence.

Get the description of graphs on a triplestore

Example of Pathway Commons

When all databases are grouped under the same graph URI (Uniform Resource Identifier), filtering on the provenance is mandatory.

$ biopax2cadbiom model --getGraphUris --triplestore http://rdf.pathwaycommons.org/sparql/
Graph URI: http://pathwaycommons.org
        Provenance URI: http://pathwaycommons.org/pc2/biogrid
        Name: BioGRID
        Comment: Source type: PSI_MI, BioGRID Release 3.4.149 (human and the viruses), 25-May-2017
        ---
Graph URI: http://pathwaycommons.org
        Provenance URI: http://pathwaycommons.org/pc2/kegg
        Name: KEGG Pathway
        Comment: Source http://www.cogsys.cs.uni-tuebingen.de/mitarb/draeger/BioPAX.zip type: BIOPAX, KEGG 07/2011 (only human, hsa* files), converted to BioPAX by BioModels (http://www.ebi.ac.uk/biomodels-main/) team
        ---
Graph URI: http://pathwaycommons.org
        Provenance URI: http://pathwaycommons.org/pc2/pid
        Name: NCI Pathway Interaction Database: Pathway
        Comment: Source type: BIOPAX, NCI Curated Human Pathways from PID (final); 27-Jul-2015
        ---
Graph URI: http://pathwaycommons.org
        Provenance URI: http://pathwaycommons.org/pc2/panther
        Name: PANTHER Pathway
        Comment: Source ftp://ftp.pantherdb.org/pathway/3.4.1/BioPAX.tar.gz type: BIOPAX, PANTHER Pathways 3.4.1 on 04-Jul-2016 (auto-converted to human-only model)
        ---
Graph URI: http://pathwaycommons.org
        Provenance URI: http://pathwaycommons.org/pc2/reactome
        Name: Reactome
        Comment: Source http://www.reactome.org/download/current/biopax.zip type: BIOPAX, Reactome v61 (only 'Homo_sapiens.owl') 23-Jun-2017
        ---
...

Below is the command to make a Cadbiom model from Pathway Commons, based on PID:

$ biopax2cadbiom model \
--listOfGraphUri http://pathwaycommons.org \
--provenanceUri http://pathwaycommons.org/pc2/pid \
--triplestore http://rdf.pathwaycommons.org/sparql/ \
--fullCompartmentsNames

The parameter --listOfGraphUri provides the URI of the graphs queried (and optionally of the BioPAX ontology if it is hosted separately).

It is thus necessary to filter the RDF triples according to their origin. This is why the optional parameter --provenanceURI has been introduced. By setting it, the program will filter entities, reactions, pathways, etc. on their dataSource BioPAX attribute.

The URL of the endpoint is specified with --triplestore.

Example of named graphs

When all databases are separated in different graphs, filtering on the provenance is NOT mandatory.

$ biopax2cadbiom model --getGraphUris --triplestore http://127.0.0.1:8890/sparql/
Graph URI: http://reactome.org/cavia
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/cricetulus
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/crithidia
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/escherichia
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/homarus
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/mycobacterium
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/triticum
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://reactome.org/vigna
        Name: None
        Comment: http://www.reactome.org
        ---
Graph URI: http://www.irisa.fr/dyliss/data/metacyc20
        Name: None
        Comment: None
        ---
Graph URI: http://www.pathwaycommons.org/v9/pid
        Name: NCI Pathway Interaction Database: Pathway
        Comment: Source type: BIOPAX, NCI Curated Human Pathways from PID (final); 27-Jul-2015
        ---
Graph URI: http://biopax.org/lvl3
        Name: None
        Comment: None
        ---
Graph URI: http://virtualcases.org/1
        Name: None
        Comment: None
        ---
...

Below is the command to make a model from a local endpoint, hosting the PID graph:

$ biopax2cadbiom model \
--listOfGraphUri http://biopax.org/lvl3 http://www.pathwaycommons.org/v9/pid \
--triplestore http://127.0.0.1:8890/sparql/ \
--fullCompartmentsNames

The parameter --listOfGraphUri provides the URI of the graphs queried (and optionally of the BioPAX ontology if it is hosted separately).

The URL of the endpoint is specified with --triplestore.

Examples of conversions from BioPAX graphs towards Cadbiom models

Reactome - Homarus_americanus.owl

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/homarus

ImageOfHomarusTestCase

Reactome - Crithidia_fasciculata.owl

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/crithidia

ImageOfCrithidiaTestCase

Reactome - Vigna_radiata_var._radiata.owl

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/vigna

ImageOfVignaTestCase

ImageOfVignaTestCase

Reactome - Triticum_aestivum.owl

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/triticum

ImageOfTriticumTestCase

Reactome - Cavia_porcellus.owl

Command: biopax2cadbiom model --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/cavia

ImageOfCaviaTestCase

Virtual Cases - virtualCase1.owl

Command: biopax2cadbiom model --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/1

ImageOfVirtualCase1

Virtual Cases - virtualCase2.owl

Command: biopax2cadbiom model --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/2

ImageOfVirtualCase2

Reactome - Escherichia_coli.owl

Command: biopax2cadbiom model --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/escherichia

ImageOfEscherichia

Reactome - Cricetulus_griseus.owl

Command: python -m biopax2cadbiom --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/cricetulus

ImageOfEscherichia

Reactome - Mycobacterium_tuberculosis.owl

Command: biopax2cadbiom model --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://reactome.org/mycobacterium

Virtual Cases - virtualCase3.owl

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/3

ImageOfVirtualCase3

Virtual Cases - virtualCase4.owl

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/4

ImageOfVirtualCase4

Virtual Cases - virtualCase5.owl

Command: biopax2cadbiom model --convertFullGraph --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/5

ImageOfVirtualCase5

Virtual Cases - virtualCase6.owl

Challenge: A class A with 2 members A1 and A2 that are not reused elsewhere. A is a component of the complex AB that regulates the reaction C -> D. Without –convertFullGraph, A1 and A2 must not be present in the model.

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/6

ImageOfVirtualCase6

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/6 --convertFullGraph

ImageOfVirtualCase6full

Virtual Cases - virtualCase6b.owl

Challenge: Same as virtualCase6 but A is a simple protein instead a class.

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/6b

ImageOfVirtualCase6b

Virtual Cases - virtualCase7.owl

Challenge: A class A with 3 members A1, A2 and A3; A1 and A3 are reused elsewhere. A1 is a control of the reaction B -> C. A3 participates to the reaction A3 -> D and A participates to the reaction A -> E. Without –convertFullGraph, A2 must not be present in the model. Thus A must subsist to represent A2, and a reaction from “A entities” to E must be present to translate the genericity of class A.

PS: From now, in test cases multiple members of classes were not reused in the model.

Command: biopax2cadbiom model --listOfGraphUri http://biopax.org/lvl3 http://virtualcases.org/7

ImageOfVirtualCase7