Test of Multiple Linear Combination on coefficients from Wald Test in Deseq2
Entering edit mode
Last seen 22 days ago

Hello everyone, I am a beginner with the DESeq2 package, and I am trying to understand the mathematical principles behind this package.

In statistical modeling and hypothesis testing, a contrast vector c is used to construct specific linear combinations in order to test whether this linear combination equals a certain hypothesized value. A example below.

If I have a condition with four group, to avoid dummy trap & not full rank of matrix, a regression equation must like : Y = Beta_0 + Beta_1 X_1 + Beta_2 X_2 + Beta_3 * X_3 + error. Where "Y" is read counts and "Beta_1 to Beta_3" is dummy variables.

Question1: When I have a factor that has been incorporated into the intercept, and I want to compare Beta_1 with the factor that has been incorporated into the intercept, how should I set the contrast vector? Which one of the contrast vector ( [1,-1,0,0] or [0,1,0,0] ) is correct?

Question2: Log2foldChange represents the logarithmic expression difference between two groups. When the contrast vector multiply Beta vector = q. Is set to q = 0, doesn't taking the logarithm result in infinity? How does the software avoid the occurrence of infinite values?

Regression DESeq2 • 220 views
Entering edit mode
Last seen 7 days ago
United States

If your coefficients are the contrasts you want, you can just use the name argument. Or you can specify the contrast using the column and levels from your colData, or you can specify the contrast using your second option. Or if the coefficient you care about is the last one, you can just use the defaults.

>  dds <- makeExampleDESeqDataSet(m=4)
>  dds <- DESeq(dds)
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
> first <- results(dds, name = "condition_B_vs_A")
> second <- results(dds)
> third <- results(dds, c("condition","B","A"))
> fourth <- results(dds, c(0,1))
> all.equal(first, second)
[1] TRUE
> all.equal(first, third)
[1] TRUE
> all.equal(first, fourth, check.attributes = FALSE)
[1] TRUE
Entering edit mode

Oh, and I don't understand your second question. If you set a contrast vector to be all zeros (which I think is what you are asking), then you are telling DESeq2 that you don't want any comparison and it tells you that is not a thing.

> results(dds, c(0,0))
Error in checkContrast(contrast, resNames) : 
  numeric contrast vector cannot have all elements equal to 0

Login before adding your answer.

Traffic: 808 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6