Fast read of .gds, .rad, .gds.rad files. The function uses read_fst or CoreArray Genomic Data Structure (GDS) file system.

Used internally in radiator and assigner and might be of interest for users.

read_rad(
  data,
  columns = NULL,
  from = 1,
  to = NULL,
  as.data.table = FALSE,
  old.format = FALSE,
  allow.dup = FALSE,
  check = TRUE,
  verbose = FALSE
)

Arguments

data

A file in the working directory ending with .rad or .gds, and produced by radiator, assigner or grur.

columns

(optional) For fst file. Column names to read. The default is to read all all columns. Default: columns = NULL.

from

(optional) For fst file. Read data starting from this row number. Default: from = 1.

to

(optional) For fst file. Read data up until this row number. The default is to read to the last row of the stored dataset. Default: to = NULL.

as.data.table

(optional, logical) For fst file. If TRUE, the result will be returned as a data.table object. Any keys set on dataset x before writing will be retained. This allows for storage of sorted datasets. Default: as.data.table = TRUE.

old.format

(optional, logical) For fst file. Use TRUE to read fst files generated with a fst package version lower than v.0.8.0 Default: old.format = FALSE.

allow.dup

(optional, logical) To allow the opening of a GDS file with read-only mode when it has been opened in the same R session. Default: allow.dup = FALSE.

check

(optional, logical) Verify that GDS number of samples and markers match. Default: check = TRUE.

verbose

(optional, logical) verbose = TRUE to be chatty during execution. Default: verbose = FALSE.

Value

A radiator tidy data frame or GDS object (with read/write permissions) in the global environment.

Details

For GDS file system, read_rad will open the GDS connection file set the filters (variants and samples) based on the info found in the file.

See also

fst GDS read_rad

Author

Thierry Gosselin thierrygosselin@icloud.com

Examples

if (FALSE) {
require(SeqArray)
shark <- radiator::read_rad(data = "data.shark.gds")
turtle <- radiator::read_rad(data = "data.turtle.rad")
}