% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grs.R
\name{grs_score}
\alias{grs_score}
\title{Calculate genetic risk scores from PGEN files on RAP}
\usage{
grs_score(
  file,
  pgen_dir = NULL,
  dest = NULL,
  maf = 0.01,
  instance = "standard",
  priority = "low"
)
}
\arguments{
\item{file}{Named character vector of local weight file paths. Names become
the GRS identifiers (output column = \code{GRS_<name>}).
Example: \code{c(grs_a = "weights_a.txt")}.}

\item{pgen_dir}{Character scalar. Path to PGEN files on RAP
(e.g. \code{"/mnt/project/pgen"}). Must be specified explicitly.}

\item{dest}{Character scalar. RAP destination path for output CSV files
(e.g. \code{"/grs/"}). Must be specified explicitly.}

\item{maf}{Numeric scalar. MAF filter threshold used when locating PGEN
files. Must match the value used in \code{\link{grs_bgen2pgen}}.
Default: \code{0.01}.}

\item{instance}{Character scalar. Instance type preset: \code{"standard"}
or \code{"large"}. Default: \code{"standard"}.}

\item{priority}{Character scalar. Job priority: \code{"low"} or
\code{"high"}. Default: \code{"low"}.}
}
\value{
A named character vector of job IDs (one per GRS), returned
invisibly. Failed submissions are \code{NA}. Use \code{\link{job_ls}} to
monitor progress.
}
\description{
Uploads local SNP weight files to the RAP project root, then submits one
Swiss Army Knife job per GRS. Each job runs plink2 \code{--score} across
all 22 chromosomes and saves a single CSV to \code{dest} on completion.
Jobs run in parallel; use \code{\link{job_ls}} to monitor progress.
}
\details{
Weight files should have three columns (any delimiter, header required):
\describe{
\item{Column 1}{Variant ID (e.g. \code{rs} IDs).}
\item{Column 2}{Effect allele (A1).}
\item{Column 3}{Effect weight (beta / log-OR).}
}
This matches the output format of \code{\link{grs_check}}.

\strong{Output per job:} \code{dest/<score_name>_scores.csv} with columns
\code{IID} and the GRS score (named \code{GRS_<name>}).

\strong{Instance types:}
\describe{
\item{\code{"standard"}}{\code{mem2_ssd1_v2_x4}: 4 cores, 12 GB RAM.}
\item{\code{"large"}}{\code{mem2_ssd2_v2_x8}: 8 cores, 28 GB RAM.}
}
}
\examples{
\dontrun{
ids <- grs_score(
  file = c(
    grs_a = "weights/grs_a_weights.txt",
    grs_b = "weights/grs_b_weights.txt"
  ),
  pgen_dir = "/mnt/project/pgen",
  dest     = "/grs/",
  priority = "high"
)

job_ls()
}
}
