Go to the documentation of this file.
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));
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;
324 #endif // _TRADATA_TEXTWRITER_HPP_
Uncontrolled user parameters (essentially allowing free text). Before using these,...
List of precursor m/z targets to include or exclude.
std::string fullName
the usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).
std::string id
String label for this target.
std::vector< InstrumentPtr > instrumentPtrs
List of instruments on which transitions are validated.
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
TextWriter & operator()(const Target &target)
TextWriter & operator()(const Publication &publication)
bool empty() const
returns true iff contains no params
const PWIZ_API_DECL Modification & modification(CVID cvid)
find a modification by CVID
TextWriter & operator()(const Protein &protein)
Product (Q3) of the transition.
Precursor precursor
Precursor (Q1) of the target.
std::vector< Target > targetIncludeList
List of precursor m/z targets to include.
Information about an ontology or CV source and a short 'lookup' tag to refer to.
std::string URI
the URI for the resource.
Precursor precursor
Precursor (Q1) of the transition.
Chemical compound other than a peptide for which one or more transitions.
std::string id
Identifier for the software to be used for referencing within a document.
TextWriter & operator()(const Contact &contact)
std::vector< Target > targetExcludeList
List of precursor m/z targets to exclude.
Information about empirical mass spectrometer observations of the peptide.
std::vector< UserParam > userParams
a collection of uncontrolled user terms
PeptidePtr peptidePtr
Reference to a peptide for which this target is the trigger.
TextWriter & operator()(const Validation &validation)
A peptide or compound that is to be included or excluded from a target list of precursor m/z values.
TextWriter & operator()(const Transition &transition)
represents a post-translational modification (PTM) modification formula or masses must be provided at...
std::vector< ContactPtr > contactPtrs
List of contacts referenced in the generation or validation of transitions.
std::vector< CV > cvs
List of controlled vocabularies used in a TraML document note: one of the <cv> elements in this list ...
std::string id
the short label to be used as a reference tag with which to refer to this particular Controlled Vocab...
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g....
represents a peptide or polypeptide (a sequence of amino acids)
std::vector< Configuration > configurationList
List of insutrument configurations used in the validation or optimization of the transitions.
std::string version
the version of the CV from which the referred-to terms are drawn.
TextWriter & operator()(const CV &cv)
std::string id
String label for this transition.
TextWriter & operator()(const std::string &label, const object_type &v)
std::vector< Publication > publications
List of publications from which the transitions were collected or wherein they are published.
std::string version
Version of the software program described.
const PWIZ_API_DECL CV & cv(const std::string &prefix)
returns a CV object for the specified namespace (prefix); currently supported namespaces are: MS UO
std::string id
Identifier for the compound to be used for referencing within a document.
PWIZ_API_DECL proteome::Peptide peptide(const Peptide &peptide)
creates a proteome::Peptide from an identdata::Peptide
bool empty() const
returns true iff all members are empty and contain no params
std::string unitsName() const
convenience function to return string for the units
TextWriter & operator()(const Peptide &peptide)
TextWriter & operator()(const Evidence &evidence)
Information about a prediction for a suitable transition using some software.
TextWriter & operator()(const TraData &msd)
TextWriter & operator()(const ParamContainer ¶mContainer)
TextWriter & operator()(const std::string &text)
The base class for elements that may contain cvParams, userParams, or paramGroup references.
std::vector< Interpretation > interpretationList
List of possible interprations of fragment ions for a transition.
TextWriter & operator()(const boost::shared_ptr< object_type > &p)
std::vector< RetentionTime > retentionTimes
List of retention time information entries.
bool empty() const
returns true iff all members are empty and contain no params
std::string value
the value for the parameter, where appropriate.
TextWriter & operator()(const RetentionTime &retentionTime)
const PWIZ_API_DECL CVTermInfo & cvTermInfo(CVID cvid)
returns CV term info for the specified CVID
std::vector< Transition > transitions
List of transitions.
TextWriter & operator()(const Modification &modification)
TextWriter(std::ostream &os, int depth=0)
std::vector< ProteinPtr > proteinPtrs
List of proteins for which one or more transitions are intended to identify.
const std::string & sequence() const
returns the sequence of amino acids making up the peptide
SoftwarePtr softwarePtr
Software used to determine the retention time.
TextWriter & operator()(const Product &product)
toType lexical_cast(const std::string &str, bool &success)
CompoundPtr compoundPtr
Reference to a compound for which this target is the trigger.
TargetList targets
List of precursor m/z targets to include or exclude.
TextWriter & operator()(const Software &software)
const std::string & version() const
returns the version of this traML document; for a document created programmatically,...
TextWriter & operator()(const std::string &label, const std::vector< object_type > &v)
Product product
Product (Q3) of the transition.
std::vector< CompoundPtr > compoundPtrs
Information about the state of validation of a transition on a given instrument model.
TextWriter & operator()(const Compound &compound)
std::vector< Configuration > configurationList
List of instrument configurations used in the validation or optimization of the target.
virtual bool empty() const
Returns true if the map is empty, false otherwise.
bool empty() const
returns true iff contains no params
ModificationMap & modifications()
the map of sequence offsets (0-based) to modifications; modifications can be added or removed from th...
Prediction prediction
Information about a prediction for a suitable transition using some software.
Precursor (Q1) of the transition.
TextWriter & operator()(const UserParam &userParam)
TextWriter & operator()(const Precursor &precursor)
TextWriter & operator()(const Prediction &prediction)
std::string id
Identifier for the publication to be used for referencing within a document.
TextWriter & operator()(const TargetList &targetList)
std::vector< SoftwarePtr > softwarePtrs
List of software packages used in the generation of one of more transitions described in the document...
represents a tag-value pair, where the tag comes from the controlled vocabulary
PeptidePtr peptidePtr
Reference to a peptide which this transition is intended to identify.
TextWriter & operator()(const CVParam &cvParam)
CompoundPtr compoundPtr
Reference to a compound for this transition.
std::string name
the name for the parameter.
std::vector< PeptidePtr > peptidePtrs
List of compounds (including peptides) for which one or more transitions are intended to identify.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms