Pooling raw counts for genome-wide CRISPR

Loading count matrix

sgA = read.table(file = "raw/CRISPR_WG_libraryA.txt", row.names = 1, header = TRUE, sep = "\t")
control = filter(sgA, str_detect(Gene, 'NonTargeting')) %>% select(-Gene) %>% 
  summarise_each(function(z) sum(z > 5)/length(z)) %>% unlist()
sgRNA = filter(sgA, str_detect(Gene, 'NonTargeting', negate = TRUE)) %>% 
  select(-Gene) %>% 
  summarise_each(function(z) sum(z > 5)/length(z)) %>% unlist()
ATable =  data.frame(name = names(sgRNA), library = "A", sgRNA, control)

sgB = read.table(file = "raw/CRISPR_WG_libraryB.txt", row.names = 1, header = TRUE, sep = "\t")
control = filter(sgB, str_detect(Gene, 'NonTargeting')) %>% select(-Gene) %>% 
  summarise_each(function(z) sum(z > 5)/length(z)) %>% unlist()
sgRNA = filter(sgB, str_detect(Gene, 'NonTargeting', negate = TRUE)) %>% 
  select(-Gene) %>% 
  summarise_each(function(z) sum(z > 5)/length(z)) %>% unlist()
BTable =  data.frame(name = names(sgRNA), library = "B", sgRNA, control)

abTable = bind_rows(ATable, BTable)

group = rep("vivo", nrow(abTable))
group[grep("plasmid", abTable$name)] = "plasmid"
group[grep("Pre", abTable$name)] = "Pre"
group[grep("vitro", abTable$name)] = "vitro"

condition = rep("", nrow(abTable))
condition[grep("plasmid", abTable$name)] = "plasmid"
condition[grep("MA", abTable$name)] = "MA"
condition[grep("HM", abTable$name)] = "HM"

abTable = data.frame(abTable, group, condition)

head(abTable)
                     name library     sgRNA control   group condition
A_plasmid       A_plasmid       A 0.9780584   0.976 plasmid   plasmid
MA_A_Pre_1     MA_A_Pre_1       A 0.7477102   0.775     Pre        MA
MA_A_Pre_2     MA_A_Pre_2       A 0.7291897   0.760     Pre        MA
HM_A_Pre_1     HM_A_Pre_1       A 0.8899342   0.901     Pre        HM
HM_A_Pre_2     HM_A_Pre_2       A 0.8741350   0.882     Pre        HM
MA_A_vitro_1 MA_A_vitro_1       A 0.6501314   0.674   vitro        MA
table(condition, group)
         group
condition Pre plasmid vitro vivo
  HM        3       0     4   40
  MA        4       0     4   40
  plasmid   0       2     0    0

coverage

p <- ggplot(abTable, aes(x = group, y = sgRNA, color = condition))
p <- p + theme_bw() + labs(x = "condition", y = "Fraction of sgRNA covered\n(> 5x)", title = "targeting sgRNA")
p <- p + theme(plot.title = element_text(hjust = 0.5)) + geom_boxplot()
print(p)
p <- ggplot(abTable, aes(x = group, y = control, color = condition))
p <- p + theme_bw() + labs(x = "condition", y = "Fraction of sgRNA covered\n(> 5x)", title = "control sgRNA")
p <- p + theme(plot.title = element_text(hjust = 0.5)) + geom_boxplot()
print(p)

Given the limited coverage especially for in vivo condition, we pooled biological replicates to gain higher coverage.

sessionInfo

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.6 (Maipo)

Matrix products: default
BLAS/LAPACK: /sibcb2/bioinformatics/software/Miniconda3/lib/libopenblasp-r0.3.15.so

locale:
[1] C

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets 
[7] methods   base     

other attached packages:
 [1] stringr_1.5.0       dplyr_1.1.2         scales_1.2.0       
 [4] RColorBrewer_1.1-3  pheatmap_1.0.12     VennDiagram_1.6.20 
 [7] futile.logger_1.4.3 ggrepel_0.9.1       ggplot2_3.4.2      
[10] rmarkdown_2.20     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9           highr_0.9            jquerylib_0.1.4     
 [4] bslib_0.2.5.1        pillar_1.9.0         compiler_4.1.0      
 [7] formatR_1.11         futile.options_1.0.1 tools_4.1.0         
[10] downlit_0.4.2        digest_0.6.29        jsonlite_1.8.7      
[13] memoise_2.0.1        evaluate_0.20        lifecycle_1.0.3     
[16] tibble_3.2.1         gtable_0.3.0         pkgconfig_2.0.3     
[19] rlang_1.1.1          rstudioapi_0.15.0    cli_3.6.1           
[22] distill_1.5          yaml_2.3.5           xfun_0.37           
[25] fastmap_1.1.0        withr_2.5.0          knitr_1.42          
[28] sass_0.4.0           generics_0.1.3       vctrs_0.6.3         
[31] tidyselect_1.2.1     glue_1.6.2           R6_2.5.1            
[34] fansi_1.0.3          bookdown_0.33        farver_2.1.1        
[37] lambda.r_1.2.4       magrittr_2.0.3       htmltools_0.5.2     
[40] colorspace_2.0-3     labeling_0.4.2       utf8_1.2.2          
[43] stringi_1.7.8        munsell_0.5.0        cachem_1.0.6