From 4073c379db26a719aba79fb7b7d2d655f3bb8402 Mon Sep 17 00:00:00 2001 From: jonathan-columbiau Date: Thu, 2 May 2024 22:24:11 -0400 Subject: [PATCH] fix bug in return all --- R/Classify_Return_All.R | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/R/Classify_Return_All.R b/R/Classify_Return_All.R index 05b9c42..8176a6b 100644 --- a/R/Classify_Return_All.R +++ b/R/Classify_Return_All.R @@ -192,23 +192,18 @@ Classify_Return_All <- function (bpcells_query, models, tree_struc) returned_df = bind_rows(returned_df, tip_cell_obs_returned) final_classifications <- final_classifications %>% append(tip_cell_classifications) } - - - - - - - - remaining_cells = best_classification_per_obs_with_counts %>% filter(!cell_id %in% tip_cell_ids) if (nrow(remaining_cells) > 0) { test_that("all remaining cells assigned to internal nodes", { expect_contains(internal_nodes, remaining_cells$best_classification) }) - for (name in remaining_cells$best_classification %>% unique()) { + further_internal_nodes = remaining_cells$best_classification %>% unique() + for (k in 1:length(further_internal_nodes)) { #add to internal_node_assignment list - internal_node_assignment[[name]] <- remaining_cells$cell_id + cur_classified_node = further_internal_nodes[k] + cur_classified_node_cell_ids = remaining_cells$cell_id[remaining_cells$best_classification == cur_classified_node] + internal_node_assignment[[cur_classified_node]] <- cur_classified_node_cell_ids } #special to returned_df = T returned_df = bind_rows(returned_df, remaining_cells)