group_samples: Group precomputed data

View source: R/io.R

group_samplesR Documentation

Group precomputed data

Description

Computing f2 statistics for populations consisting of many individuals can be slow and require a lot of memory. To speed this up, this function groups individuals into populations, computes allele counts and products of pairwise allele counts with all individuals and groups, and writes the data to disk. f2 statistics for a combination of grouped and ungrouped precomputed data can then be read using f2_from_precomp, replacing individual IDs of the grouped samples with the new group labels. All groupings are listed in ⁠{dir}/groups/{groupname}.rds⁠

Usage

group_samples(dir, inds, pops, overwrite = FALSE, verbose = TRUE)

Arguments

dir

Directory with precomputed individual pair data

inds

Individuals to group

pops

Group names, either length 1, or same length as inds

overwrite

Overwrite existing files in outdir

verbose

print progress updates

See Also

delete_groups

Examples

## Not run: 
dir = 'my/f2/dir/'
inds = c('ind1', 'ind2', 'ind3', 'ind4', 'ind5')
pops = c('pop_A', 'pop_A', 'pop_A', 'pop_B', 'pop_B')
group_samples(dir, inds, pops)

## End(Not run)

uqrmaie1/admixtools documentation built on Nov. 3, 2024, 12:56 a.m.