GeneScan1D: Conduct GeneScan1D analysis on the gene buffer region.

View source: R/GeneScan3D.R

GeneScan1DR Documentation

Conduct GeneScan1D analysis on the gene buffer region.

Description

This function conducts gene-based scan test on the gene buffer region using 1D windows with sizes 1-5-10 Kb. For binary traits, we conduct SPA gene-based tests to deal with imbalance case-control issues.

Usage

GeneScan1D(
  G = G_gene_buffer,
  Z = NULL,
  window.size = c(1000, 5000, 10000),
  pos = pos_gene_buffer,
  MAC.threshold = 10,
  MAF.threshold = 0.01,
  Gsub.id = NULL,
  resampling = FALSE,
  result.null.model = result.null.model
)

Arguments

G

The genotype matrix in the gene buffer region, which is a n*p matrix where n is the number of individuals and p is the number of genetic variants in the gene buffer region.

Z

A p*q functional annotation matrix where p is the number of genetic variants in the gene buffer region and q is the number of functional annotations. If Z is NULL (do not incorporate any functional annotations), the minor allele frequency weighted dispersion and/or burden tests are applied. Specifically, Beta(MAF; 1; 25) weights are used for rare variants and weights one are used for common variants.

window.size

The 1-D window sizes in base pairs to scan the gene buffer region. The recommended window sizes are c(1000,5000,10000).

pos

The positions of genetic variants in the gene buffer region, an p dimensional vector. Each position corresponds to a column in the genotype matrix and a row in the functional annotation matrix.

MAC.threshold

Threshold for minor allele count. Variants below MAC.threshold are ultra-rare variants. The recommended level is 10.

MAF.threshold

Threshold for minor allele frequency. Variants below MAF.threshold are rare variants. The recommended level is 0.01.

Gsub.id

The subject id corresponding to the genotype matrix, an n dimensional vector. The default is NULL, where the matched phenotype and genotype matrices are assumed.

resampling

Resampling indicator. The default is FALSE, do not conduct resampling-based moment matching when the sample size is large, especially for UK biobank-scale data.

result.null.model

The output of function "GeneScan.Null.Model()".

Value

GeneScan1D.Cauchy.pvalue

Cauchy combination p-values of all, common and rare variants for GeneScan1D analysis.

M

Number of 1D scanning windows.

Examples

library(GeneScan3DKnock)

# Load data example
# Y: outcomes, n by 1 matrix for n=2000 individuals
# X: covariates, n by d matrix for d=1 covariate
# G_gene_buffer: genotype matrix of gene buffer region, n by p matrix, p=287 variants
# Z_gene_buffer: p by q functional annotation matrix, q=1 functional annotation
# pos_gene_buffer: positions of p=287 genetic variants

data("GeneScan3D.example")
Y=GeneScan3D.example$Y; X=GeneScan3D.example$X;
G_gene_buffer=GeneScan3D.example$G_gene_buffer;Z_gene_buffer=GeneScan3D.example$Z_gene_buffer;
pos_gene_buffer=GeneScan3D.example$pos_gene_buffer;

# Preliminary data management
set.seed(12345)
result.null.model=GeneScan.Null.Model(Y, X, out_type="C", resampling=FALSE)

#Conduct GeneScan1D analysis
result.GeneScan1D=GeneScan1D(G=G_gene_buffer,Z=Z_gene_buffer,pos=pos_gene_buffer,
                            window.size=c(1000,5000,10000),
                            MAC.threshold=10,MAF.threshold=0.01,Gsub.id=NULL,resampling=FALSE,
                            result.null.model=result.null.model)
result.GeneScan1D$GeneScan1D.Cauchy.pvalue 
result.GeneScan1D$M


Iuliana-Ionita-Laza/GeneScan3DKnock documentation built on July 31, 2023, 4:32 a.m.