% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckhts.R
\name{rduckhts_bam_multi}
\alias{rduckhts_bam_multi}
\title{Read multiple BAM/SAM files into a DuckDB table}
\usage{
rduckhts_bam_multi(
  con,
  table_name,
  files,
  region = NULL,
  index_path = NULL,
  reference = NULL,
  standard_tags = FALSE,
  auxiliary_tags = FALSE,
  sequence_encoding = NULL,
  quality_representation = NULL,
  cigar_representation = NULL,
  scan_mode = NULL,
  decompression_threads = 2,
  .params = NULL,
  overwrite = FALSE
)
}
\arguments{
\item{con}{A DBI connection to DuckDB with the duckhts extension loaded.}

\item{table_name}{Name of the DuckDB table to create.}

\item{files}{Character vector of file paths or glob patterns.}

\item{region}{Optional region string (e.g. \code{"chr1:1-1000"}).}

\item{index_path}{Optional index file path.}

\item{reference}{Optional reference FASTA path (for CRAM).}

\item{standard_tags}{Logical; include standard SAM tag columns.}

\item{auxiliary_tags}{Logical; include auxiliary tag map column.}

\item{sequence_encoding}{Optional sequence encoding (e.g. \code{"nt16"}).}

\item{quality_representation}{Optional quality representation.}

\item{cigar_representation}{Optional CIGAR representation; use
\code{"binary"} for packed BAM operations.}

\item{scan_mode}{Optional scan mode (\code{"auto"} or \code{"sequential"}).}

\item{decompression_threads}{Integer. Number of htslib decompression worker
threads per file handle. Default \code{2}. Use \code{0} to disable worker
threads.}

\item{.params}{Optional data.frame with per-file parameter overrides.
Must contain a \code{file} column; other columns override uniform parameters.
\code{NA} values use the uniform default.}

\item{overwrite}{Logical; if \code{TRUE}, replace an existing table.}
}
\value{
Invisible \code{TRUE} on success.
}
\description{
Read and combine multiple BAM/SAM files via UNION ALL BY NAME,
materialising the result as a DuckDB table.
Each row includes a \code{filename} column identifying its source file.
}
