Contents

Package: RforProteomics
Authors: Authors: Laurent Gatto, Lisa Breckels and Sebastian Gibb
Last compiled: Wed Apr 26 10:04:57 2017
Last modified: 2017-04-24 16:39:10

1 Introduction

This vignette illustrates existing and Bioconductor infrastructure for the visualisation of mass spectrometry and proteomics data. The code details the visualisations presented in

Gatto L, Breckels LM, Naake T, Gibb S. Visualisation of proteomics data using R and Bioconductor. Proteomics. 2015 Feb 18. doi: 10.1002/pmic.201400392. PubMed PMID: 25690415.

1.1 References

1.2 Relevant packages

There are currently 93 Proteomics and 63 MassSpectrometry packages in Bioconductor version 3.5. Other non-Bioconductor packages are described in the RforProteomics vignette.

Package Title Version
ASEB ASEB Predict Acetylated Lysine Sites 1.20.0
bioassayR bioassayR Cross-target analysis of small molecule bioactivity 1.14.0
biobroom biobroom Turn Bioconductor objects into tidy data frames 1.8.0
BioMedR BioMedR Generating Various Molecular Representations for Chemicals, Proteins, DNAs/RNAs and Their Interactions 1.0.0
biosigner biosigner Signature discovery from omics data 1.4.0
BRAIN BRAIN Baffling Recursive Algorithm for Isotope distributioN calculations 1.22.0
Cardinal Cardinal A mass spectrometry imaging toolbox for statistical analysis 1.8.0
CausalR CausalR Causal network analysis methods 1.8.0
CellNOptR CellNOptR Training of boolean logic models of signalling networks using prior knowledge networks and perturbation data. 1.22.0
ChemmineOB ChemmineOB R interface to a subset of OpenBabel functionalities 1.14.0
ChemmineR ChemmineR Cheminformatics Toolkit for R 2.28.0
cisPath cisPath Visualization and management of the protein-protein interaction networks. 1.16.0
cleaver cleaver Cleavage of Polypeptide Sequences 1.14.0
clippda clippda A package for the clinical proteomic profiling data analysis 1.26.0
CNORdt CNORdt Add-on to CellNOptR: Discretized time treatments 1.18.0
CNORfeeder CNORfeeder Integration of CellNOptR to add missing links 1.16.0
CNORode CNORode ODE add-on to CellNOptR 1.18.0
customProDB customProDB Generate customized protein database from NGS data, with a focus on RNA-Seq data, for proteomics search 1.16.0
cydar cydar Using Mass Cytometry for Differential Abundance Analyses 1.0.0
DAPAR DAPAR Tools for the Differential Analysis of Proteins Abundance with R 1.8.0
deltaGseg deltaGseg deltaGseg 1.16.0
EGSEA EGSEA Ensemble of Gene Set Enrichment Analyses 1.4.0
eiR eiR Accelerated similarity searching of small molecules 1.16.0
EWCE EWCE Expression Weighted Celltype Enrichment 1.3.0
fCI fCI f-divergence Cutoff Index for Differential Expression Analysis in Transcriptomics and Proteomics 1.6.0
fmcsR fmcsR Mismatch Tolerant Maximum Common Substructure Searching 1.18.0
GraphPAC GraphPAC Identification of Mutational Clusters in Proteins via a Graph Theoretical Approach. 1.18.0
hpar hpar Human Protein Atlas in R 1.18.0
iPAC iPAC Identification of Protein Amino acid Clustering 1.20.0
IPPD IPPD Isotopic peak pattern deconvolution for Protein Mass Spectrometry by template matching 1.24.0
isobar isobar Analysis and quantitation of isobarically tagged MSMS proteomics data 1.22.0
kimod kimod A k-tables approach to integrate multiple Omics-Data 1.4.0
LPEadj LPEadj A correction of the local pooled error (LPE) method to replace the asymptotic variance adjustment with an unbiased adjustment based on sample size. 1.36.0
MassSpecWavelet MassSpecWavelet Mass spectrum processing by wavelet-based algorithms 1.42.0
MSGFgui MSGFgui A shiny GUI for MSGFplus 1.10.0
MSGFplus MSGFplus An interface between R and MS-GF+ 1.10.0
msmsEDA msmsEDA Exploratory Data Analysis of LC-MS/MS data by spectral counts 1.14.0
msmsTests msmsTests LC-MS/MS Differential Expression Tests 1.14.0
MSnbase MSnbase Base Functions and Classes for Mass Spectrometry and Proteomics 2.2.0
MSnID MSnID Utilities for Exploration and Assessment of Confidence of LC-MSn Proteomics Identifications 1.10.0
mzID mzID An mzIdentML parser for R 1.14.0
mzR mzR parser for netCDF, mzXML, mzData and mzML and mzIdentML files (mass spectrometry data) 2.10.0
PAA PAA PAA (Protein Array Analyzer) 1.10.0
PAnnBuilder PAnnBuilder Protein annotation data package builder 1.40.0
Path2PPI Path2PPI Prediction of pathway-related protein-protein interaction networks 1.6.0
pathview pathview a tool set for pathway based data integration and visualization 1.16.0
Pbase Pbase Manipulating and exploring protein and proteomics data 0.16.0
PCpheno PCpheno Phenotypes and cellular organizational units 1.38.0
PECA PECA Probe-level Expression Change Averaging 1.12.0
pepXMLTab pepXMLTab Parsing pepXML files and filter based on peptide FDR. 1.10.0
PGA PGA An package for identification of novel peptides by customized database derived from RNA-Seq 1.6.0
pgca pgca PGCA: An Algorithm to Link Protein Groups Created from MS/MS Data 1.0.0
phosphonormalizer phosphonormalizer Compensates for the bias introduced by median normalization in phosphoproteomics 1.0.0
plgem plgem Detect differential expression in microarray and proteomics datasets with the Power Law Global Error Model (PLGEM) 1.48.0
PLPE PLPE Local Pooled Error Test for Differential Expression with Paired High-throughput Data 1.36.0
ppiStats ppiStats Protein-Protein Interaction Statistical Package 1.42.0
proBAMr proBAMr Generating SAM file for PSMs in shotgun proteomics data 1.10.0
PROcess PROcess Ciphergen SELDI-TOF Processing 1.52.0
procoil procoil Prediction of Oligomerization of Coiled Coil Proteins 2.4.0
ProCoNA ProCoNA Protein co-expression network analysis (ProCoNA). 1.14.0
proFIA proFIA Preprocessing of FIA-HRMS data 1.2.0
pRoloc pRoloc A unifying bioinformatics framework for spatial proteomics 1.16.0
pRolocGUI pRolocGUI Interactive visualisation of spatial proteomics data 1.10.0
Prostar Prostar Provides a GUI for DAPAR 1.8.0
prot2D prot2D Statistical Tools for volume data from 2D Gel Electrophoresis 1.14.0
ProteomicsAnnotationHubData ProteomicsAnnotationHubData Transform public proteomics data resources into Bioconductor Data Structures 1.6.0
proteoQC proteoQC An R package for proteomics data quality control 1.11.0
ProtGenerics ProtGenerics S4 generic functions for Bioconductor proteomics infrastructure 1.8.0
Pviz Pviz Peptide Annotation and Data Visualization using Gviz 1.10.0
qcmetrics qcmetrics A Framework for Quality Control 1.14.0
QuartPAC QuartPAC Identification of mutational clusters in protein quaternary structures. 1.8.0
rain rain Rhythmicity Analysis Incorporating Non-parametric Methods 1.10.0
RankProd RankProd Rank Product method for identifying differentially expressed genes with application in meta-analysis 3.2.0
RCASPAR RCASPAR A package for survival time prediction based on a piecewise baseline hazard Cox regression model. 1.22.0
Rchemcpp Rchemcpp Similarity measures for chemical compounds 2.14.0
Rcpi Rcpi Molecular Informatics Toolkit for Compound-Protein Interaction in Drug Discovery 1.12.0
readat readat Functionality to Read and Manipulate SomaLogic ADAT files 1.2.0
ropls ropls PCA, PLS(-DA) and OPLS(-DA) for multivariate analysis and feature selection of omics data 1.8.0
ROTS ROTS Reproducibility-Optimized Test Statistic 1.4.0
RpsiXML RpsiXML R interface to PSI-MI 2.5 files 2.18.0
rpx rpx R Interface to the ProteomeXchange Repository 1.12.0
rTANDEM rTANDEM Interfaces the tandem protein identification algorithm in R 1.16.0
sapFinder sapFinder A package for variant peptides detection and visualization in shotgun proteomics. 1.14.0
ScISI ScISI In Silico Interactome 1.48.0
shinyTANDEM shinyTANDEM Provides a GUI for rTANDEM 1.14.0
SLGI SLGI Synthetic Lethal Genetic Interaction 1.36.0
SpacePAC SpacePAC Identification of Mutational Clusters in 3D Protein Space via Simulation. 1.14.0
specL specL specL - Prepare Peptide Spectrum Matches for Use in Targeted Proteomics 1.10.0
spliceSites spliceSites A bioconductor package for exploration of alignment gap positions from RNA-seq data 1.24.0
SWATH2stats SWATH2stats Transform and Filter SWATH Data for Statistical Packages 1.6.0
synapter synapter Label-free data analysis pipeline for optimal identification and quantitation 2.0.0
tofsims tofsims Import, process and analysis of Time-of-Flight Secondary Ion Mass Spectrometry (ToF-SIMS) imaging data 1.4.0
TPP TPP Analyze thermal proteome profiling (TPP) experiments 3.4.0
Package Title Version
apComplex apComplex Estimate protein complex membership using AP-MS protein data 2.42.0
BRAIN BRAIN Baffling Recursive Algorithm for Isotope distributioN calculations 1.22.0
CAMERA CAMERA Collection of annotation related methods for mass spectrometry data 1.32.0
Cardinal Cardinal A mass spectrometry imaging toolbox for statistical analysis 1.8.0
CATALYST CATALYST Cytometry dATa anALYSis Tools 1.0.0
cosmiq cosmiq cosmiq - COmbining Single Masses Into Quantities 1.10.0
customProDB customProDB Generate customized protein database from NGS data, with a focus on RNA-Seq data, for proteomics search 1.16.0
DAPAR DAPAR Tools for the Differential Analysis of Proteins Abundance with R 1.8.0
flagme flagme Analysis of Metabolomics GC/MS Data 1.32.0
gaga gaga GaGa hierarchical model for high-throughput data analysis 2.22.0
iontree iontree Data management and analysis of ion trees from ion-trap mass spectrometry 1.22.0
IPO IPO Automated Optimization of XCMS Data Processing parameters 1.2.0
isobar isobar Analysis and quantitation of isobarically tagged MSMS proteomics data 1.22.0
LOBSTAHS LOBSTAHS Lipid and Oxylipin Biomarker Screening through Adduct Hierarchy Sequences 1.2.0
MAIT MAIT Statistical Analysis of Metabolomic Data 1.9.0
MassArray MassArray Analytical Tools for MassArray Data 1.28.0
MassSpecWavelet MassSpecWavelet Mass spectrum processing by wavelet-based algorithms 1.42.0
Metab Metab Metab: An R Package for a High-Throughput Analysis of Metabolomics Data Generated by GC-MS. 1.10.0
metabomxtr metabomxtr A package to run mixture models for truncated metabolomics data with normal or lognormal distributions 1.10.0
metaMS metaMS MS-based metabolomics annotation pipeline 1.12.0
MetCirc MetCirc Navigating mass spectral similarity in high-resolution MS/MS metabolomics data 1.2.0
MSGFgui MSGFgui A shiny GUI for MSGFplus 1.10.0
MSGFplus MSGFplus An interface between R and MS-GF+ 1.10.0
msmsEDA msmsEDA Exploratory Data Analysis of LC-MS/MS data by spectral counts 1.14.0
msmsTests msmsTests LC-MS/MS Differential Expression Tests 1.14.0
MSnbase MSnbase Base Functions and Classes for Mass Spectrometry and Proteomics 2.2.0
MSnID MSnID Utilities for Exploration and Assessment of Confidence of LC-MSn Proteomics Identifications 1.10.0
msPurity msPurity Automated Evaluation of Precursor Ion Purity for Mass Spectrometry Based Fragmentation in Metabolomics 1.2.0
mzID mzID An mzIdentML parser for R 1.14.0
mzR mzR parser for netCDF, mzXML, mzData and mzML and mzIdentML files (mass spectrometry data) 2.10.0
PAPi PAPi Predict metabolic pathway activity based on metabolomics data 1.16.0
Pbase Pbase Manipulating and exploring protein and proteomics data 0.16.0
pepXMLTab pepXMLTab Parsing pepXML files and filter based on peptide FDR. 1.10.0
PGA PGA An package for identification of novel peptides by customized database derived from RNA-Seq 1.6.0
pgca pgca PGCA: An Algorithm to Link Protein Groups Created from MS/MS Data 1.0.0
plgem plgem Detect differential expression in microarray and proteomics datasets with the Power Law Global Error Model (PLGEM) 1.48.0
proBAMr proBAMr Generating SAM file for PSMs in shotgun proteomics data 1.10.0
PROcess PROcess Ciphergen SELDI-TOF Processing 1.52.0
proFIA proFIA Preprocessing of FIA-HRMS data 1.2.0
pRoloc pRoloc A unifying bioinformatics framework for spatial proteomics 1.16.0
Prostar Prostar Provides a GUI for DAPAR 1.8.0
proteoQC proteoQC An R package for proteomics data quality control 1.11.0
ProtGenerics ProtGenerics S4 generic functions for Bioconductor proteomics infrastructure 1.8.0
qcmetrics qcmetrics A Framework for Quality Control 1.14.0
Rdisop Rdisop Decomposition of Isotopic Patterns 1.36.0
Risa Risa Converting experimental metadata from ISA-tab into Bioconductor data structures 1.18.0
RMassBank RMassBank Workflow to process tandem MS files and build MassBank records 2.4.0
rols rols An R interface to the Ontology Lookup Service 2.4.0
ropls ropls PCA, PLS(-DA) and OPLS(-DA) for multivariate analysis and feature selection of omics data 1.8.0
rpx rpx R Interface to the ProteomeXchange Repository 1.12.0
rTANDEM rTANDEM Interfaces the tandem protein identification algorithm in R 1.16.0
sapFinder sapFinder A package for variant peptides detection and visualization in shotgun proteomics. 1.14.0
shinyTANDEM shinyTANDEM Provides a GUI for rTANDEM 1.14.0
SIMAT SIMAT GC-SIM-MS data processing and alaysis tool 1.8.0
specL specL specL - Prepare Peptide Spectrum Matches for Use in Targeted Proteomics 1.10.0
statTarget statTarget Statistical Analysis of Metabolite Profile 1.6.0
SWATH2stats SWATH2stats Transform and Filter SWATH Data for Statistical Packages 1.6.0
synapter synapter Label-free data analysis pipeline for optimal identification and quantitation 2.0.0
TargetSearch TargetSearch A package for the analysis of GC-MS metabolite profiling data 1.32.0
tofsims tofsims Import, process and analysis of Time-of-Flight Secondary Ion Mass Spectrometry (ToF-SIMS) imaging data 1.4.0
TPP TPP Analyze thermal proteome profiling (TPP) experiments 3.4.0
xcms xcms LC/MS and GC/MS Data Analysis 1.52.0
yamss yamss Tools for high-throughput metabolomics 1.2.0

