37 ostream& operator<< (ostream& os, const vector<double>& v)
40 for (
size_t i=0; i < v.size(); ++i)
57 {
"300.0 302.1 303.11 304.12 305.20",
58 "1.0 85.0 15.0 3.0 3.0"},
60 {
"299.5 300.01 300.52 301.03",
61 "10.0 75.0 25.0 40.0"},
63 {
"302.1 302.435 302.77 302.94 303.11",
64 "61.0 31.0 8.0 45.0 40.0"},
71 {
"300.0 302.1 305.20",
74 {
"299.5 300.01 301.03",
77 {
"302.1 302.94 303.11",
88 vector<double> doubleVector;
89 vector<string> tokens;
90 bal::split(tokens, doubleArray, bal::is_space(), bal::token_compress_on);
92 for (
size_t i=0; i < tokens.size(); ++i)
93 if (!tokens[i].empty())
94 doubleVector.push_back(lexical_cast<double>(tokens[i]));
113 s->precursors.push_back(
Precursor(100.0));
118 s->defaultArrayLength = inputMZArray.size();
124 vector<double> goldMZArray =
parseDoubleArray(goldStandard[0].inputMZArray);
125 vector<double> goldIntensityArray =
parseDoubleArray(goldStandard[0].inputIntensityArray);
131 int maxCharge = 3, minCharge = 1;
140 for (
size_t i=0; i < calculator->size(); ++i)
143 vector<double>& mzs = s->getMZArray()->data;
144 vector<double>& intensities = s->getIntensityArray()->data;
146 vector<double> goldMZArray =
parseDoubleArray(goldStandard[i].inputMZArray);
147 vector<double> goldIntensityArray =
parseDoubleArray(goldStandard[i].inputIntensityArray);
150 unit_assert(intensities.size() == goldIntensityArray.size());
152 for (
size_t j=0; j < mzs.size(); ++j)
166 cerr <<
"Test failed:\n" << e.what() << endl;
173 int main(
int argc,
char* argv[])
179 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
180 int failedTests =
test();
TestDeisotopeCalculator goldStandard[]
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
const size_t goldStandardSize
The method of precursor ion selection and activation.
const size_t testDeisotopeSize
boost::shared_ptr< SpectrumDataFilter > SpectrumDataFilterPtr
boost::shared_ptr< Spectrum > SpectrumPtr
SpectrumList implementation that returns spectra with the specified SpectrumDataFilter operation appl...
#define unit_assert_equal(x, y, epsilon)
TestDeisotopeCalculator testDeisotopeCalculators[]
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
PrecursorMassFilter's parameters.
const char * inputIntensityArray
#define unit_assert_operator_equal(expected, actual)
int main(int argc, char *argv[])
boost::shared_ptr< SpectrumList > SpectrumListPtr
const char * inputMZArray
std::vector< SpectrumPtr > spectra
MS_number_of_detector_counts
number of detector counts: The number of counted events observed in one or a group of elements of a d...
struct for expressing m/z tolerance in either amu or ppm
#define TEST_PROLOG(argc, argv)
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
vector< double > parseDoubleArray(const string &doubleArray)
Simple writeable in-memory implementation of SpectrumList.
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.