alignSp: Base function for Spectrum Alignment

Description Usage Arguments Value Author(s) See Also Examples

View source: R/alignSp.R

Description

Alignment of spectrum segement to the spectrum of interest

Usage

1
alignSp(refSp, refSegments, intSp, intSegments, recursion, MAX_DIST_FACTOR, MIN_RC)

Arguments

refSp

a vector specifying the reference spectrum

refSegments

a list characterizing the reference segments (start, end, peaks, ...)

intSp

a vector specifiying the spectrum of intrest

intSegments

a list characterizing the segment of interest (start, end, peaks, ...)

recursion

A list defining defaut values of the parameters of recursive alignment(minimal segment width, recursion step, resamblance, acceptance, ...)

MAX_DIST_FACTOR

distance matching parameter (0.5*peak width)

MIN_RC

minimum resamblance coefficient

Value

alignedSpectrum

aligned spectrum as a vector

Author(s)

Lyamine Hedjazi

See Also

align_mQTL

Examples

 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
29
30
31
32
## 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 a test spectrum
testSegments<- segmentateSp(Sp[1,], peakParam) 

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

##Align test spectrum
attach(Segs)
SpAlg<- alignSp(refSp,refSegs,Sp[1,],testSegs,recursion,MAX_DIST_FACTOR,MIN_RC)

mQTL.NMR documentation built on Nov. 1, 2018, 2:13 a.m.