Bayesian Inference from the Conditional Genetic Stock Identification Model
Convert data frame of allele frequencies to nested lists
Create genotype lists for each locus
Test the effects of the parametric bootstrap bias correction on a refe...
Simulate mixtures and estimate reporting group and collection proporti...
Partition a reference dataset and estimate reporting group and collect...
Get the average within-RU assignment rate for each collection
Perform a parametric bootstrapping correction on an estimated rho vect...
check a baseline and mixture file together to ensure the known_collect...
A helper function to check that the input data frame is OK
check for matching (or close to matching) genotypes in a data frame
for each individual count the number or loci missing and non_missing
Create a vector of pi Dirichlet priors with specified values for one o...
Given a vector of different categories in 1...n and a prior, simulate ...
Given a vector of counts for different categories in 1...n and a prior...
Calculate a matrix of genotype log-likelihoods for a genetic dataset
Calculate a matrix of sum-of-squares of genotype log-likelihoods for a...
infer the ploidy from the pattern of NAs in the columns of data
Simulate genotype log-likelihoods from a population by gene copy
Simulate genotypes by gene copy, with missing data from chosen individ...
Simulate genotype log-likelihoods from a population by individual
EM algorithm from the simplest GSI model for pi and the individual pos...
MCMC from the simplest GSI model for pi and the individual posterior p...
MCMC from the fully Bayesian GSI model for pi and the individual poste...
Generate a random population structure and mixture sample, as in Hasse...
Estimate mixing proportions and origin probabilities from one or sever...
Collect essential data values before mixture proportion estimation
Separate a chosen proportion of a reference dataset into a mixture wit...
for individuals of known origin in the mixture, put all their weight o...
Compute the mean and variance of the single-locus genotype likelihoods...
Pipe operator
Find all pairs that have close matches
From the pattern of missing data at each individual, compute the expec...
Return a matrix of locus-specific self-assignment logls
read a gsi_sim formatted input file into a tibble that rubias can use
Estimate mixing proportions from reference and mixture datasets
Tabulate occurrences of all observed alleles in reference genetic data
Round a given number, with 5 always rounded up
rubias: Bayesian inference from the conditional genetic stock identifi...
Sample 1 observation from cell probabilities that are columns of a mat...
Do leave-one-out self-assignment of individuals in a reference baselin...
Generate a samples for a mixture.
Convert Two-Column Genetic Data to Long Format
Generate MCMC parameter list from two-column genetic data & print summ...
A helper function to tidy up the output from the gsi_mcmc functions
A helper function to tidy up the PofZ-like output from the gsi_mcmc fu...
a helper function to tidy up the pi-traces that come out of the mcmc f...
Write a mixture data frame to gsi_sim format baseline and repunits fil...
Write a reference data frame to gsi_sim format baseline and repunits f...
Implements Bayesian inference for the conditional genetic stock identification model. It allows inference of mixed fisheries and also simulation of mixtures to predict accuracy. A full description of the underlying methods is available in a recently published article in the Canadian Journal of Fisheries and Aquatic Sciences: <doi:10.1139/cjfas-2018-0016>.