Skip to content

Commit

Permalink
relax tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed Sep 14, 2023
1 parent ea09c13 commit 846a201
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions tests/testthat/test-bulk_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,12 @@ test_that("DESeq2 differential trancript abundance - no object",{
install.packages("BiocManager", repos = "https://cloud.r-project.org")
BiocManager::install("DESeq2", ask = FALSE)
}

test_deseq2_df = DESeq2::DESeqDataSet(se_mini,design=~condition)
colData(test_deseq2_df)$condition = factor(colData(test_deseq2_df)$condition)

res_deseq2 =
test_deseq2_df |>
test_deseq2_df |>
DESeq2::DESeq() |>
DESeq2::results()

Expand Down Expand Up @@ -835,21 +835,21 @@ test_that("DESeq2 differential trancript abundance - no object",{

test_that("differential trancript abundance - random effects",{

my_input =
my_input =
input_df |>
identify_abundant(a, b, c, factor_of_interest = condition) |>
mutate(time = time |> stringr::str_replace_all(" ", "_")) |>

filter(b %in% c("ABCB4" , "ABCB9" , "ACAP1", "ACHE", "ACP5" , "ADAM28"))

my_input |>
test_differential_abundance(
~ condition + (1 + condition | time),
.sample = a,
.transcript = b,
.abundance = c,
method = "glmmseq_lme4",
action="only",
action="only",
cores = 1
) |>
pull(P_condition_adjusted) |>
Expand All @@ -860,13 +860,13 @@ test_that("differential trancript abundance - random effects",{
)

# Custom dispersion
my_input =
my_input =
my_input |>
left_join(
my_input |> pivot_transcript(b) |> mutate(disp_ = 2 ),
my_input |> pivot_transcript(b) |> mutate(disp_ = 2 ),
by = join_by(b, entrez, .abundant)
)


my_input |>
test_differential_abundance(
Expand All @@ -875,15 +875,15 @@ test_that("differential trancript abundance - random effects",{
.transcript = b,
.abundance = c,
method = "glmmseq_lme4",
action="only",
cores = 1,
action="only",
cores = 1,
.dispersion = disp_
) |>
pull(P_condition_adjusted) |>
head(4) |>
expect_equal(
c(0.1081176, 0.1303558, 0.1303558, 0.1693276),
tolerance=1e-3
tolerance=1e-2
)

})
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-bulk_methods_SummarizedExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ test_that("differential trancript abundance - random effects SE",{
head(4) |>
expect_equal(
c(0.1153254, 0.1668555, 0.1668555 , NA),
tolerance=1e-3
tolerance=1e-2
)

})
Expand Down

0 comments on commit 846a201

Please sign in to comment.