32 #include "boost/range/adaptor/transformed.hpp" 33 #include "boost/range/algorithm/max_element.hpp" 34 #include "boost/range/algorithm/min_element.hpp" 35 #include "boost/range/algorithm_ext/erase.hpp" 49 int operator()(
const EnzymePtr&
x)
const {
return x->terminalSpecificity;}
55 int operator()(
const EnzymePtr&
x)
const {
return x->missedCleavages;}
62 bool operator() (
const UserParam& up)
const {
return up.
name == name_; }
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;
123 BOOST_FOREACH(ModificationPtr& mod, peptide->modification)
124 mod->monoisotopicMassDelta = mod->avgMassDelta = max(mod->monoisotopicMassDelta, mod->avgMassDelta);
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(
'.');
162 unit_assert(bal::contains(str,
"search_engine=\"Mascot\""));
165 unit_assert(bal::contains(str,
"name=\"ionscore\""));
166 unit_assert(bal::contains(str,
"name=\"homologyscore\""));
167 unit_assert(bal::contains(str,
"name=\"identityscore\""));
168 unit_assert(bal::contains(str,
"name=\"expect\""));
169 unit_assert(bal::contains(str,
"name=\"an extra score\""));
172 unit_assert(bal::contains(str,
"spectrumNativeID=\"controllerType=0 controllerNumber=1 scan=420\""));
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);
197 if (
os_ && diff) *
os_ << diff << endl;
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"));
289 ez.
name =
"trypsin/p";
323 bool allCleavageAgentsHandled =
true;
334 cerr << e.what() << endl;
335 allCleavageAgentsHandled =
false;
429 int main(
int argc,
char** argv)
435 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
AnalysisProtocolCollection analysisProtocolCollection
int operator()(const EnzymePtr &x) const
MS_Asp_N
Asp-N: Endoproteinase Asp-N.
void testStripChargeFromConventionalSpectrumId()
std::vector< PeptideEvidencePtr > peptideEvidence
Implementation of PeptideEvidenceType from the mzIdentML schema.
AnalysisCollection analysisCollection
MS_SEQUEST
SEQUEST: The name of the SEQUEST search engine.
void stripUnmappedMetadata(IdentData &mzid)
Implementation of EnzymeType from the mzIdentML schema.
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, or CVID_Unknown if no mapping was found
MS_X_Tandem
X!Tandem: X!Tandem was used to analyze the spectra.
MS_Comet_xcorr
Comet:xcorr: The Comet result 'XCorr'.
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_Trypsin
Trypsin: Enzyme trypsin.
PWIZ_API_DECL proteome::Peptide peptide(const Peptide &peptide)
creates a proteome::Peptide from an identdata::Peptide
Calculate diffs of objects in a ProteoWizard data model hierarchy.
std::vector< SpectrumIdentificationListPtr > spectrumIdentificationList
void testPepXMLSpecificity()
std::vector< SpectrumIdentificationProtocolPtr > spectrumIdentificationProtocol
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 initializeBasicSpectrumIdentification(IdentData &mzid)
PWIZ_API_DECL PepXMLSpecificity pepXMLSpecificity(const Enzyme &ez)
converts an identdata::Enzyme into a pepXML cut/no_cut/sense tuple
MZIDData <-> pepXML stream serialization.
void clear()
clears the collections
DataCollection dataCollection
std::vector< EnzymePtr > enzymes
void diff(const string &filename1, const string &filename2)
Serializer_pepXML configuration.
Implementation of ProviderType from the mzIdentML schema.
std::vector< PeptidePtr > peptides
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
void testSerializeReally(IdentData &mzid, const Serializer_pepXML::Config &config)
void testTranslation(const string &str)
MS_WIFF_nativeID_format
WIFF nativeID format: Native format defined by sample=xsd:nonNegativeInteger period=xsd:nonNegativeIn...
SemiSpecific
neither termini must match digestion motif(s)
std::vector< MassTablePtr > massTable
std::vector< UserParam > userParams
a collection of uncontrolled user terms
#define unit_assert_operator_equal(expected, actual)
ProteinDetection proteinDetection
AnalysisSampleCollection analysisSampleCollection
Implementation of the MzIdentMLType from the mzIdentML schema.
int operator()(const EnzymePtr &x) const
MS_Trypsin_P
Trypsin/P: Cleavage agent Trypsin/P.
boost::shared_ptr< Peptide > PeptidePtr
std::string name
the name for the parameter.
ParamContainer enzymeName
std::vector< SamplePtr > samples
static const std::set< CVID > & getCleavageAgents()
returns the set of predefined cleavage agents defined in the PSI-MS CV
MS_SEQUEST_xcorr
SEQUEST:xcorr: The SEQUEST result 'XCorr'.
std::vector< SpectrumIdentificationPtr > spectrumIdentification
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< FilterPtr > databaseFilters
std::vector< BibliographicReferencePtr > bibliographicReference
MS_MyriMatch
MyriMatch: Tabb Lab software for directly comparing peptides in a database to tandem mass spectra...
Implementation of SpectrumIdentificationProtocolType from the mzIdentML schema.
std::vector< ContactPtr > auditCollection
std::vector< DBSequencePtr > dbSequences
MS_Comet
Comet: Comet open-source sequence search engine developed at the University of Washington.
UserParamNameIs(const string &name)
SequenceCollection sequenceCollection
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
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...
#define TEST_PROLOG(argc, argv)
PWIZ_API_DECL CVID cleavageAgent(const Enzyme &ez)
returns a cleavage agent CVID for an identdata::Enzyme
KernelTraitsBase< Kernel >::space_type::abscissa_type x
std::vector< AnalysisSoftwarePtr > analysisSoftwareList
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...
void read(boost::shared_ptr< std::istream > is, IdentData &mzid, const pwiz::util::IterationListenerRegistry *=0) const
read in MZIDData object from a pepXML istream
DatabaseTranslationPtr databaseTranslation
ProteinDetectionListPtr proteinDetectionListPtr
MS_MyriMatch_MVH
MyriMatch:MVH: Using the multivariate hypergeometric distribution and a peak list divided into severa...
static const std::string & getCleavageAgentRegex(CVID agentCvid)
returns the official PSI Perl regular expression defining the places in a polypeptide or protein that...
AnalysisData analysisData
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...
void write(std::ostream &os, const IdentData &mzid, const std::string &filepath, const pwiz::util::IterationListenerRegistry *=0) const
write MZIDData object to ostream as pepXML
represents a tag-value pair, where the tag comes from the controlled vocabulary
int main(int argc, char **argv)
Implementation of ProteinDetectionType from the mzIdentML schema.