View source: R/osi_dist_plot.R
| olink_osi_dist_plot | R Documentation |
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.
olink_osi_dist_plot(df, check_log = NULL, osi_score = NULL)
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 |
distribution plot (histogram overlayed with density plot) of osi values for corresponding osi_score column
# 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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.