genepop_bgc: Convert Genepop to Bayesian Genomic Clines (BGC) format.

View source: R/genepop_bgc.R

genepop_bgcR Documentation

Convert Genepop to Bayesian Genomic Clines (BGC) format.

Description

Function to convert Genepop to BGC format.

Usage

genepop_bgc(genepop, popdef, fname, path)

Arguments

genepop

the genepop data to be manipulated. This can be either a file path or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. This will the standard genepop format with a the first n+1 rows corresponding the the n loci names, or a single comma deliminated row of loci names followed by the locus data. Populations are separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as as a single row (character).

popdef

is a dataframe or path to a csv. This dataframe contains two columns. Column 1 corresponds to the population names. These names should match the individual IDs (e.g. BON_01 , 110110 would be 'BON'). The next column has the grouping classification corresponding to each population defining parental 1 ("P1") parental 2 ("P2") and admixed ("Admixed") populations. Note the classifications must be exactly as specified (caps sensitive). If populations are omitted from this dataframe then they will be omitted from the output files.

fname

collective name assigned to each of the output files for BGC. e.g. "Lobster_analysis" would result in "Lobster_analysis_P1.txt","Lobster_analysis_P2.txt", and "Lobster_analysis_Admixed.txt"

path

file path to directory where the BGC files (3) will be saved.


rystanley/genepopedit documentation built on June 14, 2024, 5:34 p.m.