gene2geo: Creates a 'ggene' object from a 'genind' object and a...

Description Usage Arguments Details Value Warning Author(s) See Also Examples

Description

The function creates a ggene object from a genind object and a data frame containing the coordinates.

Usage

1
gene2geo(X, coord)

Arguments

X

A genind object (see package adegenet) giving the genetic data of a set of individuals.

coord

A data frame containing the coordinates of the individuals.

Details

Genetic data are contained in the genind object. Such objects can be created from various file formats (genepop, genetix...) using the package adegenet.

Value

An object of class ggene with 5 items:

tab

Data frame of the dummy variable coding for the presence of each allele. The number of rows is the number of individuals, the number of columns is the total number of alleles (all locus pooled).

coord

The x and y cordinates (longitude and latitude).

nloc

Number of different locus.

loc

The number of different alleles per locus.

locnames

The names of the different locus.

Warning

This function is intended be used to manage diploid data ONLY. Haploid data are not supported by gene2geno and should be handled using tab2geo. Caution is needed as regards missing data (NAs). NAs must be removed or replaced prior to analysing the dataset. One option developped in the package adegenet is to replace NAs by the NAs by the mean allele frequency. ggene has no function to handle NAs in raw data and users are referred to the package adegenet and its function scaleGen. This function will allow processing diploid data as a genind object. For haploid datasets, NAs removal must be done directly by users.

Author(s)

Jean-Pierre Rossi <ggene.package@gmail.com>

See Also

tab2geo

Examples

1
2
3
4
5
6
library(adegenet)
dat <- read.genepop(system.file("extdata/sim_03.gen",package="ggene"), ncode=3) 
xy <- read.csv(system.file("extdata/xysim_01.csv",package="ggene"),header=FALSE)[1:dim(dat$tab)[1],]
data <- gene2geo(X=dat, coord=xy)
class(data)
str(data)

ggene documentation built on May 2, 2019, 5:54 p.m.