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