% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckhts.R
\name{rduckhts_pileup}
\alias{rduckhts_pileup}
\title{Create BAM Pileup Table}
\usage{
rduckhts_pileup(
  con,
  table_name,
  path,
  region,
  index_path = NULL,
  min_mapq = 0,
  flag_mask = 1796,
  overwrite = FALSE
)
}
\arguments{
\item{con}{A DuckDB connection with DuckHTS loaded}

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

\item{path}{Path to the BAM file}

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

\item{index_path}{Optional explicit path to the BAM index (.bai/.csi)}

\item{min_mapq}{Minimum mapping quality to include in the pileup}

\item{flag_mask}{Bitmask of SAM flags to exclude before pileup construction.
The default \code{1796} matches samtools depth-style filtering of
unmapped, secondary, QC-fail, and duplicate reads.}

\item{overwrite}{Logical. If TRUE, overwrites existing table}
}
\value{
Invisible TRUE on success
}
\description{
Creates a DuckDB table from a region-scoped BAM pileup using the DuckHTS
extension. This is a compact base/quality pileup view backed by htslib's
pileup engine; it is not samtools mpileup text parity.
}
