Skip to content

Commit

Permalink
Added error messaging if DESeq2 produces NAs in p-values due to
Browse files Browse the repository at this point in the history
various count data problems.
  • Loading branch information
Bharath Air committed Sep 28, 2023
1 parent 326f63c commit c0c64b1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/compareRhythms_deseq2.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ compareRhythms_deseq2 <- function(counts, exp_design, lengths, period,

results$rhythmic_in_B <- results[, paste0(group_id[2], "_amp")] > amp_cutoff

assertthat::assert_that(
assertthat::noNA(diff_rhy_results$pvalue),
assertthat::noNA(diff_rhy_results$padj),
assertthat::noNA(rhythmic_in_either$padj),
msg = "DESeq2 is producing NA in p-values. Check if your count matrix has
too many zero counts or too many outliers."
)

results$category <- base::mapply(categorize,
results$rhythmic_in_A,
results$rhythmic_in_B,
Expand Down

0 comments on commit c0c64b1

Please sign in to comment.