Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shuffling of cell barcodes in SingleCellExperiment object #455

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading