mixedClusters {csaw} | R Documentation |
Intersects two one-sided tests to determine if a cluster contains DB events in both directions.
mixedClusters(ids, tab, weight=NULL, pval.col=NULL, fc.col=NULL)
ids |
an integer vector or factor containing the cluster ID for each test |
tab |
a dataframe of results with |
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 |
fc.col |
an integer scalar or string specifying the columns of |
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.
A data frame containing one row per cluster, with various fields:
A numeric field containing the IUT p-value for each cluster.
This field is named PValue
if pval.col=NULL
, otherwise its name is set to colnames(tab[,pval.col]
.
A numeric field FDR
, containing the adjusted p-value for each cluster.
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.
Aaron Lun
Berger RL and Hsu JC (1996). Bioequivalence trials, intersection-union tests and equivalence confidence sets. Statist. Sci. 11, 283-319.
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)