Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extractSpectraData

Extract data from MSnbase objects for use in Spectra


Description

extractSpectraData extracts the spectra data (m/z and intensity values including metadata) from MSnExp, OnDiskMSnExp, Spectrum1, Spectrum2 objects (or list of such objects) and returns these as a DataFrame that can be used to create a Spectra::Spectra object.This function enables thus to convert data from the old MSnbase package to the newer Spectra package.

Usage

extractSpectraData(x)

Arguments

x

a list of Spectrum objects or an object extending MSnExp or a MSpectra object.

Value

DataFrame() with the full spectrum data that can be passed to the Spectra::Spectra() function to create a Spectra object.

Author(s)

Johannes Rainer

Examples

## Read an mzML file with MSnbase
fl <- system.file("TripleTOF-SWATH", "PestMix1_SWATH.mzML",
    package = "msdata")
data <- filterRt(readMSData(fl, mode = "onDisk"), rt = c(1, 6))

## Extract the data as a DataFrame
res <- extractSpectraData(data)
res

## This can be used as an input for the Spectra constructor of the
## Spectra package:
## sps <- Spectra::Spectra(res)
## sps

MSnbase

Base Functions and Classes for Mass Spectrometry and Proteomics

v2.16.1
Artistic-2.0
Authors
Laurent Gatto, Johannes Rainer and Sebastian Gibb with contributions from Guangchuang Yu, Samuel Wieczorek, Vasile-Cosmin Lazar, Vladislav Petyuk, Thomas Naake, Richie Cotton, Arne Smits, Martina Fisher, Ludger Goeminne, Adriaan Sticker and Lieven Clement.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.