group_samples | R Documentation |
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
group_samples(dir, inds, pops, overwrite = FALSE, verbose = TRUE)
dir |
Directory with precomputed individual pair data |
inds |
Individuals to group |
pops |
Group names, either length 1, or same length as |
overwrite |
Overwrite existing files in |
verbose |
print progress updates |
delete_groups
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.