2 Ascombe’s quartet

x1 x2 x3 x4 y1 y2 y3 y4
10 10 10 8 8.04 9.14 7.46 6.58
8 8 8 8 6.95 8.14 6.77 5.76
13 13 13 8 7.58 8.74 12.74 7.71
9 9 9 8 8.81 8.77 7.11 8.84
11 11 11 8 8.33 9.26 7.81 8.47
14 14 14 8 9.96 8.10 8.84 7.04
6 6 6 8 7.24 6.13 6.08 5.25
4 4 4 19 4.26 3.10 5.39 12.50
12 12 12 8 10.84 9.13 8.15 5.56
7 7 7 8 4.82 7.26 6.42 7.91
5 5 5 8 5.68 4.74 5.73 6.89
tab <- matrix(NA, 5, 4)
colnames(tab) <- 1:4
rownames(tab) <- c("var(x)", "mean(x)",
                   "var(y)", "mean(y)",
                   "cor(x,y)")

for (i in 1:4)
    tab[, i] <- c(var(anscombe[, i]),
                  mean(anscombe[, i]),
                  var(anscombe[, i+4]),
                  mean(anscombe[, i+4]),
                  cor(anscombe[, i], anscombe[, i+4]))
1 2 3 4
var(x) 11.0000000 11.0000000 11.0000000 11.0000000
mean(x) 9.0000000 9.0000000 9.0000000 9.0000000
var(y) 4.1272691 4.1276291 4.1226200 4.1232491
mean(y) 7.5009091 7.5009091 7.5000000 7.5009091
cor(x,y) 0.8164205 0.8162365 0.8162867 0.8165214

