Last updated: 2021-03-15

Checks: 6 1

Knit directory: CLLproteomics_batch13/analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20200227) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 3fb50c5. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/manuscript_S1_Overview_cache/
    Ignored:    analysis/manuscript_S3_trisomy12_cache/
    Ignored:    analysis/manuscript_S8_drugResponse_Outcomes_cache/
    Ignored:    analysis/manuscript_S9_STAT2_cache/
    Ignored:    code/.DS_Store
    Ignored:    code/.Rhistory
    Ignored:    data/.DS_Store
    Ignored:    output/.DS_Store

Untracked files:
    Untracked:  analysis/.trisomy12_norm.pdf
    Untracked:  analysis/STAT2splicing.Rmd
    Untracked:  analysis/analysisBatch2.Rmd
    Untracked:  analysis/bufferAnalysis.Rmd
    Untracked:  analysis/cohortComposition.pdf
    Untracked:  analysis/cohortComposition_batch2.pdf
    Untracked:  analysis/compareBatchClinics.Rmd
    Untracked:  analysis/compareBatchGenomics.Rmd
    Untracked:  analysis/compareTreatment.Rmd
    Untracked:  analysis/complexAnalysis_overall.Rmd
    Untracked:  analysis/corumPairs.csv
    Untracked:  analysis/manuscript_S1_Overview.Rmd
    Untracked:  analysis/manuscript_S2_genomicAssociation.Rmd
    Untracked:  analysis/manuscript_S3_trisomy12.Rmd
    Untracked:  analysis/manuscript_S4_trisomy19.Rmd
    Untracked:  analysis/manuscript_S5_IGHV.Rmd
    Untracked:  analysis/manuscript_S6_del11q.Rmd
    Untracked:  analysis/manuscript_S7_SF3B1.Rmd
    Untracked:  analysis/manuscript_S8_drugResponse_Outcomes.Rmd
    Untracked:  analysis/manuscript_S9_STAT2.Rmd
    Untracked:  analysis/patInfoTab.csv
    Untracked:  analysis/patInfoTab.tex
    Untracked:  analysis/protRNACor_eachPat.pdf
    Untracked:  analysis/test.pdf
    Untracked:  code/utils.R
    Untracked:  data/CNV_onChrom.RData
    Untracked:  data/ComplexParticipantsPubMedIdentifiers_human.txt
    Untracked:  data/Fig1A.png
    Untracked:  data/Western_blot_results_20210309_short.csv
    Untracked:  data/allComplexes.txt
    Untracked:  data/ddsrna_enc.RData
    Untracked:  data/exprCNV_enc.RData
    Untracked:  data/geneAnno.RData
    Untracked:  data/gmts/
    Untracked:  data/ic50.RData
    Untracked:  data/patMeta_enc.RData
    Untracked:  data/pepCLL_lumos_enc.RData
    Untracked:  data/proteins_in_complexes
    Untracked:  data/proteomic_explore_enc.RData
    Untracked:  data/proteomic_independent_enc.RData
    Untracked:  data/proteomic_timsTOF_enc.RData
    Untracked:  data/screenData_enc.RData
    Untracked:  data/survival_enc.RData
    Untracked:  manuscript_revision/
    Untracked:  output/MSH6_splicing.svg
    Untracked:  output/SUGP1_splicing.svg
    Untracked:  output/deResList.RData
    Untracked:  output/deResListBatch2.RData
    Untracked:  output/deResListRNA.RData
    Untracked:  output/deResList_WBC.RData
    Untracked:  output/deResList_batch1.RData
    Untracked:  output/deResList_batch3.RData
    Untracked:  output/deResList_timsTOF.RData
    Untracked:  output/dxdCLL.RData
    Untracked:  output/dxdCLL2.RData
    Untracked:  output/exprCNV.RData
    Untracked:  output/geneAnno.RData
    Untracked:  output/int_pairs.csv
    Untracked:  output/resOutcome_batch1.RData
    Untracked:  output/resOutcome_batch13.RData
    Untracked:  output/resOutcome_batch2.RData
    Untracked:  output/resOutcome_batch3.RData

