ProteoWizard
Functions | Variables
MinimumPepXMLTest.cpp File Reference
#include "MinimumPepXML.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"

Go to the source code of this file.

Functions

Specificity makeSpecificity ()
SampleEnzyme makeSampleEnzyme ()
SearchDatabase makeSearchDatabase ()
Q3RatioResult makeQ3RatioResult ()
PeptideProphetResult makePeptideProphetResult ()
AnalysisResult makeAnalysisResult ()
AlternativeProtein makeAlternativeProtein ()
ModAminoAcidMass makeModAminoAcidMass ()
ModificationInfo makeModificationInfo ()
SearchHit makeSearchHit ()
EnzymaticSearchConstraint makeEnzymaticSearchConstraint ()
AminoAcidModification makeAminoAcidModification ()
SearchSummary makeSearchSummary ()
SearchResult makeSearchResult ()
SpectrumQuery makeSpectrumQuery ()
MSMSRunSummary makeMSMSRunSummary ()
MatchPtr makeMatch ()
void testSpecificity ()
void testSampleEnzyme ()
void testSearchDatabase ()
void testQ3RatioResult ()
void testPeptideProphetResult ()
void testAnalysisResult ()
void testAlternativeProtein ()
void testModAminoAcidMass ()
void testModificationInfo ()
void testSearchHit ()
void testSearchResult ()
void testEnzymaticSearchConstraint ()
void testAminoAcidModification ()
void testSearchSummary ()
void testSpectrumQuery ()
void testMSMSRunSummary ()
void testMSMSPipelineAnalysis ()
void testMatch ()
void testMatchData ()
void testInvarianceUnderProteinProphet ()
int main (int argc, char *argv[])

Variables

ostream * os_ = 0

Function Documentation

Specificity makeSpecificity ( )

Definition at line 32 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::Specificity::cut, pwiz::data::pepxml::Specificity::minSpace, pwiz::data::pepxml::Specificity::noCut, and pwiz::data::pepxml::Specificity::sense.

Referenced by makeSampleEnzyme(), and testSpecificity().

{
Specificity specificity;
specificity.cut = "theCake";
specificity.noCut = "notTheCake";
specificity.sense = "non";
specificity.minSpace = 2;
return specificity;
}
SampleEnzyme makeSampleEnzyme ( )

Definition at line 44 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::SampleEnzyme::description, pwiz::data::pepxml::SampleEnzyme::fidelity, pwiz::data::pepxml::SampleEnzyme::independent, makeSpecificity(), pwiz::data::pepxml::SampleEnzyme::name, and pwiz::data::pepxml::SampleEnzyme::specificity.

Referenced by makeMSMSRunSummary(), and testSampleEnzyme().

{
SampleEnzyme sampleEnzyme;
sampleEnzyme.name = "oxiclean";
sampleEnzyme.description = "makes your whites whiter.";
sampleEnzyme.fidelity = "scoundrel";
sampleEnzyme.independent = true;
Specificity specificity = makeSpecificity();
sampleEnzyme.specificity = specificity;
return sampleEnzyme;
}
SearchDatabase makeSearchDatabase ( )

Definition at line 59 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::SearchDatabase::databaseName, pwiz::data::pepxml::SearchDatabase::databaseReleaseIdentifier, pwiz::data::pepxml::SearchDatabase::localPath, pwiz::data::pepxml::SearchDatabase::sizeInDbEntries, pwiz::data::pepxml::SearchDatabase::sizeOfResidues, and pwiz::data::pepxml::SearchDatabase::type.

Referenced by makeSearchSummary(), and testSearchDatabase().

{
SearchDatabase searchDatabase;
searchDatabase.localPath = "http://www.eharmony.com";
searchDatabase.databaseName = "yenta";
searchDatabase.databaseReleaseIdentifier = "village busy body";
searchDatabase.sizeInDbEntries = 2;
searchDatabase.sizeOfResidues = 3;
searchDatabase.type = "online dating service";
return searchDatabase;
}
Q3RatioResult makeQ3RatioResult ( )
PeptideProphetResult makePeptideProphetResult ( )

Definition at line 91 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::PeptideProphetResult::allNttProb, and pwiz::data::pepxml::PeptideProphetResult::probability.

