View source: R/s4_analysis_functs_1.R
run_qc | R Documentation |
run_qc()
runs cellwise and pairwise QC on the data. Cellwise QC involves filtering cells on the covariates response_n_nonzero
, response_n_umis
, and response_p_mito
. In low-MOI we additionally remove cells that contain zero or multiple gRNAs. Next, pairwise QC involves filtering out target-response pairs whose data are too sparse to be analyzed reliably. In this context we define the “number of nonzero treatment cells” (resp., the “number of nonzero control cells”) as the number of cells in the treatment group (resp., control group) that contain nonzero expression of the response. (We sometimes use the shorthand n_nonzero_trt
and n_nonzero_cntrl
to refer to the number of nonzero treatment cells and control cells, respectively.) Pairwise QC involves filtering target-response pairs on n_nonzero_trt
and n_nonzero_cntrl
. See Chapter 4 of the manual for more detailed information about this function.
run_qc(
sceptre_object,
n_nonzero_trt_thresh = 7L,
n_nonzero_cntrl_thresh = 7L,
response_n_umis_range = c(0.01, 0.99),
response_n_nonzero_range = c(0.01, 0.99),
p_mito_threshold = 0.2,
additional_cells_to_remove = integer()
)
sceptre_object |
a |
n_nonzero_trt_thresh |
(optional; default |
n_nonzero_cntrl_thresh |
(optional; default |
response_n_umis_range |
(optional; default |
response_n_nonzero_range |
(optional; default |
p_mito_threshold |
(optional; default |
additional_cells_to_remove |
(optional) a vector of integer indices specifying additional cells to remove |
an updated sceptre_object
in which cellwise and pairwise QC have been applied
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
)
# set analysis parameters, assign grnas, run qc
positive_control_pairs <- construct_positive_control_pairs(sceptre_object)
discovery_pairs <- construct_cis_pairs(sceptre_object,
positive_control_pairs = positive_control_pairs,
distance_threshold = 5e6
)
sceptre_object <- sceptre_object |>
set_analysis_parameters(
discovery_pairs = discovery_pairs,
positive_control_pairs = positive_control_pairs,
side = "left"
) |>
assign_grnas(method = "thresholding") |>
run_qc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.