olink_osi_dist_plot: OSI distribution plot

View source: R/osi_dist_plot.R

olink_osi_dist_plotR Documentation

Description

Generates a density plot showing the distribution of the selected OSI score among dataset samples using ggplot2. OSI score can be one of "OSITimeToCentrifugation", "OSIPreparationTemperature", or "OSISummary". Olink external controls are excluded from this visualization.

Usage

olink_osi_dist_plot(df, check_log = NULL, osi_score = NULL)

Arguments

df

data frame with OSI data present

check_log

check log from check NPX

osi_score

OSI column to graph, one of OSISummary, OSITimeToCentrifugation, or OSIPreparationTemperature

Value

distribution plot (histogram overlayed with density plot) of osi values for corresponding osi_score column

Examples


# Creating fake OSI data from Site data
npx_df <- OlinkAnalyze::npx_data1 |>
  dplyr::filter(
    !grepl(pattern = "control",
    x = .data[["SampleID"]],
    ignore.case = TRUE)
  ) |>
  dplyr::mutate(
    OSISummary = as.numeric(as.factor(.data[["Site"]])),
    OSISummary = .data[["OSISummary"]] - min(.data[["OSISummary"]],
                                             na.rm = TRUE),
    OSISummary = .data[["OSISummary"]] / max(.data[["OSISummary"]],
                                             na.rm = TRUE)
  )

check_log <- OlinkAnalyze::check_npx(
  df = npx_df
)

# Generate figure
OlinkAnalyze::olink_osi_dist_plot(
  df = npx_df,
  check_log = check_log,
  osi_score = "OSISummary"
)



OlinkAnalyze documentation built on June 24, 2026, 1:06 a.m.