% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inflammatory_markers.R
\name{inflammatory_markers}
\alias{inflammatory_markers}
\title{Compute inflammatory indices (classic, eosinophil, or both)}
\usage{
inflammatory_markers(
  data,
  col_map = NULL,
  panel = c("auto", "classic", "eos", "both"),
  na_action = c("keep", "omit", "error"),
  verbose = TRUE
)
}
\arguments{
\item{data}{data.frame or tibble}

\item{col_map}{named list mapping keys to column names in \code{data}.
Keys: neutrophils, lymphocytes, monocytes, platelets, WBC, CRP, albumin, eosinophils, ESR.}

\item{panel}{one of c("auto","classic","eos","both"). "auto" uses presence of eosinophils key.}

\item{na_action}{one of c("keep","omit","error"). Default "keep" propagates NA
in outputs where inputs are missing.}

\item{verbose}{logical; if \code{TRUE} (default), prints column mapping, optional input
availability, physiological range information (informational only), the list of
markers being computed, and a results summary.}
}
\value{
tibble with selected inflammatory indices, with ID column prepended if
detected (e.g. \code{id}, \code{IID}, \code{participant_id}).
}
\description{
Panels:
\itemize{
\item classic: NLR, PLR, LMR, dNLR, SII, SIRI, AISI, CRP_category
\item eos:     NLR, PLR, LMR, NER, SII, SIRI, PIV, CLR, CAR, PCR, mGPS, ESR (if mapped)
\item both:    union of classic and eos panels
}
}
\details{
Derived markers:
\itemize{
\item NLR  = neutrophils / lymphocytes
\item PLR  = platelets / lymphocytes
\item LMR  = lymphocytes / monocytes
\item dNLR = neutrophils / (WBC - neutrophils) when WBC available
\item SII  = platelets * neutrophils / lymphocytes
\item SIRI = neutrophils * monocytes / lymphocytes
\item AISI = neutrophils * monocytes * platelets / lymphocytes
\item CRP_category: "low" (<1 mg/L), "moderate" (1-3 mg/L), "high" (>3 mg/L) when CRP available
\item Eosinophil-panel extras: NER = neutrophils / eosinophils; PIV = platelets * neutrophils * monocytes / lymphocytes;
CLR = CRP/lymphocytes; CAR = CRP/albumin; PCR = platelets/CRP; mGPS (CRP, albumin); ESR passthrough.
}

Note:
\itemize{
\item These outputs are deterministic algebraic indices computed from the mapped
laboratory variables. They are intended for feature engineering and descriptive
analyses, not as standalone diagnosis/prognosis tools.
\item References below document commonly used index definitions or interpretation
conventions directly used in this implementation.
}
}
\examples{
# Quick smoke-test
df <- data.frame(neutrophils = 4, lymphocytes = 2, monocytes = 0.5,
                 platelets = 200, WBC = 7, CRP = 2.5)
inflammatory_markers(df, panel = "classic", na_action = "keep", verbose = FALSE)

\donttest{
df <- data.frame(
  neutrophils = c(4, 2),
  lymphocytes = c(2, 0),
  monocytes   = c(0.5, 0.3),
  platelets   = c(200, 150),
  WBC         = c(7, 4.5),
  CRP         = c(2.5, 0.8),
  albumin     = c(40, 42),
  eosinophils = c(0.2, 0.1),
  ESR         = c(12, 15)
)
cm <- list(
  neutrophils = "neutrophils", lymphocytes = "lymphocytes", monocytes = "monocytes",
  platelets = "platelets", WBC = "WBC", CRP = "CRP", albumin = "albumin",
  eosinophils = "eosinophils", ESR = "ESR"
)
classic_cm <- cm; classic_cm$eosinophils <- NULL; classic_cm$ESR <- NULL
inflammatory_markers(df, classic_cm, panel = "classic", na_action = "keep")
inflammatory_markers(df, cm, panel = "eos", na_action = "keep", verbose = TRUE)
}

}
\references{
\insertRef{zahorec2001}{HealthMarkers}
\insertRef{hu2014sii}{HealthMarkers}
\insertRef{qi2016siri}{HealthMarkers}
\insertRef{proctor2011mgps}{HealthMarkers}
\insertRef{pearson2003markers}{HealthMarkers}
}
