{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE)
library(rsconnect)
library(Biobase)
library(SafeQuant)
library(Ringo)
library(dplyr)
library(ggplot2)
ko_wt<- `Phospho.(STY)Sites`
#View(ko_wt)
ko_wt$Positions.within.proteins <- NULL
#cols.dont.want <- c("Leading.proteins", "Protein", 'Fasta.headers', 'Localization.prob','Score.diff','PEP','Delta.score','Score.for.localization')
#ko_wt <- ko_wt[, ! names(ko_wt) %in% cols.dont.want, drop = F]
columnsYES <- as.vector(c('Proteins','Score','Localization.prob.KO','Localization.prob.WT', 'Number.of.Phospho..STY.','Amino.acid','Charge','Intensity','Reverse','Potential.contaminant','Protein.group.IDs'))
ko_wt <- ko_wt[ ,columnsYES]
ko_wt
#columnsYES
filterdScore <- filter(ko_wt,
Score > 40)
filterdScore [ ! filterdScore$Reverse %in% '+', ]
filterdScore [ ! filterdScore$Potential.contaminant %in% '+', ]
plot(row.names(filterdScore), filterdScore$Localization.prob.WT)
tfs<- sqrt(filterdScore$Intensity)
qqnorm(filterdScore$Intensity )
qqnorm(tfs)
qqplot( filterdScore$Intensity,tfs)
library(readxl)
PS <- read_excel("N:/TSever/20181218_vsaka_frakcija_scx_posebaj_kidney_ko+wt/combined/txt/Phospho (STY)Sites.xlsx")
#View(PS)
library(readr)
Phospho_STY_Sites <- read_delim("N:/TSever/20181218_vsaka_frakcija_scx_posebaj_kidney_ko+wt/combined/txt/Phospho (STY)Sites.txt",
"\t", escape_double = FALSE, trim_ws = TRUE)
#View(Phospho_STY_Sites)
KO_005 <-rowMeans(Phospho_STY_Sites[c('Intensity KO_005' )])
ggplot(Phospho_STY_Sites, aes(Phospho_STY_Sites$`Intensity WT_000`)) +
geom_histogram()
a <- data.frame(intensity = c(0, 0, 192040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 348255787, 0, 0, 0, 0, 0, 715160, 0, 0, 5337080, 0, 0, 0, 0, 0))
a[,2]<- c('Intensity KO_005', 'Intensity KO_010', 'Intensity KO_015', 'Intensity KO_020', 'Intensity KO_025', 'Intensity KO_030', 'Intensity KO_035', 'Intensity KO_040', 'Intensity KO_045', 'Intensity KO_050','Intensity KO_060', 'Intensity KO_070', 'Intensity KO_080', 'Intensity KO_090', 'Intensity KO_100', 'Intensity WT_000', 'Intensity Wt_010', 'Intensity WT_015', 'Intensity WT_020', 'Intensity WT_025', 'Intensity WT_030', 'Intensity WT_035', 'Intensity WT_040', 'Intensity WT_045', 'Intensity WT_050', 'Intensity WT_060', 'Intensity WT_070', 'Intensity WT_080', 'Intensity WT_090', 'Intensity WT_100')
Phospho_STY_Sites2<- filter(Phospho_STY_Sites,
Score > 40)
Phospho_STY_Sites2<- filter(Phospho_STY_Sites2,
`Localization prob` > 0.75)
Phospho_STY_Sites2 [ ! Phospho_STY_Sites2$Reverse %in% '+', ]
Phospho_STY_Sites2 [ ! Phospho_STY_Sites2$`Potential contaminant` %in% '+', ]
wt000<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_000`, 1:length(Score))) +
geom_point(color='#77b800', size=2)+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:88),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
plot(Phospho_STY_Sites2$`Intensity WT_000`, 1:88)
wt050<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_050`, 1:length(Score))) +
geom_point(color='#77b800')+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt010<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_010`, 1:length(Score))) +
geom_point(color='#77b800', size=2)+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt015<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_015`, 1:length(Score))) +
geom_point(color='#77b800', size=2)+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt_unique<-c(
length(unique(c(Phospho_STY_Sites2$`Intensity WT_000`))),
1,
length(unique(c(Phospho_STY_Sites2$`Intensity Wt_010`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_015`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_020`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_025`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_030`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_035`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_040`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_045`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_050`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_060`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_070`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_080`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_090`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_100`)))
)-1
ko_unique<-c(
1,
length(unique(c(Phospho_STY_Sites2$`Intensity KO_005`))),
length(unique(c(Phospho_STY_Sites2$`Intensity KO_010`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_015`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_020`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_025`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_030`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_035`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_040`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_045`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_050`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_060`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_070`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_080`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_090`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_100`)))
)-1
ggplot()+
geom_bar(stat='identity',
aes(1:length(wt_unique),wt_unique), fill='#00cfcf', alpha=0.5, size=1.5)+
geom_bar(stat='identity',
aes(1:length(wt_unique),ko_unique), fill='#cf0000', alpha=0.5, size=1.5)+
theme_light()+
scale_x_continuous(breaks = c(1:length(ko_unique)),
labels=c('0 M','0.05 M','0.10 M','0.15 M', '0.20 M', '0.25 M', '0.30 M', '0.35 M', '0.40 M', '0.45 M', '0.50 M', '0.60 M', '0.70 M', '0.80 M', '0.90 M',' 1 M' ))+
labs(x='NaCl fraction', y='number of proteins')+
theme(legend.position = 'right')+
ggtitle('number of phophoprylated protein in each scx fraction')+
ylim(0,90)+
theme(plot.title = element_text(hjust=0.5))+
geom_rect(aes(xmin=13, xmax=16, ymin=60,ymax=83),color='#000000', fill='#ffffff', alpha=1)+
geom_rect(aes(xmin=13.5, xmax=14, ymin=63,ymax=66),color='#000000', fill='#00cfcf', alpha=0.5)+
geom_rect(aes(xmin=13.5, xmax=14, ymin=70,ymax=73),color='#000000', fill='#cf0000', alpha=0.5)+
geom_rect(aes(xmin=13.5, xmax=14, ymin=77,ymax=80),color='#000000', fill='#844B4B', alpha=0.5)+
annotate("text", x = 15, y = 65, label = "WT",color='#000000')+
annotate("text", x = 15, y = 72, label = "KO",color='#000000')+
annotate("text", x = 15, y = 79, label = "overlap",color='#000000')+
theme(axis.text.x=element_text(angle=45, hjust=1))