plot_volcano: Volcano plot

View source: R/TwoPart_MultiMS.R

plot_volcanoR Documentation

Volcano plot

Description

Function plots fold changes and p-values as a volcano plot. Two lines are plotted for the p-value cutoff at p = PV_cutoff (solid line) and p = 0.1 (dashed line).

Usage

plot_volcano(FC, PV, FC_cutoff = 2, PV_cutoff = 0.05, figtitle = "")

Arguments

FC

vector of fold changes

PV

vctor of p-values, same lenght as FC

FC_cutoff

fold change cutoff where to draw vertical cutoff lines, default = 2

PV_cutoff

p-value cutoff where to draw a horisontal cutoff line, default ==.05

figtitle

title to display at the top of the figure, default = ”

Value

Nil

Examples

data(mm_peptides)
head(mm_peptides)
intsCols = 8:13 # different from parameter names as
                # R uses outer name spaces if variable is undefined
metaCols = 1:7
m_logInts = make_intencities(mm_peptides, intsCols)
m_prot.info = make_meta(mm_peptides, metaCols)
m_logInts = convert_log2(m_logInts)

# Normalize data
grps = as.factor(c('CG','CG','CG', 'mCG','mCG','mCG'))

set.seed(123) 
mm_m_ints_eig1 = eig_norm1(m=m_logInts,treatment=grps,prot.info=m_prot.info)
mm_m_ints_eig1$h.c # check the number of bias trends detected

# Impute missing values
mm_m_ints_norm = eig_norm2(rv=mm_m_ints_eig1)
mm_prot.info = mm_m_ints_norm$normalized[,1:7]
mm_norm_m =  mm_m_ints_norm$normalized[,8:13]

set.seed(125) # needed for reproducibility of imputation
imp_mm = MBimpute(mm_norm_m, grps, prot.info=mm_prot.info,
                  pr_ppos=2, my.pi=0.05, compute_pi=FALSE)
DE_res = peptideLevel_DE(imp_mm$y_imputed, grps, imp_mm$imp_prot.info,
                         pr_ppos=2)
plot_volcano(DE_res$FC, DE_res$BH_P_val, FC_cutoff=1.5,
             PV_cutoff=.05, figtitle='Mouse DE')

YuliyaLab/ProteoMM documentation built on April 19, 2022, 8:12 a.m.