Learn R Programming

poppr (version 1.1.5)

read.genalex: Importing data from genalex formatted *.csv files.

Description

read.genalex will read in a genalex-formatted file that has been exported in a comma separated format and will parse most types of genalex data. The output is a genclone or genind object.

Usage

read.genalex(genalex, ploidy = 2, geo = FALSE, region = FALSE,
  genclone = TRUE, sep = ",")

Arguments

genalex
a *.csv file exported from genalex
ploidy
indicate the ploidy of the dataset
geo
indicates the presence of geographic data in the file. This data will be included in a data frame labeled xy in the other slot.
region
indicates the presence of regional data in the file.
genclone
when TRUE (default), the output will be a genclone object. When FALSE, the output will be a genind object
sep
A character specifying the column separator of the data. Defaults to ",".

Value

  • A genclone or genind object.

Details

if genclone = FALSE{ The resulting genind object will have a data frame in the other slot called population_hierarchy. This will contain a column for your population data and a column for your Regional data if you have set the flag.}

if genclone = TRUE{ The resulting genclone object will have a single hierarchical level defined in the hierarchy slot. This will be called "Pop" and will reflect the population factor defined in the genalex input. If region = TRUE, a second column will be inserted and labeled "Region". If you have more than two hierarchical levels within your data set, you should run the command splithierarchy on your data set to define the unique hierarchical levels. }

FOR POLYPLOID (> 2n) DATA SETS{ Adegenet's genind object has an all-or-none approach to missing data. If a sample has missing data at a particular locus, then the entire locus is considered missing. This works for diploids and haploids where allelic dosage is unambiguous. For polyploids this poses a problem as much of the data set would be transformed into missing data. With this function, I have created a workaround.

When importing polyploid data sets, missing data is scored as "0" and kept within the genind object as an extra allele. This will break most analyses relying on allele frequencies*. All of the functions in poppr will work properly with these data sets as multilocus genotype analysis is agnostic of ploidy and we have written both Bruvo's distance and the index of association in such a way as to be able to handle polyploids presented in this manner.

* To restore functionality of analyses relying on allele frequencies, use the recode_polyploids function.}

See Also

clonecorrect, genclone, genind, recode_polyploids

Examples

Run this code
Aeut <- read.genalex(system.file("files/rootrot.csv", package="poppr"))

genalex2 <- read.genalex("genalex2.csv", geo=TRUE)
# A genalex file with geographic coordinate data.

genalex3 <- read.genalex("genalex3.csv", region=TRUE)
# A genalex file with regional information.

genalex4 <- read.genalex("genalex4.csv", region=TRUE, geo=TRUE)
# A genalex file with both regional and geographic information.

Run the code above in your browser using DataLab