% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckhts.R
\name{rduckhts_score}
\alias{rduckhts_score}
\title{Compute Polygenic Scores}
\usage{
rduckhts_score(
  con,
  bcf_path,
  summary_path = NULL,
  use = NULL,
  columns = "PLINK",
  columns_file = NULL,
  q_score_thr = NULL,
  summaries_list_file = NULL,
  log_path = NULL,
  use_variant_id = FALSE,
  counts = FALSE,
  samples = NULL,
  force_samples = FALSE,
  regions = NULL,
  regions_file = NULL,
  regions_overlap = 1,
  targets = NULL,
  targets_file = NULL,
  targets_overlap = 0,
  apply_filters = NULL,
  include = NULL,
  exclude = NULL
)
}
\arguments{
\item{con}{A DuckDB connection with DuckHTS loaded}

\item{bcf_path}{Path to genotype VCF/BCF file}

\item{summary_path}{Path(s) to summary-statistics file(s). A character vector
computes multiple TSV/SSF PRS columns in one genotype scan. Use `NULL`
with `summaries_list_file` to read paths from a file.}

\item{use}{Optional dosage source (`"GT"`, `"DS"`, `"HDS"`, `"AP"`, `"GP"`, `"AS"`)}

\item{columns}{Optional summary preset (`"PLINK"`, `"PLINK2"`, `"REGENIE"`, `"SAIGE"`,
`"BOLT"`, `"METAL"`, `"PGS"`, `"SSF"`, `"GWAS-SSF"`)}

\item{columns_file}{Optional two-column summary header mapping file}

\item{q_score_thr}{Optional comma-separated p-value thresholds (e.g. `"1e-8,1e-6,1e-4"`)}

\item{summaries_list_file}{Optional path to a file (one summary path per line)
or directory of summary files, matching upstream `bcftools +score --summaries`.}

\item{log_path}{Optional path for a matching/audit log with loaded, matched,
allele-mismatch, and duplicate-marker counts per PRS.}

\item{use_variant_id}{Logical; if TRUE, match variants by ID instead of CHR+BP}

\item{counts}{Logical; if TRUE, include per-threshold matched-variant counts}

\item{samples}{Optional comma-separated list of sample names to subset (e.g. `"SAMP1,SAMP2"`)}

\item{force_samples}{Logical; if TRUE, ignore missing samples instead of erroring}

\item{regions}{Optional comma-separated region list (e.g. `"1:1000-2000,2:50-90"`)}

\item{regions_file}{Optional path to a regions file}

\item{regions_overlap}{Overlap mode for regions (`0`, `1`, or `2`). Default 1 (trim to region).}

\item{targets}{Optional comma-separated targets list}

\item{targets_file}{Optional path to a targets file}

\item{targets_overlap}{Overlap mode for targets (`0`, `1`, or `2`). Default 0 (record must start in region).}

\item{apply_filters}{Optional comma-separated FILTER names to keep (e.g. `"PASS,."`)}

\item{include}{Optional site expression (currently unsupported)}

\item{exclude}{Optional site expression (currently unsupported)}
}
\value{
A data frame with one row per sample and score/count columns.
}
\description{
Calls the DuckHTS `bcftools_score(...)` table function to compute sample-level
polygenic scores from one genotype VCF/BCF file and one or more summary-statistics files.
}
