Learn R Programming

MALDIquant (version 1.18)

trim-methods: Trim an AbstractMassObject object.

Description

This method trims an '>AbstractMassObject object. That is useful if some mass ranges should be excluded from further analysis.

Usage

# S4 method for AbstractMassObject,numeric
trim(object, range)
# S4 method for list,numeric
trim(object, range, …)
# S4 method for list,missing
trim(object, range, …)

Arguments

object

'>AbstractMassObject object or a list of '>AbstractMassObject objects.

range

numeric, limits of trimming (left/minimal mass, right/maximal mass). If missing it is automatically determined (largest overlapping mass range) for a list of '>AbstractMassObject.

arguments to be passed to underlying functions (currently only mc.cores is supported).

See Also

'>AbstractMassObject, '>MassPeaks, '>MassSpectrum

Website: http://strimmerlab.org/software/maldiquant/

Examples

Run this code
# NOT RUN {
## load package
library("MALDIquant")

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

## select only one spectrum
s <- fiedler2009subset[[1]]

## remove all mass lower 3000
trim(s, range=c(3000, Inf))

## remove all mass higher 8000
trim(s, range=c(0, 8000))

## remove all mass lower 3000 and higher 8000
trim(s, range=c(3000, 8000))

## choose largest overlapping mass range for all spectra
trim(fiedler2009subset)
# }

Run the code above in your browser using DataLab