Prognostic analysis of CRISPR hits

Load data

library("dplyr")
library("pheatmap")

focusedT = read.table(file = "out/FS_Survival.txt", row.names = NULL, header = TRUE, sep = "\t")
sigTable = filter(focusedT, pvalue < 0.01)
head(sigTable)
  markers       coef       pvalue  dataset
1   CDIPT  1.2840052 4.101476e-05 GSE10358
2   PRMT5  0.9325224 1.613859e-03 GSE10358
3   PPIL2 -1.2599542 1.099318e-04 GSE10358
4 NCKAP1L  0.8657959 6.304739e-03 GSE10358
5 SLC39A7 -0.7662949 7.919072e-03 GSE10358
6    WDR1 -0.7841336 6.485637e-03 GSE10358
vennTable = read.table(file = "out/FS_Venn.txt", row.names = 1, header = TRUE, sep = "\t")
source("/sibcb2/bioinformatics/Script/IDconverter.R")
load("/sibcb2/bioinformatics/KnowledgeBase/IDbase/GeneID2Symbol/geneInforTable.RData")
load("/sibcb2/bioinformatics/KnowledgeBase/IDbase/HomoloGene/homologeneTable.RData")
x = HM_IDAnnotation(gsub(" Mm", "", rownames(vennTable)), geneInforTable, homologeneTable)
mergedT = data.frame(vennTable, humanSymbol = x[, "Homolog_Human"])
idx = mergedT$humanSymbol != ""
sT = mergedT[idx, ]
head(sT)
          ma_vitro hm_vitro ma_vivo hm_vivo  group humanSymbol
Rraga Mm         1        1       1       1 shared       RRAGA
Pabpc1 Mm        1        1       1       1 shared      PABPC1
Wdr43 Mm         1        1       1       1 shared       WDR43
Cdipt Mm         1        1       1       1 shared       CDIPT
Vwa9 Mm          1        1       1       1 shared        VWA9
Bop1 Mm          1        1       1       1 shared        BOP1
subT = filter(sigTable, coef > 0)
s1 = summary(factor(subT$markers), maxsum = 1000)

subT = filter(sigTable, coef < 0)
s2 = summary(factor(subT$markers), maxsum = 1000)

acNum = reNum = rep(0, nrow(sT))
names(acNum) = names(reNum) = sT$humanSymbol
acNum[names(s1)] = s1
reNum[names(s2)] = s2

res = data.frame(sT, acNum, reNum) %>% arrange(desc(acNum))
# write.table(res, file = "out/FS_Survival_Summary.txt", row.names = FALSE, col.names = TRUE, sep = "\t")

head(res)
          ma_vitro hm_vitro ma_vivo hm_vivo      group humanSymbol
Fermt3 Mm        0        0       1       1  vivo_only      FERMT3
Ppcdc Mm         1        1       1       1     shared       PPCDC
Mef2c Mm         1        0       1       0     shared       MEF2C
Aco2 Mm          1        1       1       1     shared        ACO2
Tubg2 Mm         1        1       1       0     shared       TUBG2
Fkbp1a Mm        1        1       0       0 vitro_only      FKBP1A
          acNum reNum
Fermt3 Mm     4     0
Ppcdc Mm      3     0
Mef2c Mm      3     0
Aco2 Mm       3     0
Tubg2 Mm      3     0
Fkbp1a Mm     3     0
vis = filter(res, acNum >= 1, group == "vivo_only")
visM = as.matrix(vis[, 1:4])
rownames(visM) = paste(vis$humanSymbol, sep = "")

pheatmap(visM,
         main = "",
         border_color = "grey60", color = c("#f5f5f5","#f5f5f5","#dd1c77"),
         legend_breaks = c(-1,0,1),
         legend_labels = c("NC", "NC", "Depleted"),
         fontsize_row = 6,
         show_rownames = TRUE, show_colnames = TRUE,
         cluster_rows  = FALSE, cluster_cols  = FALSE)         

Summary

x = table(res$group, res$acNum > 0)
x
            
             FALSE TRUE
  ND           163   61
  shared       396  260
  vitro_only    27    9
  vivo_only     49   21
x/rowSums(x)
            
                 FALSE      TRUE
  ND         0.7276786 0.2723214
  shared     0.6036585 0.3963415
  vitro_only 0.7500000 0.2500000
  vivo_only  0.7000000 0.3000000
y = table(res$group, res$reNum > 0)
y
            
             FALSE TRUE
  ND           193   31
  shared       567   89
  vitro_only    30    6
  vivo_only     54   16
y/rowSums(y)
            
                 FALSE      TRUE
  ND         0.8616071 0.1383929
  shared     0.8643293 0.1356707
  vitro_only 0.8333333 0.1666667
  vivo_only  0.7714286 0.2285714