View source: R/s4_analysis_functs_1.R
assign_grnas | R Documentation |
assign_grnas()
performs the gRNA-to-cell assignments. sceptre
provides three gRNA-to-cell assignment strategies: the mixture method, the thresholding method, and the maximum method. The mixture method involves assigning gRNAs to cells using a principled mixture model. Next, the thresholding method assigns a gRNA to a cell if the UMI count of the gRNA in the cell is greater than or equal to some integer threshold. Finally, the maximum method assigns the gRNA that accounts for the greatest number of UMIs in a given cell to that cell. The maximum method is available only in low MOI. See Chapter 3 of the manual for more detailed information about assign_grnas()
.
assign_grnas(
sceptre_object,
method = "default",
print_progress = TRUE,
parallel = FALSE,
n_processors = "auto",
log_dir = tempdir(),
...
)
sceptre_object |
a |
method |
(optional) a string indicating the method to use to assign the gRNAs to cells, one of |
print_progress |
(optional; default |
parallel |
(optional; default |
n_processors |
(optional; default "auto") an integer specifying the number of processors to use if |
log_dir |
(optional; default |
... |
optional method-specific additional arguments |
an updated sceptre_object
in which the gRNA assignments have been carried out
See the manual for information about the method-specific additional arguments.
library(sceptredata)
data("lowmoi_example_data")
# 1. import data, set default analysis parameters
sceptre_object <- import_data(
response_matrix = lowmoi_example_data$response_matrix,
grna_matrix = lowmoi_example_data$grna_matrix,
extra_covariates = lowmoi_example_data$extra_covariates,
grna_target_data_frame = lowmoi_example_data$grna_target_data_frame,
moi = "low"
) |> set_analysis_parameters()
# 2. assign gRNAs (three different methods)
sceptre_object <- sceptre_object |> assign_grnas(method = "thresholding")
sceptre_object <- sceptre_object |> assign_grnas(method = "maximum")
sceptre_object <- sceptre_object |> assign_grnas(
method = "mixture", parallel = TRUE, n_processors = 2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.