genind2bgc: Generate inputs for BGC from genind object. Does not use...

View source: R/genind2bgc.R

genind2bgcR Documentation

Generate inputs for BGC from genind object. Does not use genotype uncertainty.

Description

This function parses a genind object to create input data frames for running genomic cline analysis in BGC. It writes the appropriate output files as: <prefix>_p0in.txt, <prefix>_p1in.txt, and <prefix>_admixedin.txt

Usage

genind2bgc(
  gen,
  p1,
  p2,
  admix,
  missingPerLoc = 0.5,
  missingPerInd = 0.5,
  subset = NULL,
  drop = TRUE,
  prefix = "bgc"
)

Arguments

gen

Genind object containing data for parental and admixed populations

p1

Character or vector containing population names for the p1 group

p2

Character or vector containing population names for the p2 group

admix

Character or vector containing population names for the admixed individuals

missingPerLoc

Proportion of missing genotypes allowed to retain a locus

missingPerInd

Proportion of missing genotypes allowed to retain an individual

subset

An optional parameter defining a number of loci to randomly retain

prefix

A string giving the prefix for bgc input file names

Examples

bgc_input <- genind2bgc(genind, p1=c("PopA", "PopB"),
                                        p2="PopC", admix=c("PopD1", "PopD2"))

bgc_input <- genind2bgc(genind, p1=c("PopA", "PopB"),
                                        p2="PopC", admix=c("PopD1", "PopD2"),
                                        missingPerInd=0.75, missingPerLoc=0.25)

bgc_input <- genind2bgc(genind, p1=c("PopA", "PopB"),
                                        p2="PopC", admix=c("PopD1", "PopD2"),
                                        subset=500)

btmartin721/ClineHelpR documentation built on Oct. 15, 2024, 5:05 a.m.