LD_blocks: Function for creating blocks of input genotypes based on LD...

Description Usage Arguments Value Examples

View source: R/all_functions.R

Description

Given an input set of genotypes from the generate.genotype() function, this function will generate LD blocks based on average LD between all members in each block, using r2 metric of LD. Scanning linearly over the genotype file from the first row, genotypes will be contiously added to blocks as long as the average of all pairwise r2 values of the genotypes in the block are above threshold. When the values goes below the threshold, the last genotype tested will be the base of a new block. For each block the variant with the highest average pairwise r2 value in block will be selected as a tagging genotype.

Usage

1
LD_blocks(genotype,threshold=0.9,max_block_size=1000)

Arguments

genotype

A genotype matrix from generate.genotype()

threshold

The threshold used for generating blocks, indicating the minimum average pairwise r2 value allowed.

max_block_size

The maximum block size allowed.

Value

Returns a named list with the following objects:

genotype

The tagging genotypes selected from the blocks

tagging_genotype

The genotype selected to represent each block. The median genotype, rounded down is selected

genotype_block_matrix

A matrix indicating which block each genotype belongs to

Returns a named list with the following objects:

Examples

1
 LD_blocks(genotype,threshold,max_blocksize)

AQS-Group/WISH documentation built on July 17, 2020, 12:12 a.m.