Skip to content

Instantly share code, notes, and snippets.

@trestletech
Last active December 19, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trestletech/6033932 to your computer and use it in GitHub Desktop.
Save trestletech/6033932 to your computer and use it in GitHub Desktop.
Download all 4 bioconductor Gists and put them in your current working directory.
getLocalGist <- function(gistID, dirName){
url <- paste0("https://gist.github.com/",gistID,"/download")
if (shiny:::download(url, paste0(dirName,".tar.gz"), mode = "wb", quiet = TRUE) != 0)
stop("Failed to download URL ", url)
gistName <- shiny:::untar2(paste0(dirName,".tar.gz"), list=TRUE)[1]
shiny:::untar2(paste0(dirName,".tar.gz"))
#file.rename seems to be pretty fragile, but this seems to be working...
dir.create(dirName)
file.copy(paste0(gistName, dir(gistName)), dirName, recursive=TRUE)
unlink(gistName, recursive=TRUE)
unlink(paste0(dirName,".tar.gz"))
}
getLocalGist(5924147, "Example1")
getLocalGist(5929468, "Example2")
getLocalGist(5929598, "Example3")
getLocalGist(5948876, "Example4")
#Cleanup and load data
rm(getLocalGist)
normal <- readRDS("Example1/normalExpr.Rds")
tumor <- readRDS("Example1/tumorExpr.Rds")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment