Learn R Programming

MALDIquant (version 1.5)

transformIntensity-methods: Transforms intensities of an AbstractMassObject object.

Description

This method performs a transformation (e.g. sqrt-transformation) on the intensities of an AbstractMassObject object.

Usage

## S3 method for class 'AbstractMassObject':
transformIntensity(object,
     fun, na.rm = TRUE,
     \dots)

Arguments

object
AbstractMassObject object or a list of AbstractMassObject objects.
fun
used transformation function (sqrt, log10, log or something else would be possible)
na.rm
logical, indicating whether NA values should be removed
...
arguments to be passed to fun

Details

transformIntensity is a shortcut for transforming intensities manually. ## doing things by hand newMassSpectrum <- singleSpectrum1; intensity(newMassSpectrum) <- sqrt(intensity(singleSpectrum1));

## the code above could replaced by the following line newMassSpectrum <- transformIntensity(singleSpectrum1, fun=sqrt);

References

See website: http://strimmerlab.org/software/maldiquant/

See Also

AbstractMassObject, MassSpectrum

Examples

Run this code
## load library
library("MALDIquant");

## load example data
data("fiedler2009subset", package="MALDIquant");

## choose only the first mass spectrum
s <- fiedler2009subset[[1]];

## transform spectrum
t <- transformIntensity(s, fun=sqrt);

## plot spectrum
par(mfrow=c(2, 1));
plot(s, main="raw spectrum");
plot(t, main="transformed spectrum");
par(mfrow=c(1, 1));

Run the code above in your browser using DataLab