32 #include "boost/range/adaptor/transformed.hpp"
33 #include "boost/range/algorithm/max_element.hpp"
34 #include "boost/range/algorithm/min_element.hpp"
38 using namespace pwiz::identdata;
39 using namespace pwiz::identdata::examples;
40 using namespace pwiz::util;
41 namespace proteome = pwiz::proteome;
48 int operator()(
const EnzymePtr&
x)
const {
return x->terminalSpecificity;}
54 int operator()(
const EnzymePtr&
x)
const {
return x->missedCleavages;}
68 as->customizations.clear();
69 as->contactRolePtr.reset();
79 ez->terminalSpecificity = (proteome::Digestion::Specificity) minSpecificity;
80 ez->missedCleavages = maxMissedCleavages;
97 location =
BFS_STRING(bfs::path(location).replace_extension(
"").filename());
101 location2 =
BFS_STRING(bfs::path(location2).replace_extension(
"").filename());
106 dbSequence->seq.clear();
107 dbSequence->length = 0;
108 dbSequence->id =
"DBSeq_" + dbSequence->accession;
113 BOOST_FOREACH(ModificationPtr& mod, peptide->modification)
114 mod->monoisotopicMassDelta = mod->avgMassDelta =
max(mod->monoisotopicMassDelta, mod->avgMassDelta);
120 BOOST_FOREACH(SpectrumIdentificationItemPtr& sii, sir->spectrumIdentificationItem)
123 sii->fragmentation.clear();
124 sii->massTablePtr.reset();
126 for (
size_t i=0; i < sii->peptideEvidencePtr.size(); ++i)
147 unit_assert(bal::contains(str,
"search_engine=\"Mascot\""));
150 unit_assert(bal::contains(str,
"name=\"ionscore\""));
151 unit_assert(bal::contains(str,
"name=\"homologyscore\""));
152 unit_assert(bal::contains(str,
"name=\"identityscore\""));
153 unit_assert(bal::contains(str,
"name=\"expect\""));
154 unit_assert(bal::contains(str,
"name=\"an extra score\""));
157 unit_assert(bal::contains(str,
"spectrumNativeID=\"controllerType=0 controllerNumber=1 scan=420\""));
162 if (
os_) *
os_ <<
"begin testSerialize" << endl;
166 serializer.
write(oss, mzid,
"tiny.pepXML");
168 if (
os_) *
os_ <<
"oss:\n" << oss.str() << endl;
172 shared_ptr<istringstream> iss(
new istringstream(oss.str()));
174 serializer.
read(iss, mzid2);
179 if (
os_ && diff) *
os_ << diff << endl;
193 EnzymePtr noEnzyme(
new Enzyme);
194 noEnzyme->id =
"ENZ_1";
195 noEnzyme->cTermGain =
"OH";
196 noEnzyme->nTermGain =
"H";
197 noEnzyme->missedCleavages = 2;
198 noEnzyme->minDistance = 1;
200 noEnzyme->siteRegexp =
"(?<=[KR])";
208 EnzymePtr aspN(
new Enzyme);
210 aspN->cTermGain =
"OH";
211 aspN->nTermGain =
"H";
212 aspN->missedCleavages = 2;
213 aspN->minDistance = 1;
214 aspN->terminalSpecificity = proteome::Digestion::FullySpecific;
215 aspN->siteRegexp =
"(?=[BD])";
220 aspN->missedCleavages = 4;
221 aspN->minDistance = 2;
223 aspN->siteRegexp =
"(?=[BND])";
224 aspN->enzymeName.clear();
225 aspN->enzymeName.userParams.push_back(
UserParam(
"custom"));
271 ez.
name =
"trypsin/p";
305 bool allCleavageAgentsHandled =
true;
316 cerr << e.what() << endl;
317 allCleavageAgentsHandled =
false;
374 int main(
int argc,
char** argv)
380 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;