When dataset is a tidy data frame, the function provides a
fast way to write a radiator .rad
file.
The function uses write_fst
with a compression level of 85,
that work well with RADseq dataset.
When the object is a CoreArray Genomic Data Structure
(GDS) file system, the function
set filters (variants and samples) based on the info found in the file and
close the connection with the GDS file.
Used internally in radiator and assigner and might be of interest for users.
write_rad(
data,
path = NULL,
filename = NULL,
tsv = FALSE,
internal = FALSE,
append = FALSE,
col.names = TRUE,
write.message = "standard",
verbose = FALSE
)
An object in the global environment: tidy data frame or GDS connection file
(optional) For tidy data frame, the path to write the data on disk.
Default: path = NULL
.
(optional) Name of the file (when using tsv files).
Default: filename = NULL
.
(optinal, logical) To trigger saving using readr::write_tsv
.
Default: tsv = FALSE
.
(optional, logical) This is used inside radiator internal code and it stops
from writting the file.
Default: internal = FALSE
.
(optional, logical) If FALSE
, will overwrite existing file.
If TRUE
, will append to existing file.
In both cases, if file does not exist a new file is created.
Default: append = FALSE
.
(optional, logical) Write columns names at the top of the file?
Must be either TRUE or FALSE.
Default: col.names = TRUE
.
(optional, character) Print a message in the console
after writting file.
With write.message = NULL
, nothing is printed in the console.
Default: write.message = "standard"
. This will print
message("File written: ", folder_short(filename))
.
(optional, logical) verbose = TRUE
to be chatty
during execution.
Default: verbose = FALSE
.
A file written in the working directory or nothing if it's a GDS connection file.