ProteoWizard
Functions | Variables
PeptideID_pepXMLTest.cpp File Reference
#include "pwiz/utility/misc/Std.hpp"
#include <cstring>
#include "PeptideID_pepXML.hpp"
#include "pwiz/utility/minimxml/SAXParser.hpp"
#include "pwiz/utility/misc/unit.hpp"

Go to the source code of this file.

Functions

void testIStream ()
 
void testFilename ()
 
int main (int argc, char *argv[])
 

Variables

ostream * os_
 
const char * samplePepXML
 

Function Documentation

§ testIStream()

void testIStream ( )

Definition at line 55 of file PeptideID_pepXMLTest.cpp.

References pwiz::peptideid::PeptideID::Record::nativeID, pwiz::peptideid::PeptideID::Record::normalizedScore, pwiz::peptideid::PeptideID_pepXml::record(), samplePepXML, pwiz::peptideid::PeptideID::Record::sequence, unit_assert, and unit_assert_equal.

Referenced by main().

56 {
57  istringstream xml (samplePepXML);
58 
59  PeptideID_pepXml ppXml(&xml);
60 
61  PeptideID::Location loc("1", 1.0, 0.);
62  PeptideID::Record bf = ppXml.record(loc);
63 
64  unit_assert(bf.nativeID == "1");
65  unit_assert(bf.sequence == "ABC");
66  unit_assert_equal(bf.normalizedScore, 0.9, 1e-15);
67 }
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
This class allows access to identified proteins in PeptideProphet files.
const char * samplePepXML
#define unit_assert(x)
Definition: unit.hpp:85

§ testFilename()

void testFilename ( )

Definition at line 69 of file PeptideID_pepXMLTest.cpp.

References pwiz::peptideid::PeptideID::Record::nativeID, pwiz::peptideid::PeptideID::Record::normalizedScore, pwiz::peptideid::PeptideID_pepXml::record(), pwiz::peptideid::PeptideID::Record::sequence, unit_assert, and unit_assert_equal.

70 {
71  ifstream xml ("test.pep.xml");
72 
73  PeptideID_pepXml ppXml(&xml);
74 
75 
76  PeptideID::Location loc("1", 1.0, 0.);
77  PeptideID::Record bf = ppXml.record(loc);
78 
79  unit_assert(bf.nativeID == "1");
80  unit_assert(bf.sequence == "ABC");
81  unit_assert_equal(bf.normalizedScore, 0.9, 1e-15);
82 }
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
This class allows access to identified proteins in PeptideProphet files.
#define unit_assert(x)
Definition: unit.hpp:85

§ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 84 of file PeptideID_pepXMLTest.cpp.

References os_, TEST_EPILOG, TEST_FAILED, TEST_PROLOG, and testIStream().

85 {
86  TEST_PROLOG(argc, argv)
87 
88  try
89  {
90  if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
91  testIStream();
92  //testFilename();
93  //testDone();
94  //testBadXML();
95  //testNested();
96  }
97  catch (exception& e)
98  {
99  TEST_FAILED(e.what())
100  }
101  catch (...)
102  {
103  TEST_FAILED("Caught unknown exception.")
104  }
105 
107 }
ostream * os_
#define TEST_EPILOG
Definition: unit.hpp:182
void testIStream()
#define TEST_FAILED(x)
Definition: unit.hpp:176
#define TEST_PROLOG(argc, argv)
Definition: unit.hpp:174

Variable Documentation

§ os_

ostream* os_

Definition at line 34 of file PeptideID_pepXMLTest.cpp.

Referenced by main().

§ samplePepXML

const char* samplePepXML
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<msms_pipeline_analysis>\n"
"<msms_run_summary>\n"
"<spectrum_query start_scan=\"1\" end_scan=\"1\" retention_time_sec=\"1.0\">\n"
"<search_result>\n"
"<search_hit peptide=\"ABC\">\n"
"<analysis_result analysis=\"peptideprophet\">\n"
"<peptideprophet_result probability=\"0.900\">\n"
"<search_score_summary>\n"
"</search_score_summary>\n"
"</peptideprophet_result>\n"
"</analysis_result>\n"
"</search_hit>\n"
"</search_result>\n"
"</spectrum_query>\n"
"</msms_run_summary>\n"
"</msms_pipeline_analysis>\n"

Definition at line 36 of file PeptideID_pepXMLTest.cpp.

Referenced by testIStream().