Skip to contents

Panels:

  • classic: NLR, PLR, LMR, dNLR, SII, SIRI, AISI, CRP_category

  • eos: NLR, PLR, LMR, NER, SII, SIRI, PIV, CLR, CAR, PCR, mGPS, ESR (if mapped)

  • both: union of classic and eos panels

Usage

inflammatory_markers(
  data,
  col_map = NULL,
  panel = c("auto", "classic", "eos", "both"),
  na_action = c("keep", "omit", "error"),
  verbose = TRUE
)

Arguments

data

data.frame or tibble

col_map

named list mapping keys to column names in data. Keys: neutrophils, lymphocytes, monocytes, platelets, WBC, CRP, albumin, eosinophils, ESR.

panel

one of c("auto","classic","eos","both"). "auto" uses presence of eosinophils key.

na_action

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

verbose

logical; if 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. id, IID, participant_id).

Details

Derived markers:

  • NLR = neutrophils / lymphocytes

  • PLR = platelets / lymphocytes

  • LMR = lymphocytes / monocytes

  • dNLR = neutrophils / (WBC - neutrophils) when WBC available

  • SII = platelets * neutrophils / lymphocytes

  • SIRI = neutrophils * monocytes / lymphocytes

  • AISI = neutrophils * monocytes * platelets / lymphocytes

  • CRP_category: "low" (<1 mg/L), "moderate" (1-3 mg/L), "high" (>3 mg/L) when CRP available

  • 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:

  • 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.

  • References below document commonly used index definitions or interpretation conventions directly used in this implementation.

References

Zahorec R (2001). “Ratio of neutrophil to lymphocyte counts–rapid and simple parameter of systemic inflammation and stress.” Bratislavske lekarske listy, 102(1), 5–14. No DOI identified; PMID: 11723675, https://pubmed.ncbi.nlm.nih.gov/11723675/. Hu B, others (2014). “Systemic Immune-Inflammation Index Predicts Prognosis of Patients after Curative Resection for Hepatocellular Carcinoma.” Clinical Cancer Research, 20(23), 6212–6222. doi:10.1158/1078-0432.CCR-14-0442 . Qi Q, others (2016). “A novel systemic inflammation response index (SIRI) for predicting the survival of patients with pancreatic cancer after chemotherapy.” Cancer, 122(14), 2158–2167. doi:10.1002/cncr.30057 . Proctor MJ, others (2011). “An inflammation-based prognostic score (mGPS) predicts cancer survival independent of tumour site: a Glasgow Inflammation Outcome Study.” British Journal of Cancer, 104(4), 726–734. doi:10.1038/sj.bjc.6606087 . Pearson TA, others (2003). “Markers of inflammation and cardiovascular disease: a statement for healthcare professionals from the CDC and AHA.” Circulation, 107(3), 499–511. doi:10.1161/01.CIR.0000052939.59093.45 .

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)
#> # A tibble: 1 × 8
#>     NLR   PLR   LMR  dNLR   SII  SIRI  AISI CRP_category
#>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <ord>       
#> 1     2   100     4  1.33   400     1   200 moderate    

# \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(): reading input 'df' — 2 rows × 9 variables
#> inflammatory_markers(): col_map (9 columns — 7 specified, 2 inferred from data)
#>   neutrophils       ->  'neutrophils'
#>   lymphocytes       ->  'lymphocytes'
#>   monocytes         ->  'monocytes'
#>   platelets         ->  'platelets'
#>   WBC               ->  'WBC'
#>   CRP               ->  'CRP'
#>   albumin           ->  'albumin'
#>   eosinophils       ->  'eosinophils'    (inferred)
#>   ESR               ->  'ESR'    (inferred)
#> inflammatory_markers(): optional inputs (panel = classic)
#>   present:  neutrophils, lymphocytes, monocytes, platelets, WBC, CRP, albumin, eosinophils, ESR
#> inflammatory_markers(): range note (informational, values not altered):
#>   lymphocytes: 1 value(s) outside plausible range
#> inflammatory_markers(): computing markers: NLR, PLR, LMR, dNLR, SII, SIRI, AISI, CRP_category
#> Warning: inflammatory_markers(): zero denominators detected.
#> inflammatory_markers(): results: NLR 2/2, PLR 2/2, LMR 2/2, dNLR 2/2, SII 2/2, SIRI 2/2, AISI 2/2, CRP_category 2/2
#> # A tibble: 2 × 8
#>     NLR   PLR   LMR  dNLR   SII  SIRI  AISI CRP_category
#>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <ord>       
#> 1     2   100     4  1.33   400     1   200 moderate    
#> 2   Inf   Inf     0  0.8    Inf   Inf   Inf low         
inflammatory_markers(df, cm, panel = "eos", na_action = "keep", verbose = TRUE)
#> inflammatory_markers(): reading input 'df' — 2 rows × 9 variables
#> inflammatory_markers(): col_map (9 columns — 9 specified)
#>   neutrophils       ->  'neutrophils'
#>   lymphocytes       ->  'lymphocytes'
#>   monocytes         ->  'monocytes'
#>   platelets         ->  'platelets'
#>   WBC               ->  'WBC'
#>   CRP               ->  'CRP'
#>   albumin           ->  'albumin'
#>   eosinophils       ->  'eosinophils'
#>   ESR               ->  'ESR'
#> inflammatory_markers(): optional inputs (panel = eos)
#>   present:  neutrophils, lymphocytes, monocytes, platelets, WBC, CRP, albumin, eosinophils, ESR
#> inflammatory_markers(): range note (informational, values not altered):
#>   lymphocytes: 1 value(s) outside plausible range
#> inflammatory_markers(): computing markers: NLR, PLR, LMR, NER, SII, SIRI, PIV, CLR, CAR, PCR, mGPS, ESR
#> Warning: inflammatory_markers(): zero denominators detected.
#> inflammatory_markers(): results: NLR 2/2, PLR 2/2, LMR 2/2, NER 2/2, SII 2/2, SIRI 2/2, PIV 2/2, CLR 2/2, CAR 2/2, PCR 2/2, mGPS 2/2, ESR 2/2
#> # A tibble: 2 × 12
#>     NLR   PLR   LMR   NER   SII  SIRI   PIV    CLR    CAR   PCR  mGPS   ESR
#>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl>  <dbl> <dbl> <int> <dbl>
#> 1     2   100     4    20   400     1   200   1.25 0.0625   80      0    12
#> 2   Inf   Inf     0    20   Inf   Inf   Inf Inf    0.0190  188.     0    15
# }