% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckhts.R
\name{rduckhts_bcf}
\alias{rduckhts_bcf}
\title{Create VCF/BCF Table}
\usage{
rduckhts_bcf(
  con,
  table_name,
  path,
  region = NULL,
  index_path = NULL,
  tidy_format = FALSE,
  additional_csq_column_types = NULL,
  scan_mode = NULL,
  decompression_threads = 0,
  decode_error_policy = "null",
  overwrite = FALSE
)
}
\arguments{
\item{con}{A DuckDB connection with DuckHTS loaded}

\item{table_name}{Name for the created table}

\item{path}{Path to the VCF/BCF file}

\item{region}{Optional genomic region (e.g., "chr1:1000-2000")}

\item{index_path}{Optional explicit path to index file (.csi/.tbi)}

\item{tidy_format}{Logical. If TRUE, FORMAT columns are returned in tidy format}

\item{additional_csq_column_types}{Optional bcftools-style `PATTERN TYPE`
overrides for CSQ/ANN/BCSQ subfield typing, separated by newlines or `;`}

\item{scan_mode}{Optional scan mode. Use \code{"auto"} (default extension
behavior) or \code{"sequential"} to force full-file streaming instead of index-backed
count/parallel scan paths. Sequential mode is incompatible with `region`.}

\item{decompression_threads}{Integer. Number of htslib decompression worker
threads per file handle. Default `0`. Use `0` to keep BCF/VCF reads
single-threaded.}

\item{decode_error_policy}{Character. Dirty/corrupt BCF decode policy:
\code{"null"} returns NULL for header-vs-payload type clashes,
\code{"warn"} emits a DuckHTS warning and returns NULL, and
\code{"error"} raises a DuckDB/R error.}

\item{overwrite}{Logical. If TRUE, overwrites existing table}
}
\value{
Invisible TRUE on success
}
\description{
Creates a DuckDB table from a VCF or BCF file using the DuckHTS extension.
This follows the RBCFTools pattern of creating a table that can be queried.
}
\examples{
library(DBI)
library(duckdb)

con <- rduckhts_connect()
bcf_path <- system.file("extdata", "vcf_file.bcf", package = "Rduckhts")
rduckhts_bcf(con, "variants", bcf_path, overwrite = TRUE)
dbGetQuery(con, "SELECT * FROM variants LIMIT 2")
dbDisconnect(con, shutdown = TRUE)

}
