#include "Serializer_pepXML.hpp"
#include "Diff.hpp"
#include "References.hpp"
#include "examples.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include "pwiz/utility/misc/Filesystem.hpp"
#include "pwiz/data/proteome/Digestion.hpp"
#include "TextWriter.hpp"
#include "boost/range/adaptor/transformed.hpp"
#include "boost/range/algorithm/max_element.hpp"
#include "boost/range/algorithm/min_element.hpp"
#include "boost/range/algorithm_ext/erase.hpp"
#include <cstring>
Go to the source code of this file.
◆ stripUnmappedMetadata()
| void stripUnmappedMetadata |
( |
IdentData & |
mzid | ) |
|
Definition at line 67 of file Serializer_pepXML_Test.cpp.
78 as->customizations.clear();
79 as->contactRolePtr.reset();
89 ez->terminalSpecificity = (proteome::Digestion::Specificity) minSpecificity;
90 ez->missedCleavages = maxMissedCleavages;
107 location =
BFS_STRING(bfs::path(location).replace_extension(
"").filename());
111 location2 =
BFS_STRING(bfs::path(location2).replace_extension(
"").filename());
116 dbSequence->seq.clear();
117 dbSequence->length = 0;
118 dbSequence->id =
"DBSeq_" + dbSequence->accession;
124 mod->monoisotopicMassDelta = mod->avgMassDelta = max(mod->monoisotopicMassDelta, mod->avgMassDelta);
127 mzid.dataCollection.analysisData.spectrumIdentificationList[0]->fragmentationTable.clear();
129 BOOST_FOREACH(SpectrumIdentificationResultPtr& sir, mzid.dataCollection.analysisData.spectrumIdentificationList[0]->spectrumIdentificationResult)
130 BOOST_FOREACH(SpectrumIdentificationItemPtr& sii, sir->spectrumIdentificationItem)
133 sii->fragmentation.clear();
134 sii->massTablePtr.reset();
136 for (
size_t i=0; i < sii->peptideEvidencePtr.size(); ++i)
155 if (sm->residues.empty())
156 sm->residues.push_back('.');
References pwiz::identdata::IdentData::analysisCollection, pwiz::identdata::DataCollection::analysisData, pwiz::identdata::IdentData::analysisProtocolCollection, pwiz::identdata::IdentData::analysisSampleCollection, pwiz::identdata::IdentData::analysisSoftwareList, pwiz::identdata::IdentData::auditCollection, BFS_STRING, pwiz::identdata::IdentData::bibliographicReference, pwiz::data::ParamContainer::clear(), pwiz::identdata::SpectrumIdentificationProtocol::databaseFilters, pwiz::identdata::SpectrumIdentificationProtocol::databaseTranslation, pwiz::identdata::IdentData::dataCollection, pwiz::identdata::SequenceCollection::dbSequences, pwiz::identdata::PeptideEvidence::end, pwiz::identdata::Enzymes::enzymes, pwiz::identdata::SpectrumIdentificationProtocol::enzymes, pwiz::identdata::DataCollection::inputs, pwiz::identdata::SpectrumIdentificationProtocol::massTable, pwiz::identdata::peptide(), pwiz::identdata::SequenceCollection::peptides, pwiz::identdata::PeptideEvidence::post, pwiz::identdata::PeptideEvidence::pre, pwiz::identdata::AnalysisCollection::proteinDetection, pwiz::identdata::AnalysisData::proteinDetectionListPtr, pwiz::identdata::IdentData::provider, pwiz::identdata::AnalysisSampleCollection::samples, pwiz::identdata::IdentData::sequenceCollection, pwiz::identdata::Inputs::sourceFile, pwiz::identdata::AnalysisCollection::spectrumIdentification, pwiz::identdata::AnalysisData::spectrumIdentificationList, pwiz::identdata::AnalysisProtocolCollection::spectrumIdentificationProtocol, pwiz::identdata::PeptideEvidence::start, and pwiz::identdata::SpectrumIdentificationProtocol::threshold.
Referenced by testSerialize().
◆ testTranslation() [1/2]
| void testTranslation |
( |
const string & |
str | ) |
|
◆ testSerializeReally()
Definition at line 175 of file Serializer_pepXML_Test.cpp.
177 if (
os_) *
os_ <<
"begin testSerialize" << endl;
181 serializer.write(oss, mzid,
"tiny.pepXML");
183 if (
os_) *
os_ <<
"oss:\n" << oss.str() << endl;
187 shared_ptr<istringstream> iss(
new istringstream(oss.str()));
189 serializer.read(iss, mzid2);
References pwiz::identdata::IdentData::analysisProtocolCollection, diff(), os_, pwiz::identdata::Serializer_pepXML::read(), pwiz::identdata::Serializer_pepXML::Config::readSpectrumQueries, pwiz::identdata::References::resolve(), pwiz::identdata::AnalysisProtocolCollection::spectrumIdentificationProtocol, testTranslation(), unit_assert, and pwiz::identdata::Serializer_pepXML::write().
Referenced by testSerialize().
◆ testSerialize()
Definition at line 201 of file Serializer_pepXML_Test.cpp.
211 EnzymePtr noEnzyme(
new Enzyme);
212 noEnzyme->id =
"ENZ_1";
213 noEnzyme->cTermGain =
"OH";
214 noEnzyme->nTermGain =
"H";
215 noEnzyme->missedCleavages = 2;
216 noEnzyme->minDistance = 1;
218 noEnzyme->siteRegexp =
"(?<=[KR])";
226 EnzymePtr aspN(
new Enzyme);
228 aspN->cTermGain =
"OH";
229 aspN->nTermGain =
"H";
230 aspN->missedCleavages = 2;
231 aspN->minDistance = 1;
232 aspN->terminalSpecificity = proteome::Digestion::FullySpecific;
233 aspN->siteRegexp =
"(?=[BD])";
238 aspN->missedCleavages = 4;
239 aspN->minDistance = 2;
241 aspN->siteRegexp =
"(?=[BND])";
242 aspN->enzymeName.clear();
243 aspN->enzymeName.userParams.push_back(
UserParam(
"custom"));
References pwiz::identdata::IdentData::analysisCollection, pwiz::identdata::DataCollection::analysisData, pwiz::identdata::IdentData::analysisProtocolCollection, pwiz::identdata::IdentData::dataCollection, pwiz::identdata::SequenceCollection::dbSequences, pwiz::identdata::examples::initializeBasicSpectrumIdentification(), MS_Asp_N, MS_Trypsin_P, NonSpecific, pwiz::identdata::SequenceCollection::peptideEvidence, pwiz::identdata::SequenceCollection::peptides, pwiz::identdata::AnalysisData::proteinDetectionListPtr, SemiSpecific, pwiz::identdata::IdentData::sequenceCollection, pwiz::identdata::AnalysisCollection::spectrumIdentification, pwiz::identdata::AnalysisData::spectrumIdentificationList, pwiz::identdata::AnalysisProtocolCollection::spectrumIdentificationProtocol, stripUnmappedMetadata(), and testSerializeReally().
Referenced by main().
◆ testPepXMLSpecificity()
| void testPepXMLSpecificity |
( |
| ) |
|
Definition at line 263 of file Serializer_pepXML_Test.cpp.
289 ez.
name =
"trypsin/p";
323 bool allCleavageAgentsHandled =
true;
334 cerr << e.what() << endl;
335 allCleavageAgentsHandled =
false;
References pwiz::data::ParamContainer::clear(), pwiz::identdata::cleavageAgent(), pwiz::identdata::PepXMLSpecificity::cut, pwiz::identdata::Enzyme::enzymeName, pwiz::proteome::Digestion::getCleavageAgentRegex(), pwiz::proteome::Digestion::getCleavageAgents(), MS_Asp_N, MS_Trypsin, MS_Trypsin_P, pwiz::identdata::Identifiable::name, pwiz::identdata::PepXMLSpecificity::no_cut, pwiz::identdata::pepXMLSpecificity(), pwiz::identdata::PepXMLSpecificity::sense, pwiz::data::ParamContainer::set(), pwiz::identdata::Enzyme::siteRegexp, unit_assert, unit_assert_operator_equal, and pwiz::data::ParamContainer::userParams.
Referenced by main().
◆ testStripChargeFromConventionalSpectrumId()
| void testStripChargeFromConventionalSpectrumId |
( |
| ) |
|
◆ testTranslation() [2/2]
Definition at line 392 of file Serializer_pepXML_Test.cpp.
References CVID_Unknown, MS_Comet, MS_Comet_xcorr, MS_MyriMatch, MS_MyriMatch_MVH, MS_SEQUEST, MS_SEQUEST_xcorr, MS_Thermo_nativeID_format, MS_WIFF_nativeID_format, MS_X_Tandem, pwiz::identdata::nativeIdStringToCVID(), pwiz::identdata::pepXMLScoreNameToCVID(), pwiz::identdata::pepXMLSoftwareNameToCVID(), pwiz::identdata::scoreCVIDToPepXMLScoreName(), pwiz::identdata::softwareCVIDToPepXMLSoftwareName(), and unit_assert_operator_equal.
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ os_
Uncontrolled user parameters (essentially allowing free text). Before using these,...
Implementation of PeptideEvidenceType from the mzIdentML schema.
void clear()
clears the collections
void stripUnmappedMetadata(IdentData &mzid)
PWIZ_API_DECL const Modification & modification(CVID cvid)
find a modification by CVID
MS_Comet
Comet: Comet open-source sequence search engine developed at the University of Washington.
MS_WIFF_nativeID_format
WIFF nativeID format: Native format defined by sample=xsd:nonNegativeInteger period=xsd:nonNegativeIn...
void testPepXMLSpecificity()
PWIZ_API_DECL PepXMLSpecificity pepXMLSpecificity(const Enzyme &ez)
converts an identdata::Enzyme into a pepXML cut/no_cut/sense tuple
Implementation of ProviderType from the mzIdentML schema.
AnalysisCollection analysisCollection
std::vector< BibliographicReferencePtr > bibliographicReference
std::vector< UserParam > userParams
a collection of uncontrolled user terms
MS_X_Tandem
X!Tandem: X!Tandem was used to analyze the spectra.
PWIZ_API_DECL CVID pepXMLSoftwareNameToCVID(const std::string &softwareName)
converts a software name stored in pepXML software element into its corresponding CVID,...
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
MZIDData <-> pepXML stream serialization.
std::vector< SamplePtr > samples
std::vector< MassTablePtr > massTable
PWIZ_API_DECL CVID cleavageAgent(const Enzyme &ez)
returns a cleavage agent CVID for an identdata::Enzyme
std::vector< SpectrumIdentificationPtr > spectrumIdentification
static const std::set< CVID > & getCleavageAgents()
returns the set of predefined cleavage agents defined in the PSI-MS CV
Implementation of ProteinDetectionType from the mzIdentML schema.
std::vector< EnzymePtr > enzymes
std::vector< FilterPtr > databaseFilters
Implementation of EnzymeType from the mzIdentML schema.
#define unit_assert_operator_equal(expected, actual)
PWIZ_API_DECL const std::string & softwareCVIDToPepXMLSoftwareName(CVID softwareCVID)
converts a software CVID to the preferred name for that software in pepXML; an unrecognized software ...
MS_SEQUEST
SEQUEST: The name of the SEQUEST search engine.
std::vector< PeptideEvidencePtr > peptideEvidence
Calculate diffs of objects in a ProteoWizard data model hierarchy.
std::vector< SpectrumIdentificationListPtr > spectrumIdentificationList
Serializer_pepXML configuration.
PWIZ_API_DECL proteome::Peptide peptide(const Peptide &peptide)
creates a proteome::Peptide from an identdata::Peptide
PWIZ_API_DECL const std::string & scoreCVIDToPepXMLScoreName(CVID softwareCVID, CVID scoreCVID)
for a given software CVID, converts a score CVID into the preferred name for that score in pepXML; an...
MS_SEQUEST_xcorr
SEQUEST:xcorr: The SEQUEST result 'XCorr'.
Implementation of SpectrumIdentificationProtocolType from the mzIdentML schema.
static const std::string & getCleavageAgentRegex(CVID agentCvid)
returns the official PSI Perl regular expression defining the places in a polypeptide or protein that...
MS_Asp_N
Asp-N: Endoproteinase Asp-N.
ProteinDetectionListPtr proteinDetectionListPtr
MS_Trypsin
Trypsin: Enzyme trypsin.
AnalysisSampleCollection analysisSampleCollection
DatabaseTranslationPtr databaseTranslation
void diff(const string &filename1, const string &filename2)
std::vector< DBSequencePtr > dbSequences
PWIZ_API_DECL void initializeBasicSpectrumIdentification(IdentData &mzid)
void testSerializeReally(IdentData &mzid, const Serializer_pepXML::Config &config)
Implementation of the MzIdentMLType from the mzIdentML schema.
SequenceCollection sequenceCollection
PWIZ_API_DECL std::string stripChargeFromConventionalSpectrumId(const std::string &id)
strips charge state from known conventions of the pepXML spectrum attribute; used to find a unique id...
std::vector< PeptidePtr > peptides
MS_Thermo_nativeID_format
Thermo nativeID format: Native format defined by controllerType=xsd:nonNegativeInteger controllerNumb...
PWIZ_API_DECL CVID nativeIdStringToCVID(const std::string &id)
attempts to convert a period-delimited id into a nativeID format (e.g. "1.0.123" appears to be a Ther...
DataCollection dataCollection
MS_Trypsin_P
Trypsin/P: Cleavage agent Trypsin/P.
#define TEST_PROLOG(argc, argv)
ParamContainer enzymeName
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
void testTranslation(const string &str)
SemiSpecific
neither termini must match digestion motif(s)
AnalysisProtocolCollection analysisProtocolCollection
MS_Comet_xcorr
Comet:xcorr: The Comet result 'XCorr'.
std::vector< SpectrumIdentificationProtocolPtr > spectrumIdentificationProtocol
ProteinDetection proteinDetection
AnalysisData analysisData
MS_MyriMatch_MVH
MyriMatch:MVH: Using the multivariate hypergeometric distribution and a peak list divided into severa...
std::vector< AnalysisSoftwarePtr > analysisSoftwareList
represents a tag-value pair, where the tag comes from the controlled vocabulary
MS_MyriMatch
MyriMatch: Tabb Lab software for directly comparing peptides in a database to tandem mass spectra.
void testStripChargeFromConventionalSpectrumId()
boost::shared_ptr< Peptide > PeptidePtr
PWIZ_API_DECL CVID pepXMLScoreNameToCVID(CVID softwareCVID, const std::string &scoreName)
for a given software CVID, converts a pepXML score name into its corresponding CVID,...
std::vector< ContactPtr > auditCollection