While the residuals of the linear regression clearly indicate fundamental differences in these data, the most simple and straightforward approach is visualisation to highlight the fundamental differences in the datasets.

ff <- y ~ x

mods <- setNames(as.list(1:4), paste0("lm", 1:4))

par(mfrow = c(2, 2), mar = c(4, 4, 1, 1))
for (i in 1:4) {
    ff[2:3] <- lapply(paste0(c("y","x"), i), as.name)
    plot(ff, data = anscombe, pch = 19, xlim = c(3, 19), ylim = c(3, 13))
    mods[[i]] <- lm(ff, data = anscombe)
    abline(mods[[i]])
}

lm1 lm2 lm3 lm4
0.0390000 1.1390909 -0.5397273 -0.421
-0.0508182 1.1390909 -0.2302727 -1.241
-1.9212727 -0.7609091 3.2410909 0.709
1.3090909 1.2690909 -0.3900000 1.839
-0.1710909 0.7590909 -0.6894545 1.469
-0.0413636 -1.9009091 -1.1586364 0.039
1.2393636 0.1290909 0.0791818 -1.751
-0.7404545 -1.9009091 0.3886364 0.000
1.8388182 0.1290909 -0.8491818 -1.441
-1.6807273 0.7590909 -0.0805455 0.909
0.1794545 -0.7609091 0.2289091 -0.111

