betas_estimator: Estimate betas per population

View source: R/betas_estimator.R

betas_estimatorR Documentation

Estimate \betas per population

Description

Estimate \betas per population.

Usage

betas_estimator(data, strata = NULL, filename = NULL, verbose = FALSE)

Arguments

data

14 options for input (diploid data only): VCFs (SNPs or Haplotypes, to make the vcf population ready), plink (tped, bed), stacks haplotype file, genind (library(adegenet)), genlight (library(adegenet)), gtypes (library(strataG)), genepop, DArT, and a data frame in long/tidy or wide format. To verify that radiator detect your file format use detect_genomic_format (see example below). Documented in Input genomic datasets of tidy_genomic_data.

DArT and VCF data: radiator was not meant to generate alleles and genotypes if you are using a VCF file with no genotype (only genotype likelihood: GL or PL). Neither is radiator able to magically generate a genind object from a SilicoDArT dataset. Please look at the first few lines of your dataset to understand it's limit before asking raditor to convert or filter your dataset.

strata

(optional) The strata file is a tab delimited file with a minimum of 2 columns headers: INDIVIDUALS and STRATA. Documented in read_strata. DArT data: a third column TARGET_ID is required. Documented on read_dart. Also use the strata read function to blacklist individuals. Default: strata = NULL.

filename

(optional) The function uses write.fst, to write the tidy data frame in the working directory. The file extension appended to the filename provided is .rad. With default: filename = NULL, the tidy data frame is in the global environment only (i.e. not written in the working directory...).

verbose

(optional, logical) When verbose = TRUE the function is a little more chatty during execution. Default: verbose = TRUE.

Value

A list is created with 3 objects: betaiovl: Average \beta_i over loci, Hw: Within population gene diversities Hb: Between populations gene diversities

Author(s)

Thierry Gosselin thierrygosselin@icloud.com

References

Weir, B., Goudet, J. (2017). A Unified Characterization of Population Structure and Relatedness Genetics 206(4), 2085-2103. https://dx.doi.org/10.1534/genetics.116.198424

Goudet, J., Kay, T., Weir, B. (2018). How to estimate kinship Molecular Ecology 27(20), 4121-4135. https://dx.doi.org/10.1111/mec.14833

Examples

## Not run: 
# Using a  VCF file, the simplest for of the function:
fh <- ibdg_fh(
data = "batch_1.vcf",
strata = "strata.panda.tsv"
)
# To see what's inside the list
names(fh)
# To view the manhattan plot:
fh$fh.manhattan.plot
# To view the distribution of FH values:
fh$fh.distribution.plot

## End(Not run)

thierrygosselin/radiator documentation built on April 25, 2024, 3:20 a.m.