Skip to content

Commit

Permalink
Fix fix_missing_cell_labels() when no cells need fixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
brgew committed Jun 19, 2024
1 parent 040397b commit eed1cd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: monocle3
Title: Clustering, Differential Expression, and Trajectory Analysis for
Single-Cell RNA-Seq
Version: 1.4.19
Version: 1.4.20
Authors@R: c(
person(given = "Hannah",
family = "Pliner",
Expand Down
6 changes: 6 additions & 0 deletions R/label_transfer.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,12 @@ fix_missing_cell_labels <- function(cds,
assertthat::assert_that(from_column_name %in% colnames(colData(cds)),
msg=paste0('from_column_name \'', from_column_name, '\' is not in the cds colData'))

if(sum(is.na(colData(cds)[[from_column_name]])) == 0) {
if(to_column_name != from_column_name)
colData(cds)[[to_column_name]] <- colData(cds)[[from_column_name]]
return(cds)
}

if(reduction_method == 'UMAP')
nn_control_default <- get_global_variable('nn_control_annoy_euclidean')
else
Expand Down

0 comments on commit eed1cd6

Please # to comment.