Skip to content

Commit

Permalink
independent filtering in DESeq2
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-james committed Jun 11, 2024
1 parent 74e67e1 commit 506408e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/deg.R
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ deg.deseq2 <- function(se,
case,
control,
sample.col,
covariates=NULL,
covariates=NULL, independentFiltering=TRUE,
prefix="DESeq2") {
pb = calculate_qc_metrics(se_make_pseudobulk(se, sample.col), assay="counts", qc_vars=c("mt", "ribo", "pc", "chrX", "chrY"))
X = SummarizedExperiment::assays(pb)$counts
Expand All @@ -492,7 +492,7 @@ deg.deseq2 <- function(se,
colData=cd,
design=design)
out = DESeq2::DESeq(dds)
df = DESeq2::results(out, list(make.names(paste0(pathology, case))), independentFiltering=FALSE)
df = DESeq2::results(out, list(make.names(paste0(pathology, case))), independentFiltering=independentFiltering)
rd = as.data.frame(SummarizedExperiment::rowData(se))
rd[[paste0(prefix, "_log2FC")]] = NA
rd[rownames(df), paste0(prefix, "_log2FC")] = df$log2FoldChange
Expand Down

0 comments on commit 506408e

Please sign in to comment.