GeneScan3D.KnockoffGeneration: GeneScan3D AR Knockoff Generation: an auto-regressive model...

View source: R/GeneScan3DKnock.R

GeneScan3D.KnockoffGenerationR Documentation

GeneScan3D AR Knockoff Generation: an auto-regressive model for knockoff generation.

Description

This function generates multiple knockoff genotypes for a gene and the corresponding regulatory elements based on an auto-regressive model. Additionally, it computes p-values from the GeneScan3D test for a gene based on the original data, and each of the knockoff replicates. The knockoff generations are optimized using shrinkage leveraging algorithm.

Usage

GeneScan3D.KnockoffGeneration(
  G_gene_buffer_surround = G_gene_buffer_surround,
  variants_gene_buffer_surround = variants_gene_buffer_surround,
  gene_buffer.pos = gene_buffer.pos,
  promoter.pos = promoter.pos,
  R = 2,
  G_EnhancerAll_surround = G_EnhancerAll_surround,
  variants_EnhancerAll_surround = variants_EnhancerAll_surround,
  p_EnhancerAll_surround = p_EnhancerAll_surround,
  Enhancer.pos = Enhancer.pos,
  p.EnhancerAll = p_EnhancerAll,
  Z = Z_gene_buffer,
  Z.promoter = Z_promoter,
  Z.EnhancerAll = Z_EnhancerAll,
  window.size = c(1000, 5000, 10000),
  MAC.threshold = 10,
  MAF.threshold = 0.01,
  Gsub.id = NULL,
  result.null.model = result.null.model,
  M = 5
)

Arguments

G_gene_buffer_surround

The genotype matrix of the surrounding region for gene buffer region.

variants_gene_buffer_surround

The genetic variants in the surrounding region for gene buffer region. Each position corresponds to a column in the genotype matrix G_gene_buffer_surround.

gene_buffer.pos

The start and end positions of gene buffer region.

promoter.pos

The start and end positions of promoter.

R

Number of enhancers.

G_EnhancerAll_surround

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

variants_EnhancerAll_surround

The genetic variants in the surrounding region for R enhancers. Each position corresponds to a column in the genotype matrix G_EnhancerAll_surround.

p_EnhancerAll_surround

Number of genetic variants in the surrounding region for R enhancers, which is a 1*R vector.

Enhancer.pos

The start and end positions for R enhancers. One row represents one enhancer, which is a R by 2 matrix.

p.EnhancerAll

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

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.

Z.promoter

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

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.

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).

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.

result.null.model

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

M

Numer of multiple knockoffs.

Value

GeneScan3D.Cauchy

GeneScan3D p-values of all, common and rare variants for original genotypes.

GeneScan3D.Cauchy_knockoff

A M by 3 GeneScan3D p-values matrix of all, common and rare variants for M knockoff genotypes.

Examples

library(GeneScan3DKnock)
data(KnockoffGeneration.example)
Y=KnockoffGeneration.example$Y; X=KnockoffGeneration.example$X; 

G_gene_buffer_surround=KnockoffGeneration.example$G_gene_buffer_surround
variants_gene_buffer_surround=KnockoffGeneration.example$variants_gene_buffer_surround
G_Enhancer1_surround=KnockoffGeneration.example$G_Enhancer1_surround
variants_Enhancer1_surround=KnockoffGeneration.example$variants_Enhancer1_surround
G_Enhancer2_surround=KnockoffGeneration.example$G_Enhancer2_surround
variants_Enhancer2_surround=KnockoffGeneration.example$variants_Enhancer2_surround

gene_buffer.pos=KnockoffGeneration.example$gene_buffer.pos
promoter.pos=KnockoffGeneration.example$promoter.pos
Enhancer1.pos=KnockoffGeneration.example$Enhancer1.pos
Enhancer2.pos=KnockoffGeneration.example$Enhancer2.pos   

Z_gene_buffer=KnockoffGeneration.example$Z_gene_buffer
Z_promoter=KnockoffGeneration.example$Z_promoter
Z_Enhancer1=KnockoffGeneration.example$Z_Enhancer1
Z_Enhancer2=KnockoffGeneration.example$Z_Enhancer2

G_EnhancerAll_surround=cbind(G_Enhancer1_surround,G_Enhancer2_surround)
variants_EnhancerAll_surround=c(variants_Enhancer1_surround,variants_Enhancer2_surround)
p_EnhancerAll_surround=c(length(variants_Enhancer1_surround),length(variants_Enhancer2_surround))
Enhancer.pos=rbind(Enhancer1.pos,Enhancer2.pos)
p_EnhancerAll=c(dim(Z_Enhancer1)[1],dim(Z_Enhancer2)[1])
Z_EnhancerAll=rbind(Z_Enhancer1,Z_Enhancer2)

set.seed(12345)
result.null.model=GeneScan.Null.Model(Y, X, out_type="C", B=1000)

result.GeneScan3D.KnockoffGeneration=GeneScan3D.KnockoffGeneration(
G_gene_buffer_surround=G_gene_buffer_surround,
variants_gene_buffer_surround=variants_gene_buffer_surround,
gene_buffer.pos=gene_buffer.pos,
promoter.pos=promoter.pos,
R=2, 
G_EnhancerAll_surround=G_EnhancerAll_surround, 
variants_EnhancerAll_surround=variants_EnhancerAll_surround,
p_EnhancerAll_surround=p_EnhancerAll_surround,
Enhancer.pos=Enhancer.pos,
p.EnhancerAll=p_EnhancerAll,
Z=Z_gene_buffer,
Z.promoter=Z_promoter,
Z.EnhancerAll=Z_EnhancerAll,
window.size=c(1000,5000,10000),
MAC.threshold=10,
MAF.threshold=0.01,
Gsub.id=NULL,
result.null.model=result.null.model,
M=5)
result.GeneScan3D.KnockoffGeneration$GeneScan3D.Cauchy 
result.GeneScan3D.KnockoffGeneration$GeneScan3D.Cauchy_knockoff

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