Part of an LC-MS map at different stages of data reduction. Axes depict retention time, m/z, and intensity. From left to right raw data points, peak picked data points and a feature are shown.
The following example (Tutorial_PeakPickerCWT.C) shows how to open a raw map (in mzData format), initialize a PeakPickerCWT object, set the most important parameters (the scale of the wavelet, a peak's minimal height and fwhm), and start the peak picking process.
Int main() { RawMap exp_raw; PeakMap exp_picked; MzDataFile mzdata_file; mzdata_file.load("../TEST/data/PeakPicker_test.mzData",exp_raw); PeakPickerCWT pp; Param param; param.setValue("thresholds:peak_bound",500.0); param.setValue("thresholds:fwhm_bound",0.1); param.setValue("wavelet_transform:scale",0.2); pp.setParameters(param); pp.pickExperiment(exp_raw,exp_picked); exp_picked.updateRanges(); cout << "Scale of the wavelet: " << (DoubleReal)param.getValue("wavelet_transform:scale") << "\nMinimal fwhm of a mass spectrometric peak: " << (DoubleReal)param.getValue("thresholds:fwhm_bound") << "\nMinimal intensity of a mass spectrometric peak " << (DoubleReal)param.getValue("thresholds:peak_bound") << "\n\nNumber of picked peaks " << exp_picked.getSize() << std::endl; return 0; } //end of main
The output of the program is:
Scale of the wavelet: 0.2 Minimal fwhm of a mass spectrometric peak: 0.1 Minimal intensity of a mass spectrometric peak 500 Number of picked peaks 14
OpenMS offers different algorithms for this task.
Writing a FeatureFinder application of your own is straightforward to do. A short example (Tutorial_FeatureFinder.C) is given below. First we need to instantiate the FeatureFinder, its parameters and the input/output data:
FeatureFinder ff; // ... set parameters (e.g. from INI file) Param parameters; // ... set input data (e.g. from mzData file) MSExperiment<> input; // ... set output data structure
Then we run the FeatureFinder. The first argument is the algorithm name (here 'simple'). Using the second and third parameter, the peak and feature data is handed to the algorithm. The fourth argument sets the parameters used by the algorithm.
FeatureMap<> output;
ff.run("simple", input, output, parameters);
Generated Tue Apr 1 15:36:40 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |