R/genlight.R
tidy_genlight.Rd
Tidy genlight object to a tidy dataframe and/or GDS object/file. Used internally in radiator and might be of interest for users.
tidy_genlight(
data,
tidy = TRUE,
gds = TRUE,
write = FALSE,
verbose = FALSE,
parallel.core = parallel::detectCores() - 1
)
(path or object) A genlight object in the global environment or
path to a genlight file that will be open with readRDS
.
(logical) Generate a tidy dataset.
Default: tidy = TRUE
.
(optional, logical) To write a radiator gds object.
Default: gds = TRUE
.
(optional, logical) To write in the working directory the tidy
data. The file is written with radiator_genlight_DATE@TIME.rad
.
Default: write = FALSE
.
(optional, logical) When verbose = TRUE
the function is a little more chatty during execution.
Default: verbose = TRUE
.
(optional) The number of core used for parallel
execution during import.
Default: parallel.core = parallel::detectCores() - 1
.
A string of the same dimension is generated when genlight:
is.null(genlight@pop)
: pop will be integrated
in the tidy dataset.
is.null(data@chromosome)
: CHROM1 will be integrated
in the tidy dataset.
is.null(data@loc.names)
: LOCUS1 to dim(genlight)[2]
will be integrated in the tidy dataset.
is.null(data@position)
: an integer string of
length = dim(genlight)[2] will be integrated in the tidy dataset.
Note: that if all CHROM, LOCUS and POS is missing the function will be terminated
Jombart T (2008) adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24, 1403-1405.
Jombart T, Ahmed I (2011) adegenet 1.3-1: new tools for the analysis of genome-wide SNP data. Bioinformatics, 27, 3070-3071.