nh_analysis_simulateR_generateR: NewHybrids data generator

View source: R/nh_analysis_simulateR_generateR.R

nh_analysis_simulateR_generateRR Documentation

NewHybrids data generator

Description

nh_analysis_data_generateR Quickly creates simulated reference populations from user provided data, and merges these with the genotypes of unknown/experimental individuals, producing a file to be analyzed by NewHybrids. Will also output a dataframe containing the names of the individuals (including those that were simulated) in the NewHybrids formatted file. The simulation function is the same as in freqbasedsim

Usage

nh_analysis_simulateR_generateR(ReferencePopsData, UnknownIndvs,
  outputName = NULL, pop.groups = c("Pure1", "Pure2"), sample.size = 200,
  NumSims = 1, NumReps = 1, cats.include = c("PopA", "PopB", "F1", "F2",
  "BCA", "BCB"))

Arguments

ReferencePopsData

A file path to a GenePop formatted file containing genotypes from two (2) ancestral populations. This is the data from which the simulated hybrids will be constructed

outputName

outputName A character vector to be applied as the name of the output.

pop.groups

Optional character vector denoting how the two ancestral populations should be named; default is PopA and PopB

sample.size

an integer number of simulated individuals to be created for each of the six hybrid classes (viz. Pure1, Pure2, F1, F2, BC1, BC2). The default is 200 (viz. 200 * each of Pure1, Pure2, F1, F2, BC1 and BC2 = 1200 total simulated individuals)

NumSims

an integer number of simulated datasets to be created. The default is 1

NumReps

integer number of replicates of each of the NumSims simulated dataset to be created. The default is 1

cats.include

Optional character vector list denoting which hybrid categories should be included in the output; default is all categories.

UnknownIndivs

A dataframe of genotypes of unknown/experimental individuals to be analyzed for hybrid category generated using the function *genepop_flatten* from the package *genepopedit*. Individuals or loci can be subsetted from this flattened data set if desired, or manipulations can conducted before flattening using the appropriate functions from *genepopedit*. Note - the number of loci in ReferencePopsData must equal the number in UnkownIndivs


bwringe/hybriddetective documentation built on March 22, 2023, 6:52 a.m.