I am working on RNA-seq data analysis, I have 2 known batches (two different days for RNA sequencing) for my analysis. I run the ComBat function to remove the batch effect on normalized dds from DESeq2 or unnormalized dds. Now, I am unable to do create the DESeqDataSet from combatedata for further analysis. When I am using DESeqDataSetFromMatrix for creating DESeq2 data object by using combatedata, I am getting error: Error in DESeqDataSet(se, design = design, ignoreRank) : some values in assay are negative
I work with Dr. Evan Johnson who developed ComBat. We are currently working on a new version of the function, called ComBat-Seq, which addresses this issue. ComBat-Seq is able to remove batch effects while maintaining the integer counts, so that the cleaned data can be used as inputs to DESeq2. ComBat-Seq functions are available at the GitHub below:
Please feel free to try it out, and let me know if you have any questions (at email@example.com).
The error is thrown because a negative count value makes no sense in RNA-sequencing data analysis. DESeq2 expects positive integer count values.
The negative values are produced by Combat as it attempts to correct for batch. Remember, though, that Combat was developed for microarray data, which is typically measured on the log [base 2] scale.
Your best option is to avoid the use of Combat and to instead include
batch as a covariate in your design formula. By doing this, the effect of batch will be taken into account when your test statistics are derived. The regression model essentially treats it as a covariate and makes adjustment thus. This may not work, however, if the batch effect is large and inconsistent.
You will find many questions on this topic on both Biostars and Bioconductor, if you search using your search engine of choice. If you need to, later, directly adjust your expression levels for
batch in your workflow, then may I suggest the use of
limma::removeBatchEffect(), as exemplified here: Why after VST are there still batches in the PCA plot?.