3 The MA plot example

The following code chunk connects to the PXD000001 data set on the ProteomeXchange repository and fetches the mzTab file. After missing values filtering, we extract relevant data (log2 fold-changes and log10 mean expression intensities) into data.frames.

library("rpx")
px1 <- PXDataset("PXD000001")
mztab <- pxget(px1, "PXD000001_mztab.txt")
## Downloading 1 file
library("MSnbase")
## here, we need to specify the (old) mzTab version 0.9
qnt <- readMzTabData(mztab, what = "PEP", version = "0.9")
sampleNames(qnt) <- reporterNames(TMT6)
qnt <- filterNA(qnt)
## may be combineFeatuers

spikes <- c("P02769", "P00924", "P62894", "P00489")
protclasses <- as.character(fData(qnt)$accession)
protclasses[!protclasses %in% spikes] <- "Background"


madata42 <- data.frame(A = rowMeans(log(exprs(qnt[, c(4, 2)]), 10)),
                       M = log(exprs(qnt)[, 4], 2) - log(exprs(qnt)[, 2], 2),
                       data = rep("4vs2", nrow(qnt)),
                       protein = fData(qnt)$accession,
                       class = protclasses)

madata62 <- data.frame(A = rowMeans(log(exprs(qnt[, c(6, 2)]), 10)),
                       M = log(exprs(qnt)[, 6], 2) - log(exprs(qnt)[, 2], 2),
                       data = rep("6vs2", nrow(qnt)),
                       protein = fData(qnt)$accession,
                       class = protclasses)


