Created
October 25, 2012 17:44
-
-
Save agrueneberg/3954263 to your computer and use it in GitHub Desktop.
TCGA Toolbox for R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RCurl) | |
library(rjson) | |
TCGA.get <- function (uri) { | |
getURI(uri) | |
} | |
TCGA.find <- function (query) { | |
uri <- paste("http://agalpha.mathbiol.org/repositories/tcga?infer=true&query=", URLencode(query, reserved=TRUE), sep="") | |
response <- fromJSON(getURI(uri, httpheader=c("Accept: application/sparql-results+json"))) | |
lapply(response$results$bindings, function (binding) { | |
lapply(binding, function (solution) { | |
solution$value | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to source:
eval(parse(text=getURL("https://raw.github.com/gist/3954263/ea30be2ea67c51069ee80ac757d9f115f65923e7/TCGA.R")))
orsource_gist("3954263")
with devtools.