genepop_structure: Convert Genepop to STRUCTURE format.

View source: R/genepop_structure.R

genepop_structureR Documentation

Convert Genepop to STRUCTURE format.

Description

Function to convert Genepop to STRUCTURE

Usage

genepop_structure(genepop, popgroup = NULL, locusnames = FALSE,
  path = NULL)

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 be the standard genepop format with the first n+1 rows corresponding to the n loci names, or a single comma delimited 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).

popgroup

if specified (Default: NULL) popgroup 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 group. If groupings are the same as populations then leave as NULL (Default).If the input genepop file does not have population and sample ID seperation using ("_") then refer to genepop_ID().

locusnames

logical (default=FALSE). Specify TRUE if you want the locus names from your Genepop file to be the first row in your Structure files.

path

the filepath and filename of output.


rystanley/genepopedit documentation built on June 27, 2023, 11:33 p.m.