GetGenotypes: Create genotypes from a output with haplotypes

View source: R/functions_pool.R

GetGenotypesR Documentation

Create genotypes from a output with haplotypes

Description

This function applies the hap2geno function to all entries of a list. Each entry of that list is a different locus simulated with scrm::scrm(). Thus, this function converts the haplotypes of all simulated loci into genotypes.

Usage

GetGenotypes(haplotypes, nDip)

Arguments

haplotypes

a list of haplotypes obtained from the simulations done with scrm::scrm(). Each entry of the list is a matrix that corresponds to a given locus. At each matrix, each column is a different site and each row is a different haplotype.

nDip

an integer representing the total number of diploid individuals to simulate. Note that this is the total number of diploid individuals and not the number of individuals per population.

Value

a list of genotypes. Each entry of the list is a matrix corresponding to a different locus. locus. At each matrix, each column is a different site and each row is a different genotype


poolHelper documentation built on July 9, 2023, 6:23 p.m.