Code Monkey home page Code Monkey logo

Comments (3)

egonw avatar egonw commented on August 22, 2024

@DeniseSl22, didn't we write a SPARQL query for this at some point in time? Or was that just on my long wish-/todo list?

from rwikipathways.

egonw avatar egonw commented on August 22, 2024

The pathway WP5424 is not in the RDF yet, but the following SPARQL should give you some idea how to do this:

SELECT ?wpid ?catalyst ?source ?target WHERE {
  ?pathway a wp:Pathway ;
      dc:identifier / dcterms:identifier ?wpid .
  ?catalysis a wp:Catalysis ;
    dcterms:isPartOf ?pathway ;
    wp:source / rdfs:label ?catalyst ;
    wp:participants ?reaction .
  ?reaction a wp:Interaction .
  OPTIONAL { ?reaction wp:source ?source }
  OPTIONAL { ?reaction wp:target ?target }
} ORDER BY ASC(?catalysis)

from rwikipathways.

DeniseSl22 avatar DeniseSl22 commented on August 22, 2024

@avelar-ageing , thanks for your question!
I've modified the query of @egonw slightly, see below.

I believe that the reactions without a clear source and/or target are not relevant in this case (and require some curation on our side). There are also a bunch of interactions between two metabolites which have not been drawn with the MIM-Catalysis interaction type, but with a regular arrow. I've reworked that line in the SPARQL query (see below), so you can comment it out to see the difference in response (# is used for comments in SPARQL).
When only including interactions of type MIM:Catalysis, you would receive 5296 results; if commenting out this line, you get 6189 results (so ~900 more). I've also added a way to unify to one database type (Wikidata, others are possible, e.g. HMDB, ChEBI, PubChem) for the metabolite annotations, in case you would want to merge the data at a later stage. Unifying the enzyme annotations can be done in a similar matter (to HGNC, Ensembl, UniProt, etc.)

Also note that this is for all pathway (WikiPathways and Reactome) and all species.
Hope the above helps, if not ask another question here.

SELECT DISTINCT ?wpid ?catalyst ?source ?sourceDb ?target ?targetDb WHERE {
  ?pathway a wp:Pathway ;
      dc:identifier / dcterms:identifier ?wpid .
 # ?catalysis a wp:Catalysis .
  ?catalysis dcterms:isPartOf ?pathway ;
    wp:source / rdfs:label ?catalyst ;
    wp:participants ?reaction .
  ?reaction a wp:Interaction .
  ?reaction wp:source ?source .
  ?source a wp:Metabolite . 
  OPTIONAL{?source wp:bdbWikidata ?sourceDb .}
  
  ?reaction wp:target ?target .
  ?target a wp:Metabolite . 
  OPTIONAL{?target wp:bdbWikidata ?targetDb .}
} ORDER BY ASC(?source)

from rwikipathways.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.