% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckhts.R
\name{rduckhts_bam_bed_coverage}
\alias{rduckhts_bam_bed_coverage}
\title{Native BAM/CRAM BED Regional Coverage Summary}
\usage{
rduckhts_bam_bed_coverage(
  con,
  path,
  bed_path,
  reference = NULL,
  index_path = NULL,
  bed_index_path = NULL,
  mapq = 0,
  min_baseq = 0,
  min_read_len = 0,
  require_flags = 0,
  exclude_flags = 1796,
  min_depth = 1,
  max_depth = 1e+06,
  decompression_threads = 0,
  fragment_mode = FALSE,
  strand_outputs = TRUE,
  processing_threads = 0
)
}
\arguments{
\item{con}{A DuckDB connection with DuckHTS loaded}

\item{path}{Path to the input BAM or CRAM file}

\item{bed_path}{Path to the input BED file}

\item{reference}{Optional reference FASTA path for CRAM input when required}

\item{index_path}{Optional explicit BAM/CRAM index path}

\item{bed_index_path}{Optional explicit BED index path (reserved for future use)}

\item{mapq}{Minimum mapping quality threshold for post-filter summaries}

\item{min_baseq}{Minimum base quality threshold for post-filter base-level summaries}

\item{min_read_len}{Minimum read length threshold for post-filter summaries}

\item{require_flags}{Required SAM flag mask}

\item{exclude_flags}{Excluded SAM flag mask. Defaults to samtools coverage's
`UNMAP|SECONDARY|QCFAIL|DUP` mask.}

\item{min_depth}{Minimum depth threshold for covered-base and mean-depth summaries}

\item{max_depth}{Maximum per-position depth cap. Set `0` to remove the cap.}

\item{decompression_threads}{Integer. Number of htslib decompression worker
threads to use for BAM/CRAM input. `0` disables htslib worker threads.}

\item{fragment_mode}{Logical. Reserved for future fragment-level semantics.}

\item{strand_outputs}{Logical. Emit forward/reverse post-filter summary columns.}

\item{processing_threads}{Reserved for future parallel interval processing.}
}
\value{
A data frame with one row per BED interval and pre/post regional summaries
}
\description{
Computes samtools coverage-like regional summaries for BAM or CRAM input over
a BED target set, with DuckHTS-specific pre/post-filter and strand-aware
post-filter outputs.
}
