From f2d2d835aa794c80832a1ce3b97e6b30eb954410 Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 29 Oct 2024 15:24:15 +0800 Subject: [PATCH] Add in preset modes --- R/bambu.R | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/R/bambu.R b/R/bambu.R index 60b11674..cd9e3a66 100644 --- a/R/bambu.R +++ b/R/bambu.R @@ -136,12 +136,30 @@ #' genome = fa.file, discovery = TRUE, quant = TRUE) #' @export bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, - opt.discovery = NULL, opt.em = NULL, rcOutDir = NULL, discovery = TRUE, + mode = NULL, opt.discovery = NULL, opt.em = NULL, rcOutDir = NULL, discovery = TRUE, assignDist = TRUE, quant = TRUE, stranded = FALSE, ncore = 1, yieldSize = NULL, trackReads = FALSE, returnDistTable = FALSE, lowMemory = FALSE, fusionMode = FALSE, verbose = FALSE, demultiplexed = FALSE, spatial = NULL, quantData = NULL, - sampleNames = NULL, cleanReads = TRUE, dedupUMI = FALSE, clusters = NULL) { + sampleNames = NULL, cleanReads = FALSE, dedupUMI = FALSE, clusters = NULL) { message(paste0("Running Bambu-v", "3.3.0")) + if(mode == "bulk"){ + lowMemory = TRUE + } + if(mode == "multiplexed"){ + if(is.null(demultiplex)) demultiplex = TRUE, + cleanReads = TRUE, + opt.em = list(degradationBias = FALSE), + quant = FALSE + } + if(mode == "fusion"){ + NDR = 1, + fusionMode = TRUE + } + if(mode == "debug"){ + verbose = TRUE, + trackReads = TRUE, + returnDistTable = TRUE + } if(is.null(annotations)) { annotations = GRangesList() } else annotations <- checkInputs(annotations, reads, readClass.outputDir = rcOutDir, genomeSequence = genome, discovery = discovery,