BiocStyle::markdown()
Package: r Biocpkg("PSMatch")
Authors: r packageDescription("PSMatch")[["Author"]]
Last modified: r file.info("Fragments.Rmd")$mtime
Compiled: r date()
library("PSMatch")
This vignette is one among several illustrating how to use the
PSMatch
package, focusing on the calculation and visualisation of
MS2 fragment ions. For a general overview of the package, see the
PSMatch
package manual page (?PSMatch
) and references therein.
To illustrate this vignette, we will import and merge raw and
identification data from the r Biocpkg("msdata")
. For details about
this section, please visit the
Spectra
package webpage.
Load the raw MS data:
(spf <- msdata::proteomics(pattern = "2014", full.names = TRUE)) library(Spectra) sp <- Spectra(spf)
Load the identification data:
(idf <- msdata::ident(pattern = "2014", full.names = TRUE)) id <- PSM(idf) |> filterPSMs() id
Merge both:
sp <- joinSpectraData(sp, id, by.x = "spectrumId", by.y = "spectrumID") sp
In this example, we are going to focus the MS2 scan with index 5449 and its parent MS1 scan (index 5447, selected automatically with the filterPrecursorScan() function).
sp5449 <- filterPrecursorScan(sp, 5449)
plotSpectra(sp5449[1], xlim = c(550, 1200)) abline(v = precursorMz(sp5449)[2], col = "red", lty = "dotted")
The MS2 scan was matched to SQILQQAGTSVLSQANQVPQTVLSLLR
(there was
obviously no match the the MS1 scan):
sp5449$sequence
The calculateFragments()
simply takes a peptide sequence as input
and returns a data.frame
with the fragment sequences, M/Z, ion type,
charge and position.
calculateFragments(sp5449$sequence[2])
We can now visualise these fragments directly on the MS spectrum. Let's first visualise the spectrum as is:
plotSpectra(sp5449[2])
plotSpectra(sp5449[2], labels = addFragments, labelPos = 3)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.