Referenced by makeAnalysisResult(), and testPeptideProphetResult().

{
PeptideProphetResult peptideProphetResult;
peptideProphetResult.probability = 0.98;
peptideProphetResult.allNttProb.push_back(0.0000);
peptideProphetResult.allNttProb.push_back(0.0000);
peptideProphetResult.allNttProb.push_back(0.780);
return peptideProphetResult;
}
AnalysisResult makeAnalysisResult ( )

Definition at line 104 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::AnalysisResult::analysis, makePeptideProphetResult(), and pwiz::data::pepxml::AnalysisResult::peptideProphetResult.

Referenced by makeSearchHit(), and testAnalysisResult().

{
AnalysisResult analysisResult;
analysisResult.analysis = "peptideprophet";
analysisResult.peptideProphetResult = pp;
return analysisResult;
}
AlternativeProtein makeAlternativeProtein ( )

Definition at line 116 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::AlternativeProtein::numTolTerm, pwiz::data::pepxml::AlternativeProtein::protein, and pwiz::data::pepxml::AlternativeProtein::proteinDescr.

Referenced by makeSearchHit(), and testAlternativeProtein().

{
AlternativeProtein alternativeProtein;
alternativeProtein.protein = "Dos Pinos";
alternativeProtein.proteinDescr = "leche";
alternativeProtein.numTolTerm = "5";
return alternativeProtein;
}
ModAminoAcidMass makeModAminoAcidMass ( )

Definition at line 127 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::ModAminoAcidMass::mass, and pwiz::data::pepxml::ModAminoAcidMass::position.

Referenced by makeModificationInfo(), and testModAminoAcidMass().

{
ModAminoAcidMass modAminoAcidMass;
modAminoAcidMass.position = 2;
modAminoAcidMass.mass = 12.345;
return modAminoAcidMass;
}
ModificationInfo makeModificationInfo ( )

Definition at line 137 of file MinimumPepXMLTest.cpp.

References makeModAminoAcidMass(), pwiz::data::pepxml::ModificationInfo::modAminoAcidMass, and pwiz::data::pepxml::ModificationInfo::modifiedPeptide.

Referenced by makeSearchHit(), and testModificationInfo().

{
ModificationInfo modificationInfo;
modificationInfo.modifiedPeptide = "GATO";
modificationInfo.modAminoAcidMass = makeModAminoAcidMass();
return modificationInfo;
}
SearchHit makeSearchHit ( )

Definition at line 146 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::SearchHit::alternativeProteins, pwiz::data::pepxml::SearchHit::analysisResult, pwiz::data::pepxml::SearchHit::calcNeutralPepMass, pwiz::data::pepxml::SearchHit::hitRank, pwiz::data::pepxml::SearchHit::isRejected, makeAlternativeProtein(), makeAnalysisResult(), makeModificationInfo(), pwiz::data::pepxml::SearchHit::massDiff, pwiz::data::pepxml::SearchHit::modificationInfo, pwiz::data::pepxml::SearchHit::numMatchedIons, pwiz::data::pepxml::SearchHit::numMissedCleavages, pwiz::data::pepxml::SearchHit::numTolTerm, pwiz::data::pepxml::SearchHit::numTotalProteins, pwiz::data::pepxml::SearchHit::peptide, pwiz::data::pepxml::SearchHit::peptideNextAA, pwiz::data::pepxml::SearchHit::peptidePrevAA, pwiz::data::pepxml::SearchHit::protein, and pwiz::data::pepxml::SearchHit::proteinDescr.

Referenced by makeSearchResult(), and testSearchHit().

{
SearchHit searchHit;
searchHit.hitRank = 1;
searchHit.peptide = "RAGMALLICK";
searchHit.peptidePrevAA = "R";
searchHit.peptideNextAA = "V";
searchHit.protein = "PA";
searchHit.proteinDescr = "Bioinfomagicist";
searchHit.numTotalProteins = 1;
searchHit.numMatchedIons = 9;
searchHit.calcNeutralPepMass = 4.21399;
searchHit.massDiff = .0004;
searchHit.numTolTerm = 2;
searchHit.numMissedCleavages = 3;
searchHit.isRejected = 0;
AnalysisResult analysisResult = makeAnalysisResult();
searchHit.analysisResult = analysisResult;
searchHit.alternativeProteins.push_back(alternativeProtein);
return searchHit;
}
EnzymaticSearchConstraint makeEnzymaticSearchConstraint ( )

