Last data update: 2014.03.03

R: NoiseModel objects
NoiseModel-classR Documentation

NoiseModel objects

Description

A NoiseModel represent the technical variation which is dependent on signal intensity.

Constructor

new(type,ibspectra,reporterTagNames=NULL,one.to.one=TRUE,min.spectra=10,plot=FALSE, pool=FALSE):

Creates a new NoiseModel object based on ibspectra object.

type:

A non-virtual class deriving from NoiseModel: ExponentialNoiseModel, ExponentialNoANoiseModel, InverseNoiseModel, InverseNoANoiseModel

reporterTagNames:

When NULL, all channels from ibspectra are taken (i.e. sampleNames(ibspectra)). Otherwise, specify subset of names, or a matrix which defines the desireed combination of channels (nrow=2).

one.to.one:

Set to false to learn noise model one a non one-to-one dataset

min.spectra:

When one.to.one=FALSE, only take proteins with min.spectra to learn noise model.

plot:

Set to true to plot data the noise model is learnt on.

pool:

If false, a NoiseModel is estimated on each combination of channels indivdually, and then the parameters are averaged. If true, the ratios of all channels are pooled and then a NoiseModel is estimated.

Accessor methods

noiseFunction:

Gets the noise function.

parameter:

Gets and sets the parameters for the noise function.

variance:

Gets the variance for data points based on the noise function and parameters.

stddev:

Convenience function, sqrt(variance(...)).

lowIntensity:

Gets and sets the low intensity slot, denoting the noise region.

naRegion:

Gets and sets the na.region slot.

Examples


data(ibspiked_set1)

ceru.proteins <- protein.g(proteinGroup(ibspiked_set1),"CERU")

# normalize
ibspiked_set1 <- normalize(correctIsotopeImpurities(ibspiked_set1))

# remove spiked proteins
ibspiked_set1.noceru <- exclude(ibspiked_set1,ceru.proteins)
ibspiked_set1.justceru <- subsetIBSpectra(ibspiked_set1,protein=ceru.proteins,direction="include")

# learn noise models
nm.i <- new("InverseNoiseModel",ibspiked_set1.noceru)
nm.e <- new("ExponentialNoiseModel",ibspiked_set1.noceru)

#learn on non-one.to.one data: not normalized, with spiked proteins
nm.n <- new("ExponentialNoiseModel",ibspiked_set1.justceru,one.to.one=FALSE)

maplot(ibspiked_set1,noise.model=c(nm.e,nm.i,nm.n),ylim=c(0.1,10))

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(isobar)
Loading required package: Biobase
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

Welcome to Bioconductor

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

Welcome to isobar (v 1.18.0)
   'openVignette("isobar")' and '?isobar' provide help on usage.


Attaching package: 'isobar'

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

    normalize

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

    paste0

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/isobar/NoiseModel-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: NoiseModel-class
> ### Title: NoiseModel objects
> ### Aliases: class:NoiseModel NoiseModel-class ExponentialNoiseModel-class
> ###   ExponentialNoANoiseModel-class InverseNoiseModel-class
> ###   InverseNoANoiseModel-class GeneralNoiseModel-class
> ###   initialize,NoiseModel-method NoiseModel NoiseModel,IBSpectra-method
> ###   variance variance,NoiseModel,numeric,numeric-method
> ###   variance,NoiseModel,numeric,missing-method stddev
> ###   stddev,NoiseModel-method noiseFunction
> ###   noiseFunction,NoiseModel-method parameter parameter<-
> ###   parameter,NoiseModel-method parameter<-,NoiseModel-method
> ###   lowIntensity lowIntensity<- lowIntensity,NoiseModel-method
> ###   lowIntensity<-,NoiseModel-method naRegion naRegion<-
> ###   naRegion,NoiseModel-method naRegion<-,NoiseModel-method
> ###   show,NoiseModel-method plot.NoiseModel
> 
> ### ** Examples
> 
> 
> data(ibspiked_set1)
> 
> ceru.proteins <- protein.g(proteinGroup(ibspiked_set1),"CERU")
> 
> # normalize
> ibspiked_set1 <- normalize(correctIsotopeImpurities(ibspiked_set1))
LOG: isotopeImpurities.corrected: TRUE
LOG: is.normalized: TRUE
	normalizing ibspiked_set1.ibspectra.csv [14991 spectra]
LOG: normalization.multiplicative.factor file ibspiked_set1.ibspectra.csv channel 114: 0.834
LOG: normalization.multiplicative.factor file ibspiked_set1.ibspectra.csv channel 115: 0.9252
LOG: normalization.multiplicative.factor file ibspiked_set1.ibspectra.csv channel 116: 0.9464
LOG: normalization.multiplicative.factor file ibspiked_set1.ibspectra.csv channel 117: 1
> 
> # remove spiked proteins
> ibspiked_set1.noceru <- exclude(ibspiked_set1,ceru.proteins)
Creating ProteinGroup ... done
> ibspiked_set1.justceru <- subsetIBSpectra(ibspiked_set1,protein=ceru.proteins,direction="include")
Creating ProteinGroup ... done
> 
> # learn noise models
> nm.i <- new("InverseNoiseModel",ibspiked_set1.noceru)
[1]  0.02943004 39.50764538  4.90970362
> nm.e <- new("ExponentialNoiseModel",ibspiked_set1.noceru)
[1]  0.03402699 11.26912497  1.42751145
> 
> #learn on non-one.to.one data: not normalized, with spiked proteins
> nm.n <- new("ExponentialNoiseModel",ibspiked_set1.justceru,one.to.one=FALSE)
3 proteins with more than 10 spectra, taking top 50.
[1] 0.0000000001 1.9049624298 0.6963100433
[1] 0.0000000001 1.0582004544 0.4018264899
[1]  0.2885837 10.2466167  8.3790144
[1] 0.0000000001 0.6412616267 0.4132829155
[1] 0.1976503792 0.0000000001 2.0754513709
[1] 0.0000000001 0.3860034265 0.3045983740
[1] 0.08103901 2.37284077 1.79351027
> 
> maplot(ibspiked_set1,noise.model=c(nm.e,nm.i,nm.n),ylim=c(0.1,10))
Warning messages:
1: In .local(x, channel1, channel2, ...) : removing 463 NA points
2: In .local(x, channel1, channel2, ...) : removing 467 NA points
3: In .local(x, channel1, channel2, ...) : removing 330 NA points
4: In .local(x, channel1, channel2, ...) : removing 481 NA points
5: In .local(x, channel1, channel2, ...) : removing 364 NA points
6: In .local(x, channel1, channel2, ...) : removing 336 NA points
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>