Commit 9eeac727 authored by Lena Hersemann's avatar Lena Hersemann

added peptide intensities of STANDARDs (boxplot and heatmap); corrected data...

added peptide intensities of STANDARDs (boxplot and heatmap); corrected data plotting with scale_y_log10 and now use intensities+1 to make sure we do not lose the zero intensities; added export of top10 LFQs per sample
parent 94c80e1e
......@@ -151,7 +151,7 @@ init_stat %>% select(GROUP, unique_entry, biased_entry, scrap_prop_unique, scrap
filter(direction) %>%
mutate(GROUP = str_replace(GROUP, ".proteinGroups.txt", "")) %>%
na.omit() %>%
ggplot(aes(feature, lfq_intensity, fill = feature)) +
ggplot(aes(feature, lfq_intensity+1, fill = feature)) +
geom_boxplot() +
# geom_violin() +
scale_y_log10() +
......@@ -172,7 +172,7 @@ init_stat %>% select(GROUP, unique_entry, biased_entry, scrap_prop_unique, scrap
mutate(sample = str_replace(sample, "lfq_intensity_", "") %>% str_replace_all(., oldNames, newNames),
GROUP = str_replace(GROUP, ".proteinGroups.txt", "") %>% str_replace_all(., oldNames, newNames)) %>%
na.omit() %>%
ggplot(aes(feature, lfq_intensity, fill = feature)) +
ggplot(aes(feature, lfq_intensity+1, fill = feature)) +
geom_boxplot() +
# geom_violin() +
scale_y_log10() +
......@@ -182,7 +182,10 @@ init_stat %>% select(GROUP, unique_entry, biased_entry, scrap_prop_unique, scrap
scale_fill_manual(values=c("coral3", "coral1", "cadetblue3", "cadetblue")) +
facet_wrap(~GROUP + sample)
#'
#' <br><br>
#'
#' ### LFQ and raw intensities of STANDARDS on protein level
rbind(init_stat %>% filter(str_detect(protein_ids, "STANDARD")) %>%
select(starts_with("lfq_intensity")) %>%
gather(sample, intensities) %>% na.omit() %>%
......@@ -191,7 +194,33 @@ rbind(init_stat %>% filter(str_detect(protein_ids, "STANDARD")) %>%
select(starts_with("intensity_")) %>%
gather(sample, intensities) %>% na.omit() %>%
mutate(sample = str_replace(sample, "lfq_intensity_", ""), feature = "raw intensities")
) %>% ggplot(aes(feature, intensities)) + geom_boxplot() + ggtitle("Intensities of STANDARDs")
) %>% ggplot(aes(feature, intensities)) + geom_boxplot()
#'
#' <br><br>
#'
#' ### LFQ and raw intensities of STANDARDS on peptide level
pepFiles <- list.files(ms_data_folder, pattern = "peptides.txt", full = TRUE)
std_info = pepFiles %>%
map(~ read_tsv(.x) %>% pretty_columns() %>%
select(proteins, sequence, matches("^lfq_intensity_"), matches("^intensity_")) %>%
filter(str_detect(proteins, "STANDARD"))) %>%
setNames(basename(pepFiles)) %>%
map_df(~ gather(.x, feature, intensity, contains("intensity")) %>%
separate(feature, c("type", "sample"), sep = "sity_"), .id = 'GROUP') %>%
mutate(sample = str_replace_all(sample, oldNames, newNames), type = str_replace(type, "inten", "intensity"))
print("STANDARD intensities on peptide level are available for the following samples:")
unique(std_info$sample)
std_info %>% ggplot(aes(sample, intensity, fill = type)) + geom_boxplot() + coord_flip()
std_info %>%
ggplot(aes(sample, sequence, fill = intensity)) + geom_tile() + facet_wrap(~type) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# init_stat %>% select(GROUP, protein_ids, unique_entry, biased_entry, scrap_prop_unique, scrap_prop_biased, matches("lfq_intensity")) %>%
......@@ -372,7 +401,7 @@ grid.arrange(p1, p2, nrow = 1)
protsData %>% ggplot(aes(intensity)) + geom_histogram(fill = "lightcyan4") + scale_x_log10() + ggtitle("LFQ intensities") + facet_wrap(~sample)
protsData %>% ggplot(aes(sample, intensity)) + geom_boxplot(fill = "lightcyan4") + ggtitle("LFQ intensities") + scale_y_log10() + coord_flip()
protsData %>% ggplot(aes(sample, intensity+1)) + geom_boxplot(fill = "lightcyan4") + ggtitle("LFQ intensities") + scale_y_log10() + coord_flip()
## when using linear scale, we discard 0s to avoid biases means
protsData %>% filter(intensity>0) %>% ggplot(aes(sample, intensity)) +
......@@ -407,6 +436,7 @@ if("identification_type" %in% colnames(heg_data) == FALSE){
d3 <- d1 + geom_point(aes(order, intensity, shape = identification_type), fill = "black") + scale_shape_manual(values=c(20, 1)) + facet_wrap(~sample, scales="free", ncol = 2) + ggtitle("LFQ intensities of top 10 proteins per sample - different scale")
}
write_tsv(heg_data, path=add_prefix("top10_lfq.txt"))
#+ fig.height=length(unique(heg_data$sample))/2+5, eval=length(unique(heg_data$sample))>0
d2
......
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