This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to get normalized counts corrected for variables in the design matrix of DESeq2 as an input for WGCNA

Hi everyone,

I am analyzing Bulk RNA-Seq data, I generated the counts with HTSeqcount and I analyzed them with DESeq2.

Then, I want to get the normalized counts corrected for the variables in my design matrix (Like age, sex, RIN, ...) to use it as an input for WGCNA.

But I realized when I am using variance normalized counts (vst-counts) from DESeq2 they are not corrected for variables in my design matrix.

I was wondering which normalized counts I can use that can be corrected for variables in my design matrix, therefore it can be used as an input for WGCNA?

I also tried to use "limma::removeBatchEffect" but still, it didn't really correct my count for those variables.

I would be grateful if anyone could provide/recommend any solutions, please!

Here is the code that I used in my DESeq2:

dds <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTable,
                                  directory=folder,
                                  design=~Plate+RIN+Sex+Age+condition+PC3+PC2+PC1)

dds <- estimateSizeFactors(dds)
keep <- rowSums( counts(dds) >= 10 ) >= 20 #filters out genes 
dds <- dds[keep,]

colData(dds)$condition <- relevel(colData(dds)$condition, ref = "Control")

dds<- DESeq(dds)

vsd <- vst(dds, blind = FALSE)

I want to get the normalized counts adjusted for sex, RIN, plate, age, PC1, PC2, PC3

Thank you in advance!

wgcna vst deseq2

2 answers

vst doesn't perform any batch correction. Check these posts on how to use vst to get the normalized transformed count data for WGCNA: link1;link2.

Regarding WGCNA, you can follow the module-trait relationship analysis to check which modules correlate with RIN, sex, age etc...

Thanks for your comment. yes, that's my point the vst doesn't perform the batch correction; even after using limma::removeBatchEffect still, the counts are somehow the same. And in WGCNA I see modules that are highly correlated with sex, age, and cell type proportions, ... Are there other methods or normalized counts that can be corrected for the batches that I can use as input for WGCNA?

Please correct your title there is typo WGCAN for WGCNA. You can get normalized counts as follows-

normalized_counts=counts(dds, normalized=TRUE)

Log in to answer this question.