-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
662 additions
and
258 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#' Download example Seurat objects | ||
#' | ||
#' Download example Seurat objects required for ShinyCell tutorial. | ||
#' | ||
#' @param type can be either "single" or "multi" which downloads one or two | ||
#' Seurat objects respectively for the Quick Start/Detailed Tutorial or | ||
#' Multi-dataset Tutorial respectively | ||
#' | ||
#' @return downloaded Seurat object | ||
#' | ||
#' @author John F. Ouyang | ||
#' | ||
#' @import data.table | ||
#' | ||
#' @examples | ||
#' getExampleData() | ||
#' | ||
#' @export | ||
getExampleData <- function(type = c("single", "multi")){ | ||
# Setup and checks | ||
files = c("http://files.ddnetbio.com/hrpiFiles/readySeu_rset.rds", | ||
"http://files.ddnetbio.com/hrpiFiles/readySeu_d21i.rds") | ||
names(files) = c("./readySeu_rset.rds", "./readySeu_d21i.rds") | ||
if(type[1] == "single"){ | ||
files = files[1] | ||
} else if(type[1] != "multi"){ | ||
stop("argument has to be either 'single' or 'multi'!") | ||
} | ||
|
||
# Download files | ||
for(i in seq_along(files)){ | ||
if(!file.exists(names(files)[i])) { | ||
res <- tryCatch(download.file(files[i], | ||
destfile = names(files)[i], | ||
method = "auto"), | ||
error = function(e) 1) | ||
if(res == 1){ | ||
stop(paste0("Following file cannot be downloaded: ", names(files)[i])) | ||
} | ||
} | ||
} | ||
# return(scConf) | ||
} | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.