| mixedClusters {csaw} | R Documentation |
Intersects two one-sided tests to determine if a cluster contains DB events in both directions.
mixedClusters(ids, tab, weights=NULL, pval.col=NULL, fc.col=NULL)
ids |
An integer vector or factor containing the cluster ID for each test. |
tab |
A data.frame of results with |
weights |
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).
The IUT p-value provides evidence 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.
The two-sided p-values in pval.col should be independent of the sign of the log-fold change under the null hypothesis.
This may not be true for all hypothesis tests, so caution is required when supplying values in tab.
A DataFrame 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)