Skip to content

Commit

Permalink
Merge pull request #455 from tuonglab/fix-shuffling
Browse files Browse the repository at this point in the history
fix shuffling of cell barcodes in SingleCellExperiment object
  • Loading branch information
ncborcherding authored Dec 10, 2024
2 parents 08e80ab + 4a2e080 commit b1fe3f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/combineExpression.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ combineExpression <- function(input.data,

combined_col_names <- unique(c(colnames(colData(sc.data)), colnames(PreMeta)))
full_data <- merge(colData(sc.data), PreMeta[rownames, , drop = FALSE], by = "row.names", all.x = TRUE)
# at this point, the rows in full_data are shuffled. match back with the original colData
full_data <- full_data[match(rownames, full_data[,1]), ]
rownames(full_data) <- full_data[, 1]
full_data <- full_data[, -1]
colData(sc.data) <- DataFrame(full_data[, combined_col_names])

rownames(colData(sc.data)) <- rownames
colData(sc.data) <- DataFrame(full_data[, combined_col_names])
}
if (filterNA) {
sc.data <- .filteringNA(sc.data)
Expand Down

0 comments on commit b1fe3f1

Please sign in to comment.