Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
csangara committed Aug 29, 2024
1 parent 2ff94b1 commit f072b81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/testthat/test-prioritization.R
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ test_that("Prioritization scheme works", {

# Check colnames
expect_equal(colnames(prior_table),
unique(c(colnames(processed_DE_table), colnames(processed_expr_table), "activity", "rank", "activity_zscore", "scaled_activity", "prioritization_score")))
unique(c(colnames(processed_DE_table), colnames(processed_expr_table),
"activity", "rank", "activity_zscore", "scaled_activity", "prioritization_score", "prioritization_rank")))


prior_table_top10 <- prior_table %>% distinct(ligand, prioritization_score) %>% mutate(rank = rank(desc(prioritization_score), ties.method = "average")) %>% arrange(rank, ligand) %>% pull(ligand) %>% .[1:10]
Expand All @@ -370,7 +371,7 @@ test_that("Prioritization scheme works", {

# Check colnames
expect_equal(colnames(prior_table),
unique(c(colnames(processed_DE_table), colnames(processed_expr_table), "prioritization_score")))
unique(c(colnames(processed_DE_table), colnames(processed_expr_table), "prioritization_score", "prioritization_rank")))

prioritizing_weights["de_ligand"] = 1
prior_table <- generate_prioritization_tables(processed_expr_table,
Expand All @@ -382,7 +383,7 @@ test_that("Prioritization scheme works", {

expect_equal(colnames(prior_table),
unique(c(colnames(processed_DE_table), colnames(processed_expr_table),
"lfc_pval_ligand", "p_val_adapted_ligand", "scaled_lfc_ligand", "scaled_p_val_ligand", "scaled_lfc_pval_ligand", "scaled_p_val_adapted_ligand", "prioritization_score")))
"lfc_pval_ligand", "p_val_adapted_ligand", "scaled_lfc_ligand", "scaled_p_val_ligand", "scaled_lfc_pval_ligand", "scaled_p_val_adapted_ligand", "prioritization_score", "prioritization_rank")))


# Check mushroom plot
Expand Down

0 comments on commit f072b81

Please sign in to comment.