Skip to content

Instantly share code, notes, and snippets.

@agrueneberg
Created October 25, 2012 17:44
Show Gist options
  • Save agrueneberg/3954263 to your computer and use it in GitHub Desktop.
Save agrueneberg/3954263 to your computer and use it in GitHub Desktop.
TCGA Toolbox for R
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
})
})
}
@agrueneberg
Copy link
Author

How to source: eval(parse(text=getURL("https://raw.github.com/gist/3954263/ea30be2ea67c51069ee80ac757d9f115f65923e7/TCGA.R"))) or source_gist("3954263") with devtools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment