get_result: Get result

View source: R/s4_analysis_functs_2.R

get_resultR Documentation

Get result

Description

get_result() returns a data frame containing the result of a calibration check, power check, or discovery analysis. We pass as arguments sceptre_object and analysis, where the latter is a string indicating the function whose results we are querying. The output is a data frame, the rows of which correspond to target-response pairs, and the columns of which are as follows: response_id, grna_target, n_nonzero_trt, n_nonzero_cntrl, pass_qc (a TRUE/FALSE value indicating whether the pair passes pairwise QC), p_value, log_2_fold_change, and significant (a TRUE/FALSE value indicating whether the pair is called as significant). The p-value contained within the p_value column is a raw (i.e., non-multiplicity-adjusted) p-value. See Section 8 of the introductory chapter in the manual for more information about this function.

Usage

get_result(sceptre_object, analysis)

Arguments

sceptre_object

a sceptre_object

analysis

a string indicating the name of the analysis whose results we are querying, one of "run_calibration_check", "run_power_check", or "run_discovery_analysis".

Value

a data frame containing the results of the analysis

Note

If output_amount is set to 2 or 3 in run_calibration_check(), run_power_check(), or run_discovery_analysis(), then the result data frame contains additional columns; see Chapter 6 in the manual for more information.

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)
pc_result <- sceptre_object |>
  set_analysis_parameters(
    side = "left",
    resampling_mechanism = "permutations",
    positive_control_pairs = positive_control_pairs
  ) |>
  assign_grnas(method = "thresholding") |>
  run_qc() |>
  run_power_check() |>
  get_result("run_power_check")

timothy-barry/sceptre documentation built on Nov. 19, 2024, 10:04 a.m.