Skip to content

Commit

Permalink
fixed index fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Remy Schwab committed May 26, 2017
1 parent 2babb84 commit 01219c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Binary file modified .DS_Store
Binary file not shown.
22 changes: 10 additions & 12 deletions R/cn_preprocess.R
Expand Up @@ -103,23 +103,21 @@ fetchIndexHandler <- function
#'
#' @return nothing
#' @export
fetch_salmon_indices<-function
(destination = "/media/ephemeral1/dat/ref",
species = "mouse",
bucket = "cellnet-rnaseq",
dir = "ref",
iFile = "salmon.index.mouse.050316.tgz")
fetch_salmon_indices = function (destination = "/media/ephemeral1/dat/ref", species = "mouse",
bucket = "cellnet-rnaseq", dir = "ref", iFile)
{
curdir <- system("pwd", intern = T)
setwd(destination)
fname2 <- iFile
if (species == "mouse") {
fname2 = "salmon.index.mouse.050316.tgz"
fname3 <- "geneToTrans_Mus_musculus.GRCm38.80.exo_Jun_02_2015.R"
fname4 <- "Mus_musculus.GRCm38.83.gtf.gz"
}
else {
fname2 = "salmon.index.human.050316.tgz"
fname3 <- "geneToTrans_Homo_sapiens.GRCh38.80.exo_Jul_04_2015.R"
fname4 <- "Homo_sapiens.GRCh38.83.gtf.gz"
}
if(length(iFile) != 0) {
fname2 = iFile
}
cat("fetching and unpacking stuff needed for Salmon ...\n")
pref <- paste0("https://s3.amazonaws.com/", bucket, "/",
Expand All @@ -128,9 +126,9 @@ fetch_salmon_indices<-function
cmd <- paste("tar zxvf ", fname2, sep = "")
system(cmd)
download.file(paste0(pref, fname3), destfile = fname3)
download.file(paste0(pref, fname4), destfile = fname4)
cmd <- paste("gzip -d ", fname4, sep = "")
system(cmd)
#download.file(paste0(pref, fname4), destfile = fname4)
#cmd <- paste("gzip -d ", fname4, sep = "")
system("rm *.tgz")
setwd(curdir)
}

Expand Down

0 comments on commit 01219c0

Please sign in to comment.