Last updated: 2021-03-05
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/compareTreatment_cache/
Ignored: analysis/manuscript_S1_Overview_cache/
Ignored: analysis/manuscript_S3_trisomy12_cache/
Ignored: analysis/manuscript_S4_trisomy19_cache/
Ignored: analysis/manuscript_S5_IGHV_cache/
Ignored: analysis/manuscript_S6_del11q_cache/
Ignored: analysis/manuscript_S7_SF3B1_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/compareTreatment.Rmd
Untracked: analysis/compare_batch1_3.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/protRNACor_eachPat.pdf
Untracked: analysis/test.pdf
Untracked: code/utils.R
Untracked: data/ComplexParticipantsPubMedIdentifiers_human.txt
Untracked: data/Fig1A.png
Untracked: data/allComplexes.txt
Untracked: data/exprCNV.RData
Untracked: data/gmts/
Untracked: data/proteins_in_complexes
Untracked: data/proteomic_LUMOS_batch13.RData
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_timsTOF.RData
Untracked: output/dxdCLL.RData
Untracked: output/dxdCLL2.RData
Untracked: output/exprCNV.RData
Untracked: output/geneAnno.RData
Untracked: output/int_pairs.csv
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.
In this analysis, I will evaluate whether the underyling hypotheses for protein complex detection algorithms is true for our CLL proteomic datasets.
There are mainly two assumptions:
The protein pairs in complexes have more conserved stoichiometry than proteins not in complexes. This is the assumption underlying Marija's algorithm.
The expressions of the protein pairs in complexes are more correlated than proteins not in pairs. This is the assumption underlying differential correlation algorithm.
Based on the analyses below, the hypotheses that proteins in complexes have higher conservativeness of stoichiometry or higher correlation are true in some extent, but the difference is very small. Therefore, I would not rely on either of the hypothesis for detecting differential complexes formation related to trisomy12 or IGHV.
load("../data/proteomic_LUMOS_batch13.RData")
load("../../var/patmeta_200522.RData")
load("../../var/ddsrna_180717.RData")
Preprocessing protein and RNA data
#subset samples and genes
overSampe <- intersect(colnames(dds), colnames(protCLL))
overGene <- intersect(rownames(dds), rowData(protCLL)$ensembl_gene_id)
ddsSub <- dds[overGene, overSampe]
protSub <- protCLL[match(overGene, rowData(protCLL)$ensembl_gene_id),overSampe]
rowData(ddsSub)$uniprotID <- rownames(protSub)[match(rownames(ddsSub),rowData(protSub)$ensembl_gene_id)]
#vst
ddsSub.vst <- varianceStabilizingTransformation(ddsSub)
Processing protein complex data
int_pairs <- read_delim("../data/proteins_in_complexes", delim = "\t") %>%
mutate(Reactome = grepl("Reactome",Evidence_supporting_the_interaction),
Corum = grepl("Corum",Evidence_supporting_the_interaction)) %>%
filter(ProtA %in% rownames(protCLL) & ProtB %in% rownames(protCLL)) %>%
mutate(pair=map2_chr(ProtA, ProtB, ~paste0(sort(c(.x,.y)), collapse = "-"))) %>%
mutate(database = case_when(
Reactome & Corum ~ "both",
Reactome & !Corum ~ "Reactome",
!Reactome & Corum ~ "Corum",
TRUE ~ "other"
)) %>% mutate(inComplex = "yes")
corum_pairs <- read_delim("../data/allComplexes.txt", delim = "\t") %>%
filter(Organism == "Human")
corumTab <- lapply(corum_pairs$`subunits(UniProt IDs)`, function(eachCom) {
comList <- sort(str_split(eachCom, ";")[[1]])
if (length(comList) > 1) {
pairTab <- combn(comList,2) %>% t() %>% as_tibble()
colnames(pairTab) <- c("ProtA","ProtB")
pairTab <- mutate(pairTab, pair=paste0(ProtA, "-", ProtB))
pairTab
} else NULL
}) %>% bind_rows() %>%
filter(ProtA %in% rownames(protCLL) & ProtB %in% rownames(protCLL)) %>%
distinct(pair, .keep_all = TRUE)
comTab = list(oldPair = filter(int_pairs, Corum)$pair,
newPiar = corumTab$pair)
UpSetR::upset(UpSetR::fromList(comTab))
Largely consistent
reactome_pairs <- read_delim("../data/ComplexParticipantsPubMedIdentifiers_human.txt", delim = "\t")
reactomeTab <- lapply(reactome_pairs$participants, function(eachCom) {
comList <- str_split(eachCom, "[|]")[[1]]
comList <- comList[str_detect(comList,"uniprot:")]
comList <- sort(str_remove(comList,"uniprot:"))
if (length(comList) > 1) {
pairTab <- combn(comList,2) %>% t() %>% as_tibble()
colnames(pairTab) <- c("ProtA","ProtB")
pairTab <- mutate(pairTab, pair=paste0(ProtA, "-", ProtB))
pairTab
} else NULL
}) %>% bind_rows() %>%
filter(ProtA %in% rownames(protCLL) & ProtB %in% rownames(protCLL)) %>%
distinct(pair, .keep_all = TRUE)
comTab = list(oldPair = filter(int_pairs, Reactome)$pair,
newPiar = reactomeTab$pair)
UpSetR::upset(UpSetR::fromList(comTab))
Create new list
reactomePair <- reactomeTab %>% select(pair) %>%
mutate(Reactome = TRUE)
corumPair <- corumTab %>% select(pair) %>%
mutate(Corum = TRUE)
comPairTab <- full_join(reactomePair, corumPair, by = "pair") %>%
mutate_all(replace_na, FALSE) %>%
mutate(database = case_when(
Reactome & Corum ~ "both",
Reactome & !Corum ~ "ReactomeOnly",
!Reactome & Corum ~ "CorumOnly"
)) %>% separate(pair, c("ProtA","ProtB"),"-",remove = FALSE) %>%
mutate(inComplex="yes")
table(comPairTab$database)
both CorumOnly ReactomeOnly
10860 10106 21543
int_pairs <- comPairTab
Save for later use
write_csv2(int_pairs, "../output/int_pairs.csv")
I will compare the distribution of the ratio of expressions of proteins pairs in complexes and not in complexes. If there's a higher conservativeness in stoichiometry, the distribution of ratios should be narrower, i.e, smaller standard deviation.
stoTab <- int_pairs %>% select(ProtA, ProtB, pair, Reactome, Corum, database, inComplex)
protMat <- assays(protCLL)[["QRILC_combat"]]
listA <- int_pairs$ProtA
listB <- int_pairs$ProtB
sdRatio <- rep(NA,nrow(int_pairs))
for (i in seq(length(sdRatio))) {
idA <- listA[i]
idB <- listB[i]
logRatio <- protMat[idA,] - protMat[idB,]
sdRatio[i] <- sd(logRatio)
}
stoTab$sdRatio <- sdRatio
ggplot(stoTab, aes(x=sdRatio, fill = database, col = database, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5) +
xlab("standard deviation of ratios")
The knowledge of complexes can be obtained from different databases. They may have different reliability. But based on this plot, there's no significant difference among different databases.
Here, I will calculate the ratios of 5000 random protein pairs that are not involved in complexes
n <- nrow(int_pairs)
n <- 5000
allProt <- unique(c(int_pairs$ProtA, int_pairs$ProtB))
randSto <- tibble(ProtA = rep("",n), ProtB = rep("",n), sdRatio = rep(0,n), inComplex ="no")
i <- 0
while (i <= n-1) {
ProtA <- sample(allProt, 1)
ProtB <- sample(allProt, 1)
pair <- paste0(sort(c(ProtA, ProtB)),collapse = "-")
if (!pair %in% stoTab$pair) {
#accept
i <- i + 1
randSto[i, 1] <- ProtA
randSto[i, 2] <- ProtB
logRatio <- protMat[ProtA,] - protMat[ProtB,]
randSto[i, 3] <- sd(logRatio)
}
}
compareTab <- bind_rows(stoTab, randSto)
ggplot(compareTab, aes(x=sdRatio, fill = inComplex, col = inComplex, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5) +
xlab("standard deviation of ratios")
There's a trend that the protein pairs in complexes have slightly lower standard deviations of expression ratio, indicating more conserved stoichiometry, but the difference is very small.
compareTab <- bind_rows(stoTab, randSto) %>%
filter(database %in% c("both",NA))
ggplot(compareTab, aes(x=sdRatio, fill = inComplex, col = inComplex, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
Not too much difference.
I will compare the Pearson correlation coefficients of protein pairs in complexes and not in complexes. A larger coefficient means higher correlation.
corTab <- int_pairs %>% select(ProtA, ProtB, pair, Reactome, Corum, database, inComplex)
protMat <- assays(protCLL)[["QRILC_combat"]]
listA <- int_pairs$ProtA
listB <- int_pairs$ProtB
coefList <- rep(NA,nrow(int_pairs))
for (i in seq(length(sdRatio))) {
idA <- listA[i]
idB <- listB[i]
coef <- cor(protMat[idA,], protMat[idB,])
coefList[i] <- coef
}
corTab$coef <- coefList
ggplot(corTab, aes(x=coef, fill = database, col = database, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
It seems if the protein pairs are annotated as complexes in both Corum and Reactome databases (stronger evidence), they tend to have higher correlation coefficient.
n <- nrow(int_pairs)
n <- 5000
allProt <- unique(c(int_pairs$ProtA, int_pairs$ProtB))
randCoef <- tibble(ProtA = rep("",n), ProtB = rep("",n), coef = rep(0,n), inComplex ="no")
i <- 0
while (i <= n-1) {
ProtA <- sample(allProt, 1)
ProtB <- sample(allProt, 1)
pair <- paste0(sort(c(ProtA, ProtB)),collapse = "-")
if (!pair %in% corTab$pair) {
#accept
i <- i + 1
randCoef[i, 1] <- ProtA
randCoef[i, 2] <- ProtB
coef <- cor(protMat[ProtA,], protMat[ProtB,])
randCoef[i, 3] <- coef
}
}
compareTab <- bind_rows(corTab, randCoef)
ggplot(compareTab, aes(x=coef, fill = inComplex, col = inComplex, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
There's indeed a trend that protein pairs in complex have higher coefficient than protein pairs that not in complexes.
Compare (only from both)
compareTab <- bind_rows(corTab, randCoef) %>%
filter(database %in% c("both",NA))
ggplot(compareTab, aes(x=coef, fill = inComplex, col = inComplex, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
The difference is stronger if I only include proteins with stronger evidence of forming complexes.
However, the correlations observed for protein abundance can also be due to the correlation in RNA expression, not neccessary due to complex formation. I will also test if the RNA expression of protein pairs shows this trend
corTab.rna <- int_pairs %>% select(ProtA, ProtB, pair, Reactome, Corum, database, inComplex) %>%
filter(ProtA %in% rowData(ddsSub.vst)$uniprotID & ProtB %in% rowData(ddsSub.vst)$uniprotID)
protMat <- assay(ddsSub.vst)
rownames(protMat) <- rowData(ddsSub.vst)$uniprotID
listA <- corTab.rna$ProtA
listB <- corTab.rna$ProtB
coefList <- rep(NA,nrow(corTab.rna))
for (i in seq(length(coefList))) {
idA <- listA[i]
idB <- listB[i]
coef <- cor(protMat[idA,], protMat[idB,])
coefList[i] <- coef
}
corTab.rna$coef <- coefList
ggplot(corTab.rna, aes(x=coef, fill = database, col = database, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
It seems that the RNA expressions of proteins in complex also have higher correlation. The trend is stronger for proteins with stronger evidences of being in complexes.
n <- nrow(int_pairs)
n <- 5000
allProt <- unique(c(corTab.rna$ProtA, corTab.rna$ProtB))
randCoef.rna <- tibble(ProtA = rep("",n), ProtB = rep("",n), coef = rep(0,n), inComplex ="no")
i <- 0
while (i <= n-1) {
ProtA <- sample(allProt, 1)
ProtB <- sample(allProt, 1)
pair <- paste0(sort(c(ProtA, ProtB)),collapse = "-")
if (!pair %in% corTab$pair) {
#accept
i <- i + 1
randCoef.rna[i, 1] <- ProtA
randCoef.rna[i, 2] <- ProtB
coef <- cor(protMat[ProtA,], protMat[ProtB,])
randCoef.rna[i, 3] <- coef
}
}
compareTab <- bind_rows(corTab.rna, randCoef.rna)
ggplot(compareTab, aes(x=coef, fill = inComplex, col = inComplex, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
compareTab <- bind_rows(corTab.rna, randCoef.rna) %>%
filter(database %in% c("both",NA))
ggplot(compareTab, aes(x=coef, fill = inComplex, col = inComplex, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
The trend is almost the same as for protein expressions. Which means the higher correlation observed for protein pairs in complexes can simply because their RNA expressions are correlated. Not necessarily because of the complex formation.
compareTab <- bind_rows(mutate(corTab, set = "Protein"), mutate(corTab.rna, set = "RNA"))
ggplot(compareTab, aes(x=coef, fill = set, col = set, y=..density..)) +
geom_histogram(position = "identity", alpha = 0.5)
There's no strong difference. The RNA expressions of protein pairs in complexes even have higher correlations than the corresponding protein expression. This somewaht contradicts previous report that the proteins expressions are more correlations for proteins in complexes than their RNA expressions. However, one explanation is that, if two proteins are annotated as complexes, there's also a high chance that they are in the same pathway and therefore, their RNAs are also co-expressed.
sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.16
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/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] parallel stats4 stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] forcats_0.5.0 stringr_1.4.0
[3] dplyr_1.0.0 purrr_0.3.4
[5] readr_1.3.1 tidyr_1.1.0
[7] tibble_3.0.3 ggplot2_3.3.2
[9] tidyverse_1.3.0 DESeq2_1.26.0
[11] SummarizedExperiment_1.16.1 DelayedArray_0.12.3
[13] BiocParallel_1.20.1 matrixStats_0.56.0
[15] Biobase_2.46.0 GenomicRanges_1.38.0
[17] GenomeInfoDb_1.22.1 IRanges_2.20.2
[19] S4Vectors_0.24.4 BiocGenerics_0.32.0
loaded via a namespace (and not attached):
[1] colorspace_1.4-1 ellipsis_0.3.1 rprojroot_1.3-2
[4] htmlTable_2.0.1 XVector_0.26.0 base64enc_0.1-3
[7] fs_1.4.2 rstudioapi_0.11 farver_2.0.3
[10] bit64_0.9-7 AnnotationDbi_1.48.0 fansi_0.4.1
[13] lubridate_1.7.9 xml2_1.3.2 splines_3.6.0
[16] geneplotter_1.64.0 knitr_1.29 Formula_1.2-3
[19] jsonlite_1.7.0 workflowr_1.6.2 broom_0.7.0
[22] annotate_1.64.0 cluster_2.1.0 dbplyr_1.4.4
[25] png_0.1-7 compiler_3.6.0 httr_1.4.1
[28] backports_1.1.8 assertthat_0.2.1 Matrix_1.2-18
[31] cli_2.0.2 later_1.1.0.1 acepack_1.4.1
[34] htmltools_0.5.0 tools_3.6.0 gtable_0.3.0
[37] glue_1.4.1 GenomeInfoDbData_1.2.2 Rcpp_1.0.5
[40] cellranger_1.1.0 vctrs_0.3.1 xfun_0.15
[43] rvest_0.3.5 lifecycle_0.2.0 XML_3.98-1.20
[46] zlibbioc_1.32.0 scales_1.1.1 hms_0.5.3
[49] promises_1.1.1 RColorBrewer_1.1-2 yaml_2.2.1
[52] memoise_1.1.0 gridExtra_2.3 UpSetR_1.4.0
[55] rpart_4.1-15 latticeExtra_0.6-29 stringi_1.4.6
[58] RSQLite_2.2.0 genefilter_1.68.0 checkmate_2.0.0
[61] rlang_0.4.7 pkgconfig_2.0.3 bitops_1.0-6
[64] evaluate_0.14 lattice_0.20-41 htmlwidgets_1.5.1
[67] labeling_0.3 bit_4.0.4 tidyselect_1.1.0
[70] plyr_1.8.6 magrittr_1.5 R6_2.4.1
[73] generics_0.0.2 Hmisc_4.4-0 DBI_1.1.0
[76] pillar_1.4.6 haven_2.3.1 foreign_0.8-71
[79] withr_2.2.0 survival_3.2-3 RCurl_1.98-1.2
[82] nnet_7.3-14 modelr_0.1.8 crayon_1.3.4
[85] rmarkdown_2.3 jpeg_0.1-8.1 locfit_1.5-9.4
[88] grid_3.6.0 readxl_1.3.1 data.table_1.12.8
[91] blob_1.2.1 git2r_0.27.1 reprex_0.3.0
[94] digest_0.6.25 xtable_1.8-4 httpuv_1.5.4
[97] munsell_0.5.0