get_block_lengths: Find LD-independent blocks

Description Usage Arguments Value Examples

View source: R/resampling.R

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

1
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 (50 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

1
2
3
4
5
6
7
## 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 Sept. 16, 2020, 5:55 a.m.