WGScan.Region: Scan the association between an quantitative/dichotomous...

Description Usage Arguments Value Examples

View source: R/WGScan.R

Description

Once the preliminary work is done by "WGScan.prelim()", this function scan a target region. This function is often used for candidate region analyses.

Usage

1
2
3
WGScan.Region(result.prelim,G,pos,Gsub.id=NULL,Z=NULL,MAF.weights='beta',
test='combined',window.size=c(5000,10000,15000,20000,25000,50000),MAF.threshold=1,
impute.method='fixed')

Arguments

result.prelim

The output of function "WGScan.prelim()"

G

Genetic variants in the target region, an n*p matrix where n is the subject ID and p is the total number of genetic variants.

pos

The positions of genetic variants, an p dimensional vector. Each position corresponds to a column in the genotype matrix.

Gsub.id

The subject id corresponding to the genotype matrix, an n dimensional vector. Each ID corresponds to a row in the genotype matrix. This is used to match phenotype with genotype. The default is NULL, where the matched phenotype and genotype matrices are assumed.

Z

Weight matrix for functional annotations, an p*q matrix where p is the total number of genetic variables and q is the number of weights. This is used to incorperate functional annotations. The default is NULL, where minor allele frequency weighted (see MAF.weights) dispersion and/or burden tests are applied.

MAF.weights

Minor allele frequency based weight. Can be 'beta' to up-weight rare variants or 'equal' for a flat weight. The default is 'beta'.

test

Can be 'dispersion', 'burden' or 'combined'. The test is 'combined', both dispersion and burden tests are applied. The default is 'combined'.

window.size

Candidate window sizes in base pairs. The default is c(5000,10000,15000,20000,25000,50000). Note that extemely small window size (e.g. 1) requires large sample size.

MAF.threshold

Threshold for minor allele frequency. Variants above MAF.threshold are ignored. The default is 1.

impute.method

Choose the imputation method when there is missing genotype. Can be "random", "fixed" or "bestguess". Given the estimated allele frequency, "random" simulates the genotype from binomial distribution; "fixed" uses the genotype expectation; "bestguess" uses the genotype with highest probability.

Value

n.marker

Number of tested variants in the window (heterozygous variants below MAF threshold).

window.summary

Results for all windows. Each row presents a window, including chromosome number, start position, end position,dispersion p-value(s), burden p-values(s).

M

Estimated number of effective tests.

threshold

Estimated threshold, 0.05/M. This threshold is for windows tested in this particular region.

p.value

P-value of entire region.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## WGScan.prelim does the preliminary data management.
# Input: Y, X (covariates)
## WGScan.Region scans a region.
# Input: G (genetic variants), pos (position) Z (weights) and result of WGScan.prelim

library(WGScan)

# Load data example
# Y: outcomes, n by 1 matrix where n is the total number of observations
# X: covariates, n by d matrix
# G: genotype matrix, n by p matrix where n is the total number of subjects
# pos: positions of genetic variants, p dimention vector
# Z: functional annotation matrix, p by q matrix

data(WGScan.example)
Y<-WGScan.example$Y;X<-WGScan.example$X
G<-WGScan.example$G;pos<-WGScan.example$pos
Z<-WGScan.example$Z

# Preliminary data management
result.prelim<-WGScan.prelim(Y,X=X,out_type="C",B=5000)

# Scan the region with functional annotations defined in Z
result<-WGScan.Region(result.prelim,G,pos,Z=Z)

WGScan documentation built on May 27, 2019, 9:05 a.m.