Estimate Sample Size for Population Genomic Studies

Estimate sample sizes needed to capture target levels of genetic diversity from a population (multivariate allele frequencies) for applications like germplasm conservation and breeding efforts. Compares bootstrap samples to a full population using linear regression, employing the R-squared value to represent the proportion of diversity captured. Iteratively increases sample size until a user-defined target R-squared is met. Offers a parallelized R implementation of a previously developed 'python' method. All ploidy levels are supported. For more details, see Sandercock et al. (2024) .


R-CMD-check GitHub Release Development Status GitHub License

castgen

This package and included functions were developed for the American chestnut landscape genomics manuscript. The aim was to develop a method for estimating the number of individuals to sample from a population in order to capture a predefined percentage of diversity within a breeding population.

Getting Started

A VCF file with GT information or a genotype matrix can be used as input

Usage

To install package:

install.packages("devtools") #If not already installed

devtools::install_github("alex-sandercock/castgen")
library("castgen")

Output data

The output will be provided in the terminal following the completion of all iterations:


Number of trees to sample = 22.0 

95% Confidence Intervals = (16.378127142052662, 27.621872857947338) 

Iterations performed = 5

Citation

If you use this package, please cite:

A.M. Sandercock, J.W. Westbrook, Q. Zhang, & J.A. Holliday, A genome-guided strategy for climate resilience in American chestnut restoration populations, Proc. Natl. Acad. Sci. U.S.A. 121 (30) e2403505121, https://doi.org/10.1073/pnas.2403505121 (2024).

Notes

The capture_diversity functions were converted from a Python function https://github.com/alex-sandercock/Capture_genomic_diversity. These R versions of the function are much (much) faster to run and have the option to run in parallel depending on cores available.

image

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("castgen")

1.0.2 by Alexander M. Sandercock, 2 years ago


https://github.com/alex-sandercock/castgen


Report a bug at https://github.com/alex-sandercock/castgen/issues


Browse source code at https://github.com/cran/castgen


Authors: Alexander M. Sandercock [aut, cre]


Documentation:   PDF Manual  


Apache License (>= 2) license


Imports doParallel, dplyr, foreach, parallel, Rdpack, stats, utils, vcfR

Suggests testthat


See at CRAN