genemapper2df: Combine txt files generated by GeneMapper

View source: R/genemapper2df.R

genemapper2dfR Documentation

Combine txt files generated by GeneMapper

Description

This function allows the user to quickly convert multiple txt files of microsatellite genotyping data from GeneMapper to a csv or a data.frame. It was tested with txt files produced by GeneMapper v4.0 up to v6.0.

Usage

genemapper2df(
  folder_name,
  export_name = "genemapper_export.csv",
  export_option = "csv"
)

Arguments

folder_name

a folder where all the .txt files generated by GeneMapper are stored.

export_name

the name of the exported csv file.

export_option

whether to export a csv file (option "csv") or a data.frame in the R Environment (option "R").

Value

a single csv file or a data.frame

Author(s)

Nikolaos Tourvas

Examples

## Not run: 

# Export csv file for use in GenAlEx
genemapper2df(folder_name = "...", export_name = "my_data", export_option = "csv")

# Create genind object
df <- genemapper2df(folder_name = "...", export_option = "R")
obj <- loci2genind(as.loci(df))

# For genind objects you will probably want to import population data as well.
# This can be done in the following way.

strata(obj) <- strata_df    #provide a data.frame with population strata (e.g. Year, Plot)
setPop(obj) <- ~Year/Plot    #set the appropriate population hierachy for the analysis
## Note that you can change population hierarchy between analyses using the previous command.

## End(Not run)

nikostourvas/PopGenUtils documentation built on April 23, 2022, 1:14 p.m.