Commit 5f19fc04 authored by Mathias Walzer's avatar Mathias Walzer
Browse files

update after switch to top3 inference

parent cf649be7
......@@ -113,25 +113,3 @@ 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')
......@@ -48,18 +48,3 @@ ggsave(
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))
}
source("../container/downstream/DIA_downstream_datacarpentry.R")
# must start with ours_...
#FDR 1%, 'all' inference
# PXD004691
ours_all_PXD004691 <- function(groups, norm="median"){
annot <- read.delim("../inputs/annotations/PXD004691_annotation_corrected.txt")
rda <- "../inputs/rdas/fdr1_all_inference/PXD004691_corrected.rda"
load(rda)
if(missing(groups)) {
groups <- as.character((goldstandard.proposed$RunlevelData %>% distinct(GROUP_ORIGINAL))$GROUP_ORIGINAL)
}
our<-goldstandard.proposed$RunlevelData %>%
clean_protein_names() %>%
group_consistency(annot) %>%
filter(GROUP_ORIGINAL %in% groups) %>%
{if(norm == "median") run_median_norm(.) else .} %>%
{if(norm == "quantile") run_quantile_norm(.) else .} %>%
{if(norm == "zscore") run_zscore_norm(.) else .} %>%
{if(norm == "minmax") run_minmax_norm(.) else .} %>%
dplyr::full_join(annot, by = c("originalRUN" = "Run")) %>%
dplyr::select(Protein,LogIntensities,matches("NormLogIntensities"),originalRUN,GROUP_ORIGINAL,SUBJECT_ORIGINAL,
feature_missingrate_per_group,feature_missingrate_per_run,technical_replicate) %>%
dplyr::ungroup()
}
# PXD000672
ours_all_PXD000672 <- function(groups, norm="median"){
annot <- read.delim("../inputs/annotations/PXD000672_annotation_corrected.txt")
rda <- "../inputs/rdas/fdr1_all_inference/PXD000672_corrected.rda"
load(rda)
if(missing(groups)) {
groups <- as.character((goldstandard.proposed$RunlevelData %>% distinct(GROUP_ORIGINAL))$GROUP_ORIGINAL)
}
our<-goldstandard.proposed$RunlevelData %>%
clean_protein_names() %>%
group_consistency(annot) %>%
dplyr::mutate(GROUP_ORIGINAL = str_trim(GROUP_ORIGINAL)) %>% # needs to be after groups filter BUT BEWARE! groups argument must be original names (incl. trailing whitespaces)
dplyr::filter(GROUP_ORIGINAL %in% groups) %>%
{if(norm == "median") run_median_norm(.) else .} %>%
{if(norm == "quantile") run_quantile_norm(.) else .} %>%
{if(norm == "zscore") run_zscore_norm(.) else .} %>%
{if(norm == "minmax") run_minmax_norm(.) else .} %>%
dplyr::full_join(annot, by = c("originalRUN" = "Run")) %>%
dplyr::select(Protein,LogIntensities,matches("NormLogIntensities"),originalRUN,GROUP_ORIGINAL,SUBJECT_ORIGINAL,
feature_missingrate_per_group,feature_missingrate_per_run) %>%
dplyr::ungroup()
}
# PXD014943
ours_all_PXD014943 <- function(groups, norm="median"){
annot <- read.delim("../inputs/annotations/PXD014943_annotation_corrected_norecalc.txt")
rda <- "../inputs/rdas/fdr1_all_inference/PXD014943.rda"
load(rda)
if(missing(groups)) {
groups <- as.character((goldstandard.proposed$RunlevelData %>% distinct(GROUP_ORIGINAL))$GROUP_ORIGINAL)
}
our<-goldstandard.proposed$RunlevelData %>%
clean_protein_names() %>%
group_consistency(annot) %>%
filter(GROUP_ORIGINAL %in% groups) %>%
{if(norm == "median") run_median_norm(.) else .} %>%
{if(norm == "quantile") run_quantile_norm(.) else .} %>%
{if(norm == "zscore") run_zscore_norm(.) else .} %>%
{if(norm == "minmax") run_minmax_norm(.) else .} %>%
full_join(annot, by = c("originalRUN" = "Run")) %>%
dplyr::select(Protein,LogIntensities,matches("NormLogIntensities"),originalRUN,GROUP_ORIGINAL,SUBJECT_ORIGINAL,
feature_missingrate_per_group,feature_missingrate_per_run) %>%
ungroup()
}
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