R: Matching of the segment of interest to the corresponding...

matchSegments {mQTL} | R Documentation

## Matching of the segment of interest to the corresponding reference

### Description

The algorithm makes use of a fuzzy logic approach to match the segment of interest to the corresponding reference

### Usage

    matchSegments(refSp, intSp, intSegments, refSegments, MAX_DIST_FACTOR, MIN_RC)

### Arguments

`refSp` | spectrum of reference
`intSp` | spetcrum of interest (test spectrum)
`intSegments` | segments of spectrum of interest
`refSegments` | segments of reference spectrum
`MAX_DIST_FACTOR` | the distance matching parameter (0.5*peak_width)
`MIN_RC` | minimum resamblance coefficient

### Details

Algorithm:

1. take segment of interest

2. take reference segments

3. calculate relative distance between them

4. calculate relative resamblance between them

5. find min value of relative distance and resamblance

6. use it as representative of similiarity between target and reference segments

7. find the segment that has the highest value of both relative distance and resamblance

### Value

A list:

`testSegs` | matched test segments
`refSegs` | matched reference segments

### Author(s)

Lyamine Hedjazi

### References

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.

### See Also

`attachSegments`

### Examples

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

    #attach test and reference segments
    attachedSegs<-attachSegments(refSegments,testSegments)

    ##Matching parameters

    MAX_DIST_FACTOR<-0.5 # The distance matching parameter (0.5*peak_width)
    MIN_RC<-0.25 # Minimum resamblance coefficient

    refSegments<-attachedSegs$refSegmentsNew
    testSegments<-attachedSegs$testSegmentsNew
    Segs<-matchSegments(refSp,spectrum, testSegments,refSegments,MAX_DIST_FACTOR, MIN_RC)

    ## End(Not run)

[Package mQTL version 1.0 Index]