KIMGENSThresholdChooser: KIMGENS threshold choosing helper

View source: R/HapDipKinship.R

KIMGENSThresholdChooserR Documentation

KIMGENS threshold choosing helper

Description

Output number of reference given a certain threshold

Usage

KIMGENSThresholdChooser(
  kins,
  ploidy,
  thresholds = c(0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45)
)

Arguments

kins

A data frame generated by kinship

ploidy

A data frame with two columns. First column is id (same as column names of genotype matrix). Second column is ploidy (1 or 2). Guess ploidy if not provided.

thresholds

A vector of proposed kinship thresholds for defining "relatives" in KIMGENS kinship.

Details

This functions helps user to decide the threshold for KIMGENS. By examining the output violin plot users can identify how many references can be used for each individual given a threshold. We recommend choosing a threshold resulting in on average 4 to 5 references and no individuals having 0 references.

Value

A violin plot

Examples

ancestrygenomatrix<-PopulationSim(1000,c(0.05,0.15,0.25))
ancestry<-matrix(c(6,2,0.3,2,6,0.3),nrow=3)
pedgeno<-HapdipPedigreeSim(ancestrygenomatrix,pedigree[1:18,],ancestry)
kins<-kinship(pedgeno,skipKIMGENS=T)
ploidy<-data.frame(id=pedigree$id,ploidy=ifelse(pedigree$sex=="F",2,1))
KIMGENSThresholdChooser(kins,ploidy)

YenWenWang/HapDipKinship documentation built on Jan. 20, 2025, 10:09 a.m.