For more background on gimap and the calculations done here, read here
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
First we can create a folder we will save files to.
output_dir <- "output_timepoints"
dir.create(output_dir, showWarnings = FALSE)
We’re going to set up three datasets that we will provide to the
set_up()
function to create a gimap
dataset
object.
counts
- the counts generated from pgPENpg_ids
- the IDs that correspond to the rows of the
counts and specify the constructsample_metadata
- metadata that describes the columns
of the counts including their timepointscounts <- example_data %>%
select(c("Day00_RepA", "Day05_RepA", "Day22_RepA", "Day22_RepB", "Day22_RepC")) %>%
as.matrix()
pg_id
are just the unique IDs listed in the same
order/sorted the same way as the count data.
Sample metadata is the information that describes the samples and is sorted the same order as the columns in the count data.
sample_metadata <- data.frame(
col_names = c("Day00_RepA", "Day05_RepA", "Day22_RepA", "Day22_RepB", "Day22_RepC"),
day = as.numeric(c("0", "5", "22", "22", "22")),
rep = as.factor(c("RepA", "RepA", "RepA", "RepB", "RepC"))
)
We’ll need to provide example_counts
,
pg_ids
and sample_metadata
to
setup_data()
.
It’s ideal to run quality checks first. The run_qc()
function will create a report we can look at to assess this.
You can take a look at an example QC report here.
Genetic interaction is calculated by:
rep
- indicates which sample from the original the data
is from. Note the pretreatment is used for calculation and its
statistics are not reported.pgRNA_target
- what gene(s) were targeted by this the
original pgRNAs for these datamean_expected_cs
- the average expected genetic
interaction scoremean_gi_score
- the average observer genetic
interaction scoretarget_type
- describes whether the CRISPR design is
targeting two genes (“gene_gene”), or a gene and a non targeting control
(“gene_ctrl”) or a targeting control and a gene (“ctrl_gene”).p_val
- p values from the testing whether a double
knockout construct is significantly different in its genetic interaction
score from single targets.fdr
- False discovery rate corrected p valuesYou can remove any samples from these plots by altering the
reps_to_drop
argument.
Here’s how you can save plots like the above.
ggplot2::ggsave("volcano_plot.png")
We can save all these data as an RDS or the genetic interaction scores themselves to a tsv file.
saveRDS(gimap_dataset, "gimap_dataset_final.RDS")
readr::write_tsv(gimap_dataset$gi_scores, "gi_scores.tsv")