Skip to contents

Immune-related Response Evaluation Criteria in Solid Tumors (iRECIST) analysis for assessing tumor response in immunotherapy trials. Implements Seymour et al. (2017) guidelines including pseudoprogression detection and confirmation requirements.

Usage

irecist(
  data,
  patientId,
  assessmentTime,
  targetLesionSum,
  newLesions,
  nonTargetStatus,
  tumorBurden,
  confirmationWindow = 4,
  confirmationWindowMax = 12,
  baselineReference = "baseline",
  prThreshold = 30,
  pdThreshold = 20,
  pdAbsolute = 5,
  trackPseudoprogression = TRUE,
  requireConfirmation = TRUE,
  confirmationScans = 1,
  showResponseTable = TRUE,
  showBestResponse = TRUE,
  showWaterfallPlot = TRUE,
  showSwimmerPlot = TRUE,
  showSpiderPlot = FALSE,
  showTimeToCPD = TRUE,
  groupVar,
  stratifiedAnalysis = FALSE,
  nadirReference = TRUE,
  exportResults = FALSE,
  showDetailedTimeline = FALSE,
  calculateORR = TRUE,
  calculateDCR = TRUE,
  showPseudoprogressionRate = TRUE,
  showReference = TRUE,
  showSummary = TRUE,
  showGlossary = TRUE,
  showAssumptions = TRUE,
  formula
)

Arguments

data

the data as a data frame

patientId

Patient identifier variable

assessmentTime

Time from baseline (weeks or months)

targetLesionSum

Sum of target lesion diameters (mm)

newLesions

Binary indicator for new lesions (0=no, 1=yes)

nonTargetStatus

Non-target lesion status (CR, non-CR/non-PD, PD)

tumorBurden

Total tumor burden measure (optional)

confirmationWindow

Minimum time window for iUPD confirmation (default: 4 weeks per iRECIST guidelines)

confirmationWindowMax

Maximum time window for iUPD confirmation (default: 12 weeks)

baselineReference

Reference point for baseline measurements

prThreshold

Percent decrease for partial response (default: 30\ RECIST)

pdThreshold

Percent increase for progressive disease (default: 20\ per RECIST)

pdAbsolute

Absolute increase required for PD (default: 5mm per RECIST)

trackPseudoprogression

Flag and track iUPD (unconfirmed progression) cases

requireConfirmation

Require confirmation scan for response calls

confirmationScans

Number of confirmation scans required for CR/PR

showResponseTable

Show detailed response category table

showBestResponse

Calculate and show best overall response per patient

showWaterfallPlot

Generate waterfall plot with iRECIST colors

showSwimmerPlot

Generate swimmer plot with iUPD events marked

showSpiderPlot

Generate spider plot showing individual lesion trajectories

showTimeToCPD

Calculate time to confirmed progressive disease (iCPD)

groupVar

Grouping variable for stratified analysis (e.g., treatment arm)

stratifiedAnalysis

Perform analysis stratified by grouping variable

nadirReference

Use nadir (lowest) value as reference for PD calculation

exportResults

Export results to CSV file

showDetailedTimeline

Show detailed timeline of response assessments and transitions

calculateORR

Calculate ORR (iCR + iPR)

calculateDCR

Calculate DCR (iCR + iPR + iSD)

showPseudoprogressionRate

Calculate rate of pseudoprogression (iUPD → non-iCPD)

showReference

Display iRECIST guidelines reference (Seymour et al. 2017)

showSummary

Display natural-language summary with copy-ready text

showGlossary

Display glossary of iRECIST terms and definitions

showAssumptions

Display analysis assumptions and data requirements

formula

(optional) the formula to use, see the examples

Value

A results object containing:

results$instructionsa html
results$dataInfoa table
results$responseTablea table
results$bestResponseTablea table
results$summaryStatsa table
results$efficacyMetricsa table
results$pseudoprogressionTablea table
results$waterfallPlotan image
results$swimmerPlotan image
results$spiderPlotan image
results$timeToCPDPlotan image
results$timelinePlotan image
results$stratifiedTablea table
results$clinicalInterpretationa html
results$referenceInfoa html
results$executiveSummarya html
results$glossarya html
results$assumptionsa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$dataInfo$asDF

as.data.frame(results$dataInfo)

Examples

data <- data.frame(
    patient = c("P01", "P01", "P01", "P02", "P02"),
    time = c(0, 8, 16, 0, 8),
    target_sum = c(45, 52, 48, 50, 35),
    new_lesions = c(0, 0, 0, 0, 0)
)

irecist(
    data = data,
    patientId = "patient",
    assessmentTime = "time",
    targetLesionSum = "target_sum",
    newLesions = "new_lesions"
)
#> Error in irecist(data = data, patientId = "patient", assessmentTime = "time",     targetLesionSum = "target_sum", newLesions = "new_lesions"): argument "nonTargetStatus" is missing, with no default