allelic_list: Create genotype lists for each locus

View source: R/data_conversion.R

allelic_listR Documentation

Create genotype lists for each locus

Description

Uses the allele counts from a_freq_list and the cleaned short-format output of tcf2long to generate a nested list of individual genotypes for each locus

Usage

allelic_list(cs, ac, samp_type = "both")

Arguments

cs

a clean short genetic data matrix; the second element of the output from tcf2long. Must have a column of individual identifiers, named "indiv"

ac

allele counts from a_freq_list

samp_type

choose which sample types of individuals to include in output: "mixture", "both", or "reference"

Value

allelic_list returns a two-component nested list, with data stored as character names of alleles ($chr) or as integer indices for the alleles ($int). Both forms contain lists representing to loci, with two component vectors corresponding to gene copies a and b.

Examples

example(a_freq_list)
ale_cs <- ale_long$clean_short
# Get the vectors of gene copies a and b for all loci in integer index form
ale_alle_list <- allelic_list(ale_cs, ale_ac)$int


benmoran11/rubias documentation built on Feb. 1, 2024, 10:52 p.m.