create_knockoff {KnockoffHybrid}R Documentation

Create knockoff genotype data in trio designs

Description

Create knockoff genotype data using phased haplotype data in trio designs.

Usage

create_knockoff(
  dat.hap,
  pos,
  M = 10,
  maxcor = 0.7,
  maxbp = 90000,
  phasing.dad = NULL,
  phasing.mom = NULL,
  seed = 100
)

Arguments

dat.hap

A 6n*p matrix for the haplotype 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 haplotypes must be coded as 0 or 1. Missing haplotypes are not allowed.

pos

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

M

A positive integer for the number of knockoffs. The default is 10.

maxcor

A real number in a range of [0,1] for the correlation threshold in hierarchical clustering, such that variants from two different clusters do not have a correlation greater than maxcor when constructing knockoff parents. The default is 0.7.

maxbp

A positive integer for the size of neighboring base pairs used to generate knockoff parents. The default is 90000.

phasing.dad

A numeric vector of length n that contains 1 or 2 to indicate which paternal haplotype was transmitted to offspring in each trio. If NA, the function will calculate the phasing information based on the input haplotype matrix.

phasing.mom

A numeric vector of length n that contains 1 or 2 to indicate which maternal haplotype was transmitted to offspring in each trio. If NA, the function will calculate the phasing information based on the input haplotype matrix.

seed

An integer for the random seed in the knockoff generation. The default is 100.

Value

A 3n*p*M array for the knockoff genotype data.

Examples

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

[Package KnockoffHybrid version 1.0.1 Index]