Skip to content

Instantly share code, notes, and snippets.

@eweitz
Last active June 9, 2021 12:44
Show Gist options
  • Save eweitz/920daff2bd79e59457b088916e3c2521 to your computer and use it in GitHub Desktop.
Save eweitz/920daff2bd79e59457b088916e3c2521 to your computer and use it in GitHub Desktop.
Pathway count by organism in WikiPathways
# Get number of pathways by organism in WikiPathways
# Graph of output:
# https://docs.google.com/spreadsheets/d/1zZSqeKufuYxfFd3pFeMAUOjCm1sLRAw5SgJ4OJel9M8/edit?usp=sharing
# Fetch all organisms in WikiPathways
curl -s https://webservice.wikipathways.org/listOrganisms?format=json | jq .organisms[] > organisms-wikipathways.json
# Fetch all pathways in WikiPathways
curl -s https://webservice.wikipathways.org/listPathways?format=json | jq . > all-wikipathways.json
# Print all organisms in WikiPathways
cat organisms-wikipathways.json
# Count pathways by organism
cat organisms-wikipathways.json | xargs -I{} grep -c {} all-wikipathways.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment