gt_update_backingfile: Update the backing matrix

View source: R/gt_update_backingfile.R

gt_update_backingfileR Documentation

Update the backing matrix

Description

This functions forces a re-write of the file backing matrix to match the gen_tibble. Individuals and loci are subsetted and reordered according to the current state of the gen_tibble. Tests for this function are in test_gt_order_loci.R

Usage

gt_update_backingfile(
  .x,
  backingfile = NULL,
  chunk_size = NULL,
  rm_unsorted_dist = TRUE,
  quiet = FALSE
)

Arguments

.x

a gen_tibble object

backingfile

the path, including the file name without extension, for backing files used to store the data (they will be given a .bk and .RDS automatically). If left to NULL (the default), the file name will be based on the name f the current backing file.

chunk_size

the number of loci to process at once

rm_unsorted_dist

boolean to set genetic_dist to zero (i.e. remove it) if it is unsorted within the chromosomes.

quiet

boolean to suppress information about the files

Details

This function does not check whether the positions of your genetic loci are sorted. To check this, and update the file backing matrix, use gt_order_loci().

Value

a gen_tibble with a backing file (i.e. a new File Backed Matrix)

Examples

example_gt <- load_example_gt("gen_tbl")

example_gt %>% gt_update_backingfile()


tidypopgen documentation built on Aug. 28, 2025, 1:08 a.m.