I want to correct my dataset for batch instead of including batch in the formula. The reason is that it seems that my data is not coming for certain sub-analysis from all batches and therefore I get a "Full Rank"-Error. The Bioinformatics Core therefore suggested to run Combat (not Limma) to correct for the batch.
Now I am struggling a bit how to do it.. I have my data - colData and cts which I want to run after with
dds <- DESeqDataSetFromMatrix(countData = cts, colData = colData, design = ~SEX + DIAGNOSIS
How do I run combat with my colData and cts? I need to build a matrix?! But I need colData and cts seperate after to build the dds object?
I am a bit confused right now...
Thank you for any hint!
Thank you. I have been on that page and I find it very difficult to understand. The remove batch effect function of Limma was three lines of code (unfortunately I was told to use combat not Limma if I do Deseq2 after)...
I have my raw counts (already quality control done and removed samples) in cts and my metadata in colData (colData$BATCH having my three batches).. any chance you can direct me to the part of the code relevant for me?
Can you show the colData? If DESeq2 refuses it due to linear combinations with other covariates then odds are good then any other regression-based approach will do the same.
Hi Bine, you have 2 choices in relation to batch adjustment:
~ condition + batch
If I choose for the option 1, then
DESeqDataSetFromMatrixfrom DESeq2 complains that the count matrix have negative values. This is because
ComBatexpects normalized data (like log2 transformed I guess) and therefore its output has negative values. Should I then apply a log2 of the data before running
vst? I am concerned because I am analyzing ATAC-seq data, so my input are raw peak counts, and I am worried that by doing some of this I would be losing valuable information.
Combat-Seq is not the same as the Combat function. See the sva package for the Combat-Seq function that works on raw counts and returns corrected raw counts.
I used the combat-seq but the deseq complain as its not integer what should i do
I cannot reproduce this, please provide a minimal reproducible example.
This here works just fine: