% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DANDELION.R
\name{calc_pair.snp}
\alias{calc_pair.snp}
\title{Organize DANDELION SNP-Gene Results}
\usage{
calc_pair.snp(
  mat.sig,
  mat.p,
  p.wes,
  gene1,
  uniq_snp,
  ref.table.keep,
  eta.wgs = 1e-05,
  SNP.ref = NULL,
  verbose = FALSE
)
}
\arguments{
\item{mat.sig}{Matrix encoding significant pairs, returned by \code{med_gene()}.}

\item{mat.p}{Matrix of DANDELION p-values, returned by \code{med_gene()}.}

\item{p.wes}{Named numeric vector of gene-level trait association p-values.}

\item{gene1}{Candidate SNPs returned by \code{med_gene()}.}

\item{uniq_snp}{Data frame containing known SNP-to-cis-gene mapping. Required
columns are \code{SNP} and \code{GeneSymbol}.}

\item{ref.table.keep}{Gene annotation data frame after filtering. Required
columns are \code{gene_name}, \code{Chromosome}, \code{start}, and \code{end}.}

\item{eta.wgs}{Significance threshold for WES genes. Default is 1e-5.}

\item{SNP.ref}{Optional SNP annotation data frame with columns \code{SNP}, \code{SNPPos},
and \code{SNPChr}. Used only for SNPs not mapped by \code{uniq_snp}.}

\item{verbose}{Logical. If \code{TRUE}, progress messages are printed. Default is \code{FALSE}.}
}
\value{
A list containing \code{pairs_dact}, \code{gene.pair}, \code{sig_gene2}, and
\code{non_sig.gene2}.
}
\description{
Cleans significant DANDELION pairs when the exposure side contains SNPs.
SNPs are mapped to cis genes using \code{uniq_snp} first. If a SNP is not present
in \code{uniq_snp}, the function optionally maps it to the nearest or overlapping
gene using \code{SNP.ref} and \code{ref.table.keep}.
}
