From e46c2a3f4980ff3b69648f900cbd733993afc15c Mon Sep 17 00:00:00 2001 From: dpsmca Date: Sun, 22 May 2022 19:12:46 -0500 Subject: [PATCH 1/9] Ignore all JetBrains IntelliJ project files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c2779e10fe..401cdac858 100644 --- a/.gitignore +++ b/.gitignore @@ -324,6 +324,7 @@ paket-files/ # JetBrains Rider .idea/ *.sln.iml +*.iml # CodeRush .cr/ From dec787667ab3256a9f0b7509c4480436c8c306f6 Mon Sep 17 00:00:00 2001 From: dpsmca Date: Wed, 29 Jun 2022 11:10:05 -0500 Subject: [PATCH 2/9] Git should ignore macOS build directories --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 401cdac858..e4535ad0b9 100644 --- a/.gitignore +++ b/.gitignore @@ -362,6 +362,8 @@ ASALocalRun/ *.nvuser /build-nt-x86 +/build-macosx-x86_64 +/build-macosx-x86 /*.log /libraries/boost_1_* /libraries/expat* From acf6be1749908c04dcb44ae9c8348e5fd3bdd0c3 Mon Sep 17 00:00:00 2001 From: Roman Zenka Date: Thu, 16 May 2024 16:47:26 -0500 Subject: [PATCH 3/9] Ignore Linux build results --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 0cc61b9471..ad2e1dad54 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,9 @@ *.out *.app +# Linux build results +/build-linux-* + ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. From f8a4c640908551a6eed9c5411f2413f29dbca70b Mon Sep 17 00:00:00 2001 From: Roman Zenka Date: Thu, 16 May 2024 16:48:18 -0500 Subject: [PATCH 4/9] Remove executable permission from quickbuild.bat since Windows ignores it anyway and this will make tab completion easier on Linux and MacOS --- quickbuild.bat | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 quickbuild.bat diff --git a/quickbuild.bat b/quickbuild.bat old mode 100755 new mode 100644 From 4fd4a2d9c88b117fe8b1ba1fe71a66e6332277f6 Mon Sep 17 00:00:00 2001 From: David Sargeant Date: Fri, 21 Jun 2024 15:49:43 -0500 Subject: [PATCH 5/9] QuaMeter peak symmetry updates --- pwiz_tools/Bumbershoot/quameter/quameter.cpp | 55 +++++++++++++++++++- pwiz_tools/Bumbershoot/quameter/quameter.h | 4 ++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/pwiz_tools/Bumbershoot/quameter/quameter.cpp b/pwiz_tools/Bumbershoot/quameter/quameter.cpp index bfaeec1c9c..19b31a31e5 100644 --- a/pwiz_tools/Bumbershoot/quameter/quameter.cpp +++ b/pwiz_tools/Bumbershoot/quameter/quameter.cpp @@ -1632,6 +1632,9 @@ namespace quameter medianSigNoisMS1 = 0, dynamicRangeOfPeptideSignals = 0, peakPrecursorIntensityMedian = 0, medianSigNoisMS2 = 0, idRatioQ1 = 0, idRatioQ2 = 0, idRatioQ3 = 0, idRatioQ4 = 0, peakPrecursorIntensity95thPercentile = 0, peakPrecursorIntensity5thPercentile = 0; + // BEG KEESH MAYO ASYMM METRIC + map surviving_peaks; // remaining "good peaks" to cacluate new peak asymmetry ratio metric + // END KEESH MAYO ASYMM METRIC if (g_rtConfig->MetricsType == "nistms") { @@ -1961,8 +1964,22 @@ namespace quameter accs::accumulator_set > identifiedPeakWidths; BOOST_FOREACH(const XICWindow& distinctMatch, pepWindow) if (distinctMatch.bestPeak) - for (size_t i=0; i < distinctMatch.PSMs.size(); ++i) // the best peak is shared between all PSMs + // BEG KEESH MAYO ASYMM METRIC + for (size_t i = 0; i < distinctMatch.PSMs.size(); ++i) // the best peak is shared between all PSMs + { identifiedPeakWidths(distinctMatch.bestPeak->fwhm); + // TODO-- Make sure that we have the right peaks + double startTime = distinctMatch.bestPeak->startTime / 60.0; // convert seconds to minutes + double peakTime = distinctMatch.bestPeak->peakTime / 60.0; + double endTime = distinctMatch.bestPeak->endTime / 60.0; + double a = peakTime - startTime; + double b = endTime - peakTime; + double epsilon = boost::math::tools::epsilon(); + // Perform the division safely + double As = b / (a + epsilon); + surviving_peaks[peakTime] = As; + } + // END KEESH MAYO ASYMM METRIC identifiedPeakWidthMedian = accs::percentile(identifiedPeakWidths, accs::percentile_number = 50); identifiedPeakWidthIQR = accs::percentile(identifiedPeakWidths, accs::percentile_number = 75) - accs::percentile(identifiedPeakWidths, accs::percentile_number = 25); @@ -2138,12 +2155,23 @@ namespace quameter if (outputFilepath.empty()) outputFilepath = bfs::change_extension(sourceFilename, ".qual.tsv").string(); + // BEG KEESH MAYO ASYMM METRIC + string outputFilepath2 = append_to_filename_before_extension(outputFilepath, "2"); + // END KEESH MAYO ASYMM METRIC + guard.lock(); bool needsHeader = !bfs::exists(outputFilepath); + // BEG KEESH MAYO ASYMM METRIC + // We use the same mutex here for our new output file. + bool needsHeader2 = !bfs::exists(outputFilepath2); ofstream qout; qout.open(outputFilepath.c_str(), ios::out | ios::app); + + ofstream qout2; + qout2.open(outputFilepath2.c_str(), ios::out | ios::app); + // END KEESH MAYO ASYMM METRIC // Tab delimited output header if (needsHeader) @@ -2156,6 +2184,19 @@ namespace quameter qout << "\tP-1\tP-2A\tP-2B\tP-2C\tP-3" << endl; } + // BEG KEESH MAYO ASYMM METRIC + if (needsHeader2) + { + qout2 << "Filename\tStartTimeStamp\tPeakTime min\tAsymmetry Ratio" << endl; + } + for (const std::pair& pair : surviving_peaks) + { + qout2 << sourceFilename << "\t" << startTimeStamp << "\t" + << pair.first << "\t" << pair.second << endl; + } + // END KEESH MAYO ASYMM METRIC + + // Tab delimited metrics qout << sourceFilename; qout << "\t" << startTimeStamp; @@ -2193,6 +2234,18 @@ namespace quameter } return; } + + // BEG KEESH MAYO ASYMM METRIC + // Function to modify the filename + string append_to_filename_before_extension(const string& filepath, const string& append_str) { + bfs::path p(filepath); + std::string stem = p.stem().string(); // Get the stem (filename without extension) + std::string extension = p.extension().string(); // Get the extension + stem += append_str; // Append the desired string + return (p.parent_path() / (stem + extension)).string(); // Reconstruct the path + } + // END KEESH MAYO ASYMM METRIC + } } diff --git a/pwiz_tools/Bumbershoot/quameter/quameter.h b/pwiz_tools/Bumbershoot/quameter/quameter.h index 688618e4b6..e0609caa00 100644 --- a/pwiz_tools/Bumbershoot/quameter/quameter.h +++ b/pwiz_tools/Bumbershoot/quameter/quameter.h @@ -97,6 +97,10 @@ void ScanRankerMetrics(const QuameterInput&); void IDFreeMetrics(const QuameterInput&); void ExecuteMetricsThread(); +// BEG KEESH MAYO ASYMM METRIC +string append_to_filename_before_extension(const string& filepath, const string& append_str); +// END KEESH MAYO ASYMM METRIC + /** * Given an idpDB file, return its RAW/mzML/etc source files. * Add: also accept filenames of interest (e.g. ignore all source files except -these-) From 097b41649c5af110daa6aa842e8fd7825fa5d4b3 Mon Sep 17 00:00:00 2001 From: David Sargeant Date: Fri, 21 Jun 2024 15:52:47 -0500 Subject: [PATCH 6/9] Add Windows and macOS default files to ignore --- .gitignore | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.gitignore b/.gitignore index ad2e1dad54..67915a0191 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,57 @@ +# Operating system files +## macOS +.DS_Store +.AppleDouble +.LSOverride + +### Icon must end with two \r +Icon + +### Thumbnails +._* + +### Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +### Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +## Windows +### Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +### Dump file +*.stackdump + +### Folder config file +[Dd]esktop.ini + +### Recycle Bin used on file shares +$RECYCLE.BIN/ + +### Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +### Windows shortcuts +*.lnk + ## Ignore C++ intermediates and outputs ## https://raw.githubusercontent.com/github/gitignore/master/C%2B%2B.gitignore From 7d0e898a8b84660a9bde9ccaf70bb855d9628555 Mon Sep 17 00:00:00 2001 From: m008480 Date: Mon, 9 Dec 2024 13:55:32 -0600 Subject: [PATCH 7/9] pre-merge for asymmetry ratio. --- .../Bumbershoot/quameter/crawdad/CrawPeak.cpp | 60 ++++++++------ .../Bumbershoot/quameter/crawdad/CrawPeak.h | 20 ++++- .../quameter/crawdad/CrawPeakAnnotator.h | 43 +++++----- .../quameter/crawdad/CrawPeakFinder.cpp | 3 + .../quameter/crawdad/SimpleCrawdad.cpp | 7 ++ .../quameter/crawdad/SimpleCrawdad.h | 17 +++- pwiz_tools/Bumbershoot/quameter/quameter.cpp | 79 ++++++++++--------- .../quameter/quameterSharedTypes.h | 13 +-- pwiz_tools/Skyline/Executables/BullseyeSharp | 2 +- .../Skyline/Executables/Hardklor/Hardklor | 2 +- 10 files changed, 154 insertions(+), 92 deletions(-) diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.cpp b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.cpp index 95bc29b1cb..7ec358b9e3 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.cpp +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.cpp @@ -1,21 +1,21 @@ -/* - * Original author: Greg Finney , - * MacCoss Lab, Department of Genome Sciences, UW - * - * Copyright 2009 University of Washington - Seattle, WA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Original author: Greg Finney , + * MacCoss Lab, Department of Genome Sciences, UW + * + * Copyright 2009 University of Washington - Seattle, WA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "CrawPeak.h" #include "CrawPeakMethod.h" #include @@ -43,12 +43,17 @@ namespace crawpeaks { return peak_area / bg_area; } + // BEG KEESH MAYO ASYMM METRIC SlimCrawPeak::SlimCrawPeak( int start_idx, int stop_idx, int peak_idx, - const std::vector & raw ,std::vector & scratch , int mz_idx ) : + const std::vector & raw ,std::vector & scratch , int mz_idx, + int start01_idx, int stop01_idx) : start_rt_idx(start_idx) , stop_rt_idx(stop_idx) , peak_rt_idx(peak_idx) , - mz_idx(mz_idx) + mz_idx(mz_idx), + start01_rt_idx(start01_idx), + stop01_rt_idx(stop01_idx) + // END KEESH MAYO ASYMM METRIC { init(); @@ -66,7 +71,7 @@ void SlimCrawPeak::init() { raw_area = bg_area = peak_area = bgslope = peak_height = raw_height = -1.0f; fwhm = -1; this->fwhm_calculated_ok = false; - } + } void CrawPeak::init() { stddev_mean_above_baseline = -1.0f; @@ -77,10 +82,13 @@ void CrawPeak::init() { int SlimCrawPeak::delcnt = 0; #endif +// BEG KEESH MAYO ASYMM METRIC CrawPeak::CrawPeak( int start_idx, int stop_idx, int peak_idx, - const std::vector & raw , std::vector & scratch, int mz_idx + const std::vector & raw , std::vector & scratch, int mz_idx, + int start01_idx, int stop01_idx ) : - SlimCrawPeak( start_idx, stop_idx, peak_idx, raw, scratch, mz_idx ) { + SlimCrawPeak( start_idx, stop_idx, peak_idx, raw, scratch, mz_idx, start01_idx, stop01_idx) { + // END KEESH MAYO ASYMM METRIC init(); intensities.resize(this->len); background_vals.resize(this->len); @@ -219,10 +227,10 @@ void CrawPeak::calc_baseline_stats( ) { } - + std::string SlimCrawPeak::as_string_header() const { return std::string("mz\tstart_idx\tpeak_idx\tstop_idx\tfwhm"); - } + } std::string SlimCrawPeak::as_string() const { char tmpstr[256]; sprintf(tmpstr,"%d\t%d\t%d\t%d\t%d\t%2.2f",mz_idx,start_rt_idx,peak_rt_idx,stop_rt_idx,fwhm); @@ -279,7 +287,7 @@ void CrawPeak::calc_baseline_stats( ) { /* ---- suppeaklocated ---- */ CrawPeakLocated::CrawPeakLocated( int lh_valley, int rh_valley, - int peak_loc, const std::vector &chrom , std::vector & scratch, int mz_idx ) : + int peak_loc, const std::vector &chrom , std::vector & scratch, int mz_idx ) : CrawPeak( lh_valley, rh_valley, peak_loc, chrom, scratch, mz_idx ) { } diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.h b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.h index 57d8852723..836a6d46d8 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.h +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeak.h @@ -76,6 +76,11 @@ public : float peak_height; float raw_height; + // BEG KEESH MAYO ASYMM METRIC + int start01_rt_idx, stop01_rt_idx; + // END KEESH MAYO ASYMM METRIC + + //CrawPeakMethod sup_method; virtual void init(); @@ -106,8 +111,11 @@ public : void calc_fwhm(); + // BEG KEESH MAYO ASYMM METRIC + SlimCrawPeak( int start_idx, int stop_idx, int peak_idx, const std::vector & raw , std::vector & scratch, int mz_idx = -1, + int start01_idx = -1, int stop01_idx = -1); + // END KEESH MAYO ASYMM METRIC - SlimCrawPeak( int start_idx, int stop_idx, int peak_idx, const std::vector & raw , std::vector & scratch, int mz_idx = -1 ); ~SlimCrawPeak() { #ifdef DEBUG delcnt++; @@ -149,6 +157,10 @@ class CrawPeak : public SlimCrawPeak { CrawPeak() { //sup_method = method; start_rt_idx = stop_rt_idx = peak_rt_idx = mz_idx = -1; + // BEG KEESH MAYO ASYMM METRIC + start01_rt_idx = stop01_rt_idx = -1; + // END KEESH MAYO ASYMM METRIC + init(); } @@ -160,9 +172,11 @@ class CrawPeak : public SlimCrawPeak { */ ///Constructor taking start,stop,peak,mz indices, and a vector of intensities + // BEG KEESH MAYO ASYMM METRIC CrawPeak( int start_idx, int stop_idx, int peak_idx, - const std::vector & raw, std::vector & scratch ,int mz_idx = -1 ); - + const std::vector & raw, std::vector & scratch ,int mz_idx = -1, + int start01_idx = -1, int stop01_idx = -1); + // END KEESH MAYO ASYMM METRIC virtual void init(); diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.h b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.h index 87dc4abc6f..9b813b74d1 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.h +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.h @@ -1,21 +1,21 @@ -/* - * Original author: Greg Finney , - * MacCoss Lab, Department of Genome Sciences, UW - * - * Copyright 2009 University of Washington - Seattle, WA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Original author: Greg Finney , + * MacCoss Lab, Department of Genome Sciences, UW + * + * Copyright 2009 University of Washington - Seattle, WA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _SUPPEAKANNOTATOR_H #define _SUPPEAKANNOTATOR_H @@ -191,6 +191,11 @@ void set_bg_scratch ( int start_idx, int stop_idx ); void calc_fwhm( SlimCrawPeak & peak ); +// BEG KEESH MAYO ASYMM METRIC +// Do we need to duplicat in ProteoWizard\pwiz_tools\Shared\Crawdad\CrawPeakAnnotator.H too? +void calc_fw01m(SlimCrawPeak& peak); +// END KEESH MAYO ASYMM METRIC + #if 0 void set_peak_positions ( SlimCrawPeak & peak ) { @@ -205,7 +210,7 @@ void calc_fwhm( SlimCrawPeak & peak ); //calls set_peak_areas onpeak member variables set_peak_bg_subtracted_area(peak); calc_fwhm(peak); - }; + }; private : diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakFinder.cpp b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakFinder.cpp index e09dc2599a..bdf25a8c6b 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakFinder.cpp +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakFinder.cpp @@ -597,6 +597,9 @@ void StackCrawPeakFinder::peak_voodoo( int lh_valley, int rh_valley, int peak_lo annotator.set_peak_slope(peak); annotator.set_peak_bg_subtracted_area ( peak ); annotator.calc_fwhm(peak); + // BEG KEESH MAYO ASYMM METRIC + annotator.calc_fw01m(peak); + // END KEESH MAYO ASYMM METRIC sps.push_back(peak); } diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.cpp b/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.cpp index d6c15ffaf7..f337c5ae9b 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.cpp +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.cpp @@ -202,6 +202,13 @@ vector CrawdadPeakFinder::CalcPeaks(int maxPeaks) itPeak->stop_rt_idx = max(_widthDataWings, min(stop_rt, itPeak->stop_rt_idx)); itPeak->stop_rt_idx -= _widthDataWings; + // BEG KEESH MAYO ASYMM METRIC + itPeak->start01_rt_idx = max(_widthDataWings, itPeak->start01_rt_idx); + itPeak->start01_rt_idx -= _widthDataWings; + itPeak->stop01_rt_idx = max(_widthDataWings, min(stop_rt, itPeak->stop01_rt_idx)); + itPeak->stop01_rt_idx -= _widthDataWings; + // END KEESH MAYO ASYMM METRIC + result.push_back(CrawdadPeakPtr(new CrawdadPeak(*itPeak))); totalArea += itPeak->peak_area; diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.h b/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.h index b2cab84b0a..63d9c05b5d 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.h +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/SimpleCrawdad.h @@ -33,6 +33,7 @@ using namespace crawpeaks; struct CrawdadPeak { + // BEG KEESH MAYO ASYMM METRIC CrawdadPeak(const SlimCrawPeak& crawPeak) { _timeIndex = crawPeak.peak_rt_idx; @@ -45,6 +46,9 @@ struct CrawdadPeak _backgroundArea = max(0.0f, crawPeak.bg_area); _fwhm = crawPeak.fwhm; _fwhmDegenerate = !crawPeak.fwhm_calculated_ok; + + _start01Index = crawPeak.start01_rt_idx; + _end01Index = crawPeak.stop01_rt_idx; } int getTimeIndex() { return _timeIndex; } @@ -60,6 +64,14 @@ struct CrawdadPeak float getFwhm() { return _fwhm; } bool getFwhmDegenerate() { return _fwhmDegenerate; } + + int getStart01Index() { return _start01Index; } + void setStart01Index(int value) { _start01Index = value; } + int getEnd01Index() { return _end01Index; } + void setEnd01Index(int value) { _end01Index = value; } + + + private: int _timeIndex; int _startIndex; @@ -69,8 +81,11 @@ struct CrawdadPeak float _height; float _fwhm; bool _fwhmDegenerate; -}; + int _start01Index; + int _end01Index; +}; +// END KEESH MAYO ASYMM METRIC typedef boost::shared_ptr CrawdadPeakPtr; diff --git a/pwiz_tools/Bumbershoot/quameter/quameter.cpp b/pwiz_tools/Bumbershoot/quameter/quameter.cpp index 19b31a31e5..be8f2974bf 100644 --- a/pwiz_tools/Bumbershoot/quameter/quameter.cpp +++ b/pwiz_tools/Bumbershoot/quameter/quameter.cpp @@ -644,12 +644,12 @@ namespace quameter } } - struct MZIntensityPairSortByMZ - { - bool operator() (const pwiz::msdata::MZIntensityPair& lhs, const pwiz::msdata::MZIntensityPair& rhs) const - { - return lhs.mz < rhs.mz; - } + struct MZIntensityPairSortByMZ + { + bool operator() (const pwiz::msdata::MZIntensityPair& lhs, const pwiz::msdata::MZIntensityPair& rhs) const + { + return lhs.mz < rhs.mz; + } }; struct UnidentifiedPrecursorPeakWidthLessThan @@ -1633,7 +1633,7 @@ namespace quameter medianSigNoisMS2 = 0, idRatioQ1 = 0, idRatioQ2 = 0, idRatioQ3 = 0, idRatioQ4 = 0, peakPrecursorIntensity95thPercentile = 0, peakPrecursorIntensity5thPercentile = 0; // BEG KEESH MAYO ASYMM METRIC - map surviving_peaks; // remaining "good peaks" to cacluate new peak asymmetry ratio metric + map surviving_peaks; // was RT => Best Peak Intensity remaining "good peaks" to cacluate new peak asymmetry ratio metric // END KEESH MAYO ASYMM METRIC if (g_rtConfig->MetricsType == "nistms") @@ -1795,7 +1795,7 @@ namespace quameter // eliminate negative signal BOOST_FOREACH(double& intensity, window.MS1Intensity) intensity = max(0.0, intensity); - + CrawdadPeakFinder crawdadPeakFinder; crawdadPeakFinder.SetChromatogram(window.MS1RT, window.MS1Intensity); @@ -1830,6 +1830,7 @@ namespace quameter // find the peak with the highest sum of (PSM scores * interpolated SIC) within the peak; // if no IDs fall within peaks, find the peak closest to the best scoring id + map > peakByIntensityBySumOfProducts; BOOST_FOREACH(const CrawdadPeakPtr& crawPeak, crawPeaks) { @@ -1837,6 +1838,8 @@ namespace quameter double endTime = window.MS1RT[crawPeak->getEndIndex()]; double peakTime = window.MS1RT[crawPeak->getTimeIndex()]; //double peakTime = startTime + (endTime-startTime)/2; + double start01Time = window.MS1RT[crawPeak->getStart01Index()]; + double end01Time = window.MS1RT[crawPeak->getEnd01Index()]; // skip degenerate peaks if (crawPeak->getFwhm() == 0 || boost::math::isnan(crawPeak->getFwhm()) || startTime == peakTime || peakTime == endTime) @@ -1850,7 +1853,8 @@ namespace quameter // Crawdad Fwhm is in index units; we have to translate it back to time units double sampleRate = (endTime-startTime) / (crawPeak->getEndIndex()-crawPeak->getStartIndex()); - Peak peak(startTime, endTime, peakTime, crawPeak->getFwhm() * sampleRate, crawPeak->getHeight()); + Peak peak(startTime, endTime, peakTime, crawPeak->getFwhm() * sampleRate, crawPeak->getHeight(), + start01Time, end01Time); window.peaks.insert(peak); if (!window.bestPeak || fabs(window.bestPeak->peakTime - window.maxScoreScanStartTime) > @@ -1875,11 +1879,11 @@ namespace quameter sumOfProducts += psm.score * interpolator.interpolate(window.MS1RT, window.MS1Intensity, psm.spectrum->scanStartTime); } - if (sumOfProducts > 0) + if (sumOfProducts > 0) peakByIntensityBySumOfProducts[sumOfProducts][peak.intensity] = peak; } - if (!peakByIntensityBySumOfProducts.empty()) + if (!peakByIntensityBySumOfProducts.empty()) window.bestPeak = peakByIntensityBySumOfProducts.rbegin()->second.rbegin()->second; if (!window.bestPeak) @@ -1919,8 +1923,9 @@ namespace quameter // eliminate negative signal BOOST_FOREACH(double& intensity, info.chromatogram.MS1Intensity) intensity = max(0.0, intensity); - + // The second peak finder is for finding peaks for chromatograms of unidentified spectra, grouped by precursor m/z IIRC. CrawdadPeakFinder crawdadPeakFinder; + // keesh NOTE-- the time vector lc.MS1RT is not stored in crawdadPeakFinder, so difficult to convert back to time in here. crawdadPeakFinder.SetChromatogram(lc.MS1RT, lc.MS1Intensity); vector crawPeaks = crawdadPeakFinder.CalcPeaks(); @@ -1933,6 +1938,8 @@ namespace quameter double endTime = lc.MS1RT[crawPeak->getEndIndex()]; double peakTime = lc.MS1RT[crawPeak->getTimeIndex()]; //double peakTime = startTime + (endTime-startTime)/2; + double start01Time = lc.MS1RT[crawPeak->getStart01Index()]; + double end01Time = lc.MS1RT[crawPeak->getEnd01Index()]; // skip degenerate peaks if (crawPeak->getFwhm() == 0 || boost::math::isnan(crawPeak->getFwhm()) || startTime == peakTime || peakTime == endTime) @@ -1946,7 +1953,8 @@ namespace quameter // Crawdad Fwhm is in index units; we have to translate it back to time units double sampleRate = (endTime-startTime) / (crawPeak->getEndIndex()-crawPeak->getStartIndex()); - Peak peak(startTime, endTime, peakTime, crawPeak->getFwhm() * sampleRate, crawPeak->getHeight()); + Peak peak(startTime, endTime, peakTime, crawPeak->getFwhm() * sampleRate, crawPeak->getHeight(), + start01Time, end01Time); lc.peaks.insert(peak); if (!lc.bestPeak || fabs(peakTime - info.spectrum->scanStartTime) < fabs(lc.bestPeak->peakTime - info.spectrum->scanStartTime)) @@ -1968,16 +1976,15 @@ namespace quameter for (size_t i = 0; i < distinctMatch.PSMs.size(); ++i) // the best peak is shared between all PSMs { identifiedPeakWidths(distinctMatch.bestPeak->fwhm); - // TODO-- Make sure that we have the right peaks - double startTime = distinctMatch.bestPeak->startTime / 60.0; // convert seconds to minutes - double peakTime = distinctMatch.bestPeak->peakTime / 60.0; - double endTime = distinctMatch.bestPeak->endTime / 60.0; - double a = peakTime - startTime; - double b = endTime - peakTime; - double epsilon = boost::math::tools::epsilon(); - // Perform the division safely + double peakTime = distinctMatch.bestPeak->peakTime / 60.0; + double start01Time = distinctMatch.bestPeak->start01Time / 60.0; // convert seconds to minutes + double end01Time = distinctMatch.bestPeak->end01Time / 60.0; + double a = peakTime - start01Time; + double b = end01Time - peakTime; + double epsilon = boost::math::tools::epsilon(); + // Perform the division safely double As = b / (a + epsilon); - surviving_peaks[peakTime] = As; + surviving_peaks[distinctMatch.bestPeak->intensity] = As; } // END KEESH MAYO ASYMM METRIC identifiedPeakWidthMedian = accs::percentile(identifiedPeakWidths, accs::percentile_number = 50); @@ -2155,7 +2162,7 @@ namespace quameter if (outputFilepath.empty()) outputFilepath = bfs::change_extension(sourceFilename, ".qual.tsv").string(); - // BEG KEESH MAYO ASYMM METRIC + // BEG KEESH MAYO ASYMM METRIC string outputFilepath2 = append_to_filename_before_extension(outputFilepath, "2"); // END KEESH MAYO ASYMM METRIC @@ -2187,12 +2194,12 @@ namespace quameter // BEG KEESH MAYO ASYMM METRIC if (needsHeader2) { - qout2 << "Filename\tStartTimeStamp\tPeakTime min\tAsymmetry Ratio" << endl; - } - for (const std::pair& pair : surviving_peaks) - { - qout2 << sourceFilename << "\t" << startTimeStamp << "\t" - << pair.first << "\t" << pair.second << endl; + qout2 << "Filename\tStartTimeStamp\tPeakIntensity\tAsymmetryRatio" << endl; + } + for (const std::pair& pair : surviving_peaks) + { + qout2 << sourceFilename << "\t" << startTimeStamp << "\t" + << pair.first << "\t" << pair.second << endl; } // END KEESH MAYO ASYMM METRIC @@ -2236,13 +2243,13 @@ namespace quameter } // BEG KEESH MAYO ASYMM METRIC - // Function to modify the filename - string append_to_filename_before_extension(const string& filepath, const string& append_str) { - bfs::path p(filepath); - std::string stem = p.stem().string(); // Get the stem (filename without extension) - std::string extension = p.extension().string(); // Get the extension - stem += append_str; // Append the desired string - return (p.parent_path() / (stem + extension)).string(); // Reconstruct the path + // Function to modify the filename + string append_to_filename_before_extension(const string& filepath, const string& append_str) { + bfs::path p(filepath); + std::string stem = p.stem().string(); // Get the stem (filename without extension) + std::string extension = p.extension().string(); // Get the extension + stem += append_str; // Append the desired string + return (p.parent_path() / (stem + extension)).string(); // Reconstruct the path } // END KEESH MAYO ASYMM METRIC diff --git a/pwiz_tools/Bumbershoot/quameter/quameterSharedTypes.h b/pwiz_tools/Bumbershoot/quameter/quameterSharedTypes.h index caea2ebc3e..cb38c858de 100644 --- a/pwiz_tools/Bumbershoot/quameter/quameterSharedTypes.h +++ b/pwiz_tools/Bumbershoot/quameter/quameterSharedTypes.h @@ -106,20 +106,23 @@ namespace quameter } }; - + // BEG KEESH MAYO ASYMM METRIC struct Peak { double startTime; double endTime; + double start01Time; + double end01Time; double peakTime; double fwhm; double intensity; - - Peak(double startTime = 0, double endTime = 0, double peakTime = 0, double fwhm = 0, double intensity = 0) - : startTime(startTime), endTime(endTime), peakTime(peakTime), fwhm(fwhm), intensity(intensity) + Peak(double startTime = 0, double endTime = 0, double peakTime = 0, double fwhm = 0, double intensity = 0, + double start01Time = 0, double end01Time = 0) + : startTime(startTime), endTime(endTime), peakTime(peakTime), fwhm(fwhm), intensity(intensity), + start01Time(start01Time), end01Time(end01Time) {} }; - + // END KEESH MAYO ASYMM METRIC struct nativeID {}; struct time {}; struct identified {}; diff --git a/pwiz_tools/Skyline/Executables/BullseyeSharp b/pwiz_tools/Skyline/Executables/BullseyeSharp index 4ecb2b1ec2..237d348eff 160000 --- a/pwiz_tools/Skyline/Executables/BullseyeSharp +++ b/pwiz_tools/Skyline/Executables/BullseyeSharp @@ -1 +1 @@ -Subproject commit 4ecb2b1ec2984fd23059e7d937ffd13ade9026e2 +Subproject commit 237d348effe9064b36e0f39617454d0b57754657 diff --git a/pwiz_tools/Skyline/Executables/Hardklor/Hardklor b/pwiz_tools/Skyline/Executables/Hardklor/Hardklor index d2b08f8689..71140105aa 160000 --- a/pwiz_tools/Skyline/Executables/Hardklor/Hardklor +++ b/pwiz_tools/Skyline/Executables/Hardklor/Hardklor @@ -1 +1 @@ -Subproject commit d2b08f8689edab7ee72cfdedd98deece21eb7adf +Subproject commit 71140105aabde41257e4a2d7f2c1e01eb0f2b4ac From 29d9e00b66079e0c2dd0ff9d0bb4e1d4772f5be4 Mon Sep 17 00:00:00 2001 From: m008480 Date: Tue, 10 Dec 2024 08:55:50 -0600 Subject: [PATCH 8/9] Added missing depend in order to build across all platforms. --- .../quameter/crawdad/CrawPeakAnnotator.cpp | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.cpp b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.cpp index 9d3f9fa9ad..4c8d5c51e3 100644 --- a/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.cpp +++ b/pwiz_tools/Bumbershoot/quameter/crawdad/CrawPeakAnnotator.cpp @@ -515,6 +515,47 @@ void CrawPeakAnnotator::calc_fwhm( SlimCrawPeak & peak ) { peak.fwhm = rh_hm - lh_hm; } +// BEG KEESH MAYO ASYMM METRIC +void CrawPeakAnnotator::calc_fw01m(SlimCrawPeak& peak) { + std::vector* c = this->get_active_chrom(); + std::vector& chrom = *c; + float lh_height = chrom.at(peak.start_rt_idx); + float rh_height = chrom.at(peak.stop_rt_idx); + float height = peak.raw_height - std::min(lh_height, rh_height); + float one_tenth_max = (float)(peak.raw_height - (0.9 * height)); + int lh_pt = -1, rh_pt = -1; + float lh_hm, rh_hm; + for (int i = peak.start_rt_idx; i < peak.peak_rt_idx; i++) { + if (chrom[i] <= one_tenth_max && chrom[i + 1] >= one_tenth_max) { + lh_pt = i; + break; + } + } + for (int i = peak.peak_rt_idx; i < std::min(peak.stop_rt_idx, (int)(chrom.size() - 2)); i++) { + if (chrom[i] >= one_tenth_max && chrom[i + 1] <= one_tenth_max) { + rh_pt = i; + break; + } + } + if (lh_pt == -1) { + lh_hm = (float)peak.start_rt_idx; + } + else { + float frac_delta = (one_tenth_max - chrom[lh_pt]) / (chrom[lh_pt + 1] - chrom[lh_pt]); + lh_hm = (float)lh_pt + frac_delta; + } + if (rh_pt == -1) { + rh_hm = (float)peak.stop_rt_idx; + } + else { + float frac_delta = (chrom[rh_pt] - one_tenth_max) / (chrom[rh_pt] - chrom[rh_pt + 1]); + rh_hm = (float)rh_pt + frac_delta; + } + peak.start01_rt_idx = (int)lh_hm; + peak.stop01_rt_idx = (int)rh_hm; +} +// END KEESH MAYO ASYMM METRIC + void CrawPeakAnnotator::refind_peak_peak( SlimCrawPeak & peak ) { peak.peak_rt_idx = get_peakloc_in_range( peak.start_rt_idx, peak.stop_rt_idx ); } From a33b61260e847affc23871600d18d90c5a04dbe6 Mon Sep 17 00:00:00 2001 From: m008480 Date: Fri, 13 Dec 2024 12:03:36 -0600 Subject: [PATCH 9/9] Make gitignore sane as master. --- .gitignore | 127 ++++++++++++++++------------------------------------- 1 file changed, 38 insertions(+), 89 deletions(-) diff --git a/.gitignore b/.gitignore index 67915a0191..d0e8093f77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,57 +1,3 @@ -# Operating system files -## macOS -.DS_Store -.AppleDouble -.LSOverride - -### Icon must end with two \r -Icon - -### Thumbnails -._* - -### Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -### Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -## Windows -### Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -### Dump file -*.stackdump - -### Folder config file -[Dd]esktop.ini - -### Recycle Bin used on file shares -$RECYCLE.BIN/ - -### Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -### Windows shortcuts -*.lnk - ## Ignore C++ intermediates and outputs ## https://raw.githubusercontent.com/github/gitignore/master/C%2B%2B.gitignore @@ -89,9 +35,6 @@ $RECYCLE.BIN/ *.out *.app -# Linux build results -/build-linux-* - ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. @@ -381,7 +324,6 @@ paket-files/ # JetBrains Rider .idea/ *.sln.iml -*.iml # CodeRush .cr/ @@ -418,9 +360,8 @@ ASALocalRun/ # NVidia Nsight GPU debugger configuration file *.nvuser -/build-nt-x86 -/build-macosx-x86_64 -/build-macosx-x86 +build-nt-x86 +/src_subset /*.log /libraries/boost_1_* /libraries/expat* @@ -439,7 +380,8 @@ Version.cpp /pwiz_tools/Bumbershoot/**/AssemblyInfo.cpp /pwiz_tools/Bumbershoot/**/AssemblyInfo.cs /pwiz_tools/Bumbershoot/idpicker/Resources/Resources.* -/pwiz_tools/Skyline/Executables/SkylineBatch/SkylineBatch/Properties/AssemblyInfo.cs +/pwiz/utility/bindings/CLI/example/binaries +/artifact_xml # Vendor reader test data extracted from tarballs (newer data should be committed directly to git) /pwiz/data/vendor_readers/*/Reader*Test.data/**/1SRef @@ -451,6 +393,7 @@ Version.cpp /pwiz_aux/msrc/utility/vendor_api/**/*.dll /pwiz_aux/msrc/utility/vendor_api/*/EULA.* /pwiz_aux/msrc/utility/vendor_api/ABI/LicenseKey.h +/pwiz_aux/msrc/utility/vendor_api/ABI/SCIEX.Apis.Data.v1.xml /pwiz_aux/msrc/utility/vendor_api/Agilent/x64/ /pwiz_aux/msrc/utility/vendor_api/Agilent/x86/ /pwiz_aux/msrc/utility/vendor_api/Bruker/BAF2SQL-README.txt @@ -459,9 +402,12 @@ Version.cpp /pwiz_aux/msrc/utility/vendor_api/Bruker/x64/ /pwiz_aux/msrc/utility/vendor_api/Bruker/x86/ /pwiz_aux/msrc/utility/vendor_api/Bruker/**/*.h +/pwiz_aux/msrc/utility/vendor_api/Bruker/**.SxS.manifest +/pwiz_aux/msrc/utility/vendor_api/Mobilion/*.h /pwiz_aux/msrc/utility/vendor_api/Shimadzu/*.xml /pwiz_aux/msrc/utility/vendor_api/Shimadzu/*.txt /pwiz_aux/msrc/utility/vendor_api/Waters/MassLynx*.h* +/pwiz_aux/msrc/utility/vendor_api/thermo/x64 /pwiz_aux/msrc/utility/vendor_api/thermo/ThermoFisher.CommonCore.RawFileReader.xml /pwiz_aux/msrc/utility/vendor_api/thermo/ThermoFisher.CommonCore.MassPrecisionEstimator.xml /pwiz_aux/msrc/utility/vendor_api/thermo/ThermoFisher.CommonCore.Data.xml @@ -479,45 +425,48 @@ SkylineTester Results /bs32.bat /bso64.bat /bso32.bat +/qb64.bat /SignAfterPublishPW.bat -/OnyxTOFMS.试验.wiff.scan -/160109_Mix1_calcurve_074_raw.skyl -/160109_Mix1_calcurve_074_raw.skyd -/160109_Mix1_calcurve_074_raw -/160109_Mix1_calcurve_073_mzML.skyl -/160109_Mix1_calcurve_073_mzML.skyd -/160109_Mix1_calcurve_073_mzML -/160109_Mix1_calcurve_071_raw.skyl -/160109_Mix1_calcurve_071_raw.skyd -/160109_Mix1_calcurve_071_raw -/160109_Mix1_calcurve_070_mzML.skyl -/160109_Mix1_calcurve_070_mzML.skyd -/160109_Mix1_calcurve_070_mzML -/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw.skyl -/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw.skyd -/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw -/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw.skyl -/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw.skyd -/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw -/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw.skyl -/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw.skyd -/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw -/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw.skyl -/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw.skyd -/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw +/160109_Mix1_calcurve_074_raw* +/160109_Mix1_calcurve_073_mzML* +/160109_Mix1_calcurve_071_raw* +/160109_Mix1_calcurve_070_mzML* +/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw* +/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw* +/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw* +/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw* /pwiz_tools/Skyline/Properties/AssemblyInfo.cs /pwiz_tools/Skyline/SkylineCmd/Properties/AssemblyInfo.cs /pwiz_tools/Skyline/SkylineNightly/Properties/AssemblyInfo.cs /pwiz_tools/Skyline/SkylineNightlyShim/Properties/AssemblyInfo.cs /pwiz_tools/Skyline/SkylineTester/Properties/AssemblyInfo.cs /pwiz_tools/Skyline/TestRunner/Properties/AssemblyInfo.cs +/pwiz_tools/Skyline/Executables/SkylineBatch/SkylineBatch/Properties/AssemblyInfo.cs /pwiz_tools/Skyline/Executables/Installer/FileList64.txt /pwiz_tools/Skyline/TestSettings_x??.testsettings /pwiz_tools/Skyline/SignAfterPublishPW.bat /BrowseOnly /x64/BrowseOnly -/qb64.bat /pwiz_tools/Skyline/Test/ProtocolBuffers/GeneratedCode/*.cs /pwiz_tools/Skyline/Test/ProtocolBuffers/tmp/*.cs /pwiz_tools/Skyline/Test/ProtocolBuffers/tmp -/pwiz_aux/msrc/utility/vendor_api/ABI/SCIEX.Apis.Data.v1.xml +/SearchControlLog.txt + +# created by WIFF2 SDK in working directory +/UserSettings.data +/UserSettings.data-journal + +# created by TeamCity for Skyline versions that need PrositConfig.xml +/pwiz_tools/Skyline/Model/Prosit/ + +# created by older versions of the code in the working directory +/Enolase_repeats_AQv1.4.2* +/PressureTrace1* +/7600ZenoTOFMSMS* +/swath.api* +/timstof_prm_scheduler.prmsqlite + +# created by tc-perftests.bat +/perfTestNames.txt +/tutorialTestNames.txt +/tests.txt