Skip to content

Commit

Permalink
Bugfix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jovoni committed Jun 6, 2024
1 parent 9e5eb05 commit ac32240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test_de <- function(devil.fit, contrast, pval_adjust_method = "BH", max_lfc = 10
H <- compute_hessian(devil.fit$beta[gene_idx,], 1 / devil.fit$overdispersion[gene_idx], devil.fit$input_matrix[gene_idx,], devil.fit$design_matrix, devil.fit$size_factors)
total_variance <- t(contrast) %*% H %*% contrast
#1 - stats::pchisq(mu_test^2 / total_variance, df = 1)
2 * stats::pt(abs(mu_test) / sqrt(total_variance), df = ncol(Y) - 2, lower.tail = F)
2 * stats::pt(abs(mu_test) / sqrt(total_variance), df = nsamples - 2, lower.tail = F)
}, mc.cores = n.cores) %>% unlist()
}

Expand Down

0 comments on commit ac32240

Please sign in to comment.