get_block_lengths: Find LD-independent blocks

View source: R/resampling.R

get_block_lengthsR Documentation

Find LD-independent blocks

Description

A new block begins at the SNP after the first SNP which is not within blgsize of the start of the last block. dat needs to be ordered first by 'CHR', then by 'POS' or 'cm'

Usage

get_block_lengths(dat, blgsize = 0.05, cpp = TRUE, verbose = TRUE)

Arguments

dat

Data frame with columns 'CHR' and either 'POS' or 'cm'

blgsize

SNP block size in Morgan. Default is 0.05 (5 cM). If blgsize is 100 or greater, if will be interpreted as base pair distance rather than centimorgan distance.

cpp

Should the faster C++ version be used?

verbose

Print progress updates

Value

A numeric vector where the ith element lists the number of SNPs in the ith block.

Examples

## Not run: 
prefix = 'path/to/packedancestrymap_prefix'
pops = c('pop1', 'pop2', 'pop3')
afdat = packedancestrymap_to_afs(prefix, pops = pops)
block_lengths = get_block_lengths(afdat)

## End(Not run)

uqrmaie1/admixtools documentation built on March 4, 2024, 10:19 p.m.