Unstaged changes:
    Modified:   analysis/_site.yml
    Deleted:    analysis/analysisSF3B1.Rmd
    Deleted:    analysis/comparePlatforms.Rmd
    Deleted:    analysis/compareProteomicsRNAseq.Rmd
    Deleted:    analysis/correlateCLLPD.Rmd
    Deleted:    analysis/correlateGenomic.Rmd
    Deleted:    analysis/correlateGenomic_removePC.Rmd
    Deleted:    analysis/correlateMIR.Rmd
    Deleted:    analysis/correlateMethylationCluster.Rmd
    Modified:   analysis/index.Rmd
    Deleted:    analysis/predictOutcome.Rmd
    Deleted:    analysis/processProteomics_LUMOS.Rmd
    Deleted:    analysis/processProteomics_timsTOF.Rmd
    Deleted:    analysis/qualityControl_LUMOS.Rmd
    Deleted:    analysis/qualityControl_timsTOF.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


Load packages and datasets

Reproducibility of genomic associations between batch 1 and batch 3

compareBatch <- function(resList, 
                         varList = c("IGHV.status","trisomy12","del11q","SF3B1"),
                         fdrCut = 0.1) {
  
  comList <- lapply(varList, function(eachVar) {
    resSub <- filter(resList, Gene == eachVar,
                     adj.P.Val <= fdrCut) %>%
      mutate(direction = ifelse(t>0, "up","down")) %>%
      mutate(group = paste0(batch,"_",direction))
    
    setList <- lapply(unique(resSub$group), function(eachGroup) {
      filter(resSub, group == eachGroup)$name
    })
    names(setList) <- unique(resSub$group)
    
    pUpSet <- upset(fromList(setList))
    
    comDown <- intersect(setList$batch1_down, setList$batch3_down)
    comUp <- intersect(setList$batch1_up, setList$batch3_up)
    
    
    resPlot <- filter(resSub, name %in% c(comUp, comDown)) %>%
      mutate(Pdir = -log10(P.Value)*sign(t)) %>%
      select(name, Pdir, batch, direction) %>%
      pivot_wider(names_from = batch, values_from = Pdir) %>% 
      arrange(direction)
    
    pPval <- ggplot(resPlot, aes(x=batch1,y=batch3)) + geom_point(aes(col=direction)) +
      ggrepel::geom_text_repel(aes(label=name)) +
      xlab("-log10(P value) (batch1)") + ylab("-log10(P value) (batch3)")
    
    resPcom <- filter(resSub, name %in% c(comUp, comDown)) %>%
      select(name, P.Value, direction, batch) %>%
      pivot_wider(names_from = batch, values_from = P.Value) %>% 
      dplyr::rename(batch1_pVal = batch1, batch3_pVal = batch3) %>%
      mutate_at(vars(starts_with("batch")),formatC,digits = 2) %>%
      arrange(direction)
    
    batch1SigTab <- filter(resList, Gene == eachVar, adj.P.Val <= fdrCut, batch == "batch1") %>%
      mutate(direction = ifelse(t>0, "up","down")) %>% select(id, direction, batch)
    
    batch3SigTab <- filter(resList, Gene == eachVar, batch == "batch3", id %in% batch1SigTab$id) %>%
      mutate(adj.P.Val = p.adjust(P.Value, method = "BH")) %>%
      filter(adj.P.Val <= fdrCut) %>% 
      mutate(direction = ifelse(t>0, "up","down")) %>%
      select(id, direction, batch)
    
    resReCap <- bind_rows(batch1SigTab, batch3SigTab) %>%
      pivot_wider(names_from = batch, values_from = direction) %>%
      filter(!is.na(batch1)) %>%
      mutate(validated = ifelse(batch3 == batch1, "yes", "no")) %>%
      mutate(validated = replace_na(validated, "no"))
    resReSum <- tibble(Gene = eachVar, total = nrow(batch1SigTab), validated = sum(resReCap$validated %in% "yes")) %>%
      mutate(ratio = validated/total)
    
    list(plotUpSet = pUpSet, plotPval = pPval, compareTable = resPcom, resTable = resSub, recapTab=resReSum)
  })
  names(comList) <- varList
  return(comList)
}

How many proteins are detected in both batches?

protOverlap <- intersect(unique(resListB1$id), unique(resListB3$id))
length(protOverlap)
[1] 3338

Subset for proteins detected in both batches

resList <- bind_rows(mutate(resListB1, batch = "batch1"), 
                     mutate(resListB3, batch = "batch3")) %>%
  filter(id %in% protOverlap )
compareRes <- compareBatch(resList)

IGHV status

Upset plot

compareRes$IGHV.status$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$IGHV.status$compareTable %>%
  DT::datatable()

trisomy12

Upset plot

