36 ostream& operator<< (ostream& os, const vector<double>& v)
39 for (
size_t i=0; i < v.size(); ++i)
58 {
"112 120 121 123 124 128 129",
63 {
"119 120 121 122 123 124 127 128 129",
64 "4 5 6 7 8 9 10 11 12",
68 {
"200 200.01 200.02 200.09 200.20",
69 "1.0 3.0 1.0 0.0 3.0",
78 {
"200.01 200.02 200.03 200.08 200.09",
79 "1.0 3.0 1.0 1.0 4.0",
88 {
"112 119 120 121 122 123 124 126 127 128 129",
89 "7 4 12 7 7 12 11 7 17 12 19",
93 {
"200 200.01 200.02 200.03 200.08 200.09 200.20",
94 "1.0 4.0 4.0 1.0 1.0 4.0 3.0",
105 vector<double> doubleVector;
106 vector<string> tokens;
107 bal::split(tokens, doubleArray, bal::is_space(), bal::token_compress_on);
109 for (
size_t i=0; i < tokens.size(); ++i)
110 if (!tokens[i].empty())
111 doubleVector.push_back(lexical_cast<double>(tokens[i]));
130 s->scanList.scans.push_back(
Scan());
131 Scan& scanRef = s->scanList.scans[0];
138 s->defaultArrayLength = inputMZArray.size();
148 vector<double> goldMZArray =
parseDoubleArray(goldStandard[0].inputMZArray);
149 vector<double> goldIntensityArray =
parseDoubleArray(goldStandard[0].inputIntensityArray);
157 for (
size_t i=0; i < calculator->size(); ++i)
160 vector<double>& mzs = s->getMZArray()->data;
161 vector<double>& intensities = s->getIntensityArray()->data;
167 vector<double> goldMZArray =
parseDoubleArray(goldStandard[i].inputMZArray);
168 vector<double> goldIntensityArray =
parseDoubleArray(goldStandard[i].inputIntensityArray);
171 unit_assert(intensities.size() == goldIntensityArray.size());
172 unit_assert(precursorMZ == goldStandard[i].inputPrecursorMZ);
175 for (
size_t j=0; j < mzs.size(); ++j)
189 cerr <<
"Test failed:\n" << e.what() << endl;
196 int main(
int argc,
char* argv[])
202 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
203 int failedTests =
test();
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
CVParam cvParam(CVID cvid) const
finds cvid in the container:
The method of precursor ion selection and activation.
int main(int argc, char *argv[])
TestScanSummerCalculator goldStandard[]
boost::shared_ptr< Spectrum > SpectrumPtr
Provides a custom-sorted spectrum list.
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run...
const size_t goldStandardSize
#define unit_assert_equal(x, y, epsilon)
MS_scan_window_upper_limit
scan window upper limit: The lower m/z bound of a mass spectrometer scan window.
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
UO_second
second: A time unit which is equal to the duration of 9 192 631 770 periods of the radiation correspo...
MS_selected_ion_m_z
selected ion m/z: Mass-to-charge ratio of an selected ion.
vector< double > parseDoubleArray(const string &doubleArray)
#define unit_assert_operator_equal(expected, actual)
MS_scan_window_lower_limit
scan window lower limit: The upper m/z bound of a mass spectrometer scan window.
boost::shared_ptr< SpectrumList > SpectrumListPtr
const char * inputIntensityArray
const size_t testScanSummerSize
const char * inputMZArray
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
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...
TestScanSummerCalculator testScanSummerCalculators[]
#define TEST_PROLOG(argc, argv)
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
value_type valueAs() const
templated value access with type conversion
Simple writeable in-memory implementation of SpectrumList.