Definition at line 175 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::EnzymaticSearchConstraint::enzyme, pwiz::data::pepxml::EnzymaticSearchConstraint::maxNumInternalCleavages, and pwiz::data::pepxml::EnzymaticSearchConstraint::minNumTermini.

Referenced by makeSearchSummary(), and testEnzymaticSearchConstraint().

{
EnzymaticSearchConstraint enzymaticSearchConstraint;
enzymaticSearchConstraint.enzyme = "emyzne";
enzymaticSearchConstraint.maxNumInternalCleavages = 1;
enzymaticSearchConstraint.minNumTermini = 1;
return enzymaticSearchConstraint;
}
AminoAcidModification makeAminoAcidModification ( )

Definition at line 187 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::AminoAcidModification::aminoAcid, pwiz::data::pepxml::AminoAcidModification::mass, pwiz::data::pepxml::AminoAcidModification::massDiff, pwiz::data::pepxml::AminoAcidModification::symbol, and pwiz::data::pepxml::AminoAcidModification::variable.

Referenced by makeSearchSummary(), and testAminoAcidModification().

{
AminoAcidModification aminoAcidModification;
aminoAcidModification.aminoAcid = "pm";
aminoAcidModification.massDiff = 9.63333;
aminoAcidModification.mass = 82.65;
aminoAcidModification.variable = "c";
aminoAcidModification.symbol = "r";
return aminoAcidModification;
}
SearchSummary makeSearchSummary ( )
SearchResult makeSearchResult ( )

Definition at line 225 of file MinimumPepXMLTest.cpp.

References makeSearchHit(), and pwiz::data::pepxml::SearchResult::searchHit.

Referenced by makeSpectrumQuery(), and testSearchResult().

{
SearchResult searchResult;
SearchHit searchHit = makeSearchHit();
searchResult.searchHit.push_back(SearchHitPtr(new SearchHit(searchHit)));
return searchResult;
}
SpectrumQuery makeSpectrumQuery ( )
MSMSRunSummary makeMSMSRunSummary ( )

Definition at line 255 of file MinimumPepXMLTest.cpp.

References makeSampleEnzyme(), makeSearchSummary(), makeSpectrumQuery(), pwiz::data::pepxml::MSMSRunSummary::sampleEnzyme, pwiz::data::pepxml::MSMSRunSummary::searchSummary, and pwiz::data::pepxml::MSMSRunSummary::spectrumQueries.

Referenced by testMSMSPipelineAnalysis(), and testMSMSRunSummary().

{
MSMSRunSummary msmsRunSummary;
SampleEnzyme sampleEnzyme = makeSampleEnzyme();
msmsRunSummary.sampleEnzyme = makeSampleEnzyme();
SearchSummary searchSummary = makeSearchSummary();
msmsRunSummary.searchSummary.push_back(SearchSummaryPtr(new SearchSummary(searchSummary)));
SpectrumQuery spectrumQuery = makeSpectrumQuery();
msmsRunSummary.spectrumQueries.push_back(SpectrumQueryPtr(new SpectrumQuery(spectrumQuery)));
msmsRunSummary.spectrumQueries.push_back(SpectrumQueryPtr(new SpectrumQuery(spectrumQuery)));
return msmsRunSummary;
}
MatchPtr makeMatch ( )

Definition at line 273 of file MinimumPepXMLTest.cpp.

References makeSpectrumQuery().

Referenced by testMatch(), and testMatchData().

{
MatchPtr match(new Match());
match->spectrumQuery = makeSpectrumQuery();
match->feature->mz = 1.234;
match->feature->retentionTime = 5.678;
return match;
}
void testSpecificity ( )

Definition at line 284 of file MinimumPepXMLTest.cpp.

References makeSpecificity(), os_, pwiz::data::pepxml::Specificity::read(), unit_assert, and pwiz::data::pepxml::Specificity::write().

Referenced by main().