compareRes$trisomy12$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$trisomy12$compareTable %>%
  DT::datatable()

del11q

Upset plot

compareRes$del11q$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$del11q$compareTable %>%
  DT::datatable()

SF3B1

Upset plot

compareRes$SF3B1$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$SF3B1$compareTable %>%
  DT::datatable()

trisomy19

Upset plot

compareRes$trisomy19$plotUpSet
NULL

Table of differentially expressed proteins in both batches

compareRes$trisomy19$compareTable %>%
  DT::datatable()

How many associated detected by batch 1 can be reproduced by batch 3

sumTab <- lapply(compareRes, function(res) {
  res$recapTab
}) %>% bind_rows()
sumTab
# A tibble: 4 x 4
  Gene        total validated ratio
  <chr>       <int>     <int> <dbl>
1 IGHV.status   412       166 0.403
2 trisomy12    1007       433 0.430
3 del11q         13        12 0.923
4 SF3B1          21        14 0.667

Comparison between batch 1 and combined batch 13

How many proteins are detected in both batches?

protOverlap <- intersect(unique(resListB1$id), unique(resListB13$id))
length(protOverlap)
[1] 3314

Subset for proteins detected in both batches

resList <- bind_rows(mutate(resListB1, batch = "original"), 
                     mutate(resListB13, batch = "extended")) %>%
  filter(id %in% protOverlap )
compareBatch <- function(resList, 
                         varList = c("IGHV.status","trisomy12","del11q","SF3B1"),
                         fdrCut = 0.05) {
  
  comList <- lapply(varList, function(eachVar) {
    resSub <- filter(resList, Gene == eachVar,
                     adj.P.Val <= fdrCut) %>%
      mutate(direction = ifelse(t>0, "up","down")) %>%
      mutate(group = paste0(batch,"_",direction))
    
    setList <- lapply(unique(resSub$group), function(eachGroup) {
      filter(resSub, group == eachGroup)$name
    })
    names(setList) <- unique(resSub$group)
    
    pUpSet <- upset(fromList(setList))
    
    comDown <- intersect(setList$original_down, setList$extended_down)
    comUp <- intersect(setList$original_up, setList$extended_up)
    
    
    resPlot <- filter(resSub, name %in% c(comUp, comDown)) %>%
      mutate(Pdir = -log10(P.Value)*sign(t)) %>%
      select(name, Pdir, batch, direction) %>%
      pivot_wider(names_from = batch, values_from = Pdir) %>% 
      arrange(direction)
    
    pPval <- ggplot(resPlot, aes(x=original,y=extended)) + geom_point(aes(col=direction)) +
      ggrepel::geom_text_repel(aes(label=name)) +
      xlab("-log10(P value) (original)") + ylab("-log10(P value) (extended)")
    
    resPcom <- filter(resSub, name %in% c(comUp, comDown)) %>%
      select(name, P.Value, direction, batch) %>%
      pivot_wider(names_from = batch, values_from = P.Value) %>% 
      dplyr::rename(original_pVal = original, extended_pVal = extended) %>%
      mutate_at(vars(contains("pVal")),formatC,digits = 2) %>%
      arrange(direction)
    
    batch1SigTab <- filter(resList, Gene == eachVar, adj.P.Val <= fdrCut, batch == "original") %>%
      mutate(direction = ifelse(t>0, "up","down")) %>% select(id, direction, batch)
    
    batch3SigTab <- filter(resList, Gene == eachVar, batch == "extended", id %in% batch1SigTab$id) %>%
      mutate(adj.P.Val = p.adjust(P.Value, method = "BH")) %>%
      filter(adj.P.Val <= fdrCut) %>% 
      mutate(direction = ifelse(t>0, "up","down")) %>%
      select(id, direction, batch)
    
    resReCap <- bind_rows(batch1SigTab, batch3SigTab) %>%
      pivot_wider(names_from = batch, values_from = direction) %>%
      filter(!is.na(original)) %>%
      mutate(validated = ifelse(extended == original, "yes", "no")) %>%
      mutate(validated = replace_na(validated, "no"))
    resReSum <- tibble(Gene = eachVar, total = nrow(batch1SigTab), validated = sum(resReCap$validated %in% "yes")) %>%
      mutate(ratio = validated/total)
    
    list(plotUpSet = pUpSet, plotPval = pPval, compareTable = resPcom, resTable = resSub, recapTab=resReSum)
  })
  names(comList) <- varList
  return(comList)
}
compareRes <- compareBatch(resList, varList = c("IGHV.status","trisomy12","del11q","SF3B1","trisomy19"))

