Extraer la información de los pathways con su respectivas interacciones usando SPARQL

44 views
Skip to first unread message

Delia Moreno

unread,
Feb 27, 2024, 11:22:34 AMFeb 27
to wikipathways-discuss
Good morning everyone,

As part of a project of my PhD, I need to extract the information of the pathways with their respective interactions in the case that applies, I was reviewing documentation and with the wikipathways endpoint seems to be the way, however I have not managed to create the query, I saw that they have examples but they do not work for me. Basically I want to extract the information from the image in a dataframe for later analysis.

Thank you very much in advance.

Translated with DeepL.com (free version)

Kristina Hanspers

unread,
Feb 28, 2024, 2:44:25 PMFeb 28
to wikipathwa...@googlegroups.com
Hi Delia,

There a "InteractionsofPathway" example query under General, which returns all interactions. Is that what you're looking for?


Regards,

Kristina

--
You received this message because you are subscribed to the Google Groups "wikipathways-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wikipathways-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wikipathways-discuss/f4c08e54-d369-4f76-97d9-bb29c0d3436bn%40googlegroups.com.

Delia Moreno

unread,
Feb 28, 2024, 3:05:05 PMFeb 28
to wikipathways-discuss
Hi Kristina, Not its different, in my case I want to extract all the information of the interactions as it is in the GPML file, according to I have investigated I must mix the two vocabularies of Wikipathways WP and GPML, but I have not been able to obtain all the information, to that adding that I am not expert with SPARQL which does not help me.

Egon Willighagen

unread,
Feb 28, 2024, 4:39:50 PMFeb 28
to wikipathwa...@googlegroups.com

Dear Delia,

okay, those SPARQL are a lot trickier, but we have written one in the past. I need to dig that up, and maybe it was my colleague Denise instead of myself.

It may take a few days to find it and/or rewrite it.

Egon




--
New work on FAIR data in materials science and nanotoxicology: "Harmonising knowledge for safer materials via the “NanoCommons” Knowledge Base",https://doi.org/10.3389/fphy.2023.1271842

--
E.L. Willighagen
Department of Bioinformatics - BiGCaT
Maastricht University (http://www.bigcat.unimaas.nl/)
Blog: https://chem-bla-ics.blogspot.com/
Mastodon: https://social.edu.nl/@egonw
PubList: https://orcid.org/0000-0001-7542-0286

Delia Moreno

unread,
Feb 28, 2024, 6:10:05 PMFeb 28
to wikipathways-discuss
Hi Egon,

thank you very much, I'll be waiting, meanwhile I'll keep looking.

Thank you all for taking the time to help me! I promise that when I have my ontology project ready, I will share it with you in case it is useful, as it will be related to identifying the risks associated with lung cancer.

De Sl

unread,
Mar 1, 2024, 7:39:02 AMMar 1
to wikipathways-discuss
Hi Delia,

What information would you need on the interactions? There's a lot that could be queried (but not all at the same time; this might lead to timeout issues).
Are you for example interested in metabolic conversions, so require a substrate/target relationship (and potentially the enzyme catalyzing that)>
Or, are you more interested in signalling pathways (so interactions between genes, transcripts, proteins, RNAs, and what not)?
If I have a better understanding of your research question, I am able to help.

The following example query takes out all the directed individual interactions from Human models based on WikiPathways and Reactome, including the type of interaction (based on MIM, for details see https://doi.org/10.1093/bioinformatics/btr336 ):

SELECT DISTINCT ?interaction ?mimtype ?pathway (str(?titleLit) as ?title)
WHERE {  
?pathway a wp:Pathway ;
         wp:organismName "Homo sapiens";
         dc:title ?titleLit .
?interaction dcterms:isPartOf ?pathway .
?interaction a wp:DirectedInteraction .
?interaction wp:source ?source .
?interaction wp:target ?target .
OPTIONAL{?interaction a ?mimtype} .
VALUES ?mimtype {wp:ComplexBinding wp:Conversion wp:Inhibition wp:Catalysis wp:Stimulation wp:TranscriptionTranslation wp:DirectedInteraction} .
  }
ORDER BY DESC(?mimtype)

Hope this helps as a start to get your project going! Denise

De Sl

unread,
Mar 1, 2024, 11:26:35 AMMar 1
to wikipathways-discuss
And an update on the query above: it currently gives 10.000 results in our SNORQL interface.
A solution to get all data, is described below (thanks Ammar Ammar for explaining the details!).
Another solution would be to filter by pathway, and run the query from a script.

Virtuoso by default has a limit of 10000 results.
Ammar Ammar  2 hours ago
One way of dealing lengthy query result set is to use "OFFSET num" in the query (after LIMIT) which tells the query engine to start the results from the result item "num" onwards. This way, you achieve pagination in SPARQL
Ammar Ammar  2 hours ago
For example, if a query has 6000 results and you want to get them in 3 batches, you make 3 queries:
  • the first query ends with
LIMIT 2000
  • the second ends with:
LIMIT 2000
OFFSET 2000
that will get results (2000-4000)
  • the third ends with
LIMIT 2000
OFFSET 4000
that will get results (4000-6000)
Ammar Ammar  2 hours ago
It is also a good practice to use ORDER BY before LIMIT since there is no garauntee to get the results in the same order with every select. Especially, if the triple store storage is partitioned or distributed.

Delia Moreno

unread,
Mar 1, 2024, 12:14:16 PMMar 1
to wikipathways-discuss
Hello,
Thank you very much for your help, in my case I am interested in the signaling routes.
For example, suppose I want to extract the information about Non-small cell lung cancer (WP4255) in the image that is formed from the GPML showing the different interactions, mutations, etc.

Delia Moreno

unread,
Mar 1, 2024, 12:14:29 PMMar 1
to wikipathways-discuss
Hello,

I put a specific WP, but now in the titles I put the name of the disease.

SELECT DISTINCT ?interaction ?mimtype ?pathway (str(?titleLit) as ?title)
WHERE {  
  ?pathway a wp:Pathway ;
           wp:organismName "Homo sapiens";
           dc:title ?titleLit .
  FILTER(STR(?pathway) = 'https://identifiers.org/wikipathways/WP4255_r127755')

  ?interaction dcterms:isPartOf ?pathway .
  ?interaction a wp:DirectedInteraction .
  ?interaction wp:source ?source .
  ?interaction wp:target ?target .
  OPTIONAL {
    ?interaction a ?mimtype .
    VALUES ?mimtype {wp:ComplexBinding wp:Conversion wp:Inhibition wp:Catalysis wp:Stimulation wp:TranscriptionTranslation wp:DirectedInteraction} .
  }
}
ORDER BY DESC(?mimtype)

Delia Moreno

unread,
Mar 11, 2024, 12:06:30 PMMar 11
to wikipathways-discuss
Hello all,

I don't know if anyone has any idea how I can move the image path in a data frame using sparkql?

I would appreciate it very much.

Egon Willighagen

unread,
Mar 13, 2024, 2:33:56 AMMar 13
to wikipathwa...@googlegroups.com
On Mon, 11 Mar 2024 at 17:06, Delia Moreno <deliamo...@gmail.com> wrote:
I don't know if anyone has any idea how I can move the image path in a data frame using sparkql?

I am not sure I understand this question. Can you elaborate?

Egpm

Reply all
Reply to author
Forward
0 new messages