File: getDispersion.R

package info (click to toggle)
r-bioc-edger 3.40.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,484 kB
  • sloc: cpp: 1,425; ansic: 1,109; sh: 21; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 604 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}