IGHV status

Upset plot

compareRes$IGHV.status$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$IGHV.status$compareTable %>%
  DT::datatable()
compareRes$IGHV.status$plotPval

trisomy12

Upset plot

compareRes$trisomy12$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$trisomy12$compareTable %>%
  DT::datatable()

del11q

Upset plot

compareRes$del11q$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$del11q$compareTable %>%
  DT::datatable()

SF3B1

Upset plot

compareRes$SF3B1$plotUpSet

Table of differentially expressed proteins in both batches

compareRes$SF3B1$compareTable %>%
  DT::datatable()

How many associated detected by batch 1 can be reproduced by combined batch 1 and 3

sumTab <- lapply(compareRes, function(res) {
  res$recapTab
}) %>% bind_rows()
sumTab
# A tibble: 5 x 4
  Gene        total validated ratio
  <chr>       <int>     <int> <dbl>
1 IGHV.status   290       273 0.941
2 trisomy12     754       720 0.955
3 del11q         11        11 1    
4 SF3B1          19        16 0.842
5 trisomy19       2         2 1    

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS  10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] latex2exp_0.4.0 forcats_0.5.1   stringr_1.4.0   dplyr_1.0.5    
 [5] purrr_0.3.4     readr_1.4.0     tidyr_1.1.3     tibble_3.1.0   
 [9] ggplot2_3.3.3   tidyverse_1.3.0 UpSetR_1.4.0    proDA_1.2.0    

loaded via a namespace (and not attached):
 [1] bitops_1.0-6                matrixStats_0.58.0         
 [3] fs_1.5.0                    lubridate_1.7.10           
 [5] httr_1.4.2                  rprojroot_2.0.2            
 [7] GenomeInfoDb_1.24.2         tools_4.0.2                
 [9] backports_1.2.1             bslib_0.2.4                
[11] DT_0.17                     utf8_1.1.4                 
[13] R6_2.5.0                    DBI_1.1.1                  
[15] BiocGenerics_0.34.0         colorspace_2.0-0           
[17] withr_2.4.1                 tidyselect_1.1.0           
[19] gridExtra_2.3               compiler_4.0.2             
[21] git2r_0.28.0                cli_2.3.1                  
[23] rvest_1.0.0                 Biobase_2.48.0             
[25] xml2_1.3.2                  DelayedArray_0.14.1        
[27] labeling_0.4.2              sass_0.3.1                 
[29] scales_1.1.1                digest_0.6.27              
[31] rmarkdown_2.7               XVector_0.28.0             
[33] pkgconfig_2.0.3             htmltools_0.5.1.1          
[35] highr_0.8                   dbplyr_2.1.0               
[37] htmlwidgets_1.5.3           rlang_0.4.10               
[39] readxl_1.3.1                rstudioapi_0.13            
[41] jquerylib_0.1.3             generics_0.1.0             
[43] farver_2.1.0                jsonlite_1.7.2             
[45] crosstalk_1.1.1             RCurl_1.98-1.2             
[47] magrittr_2.0.1              GenomeInfoDbData_1.2.3     
[49] Matrix_1.3-2                Rcpp_1.0.6                 
[51] munsell_0.5.0               S4Vectors_0.26.1           
[53] fansi_0.4.2                 lifecycle_1.0.0            
[55] stringi_1.5.3               yaml_2.2.1                 
[57] SummarizedExperiment_1.18.2 zlibbioc_1.34.0            
[59] plyr_1.8.6                  grid_4.0.2                 
[61] ggrepel_0.9.1               parallel_4.0.2             
[63] promises_1.2.0.1            crayon_1.4.1               
[65] lattice_0.20-41             haven_2.3.1                
[67] hms_1.0.0                   knitr_1.31                 
[69] pillar_1.5.1                GenomicRanges_1.40.0       
[71] stats4_4.0.2                reprex_1.0.0               
[73] glue_1.4.2                  evaluate_0.14              
[75] modelr_0.1.8                vctrs_0.3.6                
[77] httpuv_1.5.5                cellranger_1.1.0           
[79] gtable_0.3.0                assertthat_0.2.1           
[81] xfun_0.21                   broom_0.7.5                
[83] later_1.1.0.1               IRanges_2.22.2             
[85] workflowr_1.6.2             ellipsis_0.3.1