jackstraw_alstructure: Non-Parametric Jackstraw for ALStructure

View source: R/jackstraw_alstructure.R

jackstraw_alstructureR Documentation

Non-Parametric Jackstraw for ALStructure

Description

Test association between the observed variables and population structure estimated by ALStructure.

Usage

jackstraw_alstructure(
  dat,
  r,
  FUN,
  r1 = NULL,
  s = NULL,
  B = NULL,
  covariate = NULL,
  verbose = TRUE
)

Arguments

dat

a genotype matrix with m rows as variables and n columns as observations.

r

a number of significant LFs.

FUN

a function to ALStructure

r1

a numeric vector of LFs of interest (implying you are not interested in all r LFs).

s

a number of “synthetic” null variables. Out of m variables, s variables are independently permuted.

B

a number of resampling iterations. There will be a total of s*B null statistics.

covariate

a data matrix of covariates with corresponding n observations (do not include an intercept term).

verbose

a logical specifying to print the computational progress.

Details

This function uses ALStructure from Cabreros and Storey (2019). A deviation dev in logistic regression (the full model with r LFs vs. the intercept-only model) is used to assess association.

Value

jackstraw_alstructure returns a list consisting of

p.value

m p-values of association tests between variables and their LFs

obs.stat

m observed devs

null.stat

s*B null devs

Author(s)

Neo Christopher Chung nchchung@gmail.com

References

Chung and Storey (2015) Statistical significance of variables driving systematic variation in high-dimensional data. Bioinformatics, 31(4): 545-554 https://academic.oup.com/bioinformatics/article/31/4/545/2748186

See Also

jackstraw_pca jackstraw

Examples

## Not run: 
# load genotype data to analyze (not shown) into this variable
X
# choose the number of ancestries
r <- 3

# load alstructure package (install from https://github.com/StoreyLab/alstructure)
library(alstructure)
# define the function this way, a function of the genotype matrix only
FUN <- function(x) t( alstructure(x, d_hat = r)$Q_hat )

# calculate p-values (and other statistics) for each SNP
out <- jackstraw_alstructure( X, r, FUN )

## End(Not run)


ncchung/jackstraw documentation built on Aug. 22, 2023, 12:12 p.m.