# NOT RUN {
# }
# NOT RUN {
## Data
Sp=matrix(rnorm(10*13454,mean=0,sd=1), nrow=10,ncol=13454)
##Segmentation parameters
peakParam=list()
peakParam$ppmDist <- 0.03# (ppm) # distance to concatenate adjacent peaks #default 0.03#
peakParam$ampThr <- 0.3 # amplitude value to threshold small peaks #
peakParam$minPeakWidth <- 0.005 #min peak width in ppm scale
peakParam$iFrameLen<-11 #Savitzky-Golay frame length in ppm scale
peakParam$iOrder<-3 #polynomial order of Savitzky - Golay filter
peakParam$peakEdgeMax<-0.2
##Reference spectrum selection
step<-0.02 # Recursion step (default 0.02)
index<-selectRefSp(Sp,step)
refSp<-Sp[index,]
#segmentate a reference spectrum
refSegments<- segmentateSp(refSp, peakParam) # segmentate reference spectrum
#segmentate a test spectrum
spectrum<-Sp[10,]
testSegments<- segmentateSp(spectrum, peakParam) # segmentate test spectrum (10th sample)
# match test and reference segments
attachedSegs<-attachSegments(refSegments,testSegments)
# }
Run the code above in your browser using DataLab