/usr/include/libpwiz/pwiz/analysis/frequency/PeakDetectorMatchedFilter.hpp is in libpwiz-dev 3.0.9393-1+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | //
// $Id: PeakDetectorMatchedFilter.hpp 1638 2009-12-18 23:26:34Z chambm $
//
//
// Original author: Darren Kessner <darren@proteowizard.org>
//
// Copyright 2006 Louis Warschaw Prostate Cancer Center
// Cedars Sinai Medical Center, Los Angeles, California 90048
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef _PEAKDETECTORMATCHEDFILTER_HPP_
#define _PEAKDETECTORMATCHEDFILTER_HPP_
#include "pwiz/utility/misc/Export.hpp"
#include "PeakDetector.hpp"
#include "pwiz/utility/chemistry/IsotopeEnvelopeEstimator.hpp"
#include <memory>
#include <complex>
namespace pwiz {
namespace frequency {
/// MatchedFilter implementation of the PeakDetector interface.
class PWIZ_API_DECL PeakDetectorMatchedFilter : public PeakDetector
{
public:
/// structure for holding configuration
struct PWIZ_API_DECL Config
{
/// IsotopeEnvelopeEstimator pointer, must be valid for PeakDetector lifetime
const chemistry::IsotopeEnvelopeEstimator* isotopeEnvelopeEstimator;
/// number of filter correlations computed per frequency step
int filterMatchRate;
/// number of filter samples taken on either side of 0
int filterSampleRadius;
/// noise floor multiple for initial peak reporting threshold
double peakThresholdFactor;
/// maximum correlation angle (degrees) for initial peak reporting
double peakMaxCorrelationAngle;
/// noise floor multiple for isotope filter threshold
double isotopeThresholdFactor;
/// noise floor multiple for monoisotopic peak threshold
double monoisotopicPeakThresholdFactor;
/// isotope filter maximum charge state to score
int isotopeMaxChargeState;
/// isotope filter maximum number of neutrons to score
int isotopeMaxNeutronCount;
/// multiple peaks within this radius (Hz) are reported as single peak
double collapseRadius;
/// use the magnitude of the peak shape filter kernel for finding peaks
bool useMagnitudeFilter;
/// log detail level (0 == normal, 1 == extra)
int logDetailLevel;
/// log stream (0 == no logging)
std::ostream* log;
Config()
: isotopeEnvelopeEstimator(0),
filterMatchRate(0),
filterSampleRadius(0),
peakThresholdFactor(0),
peakMaxCorrelationAngle(0),
isotopeThresholdFactor(0),
monoisotopicPeakThresholdFactor(0),
isotopeMaxChargeState(0),
isotopeMaxNeutronCount(0),
collapseRadius(0),
useMagnitudeFilter(false),
logDetailLevel(0),
log(0)
{}
};
/// \name Instantiation
//@{
/// create an instance.
static std::auto_ptr<PeakDetectorMatchedFilter> create(const Config& config);
virtual ~PeakDetectorMatchedFilter(){}
//@}
/// \name PeakDetector interface
//@{
virtual void findPeaks(const pwiz::data::FrequencyData& fd,
pwiz::data::peakdata::Scan& result) const = 0;
//@}
/// \name PeakDetectorMatchedFilter interface
//@{
/// access to the configuration
virtual const Config& config() const = 0;
/// structure for holding the matched filter calculation results
struct PWIZ_API_DECL Score
{
double frequency;
int charge;
int neutronCount;
double value;
double monoisotopicFrequency;
std::complex<double> monoisotopicIntensity;
int peakCount;
std::vector<pwiz::data::peakdata::Peak> peaks;
Score(double _f = 0, int _c = 0, int _n = 0)
: frequency(_f), charge(_c), neutronCount(_n),
value(0), monoisotopicFrequency(0), monoisotopicIntensity(0),
peakCount(0)
{}
};
/// same as PeakDetector::findPeaks(), but provides additional Score information
virtual void findPeaks(const pwiz::data::FrequencyData& fd,
pwiz::data::peakdata::Scan& result,
std::vector<Score>& scores) const = 0;
//@}
};
PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const PeakDetectorMatchedFilter::Score& a);
} // namespace frequency
} // namespace pwiz
#endif // _PEAKDETECTORMATCHEDFILTER_HPP_
|