DESeq2 use of factors for colData
1
0
Entering edit mode
2.5 years ago
mcsimenc ▴ 20

Hi, I am doing differential expression analysis using a count matrix with four samples and two groups using the function:

DESeqDataSetFromMatrix(countMatrix, colData = colData, design = ~groups.

I set the corresponding rows in my colData$groups to c("ctl", "ctl", "trt", "trt"), and I get one result, same as if I set colData$groups to c(0,0,1,1). But if I set it to c(0,0,2,2), I get a different result. However, if I set colData$groups to factor(c(0,0,2,2)) I get the same results as 0,0,1,1.

What is DESeqDataSetFromMatrix doing to give the different results for colData$groups 0,0,2,2?

Thank you

DESeq2 expression differential • 1.0k views
ADD COMMENT
0
Entering edit mode
2.5 years ago

If you don't want the groups to be literal numbers, making them factors is the correct thing to do.

DESeq2 tends to do this automatically if you give it strings for the colData, but it won't do that if you give it numbers.

ADD COMMENT
0
Entering edit mode

Thanks for your answer. Do you know what DESeq2 is doing when given numbers?

ADD REPLY
0
Entering edit mode

I believe it will try to make a linear correlation between the logs of the counts and your numerical colData. But it's hard to know without seeing the rest of your code.

ADD REPLY

Login before adding your answer.

Traffic: 2492 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6