Learn R Programming

GRAB (version 0.2.4)

getPairwiseIBD: Calculate Pairwise IBD (Identity By Descent)

Description

This function calculates pairwise IBD probabilities for related samples using PLINK genotype data and sparse GRM. It follows the getSparseGRM() function workflow.

Usage

getPairwiseIBD(
  PlinkPrefix,
  SparseGRMFile,
  PairwiseIBDOutput,
  frqFile = NULL,
  tempDir = NULL,
  maxSampleNums = 2500,
  minMafIBD = 0.01,
  rm.tempFile = FALSE
)

Value

Character. Message indicating where the pairwise IBD results have been stored.

Arguments

PlinkPrefix

Character. Path to PLINK file (without file extensions .bed/.bim/.fam).

SparseGRMFile

Character. Path to sparse GRM file from getSparseGRM() function.

PairwiseIBDOutput

Character. Output path to save pairwise IBD results.

frqFile

Character. Path to frequency file corresponding to PLINK file. If NULL (default), uses PlinkPrefix.frq.

tempDir

Character. Directory to save temporary files. If NULL (default), uses tempdir().

maxSampleNums

Integer. Maximum number of subjects' genotypes to read for analysis (default: 2500).

minMafIBD

Numeric. Minimum MAF cutoff to select markers (default: 0.01).

rm.tempFile

Logical. Whether to delete temporary files (default: FALSE).

Examples

Run this code
PlinkPrefix <- file.path(system.file(package = "GRAB"), "extdata", "simuPLINK")
SparseGRMFile <- system.file("extdata", "SparseGRM.txt", package = "GRAB")
PairwiseIBDOutput <- file.path(tempdir(), "PairwiseIBD.txt")
getPairwiseIBD(PlinkPrefix, SparseGRMFile, PairwiseIBDOutput)

Run the code above in your browser using DataLab