gstud_to_genind: Convert a file from 'gstudio' or 'popgraph' into a genind...

Description Usage Arguments Details Value Author(s) Examples

View source: R/gstud_to_genind.R

Description

The function converts a file formatted to use gstudio or popgraph package into a genind object (adegenet package)

Usage

1
gstud_to_genind(x, pop_col, ind_col = NULL)

Arguments

x

An object of class data.frame with loci columns in format locus (defined in package gstudio) with as many rows as individuals and as many columns in format locus as there are loci and additional columns

pop_col

A character string indicating the name of the column with populations' names in x

ind_col

(optional) A character string indicating the name of the column with individuals' ID in x

Details

This function uses functions from pegas package. It can handle genetic data where alleles codings do not have same length, (99:101, for example). If the names of the loci include '.' characters, they will be replaced by '_'.

Value

An object of class genind.

Author(s)

P. Savary

Examples

1
2
3
4
5
data("data_ex_gstud")
x <- data_ex_gstud
pop_col <- "POP"
ind_col <- "ID"
data_genind <- gstud_to_genind(x, pop_col, ind_col)

graph4lg documentation built on March 16, 2021, 5:09 p.m.