wikipathways / WikiPathwaysCurator

Unit tests that validate the WikiPathways content and support the curation of the knowledge base.
MIT License
1 stars 2 forks source link

Curation Query for Conversions #14

Open RyAMiller opened 4 years ago

RyAMiller commented 4 years ago

While doing some work pertaining to WikiPathway sementics, I used the query

      SELECT (substr(str(?o),41) as ?IntType) (COUNT(?o) as ?IntCount)
      WHERE {
        ?entity a ?o . 
        ?entity a wp:Interaction . 
        ?entity dcterms:isPartOf <http://identifiers.org/wikipathways/WP1423_r106690> .
        ?entity dcterms:isPartOf ?pathway .
        ?pathway    a wp:Pathway ;
            wp:ontologyTag <http://vocabularies.wikipathways.org/wp#Curation:AnalysisCollection> ;
            wp:organismName        "Homo sapiens"^^xsd:string .
      } ORDER BY DESC(?IntCount)`

for the pathway. WP1423. It is a pathway about Sphingolipid Metabolism. A majority of the interactions look to be conversions of metabolites from one form to another facilitated by enzyme catalysis. All of conversion events are only classified as DirectedInteractions and do not have the type "conversion."

All catalysis events that convert a metabolite from one form to another would be conversions, correct? It seems like this might help to identify interactions that should by type 'conversion' but not.

RyAMiller commented 4 years ago

want a query that creates a table for catalysis interactions of substrate and product

RyAMiller commented 4 years ago

I think the following query is more what we had in mind. It returns the Interaction ID used by the WP RDF for the catalysis interaction, the pathway that it belongs to, the enzyme source for the interaction, the interaction that is the target of the enzyme, and the interaction type for that target interaction. Ideally this target interaction would be type wp:Conversion and that is the case some of the time, but also not always the case.

PREFIX gpml:    <http://vocabularies.wikipathways.org/gpml#>
PREFIX wp:      <http://vocabularies.wikipathways.org/wp#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT (substr(str(?entity),37) as ?catInt) ?pathway ?enzyme ?target ?IntType
      WHERE {
        ?entity a ?o . 
        ?entity a wp:Interaction . 
        ?entity a wp:Catalysis .
        ?entity wp:source ?enzyme . 
        ?entity wp:target ?target . 
        ?target a wp:Interaction .
        ?target a ?IntType . 
        ?entity dcterms:isPartOf ?pathway .
        ?pathway    a wp:Pathway .
      } 
egonw commented 4 years ago

Okay, here's a variation that find mim-catalysis interactions on what are likely things like membrane transports:

prefix dcterms:  <http://purl.org/dc/terms/>
prefix dc:      <http://purl.org/dc/elements/1.1/>
prefix xsd:     <http://www.w3.org/2001/XMLSchema#>
prefix foaf:    <http://xmlns.com/foaf/0.1/>
prefix wp:      <http://vocabularies.wikipathways.org/wp#>
prefix gpml:  <http://vocabularies.wikipathways.org/gpml#>
prefix tag:     <http://vocabularies.wikipathways.org/wp#Curation:>

SELECT DISTINCT ?homepage ?enzyme ?enzymeLabel ?substrate ?substrateLabel ?product ?productLabel
WHERE {
  ?catalysis a wp:Catalysis ;
    dcterms:isPartOf ?pathway ;
    wp:source ?enzyme ;
    wp:target ?conversion .
  ?conversion a wp:Interaction ;
    wp:source ?substrate ;
    wp:target ?product .
  FILTER ( ?substrate = ?product )
  MINUS { ?conversion a wp:Conversion }
  ?enzyme rdfs:label ?enzymeLabel .
  ?substrate rdfs:label ?substrateLabel .
  ?product rdfs:label ?productLabel .
  ?pathway a wp:Pathway ;
    foaf:page ?homepage .
  MINUS { ?pathway wp:ontologyTag tag:Reactome_Approved . }
}
egonw commented 4 years ago

This query would list the interactions that should likely be interaction:


prefix dcterms:  <http://purl.org/dc/terms/>
prefix dc:      <http://purl.org/dc/elements/1.1/>
prefix xsd:     <http://www.w3.org/2001/XMLSchema#>
prefix foaf:    <http://xmlns.com/foaf/0.1/>
prefix wp:      <http://vocabularies.wikipathways.org/wp#>
prefix gpml:  <http://vocabularies.wikipathways.org/gpml#>
prefix tag:     <http://vocabularies.wikipathways.org/wp#Curation:>

SELECT DISTINCT ?homepage ?graphid ?enzyme ?substrate ?product
WHERE {
  ?catalysis a wp:Catalysis ;
    dcterms:isPartOf ?pathway ;
    wp:source ?enzyme ;
    wp:target ?conversion .
  ?conversion a wp:Interaction ;
    wp:isAbout/gpml:graphId ?graphid ;
    wp:source ?substrate ;
    wp:target ?product .
  FILTER ( ?substrate != ?product )
  MINUS { ?conversion a wp:Conversion }
  ?enzyme rdfs:label ?enzymeLabel .
  ?substrate rdfs:label ?substrateLabel .
  ?product rdfs:label ?productLabel .
  ?pathway a wp:Pathway ;
    foaf:page ?homepage .
  MINUS { ?pathway wp:ontologyTag tag:Reactome_Approved . }
} ORDER BY ?homepage ?graphid```