Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pathway Issue]: Frequent timeouts when using API #116

Open
1 of 7 tasks
BeatWolf opened this issue Jan 18, 2024 · 4 comments
Open
1 of 7 tasks

[Pathway Issue]: Frequent timeouts when using API #116

BeatWolf opened this issue Jan 18, 2024 · 4 comments
Assignees

Comments

@BeatWolf
Copy link

What is the issue with the pathway?

Hi, i'm trying to use the API, notably to get all pathways from a given species.
When using for example:
https://webservice.wikipathways.org/ui/#!/Organism_list/get_listOrganisms

With Homo sapiens, it is slow and often simply times out.

What kind of content issue is this?

  • Missing content
  • Incorrect content
  • Duplicated content
  • Other

Type of revision

  • Major
  • Minor
  • Deletion
@khanspers
Copy link
Member

Hi @BeatWolf, there is an issue with the web service currently, we are working on fixing it.

@khanspers
Copy link
Member

@BeatWolf : it should work now, please try again. I just tried getting all pathways from Homo sapiens (https://webservice.wikipathways.org/listPathways?organism=Homo%20sapiens), and results were returned within a few seconds.

@AlexanderPico AlexanderPico self-assigned this Jan 19, 2024
@AlexanderPico
Copy link
Member

@BeatWolf On a related note: We have a new JSON-based API we are planning to migrate to. The current (not-so-stable) one will be retired at some point in the future.

If you want to share more about how you use our API, we can provide code examples to help you migrate. For example, do you use the R, Python or Java client libraries? Do you use the Swagger UI by hand? Or do you use curl or direct http calls from your scripts?

And which methods do you use?

Here is the documentation for the new API so far: https://www.wikipathways.org/json/
Essentially, we have pre-compiled JSON responses for everything, so you can just grab the JSON you need and parse it from there.

@BeatWolf
Copy link
Author

Hi, thank you for the fix.

As for the new API, indeed, although i usually only need the pathways of one organism, the URL:
https://www.wikipathways.org/json/listPathways.json
Has all i need and is faster than the API, so i'll just switch to that.

After that i need some information about the pathways. Mostly to map them to the correct genes. As this needs to work for multiple species and sometimes i have ensembl genes and sometimes refseq genes etc, i get the information through the sparql endpoint:

https://sparql.wikipathways.org/sparql?default-graph-uri=&query=PREFIX+wp%3A++++++%3Chttp%3A%2F%2Fvocabularies.wikipathways.org%2Fwp%23%3E%0APREFIX+rdfs%3A++++%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+dcterms%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0Aselect+distinct+%3Fpathway+str%28%3Flabel%29+as+%3Fname+%3Fentrez+%3FhgncId+where+%7B%0A%7B+%3FgeneProduct+a+wp%3AGeneProduct+%7D+UNION+%7B+%3FgeneProduct+a+wp%3AProtein+%7D+.+%0A%3FgeneProduct+rdfs%3Alabel+%3Flabel+.+%0A%3FgeneProduct+dcterms%3AisPartOf+%3Fpathway+.+%0A%3FgeneProduct+wp%3AbdbEntrezGene+%3Fentrez+.+%0AOptional+%7B+%3FgeneProduct+wp%3AbdbHgncSymbol+%3FhgncId+.+%7D+%0A%3Fpathway+a+wp%3APathway+.+%0A%3Fpathway+wp%3AorganismName+%22Arabidopsis+thaliana%22+.+%0A%7D%0ALIMIT+50000%0AOFFSET+0&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on

I think i could maybe get the same information through https://www.wikipathways.org/json/findPathwaysByXref.json and https://www.wikipathways.org/json/findPathwaysByText.json
But i think thats trickier. I would like to have for every node/gene mentioned to get as much information as i can, to then map it to the current gene model. I do not think anything like that is possible currently with the new API?

@khanspers khanspers transferred this issue from wikipathways/wikipathways-help Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants