30 #include "boost/filesystem/path.hpp" 38 namespace bfs = boost::filesystem;
52 shared_ptr<PeakFinder> peakFinder(
new PeakFinder_SNR(noiseCalculator, pfsnrConfig));
58 return shared_ptr<PeakExtractor>(
new PeakExtractor(peakFinder, peakFitter));
75 const size_t spectrumCount = msdCache.size();
76 vector< vector<Peak> > result(spectrumCount);
78 for (
size_t index=0; index<spectrumCount; index++)
82 vector<Peak>& peaks = result[index];
88 *
os_ <<
"index: " << index << endl;
89 *
os_ <<
"peaks: " << peaks.size() << endl;
90 copy(peaks.begin(), peaks.end(), ostream_iterator<Peak>(*
os_,
"\n"));
108 void print(ostream& os,
const string& label, vector<PeakelPtr> v)
110 os << label <<
":\n";
111 for (vector<PeakelPtr>::const_iterator it=v.begin(); it!=v.end(); ++it)
123 if (
os_)
print(*
os_,
"bombesin_2_0", bombesin_2_0);
127 if (
os_)
print(*
os_,
"bombesin_2_1", bombesin_2_1);
131 if (
os_)
print(*
os_,
"bombesin_2_2", bombesin_2_2);
135 if (
os_)
print(*
os_,
"bombesin_2_3", bombesin_2_3);
141 if (
os_)
print(*
os_,
"bombesin_3_0", bombesin_3_0);
145 if (
os_)
print(*
os_,
"bombesin_3_1", bombesin_3_1);
149 if (
os_)
print(*
os_,
"bombesin_3_2", bombesin_3_2);
169 const double mz_bomb2 = 810.415;
170 vector<FeaturePtr> bombesin_2_found = featureField.
find(mz_bomb2, epsilon,
173 const Feature& bombesin_2 = *bombesin_2_found[0];
183 const double mz_bomb3 = 540.612;
184 vector<FeaturePtr> bombesin_3_found = featureField.
find(mz_bomb3, epsilon,
187 const Feature& bombesin_3 = *bombesin_3_found[0];
199 if (
os_) *
os_ <<
"testBombesin()" << endl;
210 vector< vector<Peak> > peaks =
extractPeaks(msd, *peakExtractor);
216 peakelGrower->sowPeaks(peakelField, peaks);
218 if (
os_) *
os_ <<
"peakelField:\n" << peakelField << endl;
225 peakelPicker->pick(peakelField, featureField);
227 if (
os_) *
os_ <<
"featureField:\n" << featureField << endl;
232 void test(
const bfs::path& datadir)
234 testBombesin((datadir /
"FeatureDetectorTest_Bombesin.mzML").
string());
238 int main(
int argc,
char* argv[])
244 bfs::path datadir =
".";
246 for (
int i=1; i<argc; i++)
248 if (!strcmp(argv[i],
"-v"))
254 datadir = bfs::path(argv[i]).branch_path();
simple memory cache for common MSData info
void verifyBombesinFeatures(const FeatureField &featureField)
MZRTField is a std::set of boost::shared_ptrs, stored as a binary tree ordered by LessThan_MZRT...
shared_ptr< PeakelGrower > createPeakelGrower()
predicate returns true iff the object's retention time range contains the specified retention time ...
vector< vector< Peak > > extractPeaks(const MSData &msd, const PeakExtractor &peakExtractor)
std::vector< TPtr > find(double mz, MZTolerance mzTolerance, RTMatches matches) const
find all objects with a given m/z, within a given m/z tolerance, satisfying the 'matches' predicate ...
#define unit_assert_equal(x, y, epsilon)
PeakFitter implementation based on fitting a parabola.
SetRetentionTime(double _rt)
void testBombesin(const string &filename)
shared_ptr< PeakelPicker > createPeakelPicker()
void operator()(Peak &peak)
represents some generic metadata about a peak detected in a signal
shared_ptr< PeakExtractor > createPeakExtractor()
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
PeakFinder implementation based on signal-to-noise ratio.
void test(const bfs::path &datadir)
size_t minMonoisotopicPeakelSize
MSData object plus file I/O.
int main(int argc, char *argv[])
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here. Subsidiary data arrays are also both described and attached here.
void verifyBombesinPeakels(const PeakelField &peakelField)
virtual void open(const DataInfo &dataInfo)
start analysis of the data
void print(ostream &os, const string &label, vector< PeakelPtr > v)
simple PeakelGrower implementation, based on proximity of Peaks
#define TEST_PROLOG(argc, argv)
std::vector< MZIntensityPair > data
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
const SpectrumInfo & spectrumInfo(size_t index, bool getBinaryData=false)
access to SpectrumInfo with automatic update (open() must be called first)
simple structure for holding Spectrum info