% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_clinvar.R
\name{clinvar_variants}
\alias{clinvar_variants}
\title{Fetch ClinVar variants for a gene and parse them into A3Variant objects}
\usage{
clinvar_variants(
  gene,
  significance = c("pathogenic", "likely_pathogenic"),
  max_variants = 500L,
  esearch_url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi",
  esummary_url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi",
  batch_size = 500L,
  verbosity = 1L
)
}
\arguments{
\item{gene}{Character scalar: HGNC gene symbol, e.g. \code{"MAPT"}.}

\item{significance}{Character vector: Clinical significance filter. Any
combination of \code{"pathogenic"}, \code{"likely_pathogenic"},
\code{"uncertain_significance"}, \code{"likely_benign"}, \code{"benign"}. Pass \code{NULL}
to fetch all records regardless of significance.}

\item{max_variants}{Integer scalar: Maximum number of ClinVar records to
fetch after filtering. Defaults to \code{500L}.}

\item{esearch_url}{Character scalar: NCBI E-utilities esearch endpoint.}

\item{esummary_url}{Character scalar: NCBI E-utilities esummary endpoint.}

\item{batch_size}{Integer scalar: Number of UIDs per esummary request.
NCBI recommends no more than 500 per request.}

\item{verbosity}{Integer scalar: Verbosity level.}
}
\value{
Named list of \code{A3Variant} objects. Names use \verb{\{from\}\{position\}\{to\}}
notation (e.g. \code{"R406W"}), with a numeric suffix to disambiguate
duplicates.
}
\description{
Queries the NCBI ClinVar database via E-utilities for all variants
associated with a gene, and returns those with protein-level amino acid
changes as a named list of \code{A3Variant} objects.
}
\details{
Variants without a parseable protein change (intronic, regulatory, etc.)
are silently skipped.
}
\examples{
# Requires internet connection and fetches data from ClinVar.
\dontrun{
# Pathogenic and likely pathogenic variants (default)
mapt_variants <- clinvar_variants("MAPT")
# All variants regardless of significance
mapt_all <- clinvar_variants("MAPT", significance = NULL)
}
}
\author{
EDG
}
