plotFitCurve {DEqMS}R Documentation

plot the fitted prior variance against the number of quantified peptides or PSMs

Description

This function is to plot the fitted prior variance against the number of quantified peptides/PSMs.

Usage

plotFitCurve(fit,fit.method="loess",type="boxplot",xlab="",main="")

Arguments

fit

an list object produced by spectraCounteBayes function

fit.method

the method used to fit prior variance against the number of peptides. default loess.

type

an character indicating the type of plot to be generated. options are boxplot and scatterplot. default is boxplot

xlab

the title for x axis

main

the title for the figure

Value

return a plot graphic

Author(s)

Yafeng Zhu

Examples

library(ExperimentHub)
eh = ExperimentHub()
query(eh, "DEqMS")
dat.psm = eh[["EH1663"]]

dat.psm.log = dat.psm
dat.psm.log[,3:12] =  log2(dat.psm[,3:12])

dat.gene.nm = medianSweeping(dat.psm.log,group_col = 2)
    
psm.count.table = as.data.frame(table(dat.psm$gene)) # generate PSM count table
rownames(psm.count.table)=psm.count.table$Var1
    
cond = c("ctrl","miR191","miR372","miR519","ctrl",
"miR372","miR519","ctrl","miR191","miR372")

sampleTable <- data.frame(
row.names = colnames(dat.psm)[3:12],
cond = as.factor(cond)
)
    
gene.matrix = as.matrix(dat.gene.nm)
design = model.matrix(~cond,sampleTable)

fit1 <- eBayes(lmFit(gene.matrix,design))
# add PSM count for each gene
fit1$count <- psm.count.table[rownames(fit1$coefficients),2]  

fit2 = spectraCounteBayes(fit1)
    
plotFitCurve(fit2,type="boxplot",xlab="PSM count",
main="TMT data PXD004163")

[Package DEqMS version 1.0.1 Index]