Last data update: 2014.03.03

R: Identify ridges based on the local maximum matrix
getRidgeR Documentation

Identify ridges based on the local maximum matrix

Description

Identify ridges by connecting the local maximum of 2-D CWT coefficients from the coarse scale to detail scale. The local maximum matrix is returned from getLocalMaximumCWT

Usage

getRidge(localMax, iInit = ncol(localMax), step = -1, iFinal = 1, minWinSize= 5, gapTh = 3, skip = NULL)

Arguments

localMax

The local maximum matrix is returned from getLocalMaximumCWT with 1 represents maximum, others are 0.

iInit

The start column to search ridge. By default, it starts from the coarsest scale level.

step

Search step. -1 by default, which means searching from coarse scale to detail scale column by column.

iFinal

The final column index of search ridge.

minWinSize

The minimum slide window size used.

gapTh

The gap allowed during searching for ridge. 3 by default.

skip

The column to be skipped during search.

Value

Return a list of ridge. As some ridges may end at the scale larger than 1, in order to keep the uniqueness of the ridge names, we combined the smallest scale of the ridge and m/z index of the peak at that scale together to name the ridges. For example the ridge name "1_653" means the peak ridge ends at the CWT scale 1 with m/z index 653 at scale 1.

Author(s)

Pan Du, Simon Lin

References

Du, P., Kibbe, W.A. and Lin, S.M. (2006) Improved peak detection in mass spectrum by incorporating continuous wavelet transform-based pattern matching, Bioinformatics, 22, 2059-2065.

See Also

getLocalMaximumCWT, identifyMajorPeaks

Examples

	data(exampleMS)
	scales <- seq(1, 64, 3)
	wCoefs <- cwt(exampleMS[5000:11000], scales=scales, wavelet='mexh')
	
	localMax <- getLocalMaximumCWT(wCoefs)
	ridgeList <- getRidge(localMax)
	plotRidgeList(ridgeList)

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(MassSpecWavelet)
Loading required package: waveslim

waveslim: Wavelet Method for 1/2/3D Signals (version = 1.7.5)

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/MassSpecWavelet/getRidge.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getRidge
> ### Title: Identify ridges based on the local maximum matrix
> ### Aliases: getRidge
> ### Keywords: methods
> 
> ### ** Examples
> 
> 	data(exampleMS)
> 	scales <- seq(1, 64, 3)
> 	wCoefs <- cwt(exampleMS[5000:11000], scales=scales, wavelet='mexh')
> 	
> 	localMax <- getLocalMaximumCWT(wCoefs)
> 	ridgeList <- getRidge(localMax)
> 	plotRidgeList(ridgeList)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>