From: <ch...@us...> - 2008-04-24 14:37:44
|
Revision: 133 http://proteowizard.svn.sourceforge.net/proteowizard/?rev=133&view=rev Author: chambm Date: 2008-04-24 07:37:48 -0700 (Thu, 24 Apr 2008) Log Message: ----------- - added and made use of some necessary terms for chromatogram handling to the CV (the ones I suggested to psidev-ms) - added chromatogram building to Reader_Thermo - TODO: make chromatogram building smarter and move it outside the Reader :) - separated Reader_Thermo into 4 separate translation units: * Reader_Thermo.cpp/hpp * SpectrumList_Thermo.cpp/hpp * ChromatogramList_Thermo.cpp/hpp * Reader_Thermo_Detail.cpp/hpp (translates pwiz::raw enums to CVIDs) - added chromatogram checking (only for "TIC") to Reader_Thermo_Test * TODO: expand chromatogram test to include testing binary data? * TODO: we need a small example SRM file for Reader_Thermo_Test - changed from using anonymous namespace to "detail" namespace, like boost * TODO: discuss doing this for all anonymous namespaces (which are very ugly in MSVC :( ) Modified Paths: -------------- trunk/pwiz/pwiz/data/msdata/cv.cpp trunk/pwiz/pwiz/data/msdata/cv.hpp trunk/pwiz/pwiz/data/vendor_readers/Jamfile trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo.cpp trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Test.cpp Added Paths: ----------- trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.cpp trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.hpp trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.cpp trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.hpp Modified: trunk/pwiz/pwiz/data/msdata/cv.cpp =================================================================== --- trunk/pwiz/pwiz/data/msdata/cv.cpp 2008-04-24 13:50:25 UTC (rev 132) +++ trunk/pwiz/pwiz/data/msdata/cv.cpp 2008-04-24 14:37:48 UTC (rev 133) @@ -646,6 +646,10 @@ {MS_ProteinLynx_Global_Server_mass_spectrum_XML_file, "MS:1000614", "ProteinLynx Global Server mass spectrum XML file", "Peak list file format used by ProteinLynx Global Server."}, {MS_ProteoWizard, "MS:1000615", "ProteoWizard", "ProteoWizard software for data analysis. Currently developed and maintained by Darren Kessner at Parag Mallick's lab SFCAP at Cedars-Sinai."}, {MS_preset_scan_configuration, "MS:1000616", "preset scan configuration", "A user-defined scan configuration that specifies the instrumental settings in which a spectrum is acquired. An instrument may cycle through a list of preset scan configurations to acquire data. This is a more generic term for the Thermo \"scan event\", which is defined in the Thermo Xcalibur glossary as: a mass spectrometer scan that is defined by choosing the necessary scan parameter settings. Multiple scan events can be defined for each segment of time."}, + {MS_selected_ion_chromatogram, "MS:1000999", "selected ion chromatogram", "blah"}, + {MS_precursor_m_z, "MS:1000998", "precursor m/z", "blah"}, + {MS_product_m_z, "MS:1000997", "product m/z", "blah"}, + {MS_total_ion_chromatogram, "MS:1000996", "total ion chromatogram", "blah"} }; // termInfos_ Modified: trunk/pwiz/pwiz/data/msdata/cv.hpp =================================================================== --- trunk/pwiz/pwiz/data/msdata/cv.hpp 2008-04-24 13:50:25 UTC (rev 132) +++ trunk/pwiz/pwiz/data/msdata/cv.hpp 2008-04-24 14:37:48 UTC (rev 133) @@ -747,7 +747,11 @@ MS_ProteinLynx_Global_Server_mass_spectrum_XML_file = 1000614, MS_ProteoWizard = 1000615, MS_pwiz = MS_ProteoWizard, - MS_preset_scan_configuration = 1000616 + MS_preset_scan_configuration = 1000616, + MS_selected_ion_chromatogram = 1000999, + MS_precursor_m_z = 1000998, + MS_product_m_z = 1000997, + MS_total_ion_chromatogram = 1000996 }; // enum CVID Added: trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.cpp =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.cpp (rev 0) +++ trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.cpp 2008-04-24 14:37:48 UTC (rev 133) @@ -0,0 +1,66 @@ +#include "data/msdata/CVTranslator.hpp" +#include "utility/vendor_api/thermo/RawFile.h" +#include "utility/misc/SHA1Calculator.hpp" +#include "boost/shared_ptr.hpp" +#include "boost/lexical_cast.hpp" +#include "boost/algorithm/string.hpp" +#include "boost/filesystem/path.hpp" +#include "Reader_Thermo_Detail.hpp" +#include "ChromatogramList_Thermo.hpp" +#include <iostream> +#include <stdexcept> + + +namespace pwiz { +namespace msdata { +namespace detail { + +ChromatogramList_Thermo::ChromatogramList_Thermo() +{ +} + + +size_t ChromatogramList_Thermo::size() const +{ + return index_.size(); +} + + +const ChromatogramIdentity& ChromatogramList_Thermo::chromatogramIdentity(size_t index) const +{ + if (index>size()) + throw runtime_error(("[ChromatogramList_Thermo::chromatogramIdentity()] Bad index: " + + lexical_cast<string>(index)).c_str()); + return reinterpret_cast<const ChromatogramIdentity&>(index_[index]); +} + + +size_t ChromatogramList_Thermo::find(const string& id) const +{ + map<string, size_t>::const_iterator itr = idMap_.find(id); + if (itr != idMap_.end()) + return itr->second; + + return size(); +} + + +size_t ChromatogramList_Thermo::findNative(const string& nativeID) const +{ + return find(nativeID); +} + + +ChromatogramPtr ChromatogramList_Thermo::chromatogram(size_t index, bool getBinaryData) const +{ + if (index>size()) + throw runtime_error(("[ChromatogramList_Thermo::chromatogram()] Bad index: " + + lexical_cast<string>(index)).c_str()); + + // chromatogram is created in memory, so it always has binary data + return index_[index]; +} + +} // detail +} // msdata +} // pwiz Added: trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.hpp =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.hpp (rev 0) +++ trunk/pwiz/pwiz/data/vendor_readers/ChromatogramList_Thermo.hpp 2008-04-24 14:37:48 UTC (rev 133) @@ -0,0 +1,37 @@ +#ifndef _CHROMATOGRAMLIST_THERMO_ +#define _CHROMATOGRAMLIST_THERMO_ +#include "data/msdata/MSData.hpp" +#include "utility/vendor_api/thermo/RawFile.h" +#include <map> +#include <vector> + +using namespace std; +using boost::shared_ptr; +using boost::lexical_cast; +using boost::bad_lexical_cast; +using namespace pwiz::raw; + +namespace pwiz { +namespace msdata { +namespace detail { + +class ChromatogramList_Thermo : public ChromatogramList +{ +public: + + ChromatogramList_Thermo(); + virtual size_t size() const; + virtual const ChromatogramIdentity& chromatogramIdentity(size_t index) const; + virtual size_t find(const string& id) const; + virtual size_t findNative(const string& nativeID) const; + virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData) const; + + map<string, size_t> idMap_; + vector<ChromatogramPtr> index_; +}; + +} // detail +} // msdata +} // pwiz + +#endif // _CHROMATOGRAMLIST_THERMO_ Modified: trunk/pwiz/pwiz/data/vendor_readers/Jamfile =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/Jamfile 2008-04-24 13:50:25 UTC (rev 132) +++ trunk/pwiz/pwiz/data/vendor_readers/Jamfile 2008-04-24 14:37:48 UTC (rev 133) @@ -33,7 +33,7 @@ lib pwiz_data_vendor_readers : ExtendedReaderList.cpp - Reader_Thermo.cpp + [ glob *_Thermo*.cpp ] ../../utility/vendor_api/thermo ../msdata//pwiz_data_msdata ; Modified: trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo.cpp =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo.cpp 2008-04-24 13:50:25 UTC (rev 132) +++ trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo.cpp 2008-04-24 14:37:48 UTC (rev 133) @@ -23,7 +23,6 @@ #include "Reader_Thermo.hpp" - namespace { // helper function used by both forms (real and stubbed) of Reader_Thermo bool _hasRAWHeader(const std::string& head) @@ -52,6 +51,9 @@ #include "boost/lexical_cast.hpp" #include "boost/algorithm/string.hpp" #include "boost/filesystem/path.hpp" +#include "Reader_Thermo_Detail.hpp" +#include "SpectrumList_Thermo.hpp" +#include "ChromatogramList_Thermo.hpp" #include <iostream> #include <stdexcept> @@ -67,333 +69,10 @@ using namespace pwiz::raw; using namespace pwiz::util; namespace bfs = boost::filesystem; +using namespace pwiz::msdata::detail; // -// SpectrumList_Thermo -// - - -namespace { - - -class SpectrumList_Thermo : public SpectrumList -{ - public: - - SpectrumList_Thermo(const MSData& msd, shared_ptr<RawFile> rawfile); - virtual size_t size() const; - virtual const SpectrumIdentity& spectrumIdentity(size_t index) const; - virtual size_t find(const string& id) const; - virtual size_t findNative(const string& nativeID) const; - virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const; - - private: - - const MSData& msd_; - shared_ptr<RawFile> rawfile_; - size_t size_; - mutable vector<SpectrumPtr> spectrumCache_; - vector<SpectrumIdentity> index_; - - void createIndex(); - string findPrecursorID(int precursorMsLevel, size_t index) const; -}; - - -SpectrumList_Thermo::SpectrumList_Thermo(const MSData& msd, shared_ptr<RawFile> rawfile) -: msd_(msd), rawfile_(rawfile), - size_(rawfile->value(NumSpectra)), - spectrumCache_(size_), index_(size_) -{ - createIndex(); -} - - -size_t SpectrumList_Thermo::size() const -{ - return size_; -} - - -const SpectrumIdentity& SpectrumList_Thermo::spectrumIdentity(size_t index) const -{ - if (index>size_) - throw runtime_error(("[SpectrumList_Thermo::spectrumIdentity()] Bad index: " - + lexical_cast<string>(index)).c_str()); - return index_[index]; -} - - -size_t SpectrumList_Thermo::find(const string& id) const -{ - try - { - size_t scanNumber = lexical_cast<size_t>(id); - if (scanNumber>=1 && scanNumber<=size()) - return scanNumber-1; - } - catch (bad_lexical_cast&) {} - - return size(); -} - - -size_t SpectrumList_Thermo::findNative(const string& nativeID) const -{ - return find(nativeID); -} - - -CVParam translateAsScanningMethod(ScanType scanType) -{ - switch (scanType) - { - case ScanType_Full: - return MS_full_scan; - case ScanType_Zoom: - return MS_zoom_scan; - case ScanType_SIM: - return MS_SIM; - case ScanType_SRM: - return MS_SRM; - case ScanType_CRM: - return MS_CRM; - case ScanType_Unknown: - default: - return CVParam(); - } -} - - -CVParam translateAsSpectrumType(ScanType scanType) -{ - switch (scanType) - { - case ScanType_Full: - case ScanType_Zoom: - return MS_MSn_spectrum; - case ScanType_SIM: - return MS_SIM_spectrum; - case ScanType_SRM: - return MS_SRM_spectrum; - case ScanType_CRM: - return MS_CRM_spectrum; - case ScanType_Unknown: - default: - return CVParam(); - } -} - - -CVParam translate(MassAnalyzerType type) -{ - switch (type) - { - case MassAnalyzerType_ITMS: return MS_ion_trap; - case MassAnalyzerType_FTMS: return MS_FT_ICR; - case MassAnalyzerType_TOFMS: return MS_time_of_flight; - case MassAnalyzerType_TQMS: return MS_quadrupole; - case MassAnalyzerType_SQMS: return MS_quadrupole; - case MassAnalyzerType_Sector: return MS_magnetic_sector; - case MassAnalyzerType_Unknown: - default: - return CVParam(); - } -} - - -CVParam translateAsIonizationType(IonizationType ionizationType) -{ - switch (ionizationType) - { - case IonizationType_EI: return MS_electron_ionization; - case IonizationType_CI: return MS_chemical_ionization; - case IonizationType_FAB: return MS_fast_atom_bombardment_ionization; - case IonizationType_ESI: return MS_electrospray_ionization; - case IonizationType_NSI: return MS_nanoelectrospray; - case IonizationType_APCI: return MS_atmospheric_pressure_chemical_ionization; - //case IonizationType_TSP: return MS_thermospray_ionization; - case IonizationType_FD: return MS_field_desorption; - case IonizationType_MALDI: return MS_matrix_assisted_laser_desorption_ionization; - case IonizationType_GD: return MS_glow_discharge_ionization; - case IonizationType_Unknown: - default: - return CVParam(); - } -} - - -CVParam translateAsInletType(IonizationType ionizationType) -{ - switch (ionizationType) - { - //case IonizationType_EI: return MS_electron_ionization; - //case IonizationType_CI: return MS_chemical_ionization; - case IonizationType_FAB: return MS_continuous_flow_fast_atom_bombardment; - case IonizationType_ESI: return MS_electrospray_inlet; - case IonizationType_NSI: return MS_nanospray_inlet; - //case IonizationType_APCI: return MS_atmospheric_pressure_chemical_ionization; - case IonizationType_TSP: return MS_thermospray_inlet; - //case IonizationType_FD: return MS_field_desorption; - //case IonizationType_MALDI: return MS_matrix_assisted_laser_desorption_ionization; - //case IonizationType_GD: return MS_glow_discharge_ionization; - case IonizationType_Unknown: - default: - return CVParam(); - } -} - - -CVParam translate(PolarityType polarityType) -{ - switch (polarityType) - { - case PolarityType_Positive: - return MS_positive_scan; - case PolarityType_Negative: - return MS_negative_scan; - case PolarityType_Unknown: - default: - return CVParam(); - } -} - - -SpectrumPtr SpectrumList_Thermo::spectrum(size_t index, bool getBinaryData) const -{ - if (index>size_) - throw runtime_error(("[SpectrumList_Thermo::spectrum()] Bad index: " - + lexical_cast<string>(index)).c_str()); - - // returned cached Spectrum if possible - - if (!getBinaryData && spectrumCache_[index].get()) - return spectrumCache_[index]; - - // allocate a new Spectrum - - SpectrumPtr result(new Spectrum); - if (!result.get()) - throw runtime_error("[SpectrumList_Thermo::spectrum()] Allocation error."); - - // get rawfile::ScanInfo and translate - - long scanNumber = static_cast<int>(index) + 1; - auto_ptr<ScanInfo> scanInfo = rawfile_->getScanInfo(scanNumber); - if (!scanInfo.get()) - throw runtime_error("[SpectrumList_Thermo::spectrum()] Error retrieving ScanInfo."); - - result->index = index; - result->id = result->nativeID = lexical_cast<string>(scanNumber); - - SpectrumDescription& sd = result->spectrumDescription; - Scan& scan = sd.scan; - - if (msd_.instrumentPtrs.empty()) - throw runtime_error("[SpectrumList_Thermo::spectrum()] No instruments defined."); - scan.instrumentPtr = msd_.instrumentPtrs[0]; - - string filterString = scanInfo->filter(); - - scan.cvParams.push_back(CVParam(MS_filter_string, filterString)); - - string scanEvent = scanInfo->trailerExtraValue("Scan Event:"); - scan.cvParams.push_back(CVParam(MS_preset_scan_configuration, scanEvent)); - - /* currently non-standard for mzML - if (scanInfo->massAnalyzerType_ > MassAnalyzerType_Unknown) - scan.cvParams.push_back(translate(scanInfo->massAnalyzerType_));*/ - - result->set(MS_ms_level, scanInfo->msLevel()); - - ScanType scanType = scanInfo->scanType(); - if (scanType!=ScanType_Unknown) - { - result->cvParams.push_back(translateAsSpectrumType(scanType)); - scan.cvParams.push_back(translateAsScanningMethod(scanType)); - } - - PolarityType polarityType = scanInfo->polarityType(); - if (polarityType!=PolarityType_Unknown) scan.cvParams.push_back(translate(polarityType)); - - if (scanInfo->isProfileScan()) sd.cvParams.push_back(MS_profile_mass_spectrum); - else if (scanInfo->isCentroidScan()) sd.cvParams.push_back(MS_centroid_mass_spectrum); - - scan.cvParams.push_back(CVParam(MS_scan_time, scanInfo->startTime(), MS_minute)); - sd.cvParams.push_back(CVParam(MS_lowest_m_z_value, scanInfo->lowMass())); - sd.cvParams.push_back(CVParam(MS_highest_m_z_value, scanInfo->highMass())); - sd.cvParams.push_back(CVParam(MS_base_peak_m_z, scanInfo->basePeakMass())); - sd.cvParams.push_back(CVParam(MS_base_peak_intensity, scanInfo->basePeakIntensity())); - sd.cvParams.push_back(CVParam(MS_total_ion_current, scanInfo->totalIonCurrent())); - - for (long i=0, precursorCount=scanInfo->parentCount(); i<precursorCount; i++) - { - // Note: we report what RawFile gives us, which comes from the filter string; - // we can look in the trailer extra values for better (but still unreliable) - // info. Precursor recalculation should be done outside the Reader. - - Precursor precursor; - - // TODO: better test here for data dependent modes - if ((scanType==ScanType_Full || scanType==ScanType_Zoom ) && scanInfo->msLevel() > 1) - precursor.spectrumID = findPrecursorID(scanInfo->msLevel()-1, index); - - precursor.ionSelection.cvParams.push_back(CVParam(MS_m_z, scanInfo->parentMass(i))); - // TODO: determine precursor intensity? (parentEnergy is not precursor intensity!) - precursor.activation.cvParams.push_back(CVParam(MS_collision_energy, scanInfo->parentEnergy(i))); - sd.precursors.push_back(precursor); - } - - if (getBinaryData) - { - auto_ptr<raw::MassList> massList = - rawfile_->getMassList(scanNumber, "", raw::Cutoff_None, 0, 0, false); - - result->setMZIntensityPairs(reinterpret_cast<MZIntensityPair*>(massList->data()), - massList->size()); - } - - // save to cache if no binary data - - if (!getBinaryData && !spectrumCache_[index].get()) - spectrumCache_[index] = result; - - return result; -} - - -void SpectrumList_Thermo::createIndex() -{ - for (size_t i=0; i<size_; i++) - { - SpectrumIdentity& si = index_[i]; - si.index = i; - si.id = si.nativeID = lexical_cast<string>(i+1); - } -} - - -string SpectrumList_Thermo::findPrecursorID(int precursorMsLevel, size_t index) const -{ - // for MSn spectra (n > 1): return first scan with MSn-1 - - while (index>0) - { - --index; - SpectrumPtr candidate = spectrum(index, false); - if (candidate->cvParam(MS_ms_level).valueAs<int>() == precursorMsLevel) - return candidate->id; - } - - return ""; -} - - -} // namespace - - -// // Reader_Thermo // @@ -526,8 +205,11 @@ shared_ptr<RawFile> rawfile(RawFile::create(filename).release()); rawfile->setCurrentController(Controller_MS, 1); - result.run.spectrumListPtr = SpectrumListPtr(new SpectrumList_Thermo(result, rawfile)); + SpectrumList_Thermo* sl = new SpectrumList_Thermo(result, rawfile); + result.run.spectrumListPtr = SpectrumListPtr(sl); + result.run.chromatogramListPtr = sl->Chromatograms(); + fillInMetadata(filename, *rawfile, result); } Added: trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.cpp =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.cpp (rev 0) +++ trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.cpp 2008-04-24 14:37:48 UTC (rev 133) @@ -0,0 +1,123 @@ +#include "Reader_Thermo_Detail.hpp" + +namespace pwiz { +namespace msdata { +namespace detail { + +CVParam translateAsScanningMethod(ScanType scanType) +{ + switch (scanType) + { + case ScanType_Full: + return MS_full_scan; + case ScanType_Zoom: + return MS_zoom_scan; + case ScanType_SIM: + return MS_SIM; + case ScanType_SRM: + return MS_SRM; + case ScanType_CRM: + return MS_CRM; + case ScanType_Unknown: + default: + return CVParam(); + } +} + + +CVParam translateAsSpectrumType(ScanType scanType) +{ + switch (scanType) + { + case ScanType_Full: + case ScanType_Zoom: + return MS_MSn_spectrum; + case ScanType_SIM: + return MS_SIM_spectrum; + case ScanType_SRM: + return MS_SRM_spectrum; + case ScanType_CRM: + return MS_CRM_spectrum; + case ScanType_Unknown: + default: + return CVParam(); + } +} + + +CVParam translate(MassAnalyzerType type) +{ + switch (type) + { + case MassAnalyzerType_ITMS: return MS_ion_trap; + case MassAnalyzerType_FTMS: return MS_FT_ICR; + case MassAnalyzerType_TOFMS: return MS_time_of_flight; + case MassAnalyzerType_TQMS: return MS_quadrupole; + case MassAnalyzerType_SQMS: return MS_quadrupole; + case MassAnalyzerType_Sector: return MS_magnetic_sector; + case MassAnalyzerType_Unknown: + default: + return CVParam(); + } +} + + +CVParam translateAsIonizationType(IonizationType ionizationType) +{ + switch (ionizationType) + { + case IonizationType_EI: return MS_electron_ionization; + case IonizationType_CI: return MS_chemical_ionization; + case IonizationType_FAB: return MS_fast_atom_bombardment_ionization; + case IonizationType_ESI: return MS_electrospray_ionization; + case IonizationType_NSI: return MS_nanoelectrospray; + case IonizationType_APCI: return MS_atmospheric_pressure_chemical_ionization; + //case IonizationType_TSP: return MS_thermospray_ionization; + case IonizationType_FD: return MS_field_desorption; + case IonizationType_MALDI: return MS_matrix_assisted_laser_desorption_ionization; + case IonizationType_GD: return MS_glow_discharge_ionization; + case IonizationType_Unknown: + default: + return CVParam(); + } +} + + +CVParam translateAsInletType(IonizationType ionizationType) +{ + switch (ionizationType) + { + //case IonizationType_EI: return MS_electron_ionization; + //case IonizationType_CI: return MS_chemical_ionization; + case IonizationType_FAB: return MS_continuous_flow_fast_atom_bombardment; + case IonizationType_ESI: return MS_electrospray_inlet; + case IonizationType_NSI: return MS_nanospray_inlet; + //case IonizationType_APCI: return MS_atmospheric_pressure_chemical_ionization; + case IonizationType_TSP: return MS_thermospray_inlet; + //case IonizationType_FD: return MS_field_desorption; + //case IonizationType_MALDI: return MS_matrix_assisted_laser_desorption_ionization; + //case IonizationType_GD: return MS_glow_discharge_ionization; + case IonizationType_Unknown: + default: + return CVParam(); + } +} + + +CVParam translate(PolarityType polarityType) +{ + switch (polarityType) + { + case PolarityType_Positive: + return MS_positive_scan; + case PolarityType_Negative: + return MS_negative_scan; + case PolarityType_Unknown: + default: + return CVParam(); + } +} + +} // detail +} // msdata +} // pwiz Added: trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.hpp =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.hpp (rev 0) +++ trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Detail.hpp 2008-04-24 14:37:48 UTC (rev 133) @@ -0,0 +1,24 @@ +#ifndef _READER_THERMO_DETAIL_HPP_ +#define _READER_THERMO_DETAIL_HPP_ + +#include "data/msdata/MSData.hpp" +#include "utility/vendor_api/thermo/ScanFilter.h" + +using namespace pwiz::raw; + +namespace pwiz { +namespace msdata { +namespace detail { + +CVParam translateAsScanningMethod(ScanType scanType); +CVParam translateAsSpectrumType(ScanType scanType); +CVParam translate(MassAnalyzerType type); +CVParam translateAsIonizationType(IonizationType ionizationType); +CVParam translateAsInletType(IonizationType ionizationType); +CVParam translate(PolarityType polarityType); + +} // detail +} // msdata +} // pwiz + +#endif // _READER_THERMO_DETAIL_HPP_ Modified: trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Test.cpp =================================================================== --- trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Test.cpp 2008-04-24 13:50:25 UTC (rev 132) +++ trunk/pwiz/pwiz/data/vendor_readers/Reader_Thermo_Test.cpp 2008-04-24 14:37:48 UTC (rev 133) @@ -140,8 +140,15 @@ const Precursor& precursor2 = spectrum->spectrumDescription.precursors[0]; unit_assert(precursor2.spectrumID == "2"); // previous ms1 scan + // test chromatogram list + unit_assert(msd.run.chromatogramListPtr.get()); + ChromatogramList& cl = *msd.run.chromatogramListPtr; + if (os_) *os_ << "chromatogram list size: " << cl.size() << endl; + unit_assert(cl.size() == 1); + ChromatogramPtr chromatogram = cl.chromatogram(0, true); + unit_assert(chromatogram->id == "TIC"); + // test file-level metadata - unit_assert(msd.fileDescription.fileContent.hasCVParam(MS_MSn_spectrum)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |