Skip to content
Snippets Groups Projects
Commit cb851e4b authored by Melisande Blein-Nicolas's avatar Melisande Blein-Nicolas
Browse files

[mcq.plot.peptide.intensity] modif pour que des trous apparaissent quand il y a des NA

parent f20f76e7
No related branches found
No related tags found
No related merge requests found
......@@ -77,24 +77,36 @@ mcq.plot.peptide.intensity<- function (object, flist=NULL, rCutoff = 0.5, nprot=
bad.cor=NULL
no.corr=NULL
tab.na=c(q=NA, combiFact=NA, peptiz=NA, protein=NA)
for (i in 1:length(protok)){
sub <- tab[tab$protein %in% protok[i],]
count=table(sub$peptiz)
no.corr=c(no.corr,names(count[count<5])) # the correlation is not computed for peptiz with less than 5 occurrences
sub=sub[!sub$peptiz %in% no.corr,]
matpep=tapply(sub$q,list(as.character(sub$peptiz), sub[,"combiFact"]),FUN=mean,na.rm=T)
count <- table(sub$peptiz)
no.corr <- c(no.corr,names(count[count<5])) # the correlation is not computed for peptiz with less than 5 occurrences
sub <- sub[!sub$peptiz %in% no.corr,]
matpep <- tapply(sub$q,list(as.character(sub$peptiz), sub[,"combiFact"]),FUN=mean,na.rm=T)
temp <-stack(as.data.frame(matpep))
temp$peptiz <-rep(rownames(matpep), ncol(matpep))
temp$protein <- protok[i]
temp <- temp[which(is.na(temp$values)),]
colnames(temp)[1:2]=c("q", "combiFact")
tab.na=rbind.data.frame(tab.na, temp)
ccc=cor(t(matpep),use="pairwise.complete.obs")
ccc=ccc*(col(ccc)!=row(ccc)) # sans la bissectrice
max.cor=apply(ccc,1,max, na.rm=TRUE)
bad.cor=c(bad.cor,names(max.cor[max.cor<rCutoff]))
}
sub <- tab[tab$protein %in% protok,]
tab.na <- tab.na[-1, ]
tab.na$imputed <- "not imputed"
sub <- tab[tab$protein %in% protok, ]
sub$imputed <-"not imputed"
sub$imputed[which(is.na(sub$nirank))]="imputed"
sub <- sub[, c("q", "combiFact", "peptiz", "protein", "imputed")]
sub <- rbind.data.frame(sub, tab.na)
sub$bad.cor="correlated"
sub$bad.cor[sub$peptiz %in% bad.cor]="uncorrelated"
sub$bad.cor[sub$peptiz %in% no.corr]="not tested"
sub$imputed="not imputed"
sub$imputed[which(is.na(sub$nirank))]="imputed"
if (scale==TRUE){
mean.pep=ddply(sub, "peptiz", summarize, mean.int=mean(q))
......
......@@ -93,7 +93,7 @@ Number of NA values : 180167
normalized_filtered_xic = mcq.drop.shared.peptides(normalized_filtered_xic)
mcq.plot.peptide.reproducibility(normalized_filtered_xic, file="./output/repro.pdf")
normalized_filtered_xic = mcq.drop.unreproducible.peptides(normalized_filtered_xic, method="percent", percentNA=0.1)
my_proteins= mcq.plot.peptide.intensity(normalized_filtered_xic, rCutoff=0.5, nprot=6, getProtlist=TRUE)
my_proteins= mcq.plot.peptide.intensity(normalized_filtered_xic, rCutoff=0.5, nprot=3, getProtlist=TRUE)
mcq.plot.peptide.intensity(normalized_filtered_xic, rCutoff=0.5, protlist=my_proteins, file="./output/pep_cor5.pdf")
mcq.plot.peptide.intensity(normalized_filtered_xic, rCutoff=0.3, protlist=my_proteins, file="./output/pep_cor3.pdf")
normalized_filtered_xic = mcq.drop.uncorrelated.peptides(normalized_filtered_xic, rCutoff=0.3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment