Learn R Programming

dartR (version 1.1.11)

gl.read.dart: Import DarT data into R and conver it to a genlight object

Description

This function is a wrapper function that allows you to convert you dart file into a genlight object in one step. In previous versions you had to use read.dart and then dart2genlight. In case you have individual metadata for each individual/sample you can specify as before in the dart2genlight command the file that combines the data.

Usage

gl.read.dart(filename, ind.metafile = NULL, covfilename = NULL,
  nas = "-", topskip = NULL, lastmetric = "RepAvg", probar = TRUE)

Arguments

filename

path to file (csv file only currently)

ind.metafile

the name of the file that has entails additional information on individuals. For the required format check

covfilename

depreciated, use ind.metafile parameter

nas

a character specifying NAs (default is "-")

topskip

a number specifying the number of rows to be skipped. If not provided the number of rows to be skipped are "guessed" by the number of rows with "*" at the beginning.

lastmetric

specifies the last non genetic column (Default is "RepAvg"). Be sure to check if that is true, otherwise the number of individuals will not match. You can also specify the last column by a number.

probar

show progress bar

Value

a dart genlight object that contains individuals [if data were provided] and loci meta data [from a DArT report]. The dart genlight object can then be fed into a number of initial screening, export and export functions provided by the package. For some of the function it is necessary to have the metadata that was provided from DArT. Please check the vignette for more information. Additional information can also be found in the help documents for read.dart and dart2genlight.

Examples

Run this code
# NOT RUN {
{
dartfile <- system.file("extdata","testset_SNPs_2Row.csv", package="dartR")
covfilename <- system.file("extdata","testset_metadata.csv", package="dartR")
gl <- gl.read.dart(dartfile, ind.metafile = covfilename, probar=TRUE)
}
# }

Run the code above in your browser using DataLab