Learn R Programming

RNOmni (version 0.5.0)

RNOmni: Rank-Normal Omnibus Test

Description

Association test that synthesizes the DINT and IINT methods. The first approach directly transforms the phenotype, whereas the second approach forms residuals prior to applying the rank normal transformation (rankNorm). In the omnibus test, the direct and indirect tests are separately applied. An omnibus statistic is calculated based on whichever approach provides more evidence against the null hypothesis. Details of the method are discussed in the vignette.

Usage

RNOmni(y, G, X = NULL, method = "AvgCorr", k = 3/8, B = 100,
  set.rho = NULL, keep.rho = F, keep.stats = F, parallel = F)

Arguments

y

Numeric phenotype vector.

G

Obs by locus genotype matrix.

X

Model matrix of covariates and structure adjustments. Should include an intercept. Omit to perform marginal tests of association.

method

Method used to estimate correlation for the omnibus test, either "AvgCorr", "Bootstrap", or "Manual".

k

Offset applied during rank-normalization. See rankNorm.

B

If using method=="Bootstrap", number of bootstrap samples for correlation estimation.

set.rho

If using method=="Manual", the fixed value of rho, either a single value or a vector with one element per column in G.

keep.rho

Logical indicating whether to return the correlation parameter estimated during omnibus calculation. Defaults to FALSE.

keep.stats

Logical indicating whether to return the interim test statistics calculated by DINT and IINT. Defaults to FALSE.

parallel

Logical indicating whether to run in parallel. Must register parallel backend first.

Value

A numeric matrix of p-values, three for each locus in G, assessing the null hypothesis of no genetic effect. If keep.stats=T, the interim test statistics are retained. If keep.rho=T, the correlation between the p-values provided by DINT and IINT is retained.

Details

Assigning a p-value to the omnibus statistic requires an estimate of the correlation between the test statistics estimated by DINT and IINT under the null. When many loci are under consideration, a computationally efficient approach is to take the correlation of the observed test statistics across loci (method="AvgCorr"). Alternatively, when there are fewer loci, or locus-specific estimates are desired, the correlation may be estimated using bootstrap (method="Bootstrap"). When using the bootstrap approach, consider registering a parallel backend and setting parallel=T. To manually provide an estimate of the correlation between the test statistics, set (method="Manual") and specify (set.rho).

Examples

Run this code
# NOT RUN {
set.seed(100);
# Design matrix
X = cbind(1,rnorm(1e3));
# Genotypes
G = replicate(1e3,rbinom(n=1e3,size=2,prob=0.25));
storage.mode(G) = "numeric";
# Phenotype
y = exp(as.numeric(X%*%c(1,1))+rnorm(1e3));
# Average correlation
p = RNOmni(y=y,G=G,X=X,method="AvgCorr");
# Bootstrap correlation
p = RNOmni(y=y,G=G[,1:10],X=X,method="Bootstrap",B=100);
# Manual correlation
p = RNOmni(y=y,G=G,X=X,method="Manual",set.rho=0.5);
# }

Run the code above in your browser using DataLab