KnockoffTrio {KnockoffTrio}R Documentation

Calculate KnockoffTrio's feature statistics

Description

Calculate KnockoffTrio's feature statistics using original and knockoff genotype data.

Usage

KnockoffTrio(
  dat,
  dat.ko = NA,
  pos,
  start = NA,
  end = NA,
  size = c(1, 1000, 5000, 10000, 20000, 50000),
  p_value_only = FALSE,
  adjust_for_cov = FALSE,
  y = NA,
  chr = "1",
  xchr = FALSE,
  sex = NA
)

Arguments

dat

A 3n*p matrix for the original genotype data, in which n is the number of trios and p is the number of variants. Each trio must consist of father, mother, and offspring (in this order). The genotypes must be coded as 0, 1, or 2. Missing genotypes are not allowed.

dat.ko

A 3n*p*M array for the knockoff genotype data created by function create_knockoff. M is the number of knockoffs.

pos

A numeric vector of length p for the position of p variants.

start

An integer for the first position of sliding windows. If NA, start=min(pos). Only used if you would like to use the same starting position for different cohorts/analyses.

end

An integer for the last position of sliding windows. If NA, end=max(pos). Only used if you would like to use the same ending position for different cohorts/analyses.

size

A numeric vector for the size(s) of sliding windows when scanning the genome

p_value_only

A logical value indicating whether to perform the knockoff analysis. When p_value_only is TRUE, only the ACAT-combined p-values are to be calculated for each window. When p_value_only is FALSE, dat.ko is required and KnockoffTrio's feature statistics are to be calculated for each window in addition to the p-values.

adjust_for_cov

A logical value indicating whether to adjust for covariates. When adjust_for_cov is TRUE, y is required.

y

A numeric vector of length n for the residual Y-Y_hat. Y_hat is the predicted value from the regression model in which the quantitative trait Y is regressed on the covariates. If Y is dichotomous, you may treat Y as quantitative when applying the regression model.

chr

A character for the name of the chromosome, e.g., "1", "2", ..., "22", and "X".

xchr

A logical value indicating whether the analysis is for the X chromosome. When xchr is TRUE, the analysis is for the X chromosome and sex is required. When xchr is FALSE, the analysis is for the autosomes.

sex

A numeric vector of length n for the sex of offspring. 0s indicate females and 1s indicate males. Sex is required when xchr is TRUE.

Value

A data frame for the analysis results. Each row contains the p-values and, if p_value_only is FALSE, KnockoffTrio's feature statistics for a window.

Examples

data(KnockoffTrio.example)
dat.ko<-create_knockoff(KnockoffTrio.example$dat.hap,KnockoffTrio.example$pos,M=10)
window<-KnockoffTrio(KnockoffTrio.example$dat,dat.ko,KnockoffTrio.example$pos)

[Package KnockoffTrio version 1.0.2 Index]