23#ifndef _TRADATA_TEXTWRITER_HPP_
24#define _TRADATA_TEXTWRITER_HPP_
29#include "boost/lexical_cast.hpp"
48 :
os_(os), depth_(depth), indent_(depth*2,
' ')
55 os_ << indent_ << text << std::endl;
62 if (!cvParam.
value.empty())
72 os_ << indent_ <<
"userParam: " << userParam.
name;
74 if (!userParam.
type.empty())
os_ <<
", " << userParam.
type;
80 template<
typename object_type>
84 for_each(v.begin(), v.end(), child());
88 template<
typename object_type>
91 (*this)(label)(boost::lexical_cast<std::string>(v));
99 child()(
"version: " + msd.
version());
100 if (!msd.
cvs.empty())
101 child()(
"cvList: ", msd.
cvs);
137 for_each(paramContainer.
cvParams.begin(), paramContainer.
cvParams.end(), *
this);
144 (*this)(
"publication:");
146 (
"id: " + publication.
id)
153 (*this)(
"software:");
155 (
"id: " + software.
id)
156 (
"version: " + software.
version)
170 (*this)(
"retentionTime:");
174 child()(
"softwareRef: " + retentionTime.
softwarePtr->id);
180 (*this)(
"prediction:");
187 (*this)(
"evidence:");
194 (*this)(
"validation:");
202 child()(
"id: " + protein.
id)
210 (*this)(
"modification:");
211 child()(
"location: ", lexical_cast<string>(modification.location))
212 (
"monoisotopicMassDelta: " + lexical_cast<string>(modification.monoisotopicMassDelta))
213 (
"averageMassDelta: " + lexical_cast<string>(modification.averageMassDelta));
221 child()(
"id: " + peptide.id)
225 if (!peptide.proteinPtrs.empty())
226 child()(
"proteinRefs:", peptide.proteinPtrs);
229 if (!peptide.retentionTimes.empty())
230 child()(
"retentionTimes:", peptide.retentionTimes);
238 (*this)(
"compound:");
239 child()(
"id: " + compound.
id)
247 (*this)(
"precursor:");
261 (*this)(
"transition:");
262 child()(
"id: ", transition.
id);
274 child()(
"peptideRef: " + transition.
peptidePtr->id);
276 child()(
"compoundRef: " + transition.
compoundPtr->id);
283 child()(
"id: ", target.
id);
289 child()(
"peptideRef: " + target.
peptidePtr->id);
297 (*this)(
"targetList:");
307 template<
typename object_type>
310 return p.get() ? (*this)(*p) : *
this;
represents a post-translational modification (PTM) modification formula or masses must be provided at...
represents a peptide or polypeptide (a sequence of amino acids)
const std::string & sequence() const
returns the sequence of amino acids making up the peptide
ModificationMap & modifications()
the map of sequence offsets (0-based) to modifications; modifications can be added or removed from th...
TextWriter & operator()(const boost::shared_ptr< object_type > &p)
TextWriter & operator()(const ParamContainer ¶mContainer)
TextWriter & operator()(const TraData &msd)
TextWriter & operator()(const Prediction &prediction)
TextWriter & operator()(const RetentionTime &retentionTime)
TextWriter & operator()(const std::string &label, const object_type &v)
TextWriter & operator()(const Evidence &evidence)
TextWriter & operator()(const std::string &label, const std::vector< object_type > &v)
TextWriter & operator()(const Publication &publication)
TextWriter & operator()(const Protein &protein)
TextWriter & operator()(const Peptide &peptide)
TextWriter & operator()(const Transition &transition)
TextWriter & operator()(const Compound &compound)
TextWriter(std::ostream &os, int depth=0)
TextWriter & operator()(const Product &product)
TextWriter & operator()(const Validation &validation)
TextWriter & operator()(const UserParam &userParam)
TextWriter & operator()(const CV &cv)
TextWriter & operator()(const TargetList &targetList)
TextWriter & operator()(const Precursor &precursor)
TextWriter & operator()(const std::string &text)
TextWriter & operator()(const Modification &modification)
TextWriter & operator()(const Software &software)
TextWriter & operator()(const CVParam &cvParam)
TextWriter & operator()(const Contact &contact)
TextWriter & operator()(const Target &target)
virtual bool empty() const
Returns true if the map is empty, false otherwise.
toType lexical_cast(const std::string &str, bool &success)
PWIZ_API_DECL const CVTermInfo & cvTermInfo(CVID cvid)
returns CV term info for the specified CVID
PWIZ_API_DECL const CV & cv(const std::string &prefix)
returns a CV object for the specified namespace (prefix); currently supported namespaces are: MS UO
Information about an ontology or CV source and a short 'lookup' tag to refer to.
std::string id
the short label to be used as a reference tag with which to refer to this particular Controlled Vocab...
std::string fullName
the usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).
std::string URI
the URI for the resource.
std::string version
the version of the CV from which the referred-to terms are drawn.
represents a tag-value pair, where the tag comes from the controlled vocabulary
std::string unitsName() const
convenience function to return string for the units
The base class for elements that may contain cvParams, userParams, or paramGroup references.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
std::vector< UserParam > userParams
a collection of uncontrolled user terms
Uncontrolled user parameters (essentially allowing free text). Before using these,...
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g....
std::string value
the value for the parameter, where appropriate.
std::string name
the name for the parameter.
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
Chemical compound other than a peptide for which one or more transitions.
std::vector< RetentionTime > retentionTimes
List of retention time information entries.
std::string id
Identifier for the compound to be used for referencing within a document.
Information about empirical mass spectrometer observations of the peptide.
Precursor (Q1) of the transition.
bool empty() const
returns true iff contains no params
Information about a prediction for a suitable transition using some software.
bool empty() const
returns true iff all members are empty and contain no params
Product (Q3) of the transition.
bool empty() const
returns true iff contains no params
std::string id
Identifier for the publication to be used for referencing within a document.
SoftwarePtr softwarePtr
Software used to determine the retention time.
std::string id
Identifier for the software to be used for referencing within a document.
std::string version
Version of the software program described.
A peptide or compound that is to be included or excluded from a target list of precursor m/z values.
PeptidePtr peptidePtr
Reference to a peptide for which this target is the trigger.
std::string id
String label for this target.
Precursor precursor
Precursor (Q1) of the target.
CompoundPtr compoundPtr
Reference to a compound for which this target is the trigger.
std::vector< Configuration > configurationList
List of instrument configurations used in the validation or optimization of the target.
List of precursor m/z targets to include or exclude.
std::vector< Target > targetExcludeList
List of precursor m/z targets to exclude.
std::vector< Target > targetIncludeList
List of precursor m/z targets to include.
bool empty() const
returns true iff all members are empty and contain no params
std::vector< CV > cvs
List of controlled vocabularies used in a TraML document note: one of the <cv> elements in this list ...
std::vector< ContactPtr > contactPtrs
List of contacts referenced in the generation or validation of transitions.
std::vector< InstrumentPtr > instrumentPtrs
List of instruments on which transitions are validated.
std::vector< Publication > publications
List of publications from which the transitions were collected or wherein they are published.
std::vector< ProteinPtr > proteinPtrs
List of proteins for which one or more transitions are intended to identify.
const std::string & version() const
returns the version of this traML document; for a document created programmatically,...
std::vector< CompoundPtr > compoundPtrs
TargetList targets
List of precursor m/z targets to include or exclude.
std::vector< PeptidePtr > peptidePtrs
List of compounds (including peptides) for which one or more transitions are intended to identify.
std::vector< SoftwarePtr > softwarePtrs
List of software packages used in the generation of one of more transitions described in the document...
std::vector< Transition > transitions
List of transitions.
PeptidePtr peptidePtr
Reference to a peptide which this transition is intended to identify.
Prediction prediction
Information about a prediction for a suitable transition using some software.
Product product
Product (Q3) of the transition.
Precursor precursor
Precursor (Q1) of the transition.
std::string id
String label for this transition.
std::vector< Interpretation > interpretationList
List of possible interprations of fragment ions for a transition.
CompoundPtr compoundPtr
Reference to a compound for this transition.
std::vector< Configuration > configurationList
List of insutrument configurations used in the validation or optimization of the transitions.
Information about the state of validation of a transition on a given instrument model.