R/getDispersion.R

Defines functions getDispersion

Documented in getDispersion

getDispersion <- function(y)
#	Get most complex dispersion values from DGEList object
#	Gordon Smyth
#	Created 12 Dec 2011.  Last modified 3 Oct 2012.
{
	if( !is.null(y$tagwise.dispersion) ) {
		dispersion <- y$tagwise.dispersion
		attr(dispersion,"type") <- "tagwise"
	} else {
		if( !is.null(y$trended.dispersion) ) {
			dispersion <- y$trended.dispersion
			attr(dispersion,"type") <- "trended"
		} else {
			if( !is.null(y$common.dispersion) ) {
				dispersion <- y$common.dispersion
				attr(dispersion,"type") <- "common"
			} else
				dispersion <- NULL
		}
	}
	dispersion
}
hiraksarkar/edgeR_fork documentation built on Dec. 20, 2021, 3:52 p.m.