Export gdb to vcf format. By setting includeGeno = TRUE, a sites-only vcf is created. By setting includeVarId = TRUE, VAR_ids will be inserted into the ID field rather than the original ID in the vcf. This can be useful when running external tools, such as annotation software, and then upload the results back into the gdb, without having to map the variants to VAR_ids again.

writeVcf(
  object,
  output,
  VAR_id = NULL,
  IID = NULL,
  includeGeno = TRUE,
  includeVarId = FALSE,
  verbose = TRUE
)

Arguments

object

Input gdb.

output

Output file path.

VAR_id

Variants to include in output.

IID

Samples to include in output.

includeGeno

Can be reset to false if individual genotypes are not required in output. Defaults to TRUE.

includeVarId

Include VAR_ids in the 'ID' field? Defaults to FALSE, in which case the 'ID' field from the 'var' table is included.

verbose

Should the method be verbose? Defaults to TRUE.

Examples


library(rvatData)

output <- tempfile()
gdb <- create_example_gdb()
writeVcf(gdb, VAR_id = 1:100, output = output)
#> No IID provided, all samples will be included in output vcf
#> 25000/25000 samples to be retained in output
#> 100 variants to be retained in output