View source: R/plotting_functions.R
plot_response_grna_target_pair | R Documentation |
plot_response_grna_target_pair()
creates a violin plot of the expression level of a given response as a function of the "treatment status" (i.e., treatment or control) of a given gRNA target. The left (resp., right) violin plot shows the expression level of the response in treatment (resp., control) cells. The expression level is normalized by dividing by n_response_umis
, adding a pseudo-count of 1 and then taking the log transform. If the given response-gRNA-target pair has been analyzed, the p-value for the test of association also is displayed.
plot_response_grna_target_pair(sceptre_object, response_id, grna_target)
sceptre_object |
a |
response_id |
a string containing a response ID |
grna_target |
a string containing a gRNA target (or, if |
If grna_integration_strategy
is set to "singleton"
, then grna_target
should be set to a gRNA ID.
a violin plot
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
)
discovery_pairs <- construct_cis_pairs(sceptre_object)
sceptre_object |>
set_analysis_parameters(
side = "left",
discovery_pairs = discovery_pairs,
resampling_mechanism = "permutations",
) |>
assign_grnas(method = "thresholding") |>
run_qc() |>
run_discovery_analysis(
parallel = TRUE,
n_processors = 2
) |>
plot_response_grna_target_pair(
response_id = "ENSG00000136938",
grna_target = "candidate_enh_20"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.