Entering edit mode
I'm trying to adjust batch effect using deseq2 limma::removeBatchEffect
like below:
###### Batch Correction with limma removeBatchEffect #######
dds <- DESeqDataSetFromMatrix(countData = data,
colData = coldata,
design = ~ Samplebatch + cond)
dds <- DESeq(dds)
dds
dds$batch <- as.numeric(dds$Samplebatch)
dds$cond
dds$batch
## vst after adding batch information
vsd_abc <- vst(dds, blind = FALSE)
vsd_abc$Samplebatch
vsd_abc$batch
design0 <- model.matrix(~cond, colData(vsd_abc))
assay(vsd_abc) <- limma::removeBatchEffect(assay(vsd_abc), vsd_abc$batch, design=design0) ### Batch Correction
After batch effect correction I would like to get TPM / FPKM for performing ssGSEA and various other analyses which are normalized for the length of the gene.
Is it possible to get TPM / FPKM after batch effect removal using limma:removeBatchEffect
?
Any help is appreciated. Thank you !!
thank you for your reply. So, first I can convert uncorrected counts to FPKM and then log2 scale and use it for Batch correction with
limma::removeBatchEffect
? Can I use any log2 scaled expression instead of FPKM like CPM or TPM?Yes to all.
Thank you very much !!