#' Unzip the downloaded Data
#'
#' use the unzipData() fuction to unzip the downloaded Data,
#' get the reads counts of samples.
#' @import R.utils
#' @param dataPath the direction of download Data
#' @export
unzipData<-function(dataPath){
setwd(dataPath)
if (!file.exists('all')) {
dir.create('all')
}
if (!file.exists('output')) {
dir.create('output')
}
file_lists=list.files(pattern = '.*\\-.*\\-.*\\-.*\\-.*')
for (n in file_lists) {
x.path = paste(n, list.files(n), sep = '/')
if(!file.exists(paste("./all",n,sep='/'))){
file.copy(x.path, './all')
}
}
wdir = paste(dataPath, "all", sep = "/")
setwd(wdir)
i = 1
for (file in list.files(pattern = "*.gz")) {
print(paste0(file, "正在解压文件..."))
R.utils::gunzip(file, remove = T,overwrite=T)
print(paste0("已经解压完成 ", paste0(i, " 个!")))
i = i + 1
}
#删除annotation文件
file.remove("annotations.txt")
setwd(dataPath)
message("Completed!")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.