From e316ebe37013210ce8e525397c6bdf64c6e5ffae Mon Sep 17 00:00:00 2001 From: lingminhao Date: Thu, 6 Feb 2025 14:26:15 +0800 Subject: [PATCH] fix bug about CompressedCharacterList --- R/bambu.R | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/R/bambu.R b/R/bambu.R index a42ae236..17902f87 100644 --- a/R/bambu.R +++ b/R/bambu.R @@ -265,8 +265,6 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, ColNames <- c() for(i in seq_along(quantData)){ quantData_i <- quantData[[i]] - #load in the barcode clustering from file if provided - iter <- seq_len(ncol(metadata(quantData_i)$countMatrix)) # iter is integer if(!is.null(clusters)){ if(class(clusters[[i]])!="CompressedCharacterList"){ # !is.list(clusters) is FALSE for CompressedCharacterList clusterMaps <- NULL @@ -285,14 +283,9 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, rm(clusterMap) iter <- clustering - } else{ #if clusters is a list - if(length(quantData)>1){ - iter <- clusters[[i]] #lowMemory mode - }else{ - iter <- clusters#do.call(c,clusters) - } + } else{ + iter <- clusters[[i]] } - } countsSeCompressed <- bplapply(iter, FUN = function(j){ # previous i changed to j to avoid duplicated assignment #i = iter[i %in% colnames(metadata(quantData_i)$countMatrix)] #bug, after assignment, i become emptyprint(i) countMatrix <- unname(metadata(quantData_i)$countMatrix[,j]) # same here @@ -332,4 +325,5 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, colnames(countsSe) <- ColData[,1] return(countsSe) } -} + } +} \ No newline at end of file