diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fa6ea58..f96079c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix singularity image pull tag for MAGeCKFlute ([#160](https://github.com/nf-core/crisprseq/pull/160)) - Skip dolar signs on containerOptions ([#163](https://github.com/nf-core/crisprseq/pull/163)) - Fix error in R script when adding patterns ([#170](https://github.com/nf-core/crisprseq/pull/170)) +- Skip MAGeCKFlute when the function produces an error within the R package ### Deprecated diff --git a/templates/template_fluteMLE.R b/templates/template_fluteMLE.R index 1a9c10fd..015e4457 100644 --- a/templates/template_fluteMLE.R +++ b/templates/template_fluteMLE.R @@ -17,14 +17,28 @@ before_beta <- sub("\\\\.beta.*", "", beta_strings) unique_strings <- unique(before_beta) for(i in unique_strings) { - FluteMLE(mle, treatname= i, proj=i, pathview.top=5) - } + tryCatch( + { + FluteMLE(mle, treatname= i, proj=i, pathview.top=5) + }, + error=function(e) { + print(paste0("Could not run FluteMLE with project ",i)) + } + ) + } } else { beta_strings <- grep("\\\\.beta", colnames(mle), value = TRUE) before_beta <- sub("\\\\.beta.*", "", beta_strings) unique_strings <- unique(before_beta) for(i in unique_strings) { - FluteMLE(mle, treatname= i, proj=i, ${args}, pathview.top=5) + tryCatch( + { + FluteMLE(mle, treatname= i, proj=i, ${args}, pathview.top=5) + }, + error=function(e) { + print(paste0("Could not run FluteMLE with project ",i)) + } + ) } }