45 complex<double>(datum->real, datum->imaginary)));
55 if (
os_) *
os_ <<
"testCreation()\n";
56 const int filterMatchRate = 4;
57 const int filterSampleRadius = 2;
58 const double peakThresholdFactor = 0;
59 const double peakMaxCorrelationAngle = 5;
60 const double isotopeThresholdFactor = 666;
61 const double monoisotopicPeakThresholdFactor = 777;
72 auto_ptr<PeakDetectorMatchedFilter> pd = PeakDetectorMatchedFilter::create(config);
85 if (
os_) *
os_ <<
"testFind()\n";
104 auto_ptr<PeakDetectorMatchedFilter> pd = PeakDetectorMatchedFilter::create(config);
109 vector<PeakDetectorMatchedFilter::Score> scores;
115 *
os_ <<
"peaks found: " << data.
scans[0].peakFamilies.size() << endl;
117 *
os_ <<
"scores: " << scores.size() << endl;
118 copy(scores.begin(), scores.end(),
119 ostream_iterator<PeakDetectorMatchedFilter::Score>(*
os_,
"\n"));
126 if (
os_) *
os_ <<
"peakFamily: " << peakFamily << endl;
128 const Peak& peak = peakFamily.peaks[0];
135 unit_assert(score.monoisotopicFrequency == peak.getAttribute(Peak::Attribute_Frequency));
137 polar(peak.intensity, peak.getAttribute(Peak::Attribute_Phase))),
144 const double abundanceCutoff = .01;
145 const double massPrecision = .1;
157 if (
os_) *
os_ << setprecision(12);
166 testFind(fd, *isotopeEnvelopeEstimator);
170 int main(
int argc,
char* argv[])
176 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
177 if (
os_) *
os_ <<
"PeakDetectorMatchedFilterTest\n";
double collapseRadius
multiple peaks within this radius (Hz) are reported as single peak
int filterSampleRadius
number of filter samples taken on either side of 0
structure for holding configuration
Class for binary storage of complex frequency data.
int isotopeMaxNeutronCount
isotope filter maximum number of neutrons to score
int logDetailLevel
log detail level (0 == normal, 1 == extra)
Class used for calculating a theoretical isotope envelope for a given mass, based on an estimate of t...
void testFind(FrequencyData &fd, const IsotopeEnvelopeEstimator &isotopeEnvelopeEstimator)
#define unit_assert_equal(x, y, epsilon)
void initializeWithTestData(FrequencyData &fd)
const chemistry::IsotopeEnvelopeEstimator * isotopeEnvelopeEstimator
IsotopeEnvelopeEstimator pointer, must be valid for PeakDetector lifetime.
int main(int argc, char *argv[])
void analyze()
recache statistics calculations after any direct data changes via non-const data() ...
const double testDataCalibrationB_
virtual const Config & config() const =0
access to the configuration
const container & data() const
const access to underlying data
double monoisotopicPeakThresholdFactor
noise floor multiple for monoisotopic peak threshold
std::vector< Scan > scans
const double testDataCalibrationA_
double observationDuration() const
std::ostream * log
log stream (0 == no logging)
void testCreation(const IsotopeEnvelopeEstimator &isotopeEnvelopeEstimator)
auto_ptr< IsotopeEnvelopeEstimator > createIsotopeEnvelopeEstimator()
double peakThresholdFactor
noise floor multiple for initial peak reporting threshold
int filterMatchRate
number of filter correlations computed per frequency step
double peakMaxCorrelationAngle
maximum correlation angle (degrees) for initial peak reporting
int isotopeMaxChargeState
isotope filter maximum charge state to score
SampleDatum< double, std::complex< double > > FrequencyDatum
const CalibrationParameters & calibrationParameters() const
const double testDataObservationDuration_
virtual void findPeaks(const pwiz::data::FrequencyData &fd, pwiz::data::peakdata::Scan &result) const =0
Find the peaks in the frequency data, filling in Scan structure.
double isotopeThresholdFactor
noise floor multiple for isotope filter threshold
bool useMagnitudeFilter
use the magnitude of the peak shape filter kernel for finding peaks
#define TEST_PROLOG(argc, argv)
structure for holding the matched filter calculation results
const IsotopeCalculator * isotopeCalculator
const unsigned int testDataSize_