madata <- rbind(madata42, madata62)

3.1 The traditional plotting system

par(mfrow = c(1, 2))
plot(M ~ A, data = madata42, main = "4vs2",
     xlab = "A", ylab = "M", col = madata62$class)
plot(M ~ A, data = madata62, main = "6vs2",
     xlab = "A", ylab = "M", col = madata62$class)

3.2 lattice

library("lattice")
latma <- xyplot(M ~ A | data, data = madata,
                groups = madata$class,
                auto.key = TRUE)
print(latma)

3.3 ggplot2

library("ggplot2")
ggma <- ggplot(aes(x = A, y = M, colour = class), data = madata,
               colour = class) +
                   geom_point() +
                       facet_grid(. ~ data)
print(ggma)

3.4 Customization

library("RColorBrewer")
bcols <- brewer.pal(4, "Set1")
cls <- c("Background" = "#12121230",
         "P02769" = bcols[1],
         "P00924" = bcols[2],
         "P62894" = bcols[3],
         "P00489" = bcols[4])
ggma2 <- ggplot(aes(x = A, y = M, colour = class),
                data = madata) + geom_point(shape = 19) +
                    facet_grid(. ~ data) + scale_colour_manual(values = cls) +
                        guides(colour = guide_legend(override.aes = list(alpha = 1)))