{
if (os_) *os_ << "\ntestSpecificity() ... \n";
Specificity specificity = makeSpecificity();
ostringstream oss;
XMLWriter writer(oss);
specificity.write(writer);
Specificity readSpecificity;
istringstream iss(oss.str());
readSpecificity.read(iss);
unit_assert(specificity == readSpecificity);
if (os_) *os_ << oss.str() << endl;
}
void testSampleEnzyme ( )

Definition at line 304 of file MinimumPepXMLTest.cpp.

References makeSampleEnzyme(), os_, pwiz::data::pepxml::SampleEnzyme::read(), unit_assert, and pwiz::data::pepxml::SampleEnzyme::write().

Referenced by main().

{
if (os_) *os_ << "\ntestSampleEnzyme() ... \n";
SampleEnzyme sampleEnzyme = makeSampleEnzyme();
ostringstream oss;
XMLWriter writer(oss);
sampleEnzyme.write(writer);
SampleEnzyme readSampleEnzyme;
istringstream iss(oss.str());
readSampleEnzyme.read(iss);
unit_assert(sampleEnzyme == readSampleEnzyme);
if (os_) *os_ << oss.str() << endl;
}
void testSearchDatabase ( )

Definition at line 324 of file MinimumPepXMLTest.cpp.

References makeSearchDatabase(), os_, pwiz::data::pepxml::SearchDatabase::read(), unit_assert, and pwiz::data::pepxml::SearchDatabase::write().

{
if (os_) *os_ << "\ntestSearchDatabase() ... \n";
SearchDatabase searchDatabase = makeSearchDatabase();
ostringstream oss;
XMLWriter writer(oss);
searchDatabase.write(writer);
SearchDatabase readSearchDatabase;
istringstream iss(oss.str());
readSearchDatabase.read(iss);
unit_assert(searchDatabase == readSearchDatabase);
if (os_) *os_ << oss.str() << endl;
}
void testQ3RatioResult ( )

Definition at line 344 of file MinimumPepXMLTest.cpp.

References makeQ3RatioResult(), os_, pwiz::data::pepxml::Q3RatioResult::read(), unit_assert, and pwiz::data::pepxml::Q3RatioResult::write().

Referenced by main().

{
if (os_) *os_ << "\ntestQ3RatioResult() ... \n";
ostringstream oss;
XMLWriter writer(oss);
q.write(writer);
istringstream iss(oss.str());
readQ.read(iss);
unit_assert(q == readQ);
if (os_) *os_ << oss.str() << endl;
}
void testPeptideProphetResult ( )

Definition at line 363 of file MinimumPepXMLTest.cpp.

References makePeptideProphetResult(), os_, pwiz::data::pepxml::PeptideProphetResult::read(), unit_assert, and pwiz::data::pepxml::PeptideProphetResult::write().

Referenced by main().

{
if (os_) *os_ << "\ntestPeptideProphetResult() ... \n";
ostringstream oss;
XMLWriter writer(oss);
pp.write(writer);
PeptideProphetResult readPeptideProphetResult;
istringstream iss(oss.str());
readPeptideProphetResult.read(iss);
unit_assert(pp == readPeptideProphetResult);
if (os_) *os_ << oss.str() << endl;
}
void testAnalysisResult ( )

Definition at line 383 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::AnalysisResult::analysis, makeAnalysisResult(), makeQ3RatioResult(), os_, pwiz::data::pepxml::AnalysisResult::q3RatioResult, pwiz::data::pepxml::AnalysisResult::read(), unit_assert, and pwiz::data::pepxml::AnalysisResult::write().

Referenced by main().

{
if (os_) *os_ << "\ntestAnalysisResult() ...\n";
AnalysisResult analysisResult = makeAnalysisResult();
ostringstream oss;
XMLWriter writer(oss);
analysisResult.write(writer);
AnalysisResult readAnalysisResult;
istringstream iss(oss.str());
readAnalysisResult.read(iss);
unit_assert(analysisResult == readAnalysisResult);
if(os_) *os_ << oss.str() << endl;
AnalysisResult analysisResult2;
analysisResult2.analysis = "q3";
analysisResult2.q3RatioResult = makeQ3RatioResult();
ostringstream oss2;
XMLWriter writer2(oss2);
analysisResult2.write(writer2);
AnalysisResult readAnalysisResult2;
istringstream iss2(oss2.str());
readAnalysisResult2.read(iss2);
unit_assert(analysisResult2 == readAnalysisResult2);
if(os_) *os_ << oss2.str() << endl;
}
void testAlternativeProtein ( )

