Skip to content

Commit 87698bf

Browse files
authored
Merge pull request #121 from bcbio/feat_120_isolate_rnaseq
BREAKING CHANGE download rnaseq template from new repo
2 parents baad563 + 8e91dd4 commit 87698bf

File tree

22 files changed

+30
-4075
lines changed

22 files changed

+30
-4075
lines changed

R/helpers.R

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,31 @@ deploy_apps <- function(apps, path){
185185
})
186186
}
187187

188+
deploy_repos <- function(repo_url, path){
189+
ui_info("Getting templates from {ui_value(repo_url)}")
190+
191+
dest_file=file.path(path, paste0(names(repo_url), ".zip"))
192+
download.file(url = repo_url,
193+
destfile = dest_file)
194+
unzip(zipfile = dest_file, exdir = dirname(dest_file))
195+
fs::file_delete(dest_file)
196+
repo_unzip_path <- file.path(path,
197+
paste0(names(repo_url), "-main"))
198+
copy_files_in_folder(repo_unzip_path,
199+
path)
200+
fs::dir_delete(repo_unzip_path)
201+
}
202+
188203
copy_templates <- function(path, pipeline, org=NULL){
189204
apps=list()
190205
base = c("bcbioR")
206+
repos = c("none")
191207
if (pipeline=="base"){
192208
parts = c("templates/base")
193209
}else if(pipeline=="nf-core/rnaseq"){
194210
parts = c("templates/rnaseq")
211+
repos = "https://github.com/bcbio/rnaseq-reports/archive/refs/heads/main.zip"
212+
names(repos)="rnaseq-reports"
195213
}else if(pipeline=="singlecell"){
196214
parts = c("templates/singlecell")
197215
apps=c(apps, scRNAseq_qc="https://github.com/hbc/scRNAseq_qc_app/archive/refs/heads/main.zip")
@@ -205,13 +223,19 @@ copy_templates <- function(path, pipeline, org=NULL){
205223
}else if(pipeline=="chipseq"){
206224
parts = c("templates/chipseq")
207225
}
208-
analysis_template <- fs::path_package(base, parts)
209226

210-
ui_info("Getting templates from {ui_value(analysis_template)}")
211-
# ls_files <- grep("org", list.files(analysis_template, full.names = TRUE),
212-
# value = TRUE, invert = TRUE)
213-
# ui_info("{ui_value(length(ls_files))} amount of files to copy")
214-
copy_files_in_folder(analysis_template, path)
227+
#check if it is url or folder
228+
if (isUrl(repos)){
229+
deploy_repos(repos, path)
230+
}else{
231+
analysis_template <- fs::path_package(base, parts)
232+
233+
ui_info("Getting templates from {ui_value(analysis_template)}")
234+
# ls_files <- grep("org", list.files(analysis_template, full.names = TRUE),
235+
# value = TRUE, invert = TRUE)
236+
# ui_info("{ui_value(length(ls_files))} amount of files to copy")
237+
copy_files_in_folder(analysis_template, path)
238+
}
215239
if (!is.null(org)){
216240
org_template <- fs::path_package(base, parts, "org", org)
217241
if (fs::dir_exists(org_template)){

inst/templates/rnaseq/00_libs/FA.R

Lines changed: 0 additions & 150 deletions
This file was deleted.

inst/templates/rnaseq/00_libs/load_data.R

Lines changed: 0 additions & 159 deletions
This file was deleted.

inst/templates/rnaseq/00_params/params-example.R

Lines changed: 0 additions & 12 deletions
This file was deleted.

inst/templates/rnaseq/00_params/params.R

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)