trim-methods: Trim an AbstractMassObject object.

trim-methodsR Documentation

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 signature 'AbstractMassObject,numeric'
trim(object, range)
## S4 method for signature 'list,numeric'
trim(object, range, ...)
## S4 method for signature '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).

Author(s)

Sebastian Gibb mail@sebastiangibb.de

See Also

AbstractMassObject, MassPeaks, MassSpectrum

Website: https://strimmerlab.github.io/software/maldiquant/

Examples

## 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)

MALDIquant documentation built on Sept. 11, 2024, 6:15 p.m.