Definition at line 419 of file MinimumPepXMLTest.cpp.

References makeAlternativeProtein(), os_, pwiz::data::pepxml::AlternativeProtein::read(), unit_assert, and pwiz::data::pepxml::AlternativeProtein::write().

Referenced by main().

{
if (os_) *os_ << "\ntestAlternativeProtein() ...\n";
ostringstream oss;
XMLWriter writer(oss);
alternativeProtein.write(writer);
AlternativeProtein readAlternativeProtein;
istringstream iss(oss.str());
readAlternativeProtein.read(iss);
unit_assert(alternativeProtein == readAlternativeProtein);
if(os_) *os_ << oss.str() << endl;
}
void testModAminoAcidMass ( )

Definition at line 440 of file MinimumPepXMLTest.cpp.

References makeModAminoAcidMass(), os_, pwiz::data::pepxml::ModAminoAcidMass::read(), unit_assert, and pwiz::data::pepxml::ModAminoAcidMass::write().

Referenced by main().

{
if (os_) *os_ << "\ntestModAminoAcidMass() ...\n";
ModAminoAcidMass modAminoAcidMass = makeModAminoAcidMass();
ostringstream oss;
XMLWriter writer(oss);
modAminoAcidMass.write(writer);
ModAminoAcidMass readModAminoAcidMass;
istringstream iss(oss.str());
readModAminoAcidMass.read(iss);
unit_assert(modAminoAcidMass == readModAminoAcidMass);
if(os_) *os_ << oss.str() << endl;
}
void testModificationInfo ( )

Definition at line 459 of file MinimumPepXMLTest.cpp.

References makeModificationInfo(), os_, pwiz::data::pepxml::ModificationInfo::read(), unit_assert, and pwiz::data::pepxml::ModificationInfo::write().

Referenced by main().

{
if (os_) *os_ << "\ntestModificationInfo() ...\n";
ModificationInfo modificationInfo = makeModificationInfo();
ostringstream oss;
XMLWriter writer(oss);
modificationInfo.write(writer);
ModificationInfo readModificationInfo;
istringstream iss(oss.str());
readModificationInfo.read(iss);
unit_assert(modificationInfo == readModificationInfo);
if(os_) *os_ << oss.str() << endl;
}
void testSearchHit ( )

Definition at line 479 of file MinimumPepXMLTest.cpp.

References makeSearchHit(), os_, pwiz::data::pepxml::SearchHit::read(), unit_assert, and pwiz::data::pepxml::SearchHit::write().

Referenced by main().

{
if (os_) *os_ << "\ntestSearchHit() ...\n";
SearchHit searchHit = makeSearchHit();
ostringstream oss;
XMLWriter writer(oss);
searchHit.write(writer);
SearchHit readSearchHit;
istringstream iss(oss.str());
readSearchHit.read(iss);
unit_assert(searchHit == readSearchHit);
if(os_) *os_ << oss.str() << endl;
}
void testSearchResult ( )

Definition at line 498 of file MinimumPepXMLTest.cpp.

References makeSearchResult(), os_, pwiz::data::pepxml::SearchResult::read(), unit_assert, and pwiz::data::pepxml::SearchResult::write().

Referenced by main().

{
if(os_) *os_ << "\ntestSearchResult() ... \n";
SearchResult searchResult = makeSearchResult();
ostringstream oss;
XMLWriter writer(oss);
searchResult.write(writer);
SearchResult readSearchResult;
istringstream iss(oss.str());
readSearchResult.read(iss);
unit_assert(searchResult == readSearchResult);
if(os_) *os_ << oss.str() << endl;
}
void testEnzymaticSearchConstraint ( )

Definition at line 519 of file MinimumPepXMLTest.cpp.

References makeEnzymaticSearchConstraint(), os_, pwiz::data::pepxml::EnzymaticSearchConstraint::read(), unit_assert, and pwiz::data::pepxml::EnzymaticSearchConstraint::write().

