Last data update: 2014.03.03

R: Removes reporter ion tag peaks
removeReporters-methodsR Documentation

Removes reporter ion tag peaks

Description

This methods sets all the reporter tag ion peaks from one MS2 spectrum or all the MS2 spectra of an experiment to 0. Reporter data is specified using an "ReporterIons" instance. The peaks are selected around the expected reporter ion m/z value +/- the reporter width. Optionally, the spectrum/spectra can be cleaned to remove successive 0 intensity data points (see the clean function for details).

Note that this method only works for MS2 spectra or experiments that contain MS2 spectra. It will fail for MS1 spectrum.

Methods

signature(object = "MSnExp", reporters = "ReporterIons", clean = "logical", verbose = "logical" )

The reporter ion peaks defined in the reporters instance of all the MS2 spectra of the "MSnExp" instance are set to 0 and, if clean is set to TRUE, cleaned. The default value of reporters is NULL, which leaves the spectra as unchanged. The verbose parameter (default is TRUE) defines whether a progress bar should be showed.

signature(object = "Spectrum", reporters = "ReporterIons", clean = "FALSE")

The reporter ion peaks defined in the reporters instance of MS2 "Spectrum" instance are set to 0 and, if clean is set to TRUE, cleaned. The default value of reporters is NULL, which leaves the spectrum as unchanged.

Author(s)

Laurent Gatto <lg390@cam.ac.uk>

See Also

clean and removePeaks for other spectra processing methods.

Examples

sp1 <- itraqdata[[1]]
sp2 <- removeReporters(sp1,reporters=iTRAQ4)
sel <- mz(sp1) > 114 & mz(sp1) < 114.2
mz(sp1)[sel]
intensity(sp1)[sel]
plot(sp1,full=TRUE,reporters=iTRAQ4)
intensity(sp2)[sel]
plot(sp2,full=TRUE,reporters=iTRAQ4)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MSnbase)
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: mzR
Loading required package: Rcpp
Loading required package: BiocParallel
Loading required package: ProtGenerics

This is MSnbase version 1.20.7 
  Read '?MSnbase' and references therein for information
  about the package and how to get started.


Attaching package: 'MSnbase'

The following object is masked from 'package:stats':

    smooth

The following object is masked from 'package:base':

    trimws

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/MSnbase/removeReporters-methods.Rd_%03d_medium.png", width=480, height=480)
> ### Name: removeReporters-methods
> ### Title: Removes reporter ion tag peaks
> ### Aliases: removeReporters-methods removeReporters
> ### Keywords: methods
> 
> ### ** Examples
> 
> sp1 <- itraqdata[[1]]
> sp2 <- removeReporters(sp1,reporters=iTRAQ4)
> sel <- mz(sp1) > 114 & mz(sp1) < 114.2
> mz(sp1)[sel]
 [1] 114.0956 114.0975 114.0993 114.1012 114.1030 114.1049 114.1067 114.1085
 [9] 114.1104 114.1122 114.1141 114.1159 114.1178 114.1196 114.1214 114.1233
[17] 114.1251
> intensity(sp1)[sel]
 [1]      0.0000      0.0000      0.0000      0.0000   1640.2427  25143.0898
 [7]  87905.3906 164363.5156 197455.8125 158061.2812  79058.3672  17596.0898
[13]    346.5309      0.0000      0.0000      0.0000      0.0000
> plot(sp1,full=TRUE,reporters=iTRAQ4)
> intensity(sp2)[sel]
 [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> plot(sp2,full=TRUE,reporters=iTRAQ4)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>