Learn R Programming

plinkQC (version 0.2.2)

run_check_relatedness: Run PLINK IBD estimation

Description

Run LD pruning on dataset with plink --exclude range highldfile --indep-pairwise 50 5 0.2, where highldfile contains regions of high LD as provided by Anderson et (2010) Nature Protocols. Subsequently, plink --genome is run on the LD pruned data. plink --genome calculates identity by state (IBS) for each pair of individuals based on the average proportion of alleles shared at genotyped SNPs. The degree of recent shared ancestry, i.e. the identity by descent (IBD) can be estimated from the genome-wide IBS. The proportion of IBD between two individuals is returned by --genome as PI_HAT.

Usage

run_check_relatedness(indir, name, qcdir = indir, highIBDTh = 0.185,
  path2plink = NULL, showPlinkOutput = TRUE, verbose = FALSE)

Arguments

indir

[character] /path/to/directory containing the basic PLINK data files name.bim, name.bed, name.fam files.

name

[character] Prefix of PLINK files, i.e. name.bed, name.bim, name.fam.

qcdir

[character] /path/to/directory to save name.genome as returned by plink --genome. User needs writing permission to qcdir. Per default qcdir=indir.

highIBDTh

[double] Threshold for acceptable proportion of IBD between pair of individuals; only pairwise relationship estimates larger than this threshold will be recorded.

path2plink

[character] Absolute path to PLINK executable (https://www.cog-genomics.org/plink/1.9/) i.e. plink should be accesible as path2plink -h. The full name of the executable should be specified: for windows OS, this means path/plink.exe, for unix platforms this is path/plink. If not provided, assumed that PATH set-up works and PLINK will be found by exec_wait('plink').

showPlinkOutput

[logical] If TRUE, plink log and error messages are printed to standard out.

verbose

[logical] If TRUE, progress info is printed to standard out.

Details

Both run_check_relatedness and its evaluation via evaluate_check_relatedness can simply be invoked by check_relatedness.

Examples

Run this code
# NOT RUN {
indir <- system.file("extdata", package="plinkQC")
name <- 'data'
qcdir <- tempdir()
# the following code is not run on package build, as the path2plink on the
# user system is not known.
# }
# NOT RUN {
run <- run_check_relatedness(indir=indir, qcdir=qcdir, name=name)
# }

Run the code above in your browser using DataLab