Hi Mads

It sounds like you have a very interesting dataset. I hope I can help answer some of your questions

1) Checking model fits
Glad to hear that the tagwise dispersions fit the data better than the other options (as we would expect).

I have found it useful to use QQ (quantile-quantile) plots to assess the model fits to the data. We can easily compute deviance goodness-of-fit statistics, which should follow a chi-square distribution if the model fit is adequate. I transform these to (approximate) normality and produce a normal QQ-plot as this results in a nicer plot (less compression of lower quantiles as you would get with a chi-square QQ-plot).
Some example code to produce such a plot below. The gof() function defines "outlier" genes (those with a poor fit) as genes with a FWER less than pcutoff. zscoreGamma() converts gamma RVs (e.g. chi-quare) to a normal z score.

glmfit <- glmFit(d, design) 
goodness <- gof(glmfit, pcutoff=0.05)
sum(goodness$outlier)
rownames(d)[goodness$outlier]
z <- limma::zscoreGamma(goodness$gof.statistic, shape=goodness$df/2, scale=2)
qq <- qqnorm(z, panel.first=grid(), main="tagwise dispersion")
abline(0,1,lwd=3)
points(qq$x[goodness$outlier],qq$y[goodness$outlier], pch=16, col="dodgerblue")

2) Choosing prior.n
We currently recommending choosing a value for prior.n that gives the common likelihood (our "prior") a weight equivalent to 20-30 prior degrees of freedom. A little formula helps to choose prior.n:

prior.n * residual df = 20 prior df

You can calculate the residual df from your experimental design. Then a sensible value for prior.n is ( prior.n = 20 / residual df ).
You can check that this value of prior.n is doing a good job using the QQ-plot as described above. 


3) Order of d$tagwise.dispersion
Yes, the order of d$tagwise.dispersion is the same as rownames(d$counts)

Hope that helps with your analysis.

Cheers
Davis



On May 30, 2011, at 4:56 PM, Mads Sønderkær wrote:

> Hi,
> Introduction:
> I’m analyzing a high replicate tag based mRNAseq (SAGE like) data set. In the experiment I have 2x 47 replicates of true biological samples of potato leaves. I also have triplicates of libraries originating from the same crushed leaf material, but from different library preps. I hope to be able to evaluate biological and technical variation from these. I have chosen to use EgdeR for the analysis, while it has some very attractive features. One is that it is possible to estimate the dispersion.
> For now I can conclude that the tagwise dispersion model fits the data better than the poisson and the common dispersion model (not suerpringly).
>  
> Howerver when calculating the tagwise dispersion, prior.n and used.prop needed to be defined. I have looked in the forum and found 1 E-mail regarding prior.n.
> My question is:
> Is there a way to find the optimal value for prior.n – and how is this evaluated? I’m thinking of subtracting the raw variance from the calculated tagwise variance, and then look at the absolute SUM (the sum of error). Is this a good way to go?
>  
> Regarding the d$tagwise.dispersion (here d is a DGEList after estimateTagwiseDisp). I believe the object is a vector, but there are no row names. My question is now if the order of  d$tagwise.dispersion is the same as rownames(d$counts)?
>  
> Session info:
> R version 2.13.0 (2011-04-13)
> Platform: x86_64-pc-mingw32/x64 (64-bit)
>  
> other attached packages:
> [1] edgeR_2.2.5
>  
> Kind regards
> Mads Sønderkær
>  
> <image001.jpg>
>  
> Mads Sønderkær
> PhD Student
> Mobile: +45 3053 2492
>  
> Aalborg University
> Department of Biotechnology, Chemistry and Environmental Engineering
> Sohngaardsholmsvej 49
> Room 17
> 9000 Aalborg
> Denmark
> Phone: +45 9940 8461
> www.bio.aau.dk
>  
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

------------------------------------------------------------------------
Davis J McCarthy
Research Technician
Bioinformatics Division
Walter and Eliza Hall Institute of Medical Research
1G Royal Parade, Parkville, Vic 3052, Australia
dmccarthy@wehi.edu.au
http://www.wehi.edu.au




______________________________________________________________________
The information in this email is confidential and intend...{{dropped:8}}

