Concatenation of test and reference segments to ensure one-to-one
correspondence.
Usage
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:
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
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
## 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)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(mQTL.NMR)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/mQTL.NMR/attachSegments.Rd_%03d_medium.png", width=480, height=480)
> ### Name: attachSegments
> ### Title: Concatenation of test and reference segments
> ### Aliases: attachSegments
> ### Keywords: function
>
> ### ** Examples
>
>
> ## Data
> load_datafiles()
> Sp<-t(read.table(phenofile))
> ppm<-as.numeric(colnames(Sp))
>
> ## Normalization
> normSp<-normalise(abs(Sp),'CS')
[1] "Start constant sum normalisation:"
>
> ##Segmentation and matching parameters
> setupRSPA(ppm)
>
> ##reference spectrum selection
> attach(normSp)
The following object is masked _by_ .GlobalEnv:
Sp
> index<-selectRefSp(Sp,recursion$step)
There were 40 warnings (use warnings() to see them)
> 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)
>
>
>
>
>
>
> dev.off()
null device
1
>