gmap: Genomic Mediation analysis with Adaptive Petmutation scheme

View source: R/gmap.R

gmapR Documentation

Genomic Mediation analysis with Adaptive Petmutation scheme

Description

The gmap function performs genomic mediation analysis with Adaptive Permutation scheme. It tests for mediation effects for a set of user specified mediation trios(e.g., eQTL, cis- and trans-genes) in the genome with the assumption of the presence of cis-association.

It returns the mediation p-values(nominal and empirical), the coefficient of linear models(e.g, t_stat, std.error, beta, beta.total) and the proportions mediated(e.g., the percentage of reduction in trans-effects after accounting for cis-mediation).

Usage

gmap(
  snp.dat,
  fea.dat,
  conf,
  trios.idx,
  cl = NULL,
  Minperm = 100,
  Maxperm = 10000
)

Arguments

snp.dat

The eQTL genotype matrix. Each row is an eQTL, each column is a sample.

fea.dat

A feature profile matrix. Each row is for one feature, each column is a sample.

conf

A confounders matrix which is adjusted in all mediation tests. Each row is a confounder, each column is a sample.

trios.idx

A matrix of selected trios indexes (row numbers) for mediation tests. Each row consists of the index (i.e., row number) of the eQTL in snp.dat, the index of cis-gene feature in fea.dat, and the index of trans-gene feature in fea.dat. The dimension is the number of trios by three.

cl

Parallel backend if it is set up. It is used for parallel computing. We set cl=NULL as default.

Minperm

The minimum number of permutations. When the number of permutation statistics better than the original statistic is greater than Minperm, stop permutation and directly calculate the empirical P value. If Minperm=0, only the nominal P-value is calculated. We set Minperm=100 as default.

Maxperm

Maximum number of permutation. We set Maxperm=10000 as default.

Details

The function performs genomic mediation analysis with Adaptive Permutation scheme. Adaptive Permutation schemeWhen using Fixed Permutation scheme, good estimation of insignificant adjusted P-values can be achieved with few permutations while many more are needed to estimate highly significant ones. Therefore, we implemented an alternative permutation scheme that adapts the number of permutations to the significance level of the variant–phenotype pairs.

Value

The algorithm will return a list of nperm, empirical.p, nominal.p, beta, std.error, t_stat, beta.total, beta.change.

nperm

The actual number of permutations for testing mediation.

empirical.p

The mediation empirical P-values with nperm times permutation. A matrix with dimension of the number of trios.

nominal.p

The mediation nominal P-values. A matrix with dimension of the number of trios.

std.error

The return std.error value of feature1 for fit liner models. A matrix with dimension of the number of trios.

t_stat

The return t_stat value of feature1 for fit liner models. A matrix with dimension of the number of trios.

beta

The return beta value of feature2 for fit liner models in the case of feature1. A matrix with dimension of the number of trios.

beta.total

The return beta value of feature2 for fit liner models without considering feature1. A matrix with dimension of the number of trios.

beta.change

The proportions mediated. A matrix with dimension of the number of trios.

References

Ongen H, Buil A, Brown AA, Dermitzakis ET, Delaneau O. (2016) Fast and efficient QTL mapper for thousands of molecular phenotypes. Bioinformatics. 2016;32:1479–1485. doi: 10.1093/bioinformatics/btv722

Examples


output <- gmap(conf = dat$known.conf, fea.dat = dat$fea.dat, snp.dat = dat$snp.dat,
               trios.idx = dat$trios.idx[1:10,], Minperm = 10, Maxperm = 1000)

## Not run: 
  ## generate a cluster with 2 nodes for parallel computing
  cl <- makeCluster(2)
  output <- gmap(conf = dat$known.conf, fea.dat = dat$fea.dat, snp.dat = dat$snp.dat,
                 trios.idx = dat$trios.idx[1:10,], cl = cl, Minperm = 10, Maxperm = 1000)
  stopCluster(cl)

## End(Not run)


QidiPeng/eQTLMAPT documentation built on Jan. 25, 2023, 11:03 p.m.