Batch MultiPeak Fitting
aabeleira
MPF2_AutoMPFit(resultDFBase, peakType, PeakCoefWaveFormat, BLType, BLCoefWaveName, yWaveList, xWaveList, InitialGuessOptions [, noiseEst, smFact, noiseEstMult, smFactMult, minAutoFindFraction])
I believe I would like to use initialOptionsGuess 0 "Do not run the automatic peak picker. Initial guesses will be pre-loaded in coefficient waves in the data folder resultDFBase+"_0". Use those values for every data set." I just am a bit lost on how I should set up a data folder containing the required information, and then how to feed that to the function inputs.
That means that the first of the result data folders must exist before you call MPF2_AutoMPFit(), and you need to copy the coefficient waves from your manual run into that data folder. You might have something like
String newDFName = resultDFBase+"_0"
String PeakCoefWaveFormat = "myPeak%d"
DuplicateDataFolder root:Packages:MultiPeakFit2:MPF_SetFolder_1, $newDFName
DFREF newdf = $newDFName
Variable i
for (i = 0; i < 19; i += 1)
String wname
sprintf(wname, "Peak %d Coefs", i)
String newname
sprintf(newname, PeakCoefWaveFormat, i)
Rename newdf:$wname, $newname
endfor
MPF2_AutoMPFit(resultDFBase, ..., PeakCoefWaveFormat, ...)
In that code (which is completely untested!) the complete data folder for a manual multipeak fit is duplicated, giving the duplicate the appropriate name ending in "_0". The the looop renames the coefficients waves from the names used by the MPF2 user interface, to names corresponding to the names specified by the PeakCoefWaveFormat input string.
If you have a baseline as part of the fit, you need to do the same for the baseline coefficient wave. To avoid the loop and renaming waves, you could just use
String newDFName = resultDFBase+"_0"
DuplicateDataFolder root:Packages:MultiPeakFit2:MPF_SetFolder_1, $newDFName
MPF2_AutoMPFit(resultDFBase, ..., "Peak %d Coefs", ..., "Baseline Coefs", ...)
This simplifies the problem by using the same names as the GUI for MPF2 uses, so you only need to duplicate the data folder, you don't need to rename the waves.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.comJohn Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 10, 2014 at 03:13 pm - Permalink
<br />
variable UserInNumPeaks<br />
string/g ywavelist = wavelist("*",";","") //creates a wavelist from the target waves in the selected data folder to be used as wavelist input in MPF2_auto function<br />
String newDFName = "resultDFBase"+"_0" //declares a string with the name resultDFBase_0 <br />
DuplicateDataFolder root:Packages:MultiPeakFit2:MPF_SetFolder_1, $newDFName //duplicates the manual MPF output parameter/coef folder and assigns it the resultDFBase_0 name to be used by the MPF2_auto function <br />
setdatafolder $newDFname<br />
variable/g NumOfPeaks = UserInNumPeaks<br />
variable/G MPFError = 0<br />
<br />
setdatafolder root:<br />
<br />
MPF2_AutoMPFit("resultDFBase", "gauss", "Peak %d Coefs", "constant", "Baseline Coefs", ywavelist,"", 0) //calls MPF2_auto function to fit the rest of the waves in the root data folder via ywavelist<br />
<br />
end
In the data browser of the attached experiment you will find resultDFBase_0, resultDFBase_1, and ResultDFbase_2 which should correspond to wave4, wave_5, and wave6 respectively. In each of those folders there is a wave titled MPF2_ResultsListWave that contains all of the useful results of the fit for the wave of interest. However, the results contained in MPF2_ResultsListWave for resultDFBase_0, resultDFBase_1, and ResultDFbase_2 are identical. I.E identical peak locations, peak areas etc. This should not be the case. The chromatograms are indeed very very similar, but there are small differences in peak location and peak area in each chromatogram as I mentioned earlier. So my question here is what am I doing wrong? Do I have some input parameters such as ywavelist (ie wave4;wave5;wave6) in the wrong data folder?
June 11, 2014 at 12:46 pm - Permalink
You are doing nothing wrong. The presence of MPF2_ResultsListWave in those data folders is an unfortunate consequence of the use of the DuplicateDataFolder operation to create the results data folders. The MPF2_ResultsListWave in the original manual-fit folder was used by the GUI to display the results in the peak list in the control panel. It is not involved in the fits in the automated batch fitting.
Your batch fit did the job- here is a listing from a table of the Peak 0 Coefs waves from each of the resultDFBase_n data folders:
213.177 215.414 214.598
3.07289 2.66981 3.16373
0.153097 0.141413 0.100335
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 12, 2014 at 09:12 am - Permalink
Thanks for the help and clarification. The issue with the data in the Peak Coef waves is that only location, peak width, and peak amplitude are displayed. The information that I really need is peak area. Do you have any suggestions on how to access that information?
Thanks
June 12, 2014 at 10:35 am - Permalink
June 12, 2014 at 11:14 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 12, 2014 at 11:47 am - Permalink