runConCub: Enrichment analysis on two- or three-way contingency tables.

Description Usage Arguments Details Value Examples

View source: R/geecc.R

Description

Perform the enrichment analysis on two- or three-way contingency tables.

Usage

1
2
3
runConCub(obj, filter, nthreads = 2, subset = NULL,
	verbose=list(output.step=0, show.cat1=FALSE,
	show.cat2=FALSE, show.cat3=FALSE))

Arguments

obj

an object with class concub

filter

an object with class concubfilter

nthreads

number of threads to use in hypergeom.test

subset

a named list. Restrict enrichment analysis to these category variables

verbose

A list to control verbosity:

output.step:

after how many variables passed of category 2 a control output should be printed

show.cat1:

show current level of category 1

show.cat2:

show current level of category 2

show.cat3:

show current level of category 3

Details

This function applies a test for association for all combinations of all variables of all categories to be tested. Depending on the settings in the concubfilter-object, a one-sided or two-sided test is made, using the exact hypergeometric test as implemented in the hypergea-package if the smallest expected value is smaller than 5, or using the chi-squared test as implemented in the loglm-function implemented in the MASS-package. The minimum expected value can be changed in the concub-object by the user (approx-parameter). In this function only filter-settings those filter settings are used, which skip the tests.

Value

An object with class concub.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##
## a completely artificial example run
## through the routines of the package
##
R <- 500
#generate R random gene-ids
ID <- sapply(1:R, function(r){paste( sample(LETTERS, 10), collapse="" ) } )
ID <- unique(ID)

#assign artificial differentially expressed genes randomly
category1 <- list( deg.smallFC=sample(ID, 100, rep=FALSE),
	deg.hughFC=sample(ID, 100, rep=FALSE) )
#assign artificial GO terms of genes randomly
category2 <- list( go1=sample(ID, 50, replace=FALSE),
	go2=sample(ID, 166, replace=FALSE),
	go3=sample(ID, 74, replace=FALSE),
	go4=sample(ID, 68, replace=FALSE) )
#assign artificial sequence length of genes randomly
LEN <- setNames(sample(seq(100, 1000, 100), length(ID), replace=TRUE), ID)
category3 <- split( ID, f=factor(LEN, levels=seq(100, 1000, 100)) )
CatList <- list(deg=category1, go=category2, len=category3)

ConCubFilter.obj <- new("concubfilter", names=names(CatList))
ConCub.obj <- new("concub", categories=CatList)
ConCub.obj.2 <- runConCub( obj=ConCub.obj, filter=ConCubFilter.obj, nthreads=1 )
ConCub.obj.2

geecc documentation built on April 28, 2020, 8:19 p.m.