attachSegments: Concatenation of test and reference segments

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/attachSegments.R

Description

Concatenation of test and reference segments to ensure one-to-one correspondence.

Usage

1
attachSegments(refSegments,testSegments)

Arguments

refSegments

a list characterizing the segments of the reference spectrum (start, end, peaks, center)

testSegments

a list characterizing the segments of the test spectrum (start,end, peaks, center)

Details

The algorithm:

  1. For each reference segment within segment boundaries, i.e. between initial and final positions, find all centre (middle) positions of test segments and merge those segments, if more than one centre position is found

  2. Apply the same procedure for each test segment

Value

A list:

segments$start

a vector specifiying the starting of each concatenated test segment

segments$PeakLeftBoundary

a list defining the peak left boundary of each concatenated test segment

segments$PeakRightBoundary

a list defining the peak right boundary of each concatenated test segment

segments$Peaks

a list specifiying the peaks information of each concatenated test segment (max position, start position, end position,...)

segments$end

a vector specifiying the end of each concatenated test segment

segments$end

a vector specifiying the center of each concatenated test segment

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

matchSegments

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

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