Go to the source code of this file.
◆ test()
Definition at line 75 of file ParamTypesTest.cpp.
77 vector<CVParam> params;
90 copy(params.begin(), params.end(), ostream_iterator<CVParam>(*
os_,
"\n"));
93 *
os_ <<
"as mzML <cvParam> elements:\n";
97 *
os_ <<
"value casting:\n";
98 int temp = params[0].valueAs<
int>();
100 float temp2 = params[1].valueAs<
float>();
101 *
os_ << temp2 << endl;
102 string temp3 = params[2].valueAs<
string>();
103 *
os_ << temp3 <<
"\n\n";
108 unit_assert(2000.012345 == params[1].valueAs<double>());
110 unit_assert(5.890500 == params[3].valueAs<double>());
121 ostringstream ossScanTime;
125 <<
"ossScanTime: " << ossScanTime.str() << endl;
127 if (
os_) *
os_ <<
"scan time in seconds: " << scanTime.timeInSeconds() << endl;
130 ostringstream ossCollisionEnergy;
133 <<
"ossCollisionEnergy: " << ossCollisionEnergy.str() << endl;
References MS_collision_energy, MS_deisotoping, MS_highest_observed_m_z, MS_lowest_observed_m_z, MS_m_z, MS_peak_picking, MS_scan_start_time, mzmlCollisionEnergy, mzmlScanTime, os_, pwiz::data::CVParam::timeInSeconds(), unit_assert, unit_assert_equal, UO_electronvolt, UO_minute, and pwiz::msdata::id::value().
Referenced by main().
◆ testIs()
◆ testIsChildOf()
Definition at line 152 of file ParamTypesTest.cpp.
157 vector<CVParam> params;
164 vector<CVParam>::const_iterator itDiss =
167 vector<CVParam>::const_iterator itUnit =
172 *
os_ <<
"find dissociation method: "
173 << (itDiss!=params.end() ?
cvTermInfo(itDiss->cvid).
name :
"not found")
176 *
os_ <<
"find unit: "
177 << (itUnit!=params.end() ?
cvTermInfo(itUnit->cvid).
name :
"not found")
References pwiz::cv::cvTermInfo(), MS_collision_induced_dissociation, MS_dissociation_method, MS_highest_observed_m_z, MS_lowest_observed_m_z, MS_plasma_desorption, pwiz::cv::CVTermInfo::name, os_, unit_assert, UO_electronvolt, and UO_unit.
Referenced by main().
◆ testParamContainer()
void testParamContainer |
( |
| ) |
|
Definition at line 187 of file ParamTypesTest.cpp.
217 string result =
"goober";
References pwiz::data::CVParam::cvid, CVID_Unknown, pwiz::data::ParamContainer::cvParam(), pwiz::data::ParamContainer::cvParamChild(), pwiz::data::ParamContainer::cvParamChildren(), pwiz::data::ParamContainer::cvParamChildValueOrDefault(), pwiz::data::ParamContainer::cvParams, pwiz::data::ParamContainer::cvParamValueOrDefault(), pwiz::data::UserParam::empty(), pwiz::data::ParamContainer::hasCVParam(), pwiz::data::ParamContainer::hasCVParamChild(), MS_CID, MS_deisotoping, MS_dissociation_method, MS_electric_field_strength, MS_ETD, MS_ion_optics_attribute, MS_ionization_type, MS_ms_level, MS_MSn_spectrum, MS_peak_picking, MS_PQD, MS_precursor_activation_attribute, MS_reflectron_off, MS_reflectron_on, MS_selected_ion_m_z, MS_spectrum_type, pwiz::data::UserParam::name, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::data::ParamContainer::set(), pwiz::data::UserParam::type, unit_assert, unit_assert_operator_equal, pwiz::data::UserParam::units, UO_dalton, UO_mass_unit, UO_minute, UO_second, pwiz::data::ParamContainer::userParam(), pwiz::data::ParamContainer::userParams, pwiz::data::CVParam::value, pwiz::data::CVParam::valueAs(), and pwiz::data::UserParam::valueAs().
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ os_
◆ mzmlScanTime
Initial value:=
"<cvParam cvLabel=\"MS\" accession=\"MS:1000016\" name=\"scan start time\" value=\"5.890500\" "
"unitAccession=\"UO:0000031\" unitName=\"minute\"/>\n"
Definition at line 66 of file ParamTypesTest.cpp.
Referenced by test().
◆ mzmlCollisionEnergy
const char* mzmlCollisionEnergy |
Initial value:=
"<cvParam cvLabel=\"MS\" accession=\"MS:1000045\" name=\"collision energy\" value=\"35.00\" "
"unitAccession=\"UO:0000266\" unitName=\"electronvolt\"/>\n"
Definition at line 70 of file ParamTypesTest.cpp.
Referenced by test().
Uncontrolled user parameters (essentially allowing free text). Before using these,...
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
MS_deisotoping
deisotoping: The removal of isotope peaks to represent the fragment ion as one data point and is comm...
MS_ion_optics_attribute
ion optics attribute: Ion optics involves components that help focus ion streams in mass spectrometry...
#define unit_assert_equal(x, y, epsilon)
MS_peak_picking
peak picking: Spectral peak processing conducted on the acquired data to convert profile data to cent...
MS_plasma_desorption
plasma desorption: The ionization of material in a solid sample by bombarding it with ionic or neutra...
UO_mass_unit
mass unit: A unit which is a standard measure of the amount of matter/energy of a physical object.
void testParamContainer()
std::vector< UserParam > userParams
a collection of uncontrolled user terms
UO_unit
unit: A unit of measurement is a standardized quantity of a physical quality.
MS_ETD
ETD (electron transfer dissociation): A process to fragment ions in a mass spectrometer by inducing f...
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run.
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string
value_type valueAs() const
Templated value access with type conversion.
MS_PQD
PQD (pulsed q dissociation): A process that involves precursor ion activation at high Q,...
functor for finding children of a specified CVID in a collection of CVParams:
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g....
UO_second
second: A time unit which is equal to the duration of 9 192 631 770 periods of the radiation correspo...
#define unit_assert_operator_equal(expected, actual)
MS_ionization_type
ionization type: The method by which gas phase ions are generated from the sample.
ValueT cvParamValueOrDefault(CVID cvid, ValueT defaultValue) const
finds cvid in the container:
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
value_type valueAs() const
templated value access with type conversion
boost::shared_ptr< ParamGroup > ParamGroupPtr
UO_electronvolt
electronvolt: A non-SI unit of energy (eV) defined as the energy acquired by a single unbound electro...
MS_collision_energy
collision energy: Energy for an ion experiencing collision with a stationary gas particle resulting i...
UserParam userParam(const std::string &) const
finds UserParam with specified name
CVParam cvParam(CVID cvid) const
finds cvid in the container:
The base class for elements that may contain cvParams, userParams, or paramGroup references.
bool hasCVParamChild(CVID cvid) const
returns true iff cvParams contains a child (is_a) of cvid (recursive)
MS_electric_field_strength
electric field strength: The magnitude of the force per unit charge at a given point in space.
bool hasCVParam(CVID cvid) const
returns true iff cvParams contains exact cvid (recursive)
std::vector< CVParam > cvParamChildren(CVID cvid) const
finds all children of cvid in the container:
functor for finding CVParam with specified exact CVID in a collection of CVParams:
const char * mzmlCollisionEnergy
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
MS_selected_ion_m_z
selected ion m/z: Mass-to-charge ratio of an selected ion.
MS_spectrum_type
spectrum type: Spectrum type.
const char * mzmlScanTime
UO_dalton
dalton: An independently to the base SI units defined mass unit which is equal to one twelfth of the ...
#define TEST_PROLOG(argc, argv)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
MS_reflectron_on
reflectron on: Reflectron is on.
MS_m_z
m/z: Three-character symbol m/z is used to denote the quantity formed by dividing the mass of an ion ...
bool empty() const
returns true iff name, value, type, and units are all empty
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
MS_dissociation_method
dissociation method: Fragmentation method used for dissociation or fragmentation.
PWIZ_API_DECL const CVTermInfo & cvTermInfo(CVID cvid)
returns CV term info for the specified CVID
MS_highest_observed_m_z
highest observed m/z: Highest m/z value observed in the m/z array.
ValueT cvParamChildValueOrDefault(CVID cvid, ValueT defaultValue) const
finds child of cvid in the container:
MS_collision_induced_dissociation
collision-induced dissociation: The dissociation of an ion after collisional excitation....
MS_reflectron_off
reflectron off: Reflectron is off.
MS_lowest_observed_m_z
lowest observed m/z: Lowest m/z value observed in the m/z array.
MS_precursor_activation_attribute
precursor activation attribute: Precursor Activation Attribute.
UO_minute
minute: A time unit which is equal to 60 seconds.
represents a tag-value pair, where the tag comes from the controlled vocabulary
MS_CID
CID (collision-induced dissociation): The dissociation of an ion after collisional excitation....
std::string name
the name for the parameter.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms