Skip to content

Commit

Permalink
Fixed bug in plot_deconvolution and added test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanspeh committed Apr 22, 2024
1 parent 30270e1 commit f50a493
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/plot_deconvolution.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ plot_deconvolution_celltype_corrs <- function(deconvolution, actual){
estimate_v_actual <- dplyr::left_join(deconvolution, actual, by = dplyr::join_by("sample", "cell_type"),
suffix = c("_estimate", "_actual"))

cell_types <- unique(estimate_v_actual["cell_type"])
cell_types <- unlist(unique(estimate_v_actual["cell_type"]))
lapply(cell_types, plot_corr_celltype, data = estimate_v_actual)

}


Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot_deconvolution.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ testdata <- readRDS("testdata/cellanneal_deconvolution_long.Rdata")
test_that("plots without error", {
expect_no_error(plot_deconvolution_violin(testdata, testdata))
expect_no_error(plot_deconvolution_celltype_corrs(testdata, testdata))
expect_equal(length(plot_deconvolution_celltype_corrs(testdata, testdata)), 8)
})

0 comments on commit f50a493

Please sign in to comment.