31 using namespace eharmony;
32 using namespace pwiz::util;
34 boost::shared_ptr<SpectrumQuery>
makeSpectrumQuery(
double precursorNeutralMass,
double rt,
int charge,
string sequence,
double score,
int startScan,
int endScan)
36 boost::shared_ptr<SpectrumQuery> spectrumQuery(
new SpectrumQuery());
37 spectrumQuery->startScan = startScan;
38 spectrumQuery->endScan = endScan;
39 spectrumQuery->precursorNeutralMass = precursorNeutralMass;
40 spectrumQuery->assumedCharge = charge;
41 spectrumQuery->retentionTimeSec = rt;
49 analysisResult.
analysis =
"peptideprophet";
62 spectrumQuery->searchResult = searchResult;
70 vector<boost::shared_ptr<SpectrumQuery> > testSpectrumQueries;
71 testSpectrumQueries.push_back(
makeSpectrumQuery(550.82, 83.46, 3,
"MAHTOMEDI", .95, 612, 651));
72 testSpectrumQueries.push_back(
makeSpectrumQuery(02.139, 02.142, 3,
"CAMBRIDGE", .95, 617, 857));
73 testSpectrumQueries.push_back(
makeSpectrumQuery(904.04, 913.60, 3,
"MAHTOMEDI", .95, 310, 805));
74 testSpectrumQueries.push_back(
makeSpectrumQuery(537.17, 53.703, 3,
"MAHTOMEDI", .96, 608, 715));
76 PidfPtr four(
new PeptideID_dataFetcher(testSpectrumQueries));
77 testSpectrumQueries.erase(testSpectrumQueries.begin());
78 testSpectrumQueries.erase(testSpectrumQueries.begin());
79 PidfPtr two(
new PeptideID_dataFetcher(testSpectrumQueries));
80 testSpectrumQueries.erase(testSpectrumQueries.begin());
81 PidfPtr one(
new PeptideID_dataFetcher(testSpectrumQueries));
83 boost::shared_ptr<Feature_dataFetcher> dummy_fdf(
new Feature_dataFetcher());
85 boost::shared_ptr<AMTContainer> cuatro(
new AMTContainer());
87 cuatro->_fdf = dummy_fdf;
88 boost::shared_ptr<AMTContainer> dos(
new AMTContainer());
90 dos->_fdf = dummy_fdf;
91 boost::shared_ptr<AMTContainer> uno(
new AMTContainer());
93 uno->_fdf = dummy_fdf;
95 vector<boost::shared_ptr<AMTContainer> > testEntries;
96 testEntries.push_back(cuatro);
97 testEntries.push_back(dos);
98 testEntries.push_back(uno);
100 NeighborJoiner neighborJoiner(testEntries);
101 boost::shared_ptr<NumberOfMS2IDs> numpep(
new NumberOfMS2IDs());
103 neighborJoiner.addDistanceAttribute(numpep);
104 neighborJoiner.calculateDistanceMatrix();
105 neighborJoiner.joinNearest();
110 unit_assert(neighborJoiner._rowEntries.back() == *dos);
111 unit_assert(neighborJoiner._columnEntries.back() == *dos);
113 neighborJoiner.calculateDistanceMatrix();
114 neighborJoiner.joinNearest();
119 unit_assert(neighborJoiner._rowEntries.back() == *cuatro);
120 unit_assert(neighborJoiner._columnEntries.back() == *cuatro);