Referenced by main().

{
if (os_) *os_ << "\ntestEnzymaticSearchConstraint() ... \n";
ostringstream oss;
XMLWriter writer(oss);
enzymaticSearchConstraint.write(writer);
EnzymaticSearchConstraint readEnzymaticSearchConstraint;
istringstream iss(oss.str());
readEnzymaticSearchConstraint.read(iss);
unit_assert(enzymaticSearchConstraint == readEnzymaticSearchConstraint);
if(os_) *os_ << oss.str() << endl;
}
void testAminoAcidModification ( )

Definition at line 539 of file MinimumPepXMLTest.cpp.

References makeAminoAcidModification(), os_, pwiz::data::pepxml::AminoAcidModification::read(), unit_assert, and pwiz::data::pepxml::AminoAcidModification::write().

Referenced by main().

{
if (os_) *os_ << "\ntestAminoAcidModification() ... \n";
ostringstream oss;
XMLWriter writer(oss);
aminoAcidModification.write(writer);
AminoAcidModification readAminoAcidModification;
istringstream iss(oss.str());
readAminoAcidModification.read(iss);
unit_assert(aminoAcidModification == readAminoAcidModification);
if(os_) *os_ << oss.str() << endl;
}
void testSearchSummary ( )

Definition at line 559 of file MinimumPepXMLTest.cpp.

References makeSearchSummary(), os_, pwiz::data::pepxml::SearchSummary::read(), unit_assert, and pwiz::data::pepxml::SearchSummary::write().

Referenced by main().

{
if(os_) *os_ << "\ntestSearchSummary() ... \n";
SearchSummary searchSummary = makeSearchSummary();
ostringstream oss;
XMLWriter writer(oss);
searchSummary.write(writer);
SearchSummary readSearchSummary;
istringstream iss(oss.str());
readSearchSummary.read(iss);
unit_assert(searchSummary == readSearchSummary);
if(os_) *os_ << oss.str() << endl;
}
void testSpectrumQuery ( )

Definition at line 579 of file MinimumPepXMLTest.cpp.

References makeSpectrumQuery(), os_, pwiz::data::pepxml::SpectrumQuery::read(), unit_assert, and pwiz::data::pepxml::SpectrumQuery::write().

Referenced by main().

{
if(os_) *os_ << "\ntestSpectrumQuery() ... \n";
SpectrumQuery spectrumQuery = makeSpectrumQuery();
ostringstream oss;
XMLWriter writer(oss);
spectrumQuery.write(writer);
if(os_) *os_ << oss.str() << endl;
SpectrumQuery readSpectrumQuery;
istringstream iss(oss.str());
readSpectrumQuery.read(iss);
readSpectrumQuery.write(writer);
if(os_) *os_ << oss.str() << endl;
unit_assert(spectrumQuery == readSpectrumQuery);
if(os_) *os_ << oss.str() << endl;
}
void testMSMSRunSummary ( )

Definition at line 603 of file MinimumPepXMLTest.cpp.

References makeMSMSRunSummary(), os_, pwiz::data::pepxml::MSMSRunSummary::read(), unit_assert, and pwiz::data::pepxml::MSMSRunSummary::write().

Referenced by main().

{
if(os_) *os_ << "\ntestMSMSRunSummary() ... \n";
MSMSRunSummary msmsRunSummary = makeMSMSRunSummary();
ostringstream oss;
XMLWriter writer(oss);
msmsRunSummary.write(writer);
MSMSRunSummary readMSMSRunSummary;
istringstream iss(oss.str());
readMSMSRunSummary.read(iss);
unit_assert(msmsRunSummary == readMSMSRunSummary);
if(os_) *os_ << oss.str() << endl;
}
void testMSMSPipelineAnalysis ( )

Definition at line 623 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::MSMSPipelineAnalysis::date, makeMSMSRunSummary(), pwiz::data::pepxml::MSMSPipelineAnalysis::msmsRunSummary, os_, pwiz::data::pepxml::MSMSPipelineAnalysis::read(), pwiz::data::pepxml::MSMSPipelineAnalysis::summaryXML, unit_assert, pwiz::data::pepxml::MSMSPipelineAnalysis::write(), pwiz::data::pepxml::MSMSPipelineAnalysis::xmlns, pwiz::data::pepxml::MSMSPipelineAnalysis::xmlnsXSI, and pwiz::data::pepxml::MSMSPipelineAnalysis::XSISchemaLocation.

