Commit cf649be7 authored by Mathias Walzer's avatar Mathias Walzer
Browse files

more plot panel updates

parent 25fc6172
......@@ -37,8 +37,9 @@ analyse_cv <- function(df) {
geom_violin(trim=TRUE) +
geom_boxplot(width=0.1) +
labs(title = "Coefficient of variation", x = "Types", y = "CV [%]") +
ylim(0,100) +
theme_bw() + theme(axis.text.x = element_text(angle = 45, hjust = 1))
return_list <- list("t_groups_cv" = groups, "t_subjects_cv" = subjects, "median_cv" = oamedian, "p_cv" = plot)
return(return_list)
}
\ No newline at end of file
}
......@@ -2,9 +2,9 @@ source("../container/downstream/DIA_downstream_datacarpentry.R")
source("../container/postprocess/DIA_postprocess_differential.R")
source("../container/postprocess/codify_study_customisations.R")
pxds <- list("PXD014943" = list(c("eDLBCL", "PCNSL") , c("IVL", "eDLBCL")),
pxds <- list("PXD014943" = list(c("eDLBCL", "PCNSL") , c("eDLBCL", "IVL")),
"PXD004691" = list(c("F-N", "F-T"), c("P-N","P-T")),
"PXD000672" = list(c("normal_ccRCC", "ccRCC"), c("ccRCC", "pRCC"))
"PXD000672" = list(c("ccRCC", "normal_ccRCC"), c("ccRCC", "pRCC"))
)
for (name in names(pxds)) {
......@@ -14,14 +14,28 @@ for (name in names(pxds)) {
# fix headers
Contrast_PXD004691$`F-N-F-T` <- Contrast_PXD004691$`F-N-F-T` + labs(title="PXD004691 normal(ff)-PrC(ff)")
Contrast_PXD004691$`P-N-P-T` <- Contrast_PXD004691$`P-N-P-T` + labs(title="PXD004691 normal(pe)-PrC(pe)")
Contrast_PXD000672$`normal_ccRCC-ccRCC` <- Contrast_PXD000672$`normal_ccRCC-ccRCC` + labs(title="PXD000672 normal-ccRCC")
Contrast_PXD000672$`ccRCC-normal_ccRCC` <- Contrast_PXD000672$`ccRCC-normal_ccRCC` + labs(title="PXD000672 ccRCC-normal")
# make figure panel
panel_de <- (Contrast_PXD014943$`eDLBCL-PCNSL`| Contrast_PXD014943$`IVL-eDLBCL`) /
(Contrast_PXD004691$`F-N-F-T` | Contrast_PXD004691$`P-N-P-T` ) /
(Contrast_PXD000672$`normal_ccRCC-ccRCC` | Contrast_PXD000672$`ccRCC-pRCC`) /
plot_annotation(tag_levels = 'A')
panel_de <- (Contrast_PXD014943$`eDLBCL-PCNSL` + ylim(0,30) | Contrast_PXD014943$`eDLBCL-IVL`+ ylim(0,30) ) /
(Contrast_PXD004691$`F-N-F-T` + ylim(0,25) | Contrast_PXD004691$`P-N-P-T` + ylim(0,25) ) /
(Contrast_PXD000672$`ccRCC-normal_ccRCC` + ylim(0,15) | Contrast_PXD000672$`ccRCC-pRCC`+ ylim(0,15) ) /
plot_annotation(tag_levels = 'A', title = 'Volcano plots for differential expression')
# panel_de
# point size should be 2
ggsave(
"dia_paper_volcano_panel_top3update.pdf",
plot = panel_de,
device = "pdf",
scale = 1,
width = 38,
height = 38,
units = "cm" ,
dpi = 300,
limitsize = TRUE
)
# write protein tables
# not working :/
......@@ -99,3 +113,25 @@ write.table(Contrast_PXD000672$`contrast-ccRCC-pRCC` %>%
quote = FALSE, row.names = FALSE,
sep = "\t")
# recalc differential expressions with top3 imputation
source("FC_variance_results_datacarpentry.R")
PXD000672_1_1_top3 <- calc_contrasts("1_1_top3_PXD000672", list(c("ccRCC", "normal_ccRCC"), c("ccRCC", "pRCC")) )
PXD004691_1_1_top3 <- calc_contrasts("1_1_top3_PXD004691", list(c("F-N", "F-T"), c("P-N","P-T")) )
PXD014943_1_1_top3 <- calc_contrasts("1_1_top3_PXD014943", list(c("eDLBCL", "PCNSL") , c("eDLBCL", "IVL")) )
# fix headers
PXD004691_1_1_top3$`F-N-F-T` <- PXD004691_1_1_top3$`F-N-F-T` + labs(title="PXD004691 normal(ff)-PrC(ff)")
PXD004691_1_1_top3$`P-N-P-T` <- PXD004691_1_1_top3$`P-N-P-T` + labs(title="PXD004691 normal(pe)-PrC(pe)")
PXD000672_1_1_top3$`ccRCC-normal_ccRCC` <- PXD000672_1_1_top3$`ccRCC-normal_ccRCC` + labs(title="PXD000672 ccRCC-normal")
PXD000672_1_1_top3$`ccRCC-pRCC` <- PXD000672_1_1_top3$`ccRCC-pRCC` + labs(title="PXD000672 ccRCC-pRCC")
PXD014943_1_1_top3$`eDLBCL-PCNSL` <- PXD014943_1_1_top3$`eDLBCL-PCNSL` + labs(title="PXD014943 eDLBCL-PCNSL")
PXD014943_1_1_top3$`eDLBCL-IVL` <- PXD014943_1_1_top3$`eDLBCL-IVL` + labs(title="PXD014943 eDLBCL-IVL")
# make figure panel
panel_de <- (PXD014943_1_1_top3$`eDLBCL-PCNSL` + ylim(0,30) | PXD014943_1_1_top3$`eDLBCL-IVL`+ ylim(0,30) ) /
(PXD004691_1_1_top3$`F-N-F-T` + ylim(0,25) | PXD004691_1_1_top3$`P-N-P-T` + ylim(0,25) ) /
(PXD000672_1_1_top3$`ccRCC-normal_ccRCC` + ylim(0,15) | PXD000672_1_1_top3$`ccRCC-pRCC`+ ylim(0,15) ) /
plot_annotation(tag_levels = 'A', title = 'Volcano plots for differential expression')
......@@ -70,12 +70,18 @@ discovery <- ggplot(protein_comp, aes(x=PXD, y=count, fill=Source)) +
scale_fill_brewer(palette="Dark2")
fdr + discovery + plot_annotation(tag_levels = 'A')
# ggsave('dia_paper_numbers_panel.png', fdr + discovery + plot_annotation(tag_levels = 'A') ,
# width = 160,
# height = 106,
# units = "mm", dpi = 300
# )
panel_num <- fdr + discovery + plot_annotation(tag_levels = 'A')
ggsave(
"dia_paper_numbers_panel_top3_oridata_update.pdf",
plot = panel_num,
device = "pdf",
scale = 1,
width = 38,
height = 19,
units = "cm" ,
dpi = 300,
limitsize = TRUE
)
protein_comp <- read.delim("../R/protein_comparisons_allinference.tsv") %>%
......
......@@ -11,10 +11,55 @@ for (p in pxds ){
assign(paste("Variances_original",p,sep="_"), analyse_cv(df2))
}
(Variances_reanalysis_PXD003497$p_cv | Variances_original_PXD003497$p_cv ) /
(Variances_reanalysis_PXD004873$p_cv | Variances_original_PXD004873$p_cv ) /
(Variances_reanalysis_PXD014194$p_cv | Variances_original_PXD014194$p_cv ) /
plot_annotation(tag_levels = 'A')
panel_cv <- (Variances_reanalysis_PXD003497$p_cv +
labs(title = "PXD003497", subtitle = "(Reanalysis)") +
theme(legend.position = "none") +
scale_x_discrete(labels=c("Total","AAC", "BPH", "DAC" )) |
Variances_original_PXD003497$p_cv +
labs(title = "PXD003497", subtitle = "(Original)") +
theme(legend.position = "none", legend.title=element_blank()) +
scale_x_discrete(labels=c("Total","AAC", "BPH", "DAC" )) ) /
(Variances_reanalysis_PXD004873$p_cv +
labs(title = "PXD004873", subtitle = "(Reanalysis)") +
theme(legend.position = "none") +
scale_x_discrete(labels=c("Normal", "Tumour", "Total")) |
Variances_original_PXD004873$p_cv +
labs(title = "PXD004873", subtitle = "(Original)") +
theme(legend.position = "none", legend.title=element_blank()) +
scale_x_discrete(labels=c("Normal", "Tumour", "Total" )) )/
(Variances_reanalysis_PXD014194$p_cv + labs(title = "PXD014194", subtitle = "(Reanalysis)") + theme(legend.position = "none") |
Variances_original_PXD014194$p_cv + labs(title = "PXD014194", subtitle = "(Original)") + theme(legend.position = "none", legend.title=element_blank()) ) /
plot_annotation(tag_levels = 'A', title = 'Coefficient of variation in technical replicates')
ggsave(
"dia_paper_cv_panel_top3update.pdf",
plot = panel_cv,
device = "pdf",
scale = 1,
width = 38,
height = 38,
units = "cm" ,
dpi = 300,
limitsize = TRUE
)
Variances_reanalysis_PXD004691 <- analyse_cv(ours_PXD004691() %>% filter(feature_missingrate_per_group < 50) )
# No reproduction of variance from original for PXD004691 possible, data starts at sample level (tech_rep already merged)
source("FC_variance_results_datacarpentry.R")
source("../container/postprocess/DIA_postprocess_variation.R")
source("../container/postprocess/codify_study_customisations.R")
source("../container/postprocess/codify_originalresult_integration.R")
pxds <- c("PXD003497","PXD014194","PXD004873")
for (p in pxds ){
print(p)
df1 <- get(paste("ours_1_1_top3_",p,sep=""))() %>% filter(feature_missingrate_per_group < 50)
assign(paste("Variances_reanalysis_top3",p,sep="_"), analyse_cv(df1))
df2 <- get(paste("theirs_",p,sep=""))() %>% rename(NormLogIntensities = LogIntensities) # we have to assume their intensities are normalised and filtered
assign(paste("Variances_original",p,sep="_"), analyse_cv(df2))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment