# Plot resampling distribution

`plot_resampling_distribution.Rd`

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

    plot_resampling_distribution(row)

## Arguments

sceptre_result

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

## Value

a ggplot2 object containing the plot

## Examples

    data(gene_matrix); data(gRNA_matrix); data(covariate_matrix)
    gene_expressions <- gene_matrix[1,,drop=FALSE]
    gRNA_expressions <- gRNA_matrix[1,,drop=FALSE]
    gene_gRNA_pairs <- data.frame(gene_id = rep(row.names(gene_expressions), 2),
                                  gRNA_id = row.names(gRNA_expressions))
    result <- run_sceptre_high_moi(gene_matrix, gRNA_matrix, covariate_matrix,
                                   gene_gRNA_pairs, parallel = FALSE, full_output = TRUE)
    #> Check /var/folders/h6/pt59hmwd7rqb3jqfzwh0hlth0000gn/T//RtmpDEJYBj/logs for more detailed status updates.
    #> Running checks and setting up directory structure.  ✓
    #> Running gene precomputations.  ✓
    #> Running perturbation precomputations.  ✓
    #> Running perturbation-to-gene association tests. ✓
    #> Collecting and returning results.  ✓
    #>
    row <- result[1,]
    result_plot <- plot_resampling_distribution(row)
    plot(result_plot)