DESEq2 warning while using GLM fitting
1
3
Entering edit mode
7.9 years ago

Hello all,

Using time series (two condition with 4 time point) data in DESeq2, I got warning while fitting by GLM ??

bckCDS <- DESeqDataSetFromMatrix(countData = x, colData=ExpDesign, design= ~condition.label + condition.Time + condition.label:condition.Time)

ddsLRT= DESeq (bckCDS, test =LRT, reduced = ~condition.label + condition.Time)
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
NOTE: fitType=parametric, but the dispersion trend was not well captured by the
function: y = a/x + b, and a local regression fit was automatically substituted.
specify fitType=local or mean to avoid this message next time.
final dispersion estimates
fitting model and testing


May I have fit it by "local", indeed its work by this however, my question is why its not working by fitType='parametric'. What is advantage and disadvantage of it?

Thanks

next-gen DESeq2 RNA-Seq R • 8.4k views
3
Entering edit mode
7.9 years ago
Michael Love ★ 2.5k

Depending on the version you are using, this used to be a warning but is now just a message/note.

The printed message here is literally all you need to know. The software cannot find parameters a and b to fit the dispersion over mean trend using that formula (read the manuscript for more information about the point of modeling dispersion over mean).

So a local regression was automatically substituted. There is no further action required by the user.

0
Entering edit mode

Dear sir,

Thanks for your kind answer. Its done. But now I am trying to use Time series analysis for one condition (one condition with 4 time points).... Indeed I tried and got error.

bckCDS <- DESeqDataSetFromMatrix(countData = wt, colData=ExpDesign, design= ~condition.Time)
condition.label condition.Time
WT.T1.1              WT             T1
WT.T1.2              WT             T1
WT.T1.3              WT             T1
WT.T2.1              WT             T2
....
.......

> ddsLRT= DESeq(bckCDS, test ="LRT", reduced = ~condition.Time, fitType='local')
Error in nbinomLRT(object, full = full, reduced = reduced, betaPrior = betaPrior,  :
less than one degree of freedom, perhaps full and reduced models are not in the correct order
> ?DESeq
> ddsLRT= DESeq(bckCDS, test ="LRT", fitType='local')
Error in checkLRT(full, reduced) :
provide a reduced formula for the likelihood ratio test, e.g. nbinomLRT(object, reduced = ~ 1)

0
Entering edit mode

Now I tried

ddsLRT= DESeq(bckCDS, test ="LRT", fitType='local',full=~condition.Time, reduced=~1)


and it seem its work, is it ok what I am doing?

0
Entering edit mode

Yes, that's likely what you want. What you're asking there is, "Which model fits a gene's expression better, one where expression can change with each timepoint (~condition.Time), or one where expression is constant or at least doesn't vary at the timepoints we looked at (~1)."

If you know someone locally who's taken more statistics (or even just linear algebra...so any physicicist, computational biologist, engineer, etc.), you might ask him/her to draw out what ~condition.Time and ~1 are doing. I know that these things largely look meaningless, but they're probably pretty easy to understand if someone just goes through a simple example on a white board.

0
Entering edit mode

You used the same model for the full and reduced fitting...that won't work very well. I'm assuming with the LRT you're trying to ask the question, "Is there an effect of time?" In that case, the reduced design should be ~1.

0
Entering edit mode

that mean i should not use full = ~condition, right ?
now i end up with..

bckCDS <- DESeqDataSetFromMatrix(countData = wt, colData=ExpDesign, design= ~condition.Time)

ddsLRT= DESeq(bckCDS, test ="LRT", fitType='local', reduced=~1)

resLRT=results(ddsLRT)

0
Entering edit mode

You didn't define a condition column in ExpDesign, so using ~condition would just lead to an error message.

0
Entering edit mode

I didn't get any error bcz I have condition as name condition.label in ExpDesign and its only one condition, therefore I can't use contrast model, however I used only condition.Time in my model matrix.

bckCDS <- DESeqDataSetFromMatrix(countData = wt, colData=ExpDesign, design= ~condition.Time)

ddsLRT= DESeq(bckCDS, test ="LRT", fitType='local', reduced=~1)

condition.label condition.Time
WT.T1.1              WT             T1
WT.T1.2              WT             T1
WT.T1.3              WT             T1
WT.T2.1              WT             T2
....
.......

0
Entering edit mode

If condition.label is only ever WT then there's no point in including it. It can't change anything.

0
Entering edit mode

Thanks Dev,

I got my results, just last answer I would like to have from your side. I got comparison between T1 vs T2, T1 vs T3 and T1 vs T4. However, is there way to compare all 6 combinations like T1 vs T2, T1 vs T3, T1 vs T4, T2 vs T3, T2 vs T4 and T3 vs T4? I guess, I have to use nbinomLRT()?

Thanks, I got it.

0
Entering edit mode

See help(results) and note the contrast parameter. Also, you can just use a Wald test, which is the default.