Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/matchSegments.R
The algorithm makes use of a fuzzy logic approach to match the segment of interest to the corresponding reference
1 | matchSegments(refSp, intSp, intSegments, refSegments, MAX_DIST_FACTOR, MIN_RC)
|
refSp |
a vector specifying the spectrum of reference |
intSp |
a vector specifying the spetcrum of interest (test spectrum) |
intSegments |
a list characterizing the segments of spectrum of interest |
refSegments |
a list characterizing the segments of the reference spectrum (start, end, peaks, center) |
MAX_DIST_FACTOR |
distance matching parameter (0.5*peak_width) |
MIN_RC |
minimum resamblance coefficient |
Algorithm:
pick-up segment of interest
pick-up reference segments
calculate relative distance between them
calculate relative resamblance between them
find min value of relative distance and resamblance
use it as representative of similiarity between target and reference segments
find the segment that has the highest value of both relative distance and resamblance
A list:
testSegs |
a list characterizing the matched test segments |
refSegs |
a list characterizing the matched reference segments |
Lyamine Hedjazi
Veselkov,K. et al (2009) Recursive Segment-Wise Peak Alignment of Biological 1H NMR Spectra for Improved Metabolic Biomarker Recovery, Anal. Chem., 81(1), 56-66.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Data
load_datafiles()
Sp<-t(read.table(phenofile))
ppm<-as.numeric(colnames(Sp))
## Normalization
normSp<-normalise(abs(Sp),'CS')
##Segmentation and matching parameters
setupRSPA(ppm)
##reference spectrum selection
attach(normSp)
index<-selectRefSp(Sp,recursion$step)
refSp<-Sp[index,]
##segmentate a reference spectrum
refSegments<- segmentateSp(refSp, peakParam) # segmentate reference spectrum
##segmentate a test spectrum
testSegments<- segmentateSp(Sp[1,], peakParam) # segmentate test spectrum (1st sample)
##attach test and reference segments
attachedSegs<-attachSegments(refSegments,testSegments)
##Match test and reference segments
attach(attachedSegs)
Segs<-matchSegments(refSp,Sp[1,],testSegmentsNew,refSegmentsNew,MAX_DIST_FACTOR, MIN_RC)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.