Skip to content

Commit e316ebe

Browse files
committed
fix bug about CompressedCharacterList
1 parent b122513 commit e316ebe

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

R/bambu.R

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL,
265265
ColNames <- c()
266266
for(i in seq_along(quantData)){
267267
quantData_i <- quantData[[i]]
268-
#load in the barcode clustering from file if provided
269-
iter <- seq_len(ncol(metadata(quantData_i)$countMatrix)) # iter is integer
270268
if(!is.null(clusters)){
271269
if(class(clusters[[i]])!="CompressedCharacterList"){ # !is.list(clusters) is FALSE for CompressedCharacterList
272270
clusterMaps <- NULL
@@ -285,14 +283,9 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL,
285283
rm(clusterMap)
286284
iter <- clustering
287285

288-
} else{ #if clusters is a list
289-
if(length(quantData)>1){
290-
iter <- clusters[[i]] #lowMemory mode
291-
}else{
292-
iter <- clusters#do.call(c,clusters)
293-
}
286+
} else{
287+
iter <- clusters[[i]]
294288
}
295-
}
296289
countsSeCompressed <- bplapply(iter, FUN = function(j){ # previous i changed to j to avoid duplicated assignment
297290
#i = iter[i %in% colnames(metadata(quantData_i)$countMatrix)] #bug, after assignment, i become emptyprint(i)
298291
countMatrix <- unname(metadata(quantData_i)$countMatrix[,j]) # same here
@@ -332,4 +325,5 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL,
332325
colnames(countsSe) <- ColData[,1]
333326
return(countsSe)
334327
}
335-
}
328+
}
329+
}

0 commit comments

Comments
 (0)