How to use combat in order to remove batch effects?
Hello! I have RNA seq data and I need to use combat to remove the batch effects. Somehow when I run it, it isnt actually doing anything.
The code:
dds <- DESeq(dds, betaPrior=TRUE)
normalized_counts <- counts(dds, normalized=TRUE)
log2 = log2(normalized_counts+1)
modcombat = model.matrix(~dex, metadata) - with metadata being a variable containing treatment or control (under dex column) and batch and name of each patient.
com<-ComBat(log2, metadata$Batch, mod = modcombat)
Its supposed to be 4 different batches, but in the com variable I can see that the values have stayed the same as in log2.
What could be wrong? Would appreciate any help!
• 841 views
•
link
0 answers
No answers yet.
Log in to answer this question.