Function to concatenate gdb databases. Only retains content of base tables (SM, var, dosage).

concatGdb(
  targets,
  output,
  skipRemap = FALSE,
  skipIndexes = FALSE,
  verbose = TRUE
)

Arguments

targets

File listing full paths of gdbs to concatenate

output

Output gdb file path.

skipRemap

Flag to skip resetting of VAR_id to row id after concatenation. Defaults to FALSE.

skipIndexes

Flag to skip generation of standard var and dosage table indexes (VAR_id;CHROM, POS,REF,ALT). Defaults to FALSE.

verbose

Should the function be verbose? (TRUE/FALSE), defaults to TRUE.

Examples


library(rvatData)
gdb <- gdb(rvat_example("rvatData.gdb"))

# to illustrate how concatGdb we'll first generate two small gdbs to concatenate
gdb1 <- tempfile()
subsetGdb(
  gdb, 
  VAR_id = 1:100,
  output = gdb1
)
#> 2025-02-12 12:25:12	Complete

gdb2 <- tempfile()
subsetGdb(
  gdb, 
  VAR_id = 101:200,
  output = gdb2
)
#> 2025-02-12 12:25:13	Complete

# write filepaths of gdbs to concatenate to a file
targets <- tempfile()
readr::write_lines(c(gdb1, gdb2), file = targets)
concatgdb <- tempfile()

# concatenate
concatGdb(
  targets = targets,
  output = concatgdb,
)
#> 2025-02-12 12:25:13	Creating db tables
#> Creating SM, anno and cohort tables
#> Merging '/var/folders/cl/wvc0rvjx4vd5rzt2_fhpmfth0000gp/T//RtmpRC6myU/file1825c604197c'
#> Merging '/var/folders/cl/wvc0rvjx4vd5rzt2_fhpmfth0000gp/T//RtmpRC6myU/file1825c77251ef9'
#> 2025-02-12 12:25:13	Reseting VAR_id to rowid
#> 2025-02-12 12:25:13	Creating var table indexes
#> 2025-02-12 12:25:13	Creating dosage table index
#> 2025-02-12 12:25:13	Creating ranged var table
#> 2025-02-12 12:25:13	Complete