plot_run_power_check: Plot run power check

View source: R/plotting_functions.R

plot_run_power_checkR Documentation

Plot run power check

Description

plot_run_power_check() creates a visualization of the outcome of the power check analysis. Each point in the plot corresponds to a target-response pair, with positive control pairs in the left column and negative control pairs in the right column. The vertical axis indicates the p-value of a given pair; smaller (i.e., more significant) p-values are positioned higher along this axis (p-values truncated at clip_to for visualization). The positive control p-values should be small, and in particular, smaller than the negative control p-values.

Usage

plot_run_power_check(
  sceptre_object,
  point_size = 1,
  transparency = 0.8,
  clip_to = 1e-20
)

Arguments

sceptre_object

a sceptre_object that has had run_power_check() called on it

point_size

(optional; default 1) the size of the individual points in the plot

transparency

(optional; default 0.8) the transparency of the individual points in the plot

clip_to

(optional; default 1e-20) p-values smaller than this value are set to clip_to for better visualization. If clip_to=0 is used then no clipping is done.

Value

a single ggplot2 plot

Examples

library(sceptredata)
data(highmoi_example_data)
data(grna_target_data_frame_highmoi)
# import data
sceptre_object <- import_data(
  response_matrix = highmoi_example_data$response_matrix,
  grna_matrix = highmoi_example_data$grna_matrix,
  grna_target_data_frame = grna_target_data_frame_highmoi,
  moi = "high",
  extra_covariates = highmoi_example_data$extra_covariates,
  response_names = highmoi_example_data$gene_names
)
positive_control_pairs <- construct_positive_control_pairs(sceptre_object)
sceptre_object |>
  set_analysis_parameters(
    side = "left",
    positive_control_pairs = positive_control_pairs,
    resampling_mechanism = "permutations",
  ) |>
  assign_grnas(method = "thresholding") |>
  run_qc() |>
  run_calibration_check(
    parallel = TRUE,
    n_processors = 2,
    n_calibration_pairs = 500,
    calibration_group_size = 2
  ) |>
  run_power_check() |>
  plot_run_power_check()

timothy-barry/sceptre documentation built on Sept. 27, 2024, 6:49 a.m.