diff --git a/pwiz/data/msdata/Reader.cpp b/pwiz/data/msdata/Reader.cpp index 577f073770..8ab14325e8 100755 --- a/pwiz/data/msdata/Reader.cpp +++ b/pwiz/data/msdata/Reader.cpp @@ -52,6 +52,7 @@ Reader::Config::Config() , sortAndJitter(false) , globalChromatogramsAreMs1Only(false) , ddaProcessing(false) + , ignoreScheduledLimitsForChromatograms(false) { } @@ -74,6 +75,7 @@ Reader::Config::Config(const Config& rhs) isolationMzAndMobilityFilter = rhs.isolationMzAndMobilityFilter; sortAndJitter = rhs.sortAndJitter; globalChromatogramsAreMs1Only = rhs.globalChromatogramsAreMs1Only; + ignoreScheduledLimitsForChromatograms = rhs.ignoreScheduledLimitsForChromatograms; } // default implementation; most Readers don't need to worry about multi-run input files diff --git a/pwiz/data/msdata/Reader.hpp b/pwiz/data/msdata/Reader.hpp index c119a305b7..8d7edd38b5 100755 --- a/pwiz/data/msdata/Reader.hpp +++ b/pwiz/data/msdata/Reader.hpp @@ -96,6 +96,10 @@ class PWIZ_API_DECL Reader // to the same precursor from the same survey scan, and lockmass-correcting the precursor mass (if the lockmass refiner is active). bool ddaProcessing; + /// when true, scheduled SIM/SRM chromatograms will try to get an XIC covering the entire range instead of just the scheduled range + /// (useful if the instrument recorded extra data outside the scheduled limits, currently only applicable to Sciex WIFF) + bool ignoreScheduledLimitsForChromatograms; + Config(); Config(const Config& rhs); }; diff --git a/pwiz/data/vendor_readers/ABI/ChromatogramList_ABI.cpp b/pwiz/data/vendor_readers/ABI/ChromatogramList_ABI.cpp index 55bf2b9f0a..1a18eb605b 100644 --- a/pwiz/data/vendor_readers/ABI/ChromatogramList_ABI.cpp +++ b/pwiz/data/vendor_readers/ABI/ChromatogramList_ABI.cpp @@ -251,7 +251,7 @@ PWIZ_API_DECL ChromatogramPtr ChromatogramList_ABI::chromatogram(size_t index, D result->setTimeIntensityArrays(std::vector(), std::vector(), UO_minute, MS_number_of_detector_counts); pwiz::util::BinaryData times, intensities; - experiment->getSIC(ie.transition, times, intensities); + experiment->getSIC(ie.transition, times, intensities, config_.ignoreScheduledLimitsForChromatograms); result->defaultArrayLength = times.size(); if (getBinaryData) @@ -290,7 +290,7 @@ PWIZ_API_DECL ChromatogramPtr ChromatogramList_ABI::chromatogram(size_t index, D result->setTimeIntensityArrays(std::vector(), std::vector(), UO_minute, MS_number_of_detector_counts); pwiz::util::BinaryData times, intensities; - experiment->getSIC(ie.transition, times, intensities); + experiment->getSIC(ie.transition, times, intensities, config_.ignoreScheduledLimitsForChromatograms); result->defaultArrayLength = times.size(); if (getBinaryData) diff --git a/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.cpp b/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.cpp index 0229ff78ab..559303242b 100644 --- a/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.cpp +++ b/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.cpp @@ -130,9 +130,9 @@ struct ExperimentImpl : public Experiment virtual size_t getSRMSize() const; virtual void getSRM(size_t index, Target& target) const; - virtual double getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities) const; + virtual double getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, bool ignoreScheduledLimits) const; virtual void getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, - double& basePeakX, double& basePeakY) const; + double& basePeakX, double& basePeakY, bool ignoreScheduledLimits) const; virtual void getAcquisitionMassRange(double& startMz, double& stopMz) const; virtual ScanType getScanType() const; @@ -609,7 +609,7 @@ void ExperimentImpl::getSRM(size_t index, Target& target) const CATCH_AND_FORWARD } -double ExperimentImpl::getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities) const +double ExperimentImpl::getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, bool ignoreScheduledLimits) const { try { @@ -620,7 +620,13 @@ double ExperimentImpl::getSIC(size_t index, pwiz::util::BinaryData& time getSRM(index, target); ExtractedIonChromatogramSettings^ option = gcnew ExtractedIonChromatogramSettings(index); - if (target.startTime != target.endTime) + if (ignoreScheduledLimits) + { + option->StartCycle = 0; + option->EndCycle = convertRetentionTimeToCycle(cycleTimes().back()); + option->UseStartEndCycle = true; + } + else if (target.startTime != target.endTime) { option->StartCycle = convertRetentionTimeToCycle(target.startTime); option->EndCycle = convertRetentionTimeToCycle(target.endTime); @@ -636,9 +642,9 @@ double ExperimentImpl::getSIC(size_t index, pwiz::util::BinaryData& time } void ExperimentImpl::getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, - double& basePeakX, double& basePeakY) const + double& basePeakX, double& basePeakY, bool ignoreScheduledLimits) const { - basePeakY = getSIC(index, times, intensities); + basePeakY = getSIC(index, times, intensities, ignoreScheduledLimits); try { diff --git a/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.hpp b/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.hpp index 8d1ac7a305..38103b57f5 100644 --- a/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.hpp +++ b/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile.hpp @@ -190,9 +190,9 @@ struct PWIZ_API_DECL Experiment virtual size_t getSRMSize() const = 0; virtual void getSRM(size_t index, Target& target) const = 0; - virtual double getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities) const = 0; + virtual double getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, bool ignoreScheduledLimits) const = 0; virtual void getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, - double& basePeakX, double& basePeakY) const = 0; + double& basePeakX, double& basePeakY, bool ignoreScheduledLimits) const = 0; virtual void getAcquisitionMassRange(double& startMz, double& stopMz) const = 0; virtual ScanType getScanType() const = 0; diff --git a/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile2.ipp b/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile2.ipp index e94ebcacf8..5027ffa8aa 100644 --- a/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile2.ipp +++ b/pwiz_aux/msrc/utility/vendor_api/ABI/WiffFile2.ipp @@ -128,9 +128,9 @@ struct Experiment2Impl : public Experiment virtual size_t getSRMSize() const; virtual void getSRM(size_t index, Target& target) const; - virtual double getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities) const; + virtual double getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, bool ignoreScheduledLimits) const; virtual void getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, - double& basePeakX, double& basePeakY) const; + double& basePeakX, double& basePeakY, bool ignoreScheduledLimits) const; virtual void getAcquisitionMassRange(double& startMz, double& stopMz) const; virtual ScanType getScanType() const; @@ -564,15 +564,15 @@ void Experiment2Impl::getSRM(size_t index, Target& target) const CATCH_AND_FORWARD } -double Experiment2Impl::getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities) const +double Experiment2Impl::getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, bool ignoreScheduledLimits) const { double x, y; - getSIC(index, times, intensities, x, y); + getSIC(index, times, intensities, x, y, ignoreScheduledLimits); return y; } void Experiment2Impl::getSIC(size_t index, pwiz::util::BinaryData& times, pwiz::util::BinaryData& intensities, - double& basePeakX, double& basePeakY) const + double& basePeakX, double& basePeakY, bool ignoreScheduledLimits) const { try { diff --git a/pwiz_tools/commandline/msconvert.cpp b/pwiz_tools/commandline/msconvert.cpp index 6e6eac3622..6767280525 100644 --- a/pwiz_tools/commandline/msconvert.cpp +++ b/pwiz_tools/commandline/msconvert.cpp @@ -70,15 +70,8 @@ struct Config : public Reader::Config Config() : outputPath("."), verbose(false), merge(false) { - simAsSpectra = false; - srmAsSpectra = false; - combineIonMobilitySpectra = false; - ignoreCalibrationScans = false; - reportSonarBins = false; - unknownInstrumentIsError = true; stripLocationFromSourceFiles = false; stripVersionFromSoftware = false; - ddaProcessing = false; } string outputFilename(const string& inputFilename, const MSData& inputMSData) const; @@ -344,6 +337,9 @@ Config parseCommandLine(int argc, char** argv) ("ignoreCalibrationScans", po::value(&config.ignoreCalibrationScans)->zero_tokens(), ": do not process calibration scans (currently only applies to Waters lockmass function)") + ("ignoreScheduledLimitsForChromatograms", + po::value(&config.ignoreScheduledLimitsForChromatograms)->zero_tokens(), + ": scheduled SIM/SRM chromatograms will try to get an XIC covering the entire run time instead of just the scheduled limits") ("acceptZeroLengthSpectra", po::value(&config.acceptZeroLengthSpectra)->zero_tokens(), ": some vendor readers have an efficient way of filtering out empty spectra, but it takes more time to open the file")