mixedClusters {csaw}R Documentation

Tests for mixed DB clusters

Description

Intersects two one-sided tests to determine if a cluster contains DB events in both directions.

Usage

mixedClusters(ids, tab, weight=NULL, pval.col=NULL, fc.col=NULL) 

Arguments

ids

an integer vector or factor containing the cluster ID for each test

tab

a dataframe of results with PValue and at least one logFC field for each test

weight

a numeric vector of weights for each window, defaults to 1 for each test

pval.col

an integer scalar or string specifying the column of tab containing the p-values

fc.col

an integer scalar or string specifying the columns of tab containing the log-fold changes

Details

This function converts two-sided p-values to one-sided counterparts for each direction of log-fold change. For each direction, the corresponding one-sided p-values are combined to yield a combined p-value for each cluster. Each cluster is associated with two combined p-values (one in each direction), which are intersected using the Berger's intersection-union test (IUT). This tests against the null hypothesis that either direction is not significant. In short, a low p-value is only possible if there is DB in both directions. This formally identifies mixed clusters corresponding to complex DB events.

Value

A data frame containing one row per cluster, with various fields:

All other fields are the same as those returned by combineTests. The exception is the direction field, which is not returned as the test is done explicitly for mixed clusters.

Author(s)

Aaron Lun

References

Berger RL and Hsu JC (1996). Bioequivalence trials, intersection-union tests and equivalence confidence sets. Statist. Sci. 11, 283-319.

See Also

combineTests

Examples

ids <- round(runif(100, 1, 10))
tab <- data.frame(logFC=rnorm(100), logCPM=rnorm(100), PValue=rbeta(100, 1, 2))
mixed <- mixedClusters(ids, tab)
head(mixed)

[Package csaw version 1.14.1 Index]