Referenced by main().

{
if(os_) *os_ << "\ntestMSMSPipelineAnalysis() ... \n";
MSMSPipelineAnalysis msmsPipelineAnalysis;
msmsPipelineAnalysis.date = "20000101";
msmsPipelineAnalysis.summaryXML = "/2000/01/20000101/20000101.xml";
msmsPipelineAnalysis.xmlns = "http://regis-web.systemsbiology.net/pepXML";
msmsPipelineAnalysis.xmlnsXSI = "aruba";
msmsPipelineAnalysis.XSISchemaLocation = "jamaica";
msmsPipelineAnalysis.msmsRunSummary = msrs;
ostringstream oss;
XMLWriter writer(oss);
msmsPipelineAnalysis.write(writer);
MSMSPipelineAnalysis readMSMSPipelineAnalysis;
istringstream iss(oss.str());
readMSMSPipelineAnalysis.read(iss);
unit_assert(msmsPipelineAnalysis == readMSMSPipelineAnalysis);
if(os_) *os_ << oss.str() << endl;
}
void testMatch ( )

Definition at line 651 of file MinimumPepXMLTest.cpp.

References makeMatch(), os_, pwiz::data::pepxml::Match::read(), unit_assert, and pwiz::data::pepxml::Match::write().

Referenced by main().

{
if(os_) *os_ << "\ntestMatch() ... \n";
MatchPtr match = makeMatch();
ostringstream oss;
XMLWriter writer(oss);
match->write(writer);
Match readMatch;
istringstream iss(oss.str());
readMatch.read(iss);
ostringstream checkstream;
XMLWriter check(checkstream);
readMatch.write(check);
// unit_assert(*match == readMatch);
if(os_) *os_ << oss.str() << endl;
if(os_) *os_ << checkstream.str() << endl;
unit_assert(*match == readMatch);
}
void testMatchData ( )

Definition at line 677 of file MinimumPepXMLTest.cpp.

References makeMatch(), pwiz::data::pepxml::MatchData::matches, os_, pwiz::data::pepxml::MatchData::read(), pwiz::data::pepxml::MatchData::searchNbhdCalculator, unit_assert, pwiz::data::pepxml::MatchData::warpFunctionCalculator, and pwiz::data::pepxml::MatchData::write().

Referenced by main().

{
if(os_) *os_ << "\ntestMatchData() ... \n";
MatchData matchData;
matchData.warpFunctionCalculator = "Spock";
matchData.searchNbhdCalculator = "Mr. Rogers";
matchData.matches.push_back(makeMatch());
matchData.matches.push_back(makeMatch());
ostringstream oss;
XMLWriter writer(oss);
matchData.write(writer);
MatchData readMatchData;
istringstream iss(oss.str());
readMatchData.read(iss);
ostringstream checkstream;
XMLWriter check(checkstream);
readMatchData.write(check);
// unit_assert(*match == readMatch);
if(os_) *os_ << oss.str() << endl;
if(os_) *os_ << checkstream.str() << endl;
unit_assert(matchData == readMatchData);
if(os_) *os_ << oss.str() << endl;
}
void testInvarianceUnderProteinProphet ( )

Definition at line 712 of file MinimumPepXMLTest.cpp.

References pwiz::data::pepxml::MSMSPipelineAnalysis::read(), and pwiz::data::pepxml::MSMSPipelineAnalysis::write().

{
ifstream ifs("20080619-A-6mixtestRG_Data10_msprefix.pep.xml");
if (!(ifs.good()) )
{
throw runtime_error("bad ifs");
return;
}
MSMSPipelineAnalysis msmsPipelineAnalysis;
msmsPipelineAnalysis.read(ifs);
ofstream ofs("test.pep.xml", ios::app);
XMLWriter writer(ofs);
msmsPipelineAnalysis.write(writer);
}
int main ( int  argc,
char *  argv[] 
)

Variable Documentation

ostream* os_ = 0

Definition at line 30 of file MinimumPepXMLTest.cpp.