![]() |
Colored pathways created with the new R package. |
Of course, hiding those details is not so much of an issue, and since I have made so many R packages in the past, I decided to pick up the request to create an R package for WikiPathways: rWikiPathways. It is not feature complete yet, and not extensively tested in daily use yet (there is a test suite). But here are some code examples. Listing pathways and organisms in the wiki is done with:
organisms = listOrganisms()
pathways = listPathways()
humanPathways = listPathways(organism="Homo sapiens")
For the technology oriented users, for each pathway, you have access to the GPML source file for each pathway:gpml = getPathway(pathway="WP4")
gpml = getPathway(pathway="WP4", revision=83654)
However, most use will likely be via database identifiers for genes, proteins, and metabolites, called Xrefs (also check out the R package for BridgeDb):xrefs = getXrefList(pathway="WP2338", systemCode="S")
pathways = findPathwaysByXref("HMDB00001", "Ch")
pathways = findPathwaysByXref(identifier="HMDB00001", systemCode="Ch")
pathways = findPathwaysByXref(
identifier=c("HMDB00001", "HMDB00002"),
systemCode=c("Ch", "Ch")
)
Of course, these are just the basics, and the question was about colored pathways. The SOAP code was a bit more elaborate, and this is the version with this new package (the result at the top of this post):svg = getColoredPathway(pathway="WP1842", graphId=c("dd68a","a2c17"),
color=c("FF0000", "00FF00"));
writeLines(svg, "pathway.svg")
If you use this package in your research, please cite the below WikiPathways paper. If you have feature requests, please post the in the issue tracker.
Add a comment