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

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

Arguments

targets

Character vector of gdb file paths, or a single path to a file listing gdb paths.

output

Output gdb file path.

skipRemap

Skip resetting of VAR_id to row id after concatenation? Defaults to FALSE.

skipIndexes

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

overWrite

Overwrite output file if it already exists? Defaults to FALSE.

verbose

Should the function be verbose? Defaults to TRUE.

Examples

library(rvatData)
gdb <- create_example_gdb()

# to illustrate how concatGdb we'll first generate two small gdbs to concatenate
gdb1 <- tempfile()
subsetGdb(
  gdb,
  VAR_id = 1:100,
  output = gdb1
)
#> 2026-03-30 18:37:40	Complete

gdb2 <- tempfile()
subsetGdb(
  gdb,
  VAR_id = 101:200,
  output = gdb2
)
#> 2026-03-30 18:37:40	Complete

# write filepaths of gdbs to concatenate to a file
concatgdb <- tempfile()

# concatenate
concatGdb(
  targets = c(gdb1, gdb2),
  output = concatgdb,
)
#> 2026-03-30 18:37:40	Creating gdb tables
#> 2026-03-30 18:37:40	Creating db tables
#> Creating SM, anno and cohort tables
#> Merging '/tmp/RtmpvjdKWE/file153931cd85e79'
#> Merging '/tmp/RtmpvjdKWE/file1539323ac8da8'
#> 2026-03-30 18:37:40	Reseting VAR_id to rowid
#> 2026-03-30 18:37:40	Creating var table indexes
#> 2026-03-30 18:37:40	Creating SM table index
#> 2026-03-30 18:37:40	Creating dosage table index
#> 2026-03-30 18:37:40	Creating ranged var table
#> 2026-03-30 18:37:40	Complete