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;
74 unit_assert(pd->config().filterMatchRate == filterMatchRate);
75 unit_assert(pd->config().filterSampleRadius == filterSampleRadius);
76 unit_assert(pd->config().peakThresholdFactor == peakThresholdFactor);
77 unit_assert(pd->config().peakMaxCorrelationAngle == peakMaxCorrelationAngle);
78 unit_assert(pd->config().isotopeThresholdFactor == isotopeThresholdFactor);
79 unit_assert(pd->config().monoisotopicPeakThresholdFactor == monoisotopicPeakThresholdFactor);
85 if (
os_) *
os_ <<
"testFind()\n";
109 vector<PeakDetectorMatchedFilter::Score> scores;
110 pd->findPeaks(fd, data.
scans[0], 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;
144 const double abundanceCutoff = .01;
145 const double massPrecision = .1;
157 if (
os_) *
os_ << setprecision(12);
166 testFind(fd, *isotopeEnvelopeEstimator);
170int main(
int argc,
char* argv[])
176 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
177 if (
os_) *
os_ <<
"PeakDetectorMatchedFilterTest\n";
int main(int argc, char *argv[])
auto_ptr< IsotopeEnvelopeEstimator > createIsotopeEnvelopeEstimator()
void initializeWithTestData(FrequencyData &fd)
const double testDataObservationDuration_
const unsigned int testDataSize_
const double testDataCalibrationB_
const double testDataCalibrationA_
Class used for calculating a theoretical isotope envelope for a given mass, based on an estimate of t...
Class for binary storage of complex frequency data.
double observationDuration() const
const CalibrationParameters & calibrationParameters() const
void analyze()
recache statistics calculations after any direct data changes via non-const data()
const container & data() const
const access to underlying data
static std::auto_ptr< PeakDetectorMatchedFilter > create(const Config &config)
create an instance.
SampleDatum< double, std::complex< double > > FrequencyDatum
const IsotopeCalculator * isotopeCalculator
std::vector< Scan > scans
std::vector< Peak > peaks
double getAttribute(Attribute attribute) const
structure for holding configuration
int logDetailLevel
log detail level (0 == normal, 1 == extra)
std::ostream * log
log stream (0 == no logging)
double peakMaxCorrelationAngle
maximum correlation angle (degrees) for initial peak reporting
int isotopeMaxChargeState
isotope filter maximum charge state to score
const chemistry::IsotopeEnvelopeEstimator * isotopeEnvelopeEstimator
IsotopeEnvelopeEstimator pointer, must be valid for PeakDetector lifetime.
int filterMatchRate
number of filter correlations computed per frequency step
double monoisotopicPeakThresholdFactor
noise floor multiple for monoisotopic peak threshold
double peakThresholdFactor
noise floor multiple for initial peak reporting threshold
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
double isotopeThresholdFactor
noise floor multiple for isotope filter threshold
bool useMagnitudeFilter
use the magnitude of the peak shape filter kernel for finding peaks
int isotopeMaxNeutronCount
isotope filter maximum number of neutrons to score
structure for holding the matched filter calculation results
double monoisotopicFrequency
std::complex< double > monoisotopicIntensity
#define unit_assert_equal(x, y, epsilon)
#define TEST_PROLOG(argc, argv)