Learn R Programming

speaq (version 1.2.0)

hClustAlign: CluPA function for two spectra.

Description

This function implements the idea of the CluPA algorithm to align the target spectrum against the reference spectrum.

Usage

hClustAlign(refSpec,
        tarSpec,
        peakList,
        peakLabel,
        startP,
        endP,
        distanceMethod = "average",
        maxShift = 0,
        acceptLostPeak = FALSE)

Arguments

refSpec
The reference spectrum.
tarSpec
The target spectrum.
peakList
List of peaks of the both reference and target spectra
peakLabel
The list of the labels of the peaks
startP
The starting point of the segment.
endP
The ending point of the segment.
distanceMethod
The distance method for the hierarchial clustering algorithm.
maxShift
The maximum number of points for a shift step.
acceptLostPeak
This is an option for users, TRUE is the default value. If the users believe that all the peaks in the peak list are true positive, change it to FALSE.

Value

  • tarSpecThe target spectrum after alignment
  • peakListThe peak list after alignment

Details

This function implements the idea of the CluPA algorithm to align the target spectrum against the reference spectrum.

References

Vu TN, Valkenborg D, Smets K, Verwaest KA, Dommisse R, Lemie`re F, Verschoren A, Goethals B, Laukens K. (2011) An integrated workflow for robust alignment and simplified quantitative analysis of NMR spectrometry data. BMC Bioinformatics. 2011 Oct 20;12:405.

See Also

dohCluster

Examples

Run this code
res=makeSimulatedData();
X=res$data;
groupLabel=res$label;


peakList <- detectSpecPeaks(X,
  nDivRange = c(128),                
  scales = seq(1, 16, 2),
  baselineThresh = 50000,
  SNR.Th = -1,
    verbose=FALSE
);


resFindRef<- findRef(peakList);
refInd <- resFindRef$refInd;

tarInd=1;
refSpec=X[refInd,];
tarSpec=X[tarInd,];

mergedPeakList=c(peakList[[refInd]],peakList[[tarInd]]);
mergedPeakLabel=double(length(mergedPeakList));
for (i in 1:length(peakList[[refInd]]) ) mergedPeakLabel[i]=1;
startP=1;
endP=length(tarSpec);
res=hClustAlign(refSpec,tarSpec,mergedPeakList,mergedPeakLabel,startP,endP,
        maxShift=50,acceptLostPeak=TRUE)

Run the code above in your browser using DataLab