print(ggma2)

3.5 The MAplot method for MSnSet instances

MAplot(qnt, cex = .8)

3.6 An interactive shiny app for MA plots

This app is based on Mike Love’s shinyMA application, adapted for a proteomics data. A screen shot is displayed below. To start the application:

shinyMA()

shinyMA screeshot

The application is also available online at https://lgatto.shinyapps.io/shinyMA/.

See the excellent shiny web page for tutorials.

3.7 Volcano plots

Below, using the msmsTest package, we load a example MSnSet data with spectral couting data (from the r Biocpkg("msmsEDA") package) and run a statistical test to obtain (adjusted) p-values and fold-changes.

library("msmsEDA")
library("msmsTests")
data(msms.dataset)
## Pre-process expression matrix
e <- pp.msms.data(msms.dataset)
## Models and normalizing condition
null.f <- "y~batch"
alt.f <- "y~treat+batch"
div <- apply(exprs(e), 2, sum)
## Test
res <- msms.glm.qlll(e, alt.f, null.f, div = div)
lst <- test.results(res, e, pData(e)$treat, "U600", "U200 ", div,
                    alpha = 0.05, minSpC = 2, minLFC = log2(1.8),
                    method = "BH")

Here, we produce the volcano plot by hand, with the plot function. In the second plot, we limit the x axis limits and add grid lines.

plot(lst$tres$LogFC, -log10(lst$tres$p.value))

plot(lst$tres$LogFC, -log10(lst$tres$p.value),
     xlim = c(-3, 3))
grid()

Below, we use the res.volcanoplot function from the r Biocpkg("msmsTests") package. This functions uses the sample annotation stored with the quantitative data in the MSnSet object to colour the samples according to their phenotypes.

## Plot
res.volcanoplot(lst$tres,
                max.pval = 0.05,
                min.LFC = 1,
                maxx = 3,
                maxy = NULL,
                ylbls = 4)

3.8 A PCA plot

Using the counts.pca function from the msmsEDA package:

library("msmsEDA")
data(msms.dataset)
msnset <- pp.msms.data(msms.dataset)
lst <- counts.pca(msnset, wait = FALSE)

