GeneScan3D: Conduct GeneScan3D analysis on the gene buffer region,...

View source: R/GeneScan3D.R

GeneScan3DR Documentation

Conduct GeneScan3D analysis on the gene buffer region, integrating promoter and R enhancers.

Description

This function conducts gene-based scan test on the gene buffer region, integrating proximal and distal regulatory elements for a gene, i.e., promoter and R enhancers. For binary traits, we conduct SPA gene-based tests to deal with imbalance case-control issues.

Usage

GeneScan3D(
  G = G_gene_buffer,
  Z = Z_gene_buffer,
  G.promoter = G_promoter,
  Z.promoter = Z_promoter,
  G.EnhancerAll = G_EnhancerAll,
  Z.EnhancerAll = Z_EnhancerAll,
  R = length(p_EnhancerAll),
  p_Enhancer = p_EnhancerAll,
  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.

G.promoter

The genotype matrix for promoter, which can be NULL, that is, do not integrate promoter.

Z.promoter

The functional annotation matrix for promoter. Z.promoter can be NULL.

G.EnhancerAll

The genotype matrix for R enhancers, by combining the genotype matrix of each enhancer by columns.

Z.EnhancerAll

The functional annotation matrix for R enhancers, by combining the functional annotation matrix of each enhancer by rows. Z.EnhancerAll can be NULL.

R

Number of enhancers.

p_Enhancer

Number of variants in R enhancers, which is a 1*R vector.

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 G and a row in the functional annotation matrix Z.

MAC.threshold

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

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

GeneScan3D.Cauchy.pvalue

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

M

Number of 1D scanning windows.

minp

Minimum p-values of all, common and rare variants for 3D windows.

RE_minp

The regulartory elements in the 3D windows corresponding to the minimum p-values, for all, common and rare variants. 0 represents promoter and a number from 1 to R represents promoter and r-th enhancer.

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
# pos_gene_buffer: positions of p=287 genetic variants
# Z_gene_buffer: p by q functional annotation matrix, q=1 functional annotation
# G_promoter: 2000 by 6 genotype matrix of promoter
# Z_promoter: 6 by 1 functional annotation matrix of promoter
# G_EnhancerAll: 2000 by 86 genotype matrix of R=2 enhancers; 
# Z_EnhancerAll: 86 by 1 functional annotation matrix of R=2 enhancers
# p_EnhancerAll: Number of variants for R=2 enhancers.

data("GeneScan3D.example")

Y=GeneScan3D.example$Y; X=GeneScan3D.example$X; n=length(Y)

G_gene_buffer=GeneScan3D.example$G_gene_buffer
G_promoter=GeneScan3D.example$G_promoter
G_EnhancerAll=cbind(GeneScan3D.example$G_Enhancer1,GeneScan3D.example$G_Enhancer2)

Z_gene_buffer=GeneScan3D.example$Z_gene_buffer
Z_promoter=GeneScan3D.example$Z_promoter
Z_EnhancerAll=rbind(GeneScan3D.example$Z_Enhancer1,GeneScan3D.example$Z_Enhancer2)

pos_gene_buffer=GeneScan3D.example$pos_gene_buffer
p_EnhancerAll=c(dim(GeneScan3D.example$G_Enhancer1)[2],dim(GeneScan3D.example$G_Enhancer2)[2])

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

# Conduct GeneScan3D analysis
result.GeneScan3D=GeneScan3D(G=G_gene_buffer,Z=Z_gene_buffer,
                            G.promoter=G_promoter,Z.promoter=Z_promoter,
                            G.EnhancerAll=G_EnhancerAll,Z.EnhancerAll=Z_EnhancerAll, 
                            R=2,p_Enhancer=p_EnhancerAll,
                            pos=pos_gene_buffer,
                            window.size=c(1000,5000,10000),MAC.threshold=10,MAF.threshold=0.01,
                            result.null.model=result.null.model)
result.GeneScan3D$GeneScan3D.Cauchy.pvalue


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