# Plot result

`plot_result.Rd`

For a given gRNA-gene pair analyzed by `sceptre`, plots the resampled test statistics alongside the "ground truth" test statistic derived from the raw data.

    plot_result(row)

## Arguments

row

  single row of the data frame outputted by `run_sceptre_high_moi`, when `full_output` is set to TRUE

## Value

a ggplot2 object containing the plot

## Examples

    # RUN THE METHOD
    set.seed(4)
    library(magrittr)
    data(gene_matrix)
    data(gRNA_matrix)
    data(covariate_matrix)
    data(gRNA_groups_table)
    data(gene_gRNA_group_pairs)
    combined_perturbation_matrix <- threshold_gRNA_matrix(gRNA_matrix) %>%
    combine_perturbations(gRNA_groups_table)
    gene_gRNA_group_pairs <- gene_gRNA_group_pairs %>% sample_n(1)
    #> Error in sample_n(., 1): could not find function "sample_n"
    result <- run_sceptre_high_moi(gene_matrix = gene_matrix,
    combined_perturbation_matrix = combined_perturbation_matrix,
    covariate_matrix = covariate_matrix,
    gene_gRNA_group_pairs = gene_gRNA_group_pairs,
    side = "left", parallel = FALSE, full_output = TRUE)
    #> Check /var/folders/h6/pt59hmwd7rqb3jqfzwh0hlth0000gn/T//Rtmp6TcIGC/logs for more detailed status updates.
    #> Running checks and setting up directory structure.  ✓
    #> Running gene precomputations.  ✓
    #> Running perturbation precomputations.  ✓
    #> Warning: 'dp' does not seem to be at MLE; score not quite 0
    #> Warning: 'dp' does not seem to be at MLE; score not quite 0
    #> Running perturbation-to-gene association tests. ✓
    #> Collecting and returning results.
    #> Joining, by = c("gene_id", "gRNA_id")
    #>  ✓
    #>

    # CREATE THE PLOT
    plot_result(result[1,])