It is also possible to generate the PCA data using the prcomp. Below, we extract the coordinates of PC1 and PC2 from the counts.pca result and plot them using the plot function.

pcadata <- lst$pca$x[, 1:2]
head(pcadata)
##                  PC1       PC2
## U2.2502.1 -120.26080 -53.55270
## U2.2502.2  -99.90618 -53.89979
## U2.2502.3 -127.35928 -49.29906
## U2.2502.4 -166.04611 -39.27557
## U6.2502.1 -127.18423  37.11614
## U6.2502.2 -117.97016  47.03702
plot(pcadata[, 1], pcadata[, 2],
     xlab = "PCA1", ylab = "PCA2")
grid()

4 Plotting with R

kable(plotfuns)
plot type traditional lattice ggplot2
scatterplots plot xyplot geom_point
histograms hist histgram geom_histogram
density plots plot(density()) densityplot geom_density
boxplots boxplot bwplot geom_boxplot
violin plots vioplot::vioplot bwplot(…, panel = panel.violin) geom_violin
line plots plot, matplot xyploy, parallelplot geom_line
bar plots barplot barchart geom_bar
pie charts pie geom_bar with polar coordinates
dot plots dotchart dotplot geom_point
stip plots stripchart stripplot goem_point
dendrogramms plot(hclust()) latticeExtra package ggdendro package
heatmaps image, heatmap levelplot geom_tile

Below, we are going to use a data from the r Biocexptpkg("pRolocdata") to illustrate the plotting functions.

library("pRolocdata")
data(tan2009r1)

4.1 Scatter plots

See the MA and volcano plot examples.

The default plot type is p, for points. Other important types are l for lines and h for histogram (see below).

4.2 Historams and density plots

We extract the (normalised) intensities of the first sample

x <- exprs(tan2009r1)[, 1]

and plot the distribution with a histogram and a density plot next to each other on the same figure (using the mfrow par plotting paramter)

par(mfrow = c(1, 2))
hist(x)
plot(density(x))

4.3 Box plots and violin plots

we first extract the 888 proteins by r ncol(tan2009r1) samples data matrix and plot the sample distributions next to each other using boxplot and beanplot (from the beanplot package).

library("beanplot")
x <- exprs(tan2009r1)
par(mfrow = c(2, 1))
boxplot(x)
beanplot(x[, 1], x[, 2], x[, 3], x[, 4], log = "")

4.4 Line plots

below, we produce line plots that describe the protein quantitative profiles for two sets of proteins, namely er and mitochondrial proteins using matplot.

we need to transpose the matrix (with t) and set the type to both (b), to display points and lines, the colours to red and steel blue, the point characters to 1 (an empty point) and the line type to 1 (a solid line).

er <- fData(tan2009r1)$markers == "ER"
mt <- fData(tan2009r1)$markers == "mitochondrion"

par(mfrow = c(2, 1))
matplot(t(x[er, ]), type = "b", col = "red", pch = 1, lty = 1)
matplot(t(x[mt, ]), type = "b", col = "steelblue", pch = 1, lty = 1)

In the last section, about spatial proteomics, we use the specialised plotDist function from the pRoloc package to generate such figures.

4.5 Bar and dot charts

To illustrate bar and dot charts, we cound the number of proteins in the respective class using table.

x <- table(fData(tan2009r1)$markers)
x
## 
##  Cytoskeleton            ER         Golgi      Lysosome       Nucleus 
##             7            28            13             8            21 
##            PM    Peroxisome    Proteasome  Ribosome 40S  Ribosome 60S 
##            34             4            15            20            32 
## mitochondrion       unknown 
##            29           677
par(mfrow = c(1, 2))
barplot(x)
dotchart(x)
## Warning in dotchart(x): 'x' is neither a vector nor a matrix: using
## as.numeric(x)

4.6 Heatmaps

The easiest to produce a complete heatmap is with the heatmap function:

heatmap(exprs(tan2009r1))