forked from OpenMS/OpenMS
-
Notifications
You must be signed in to change notification settings - Fork 5
Push MTD #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
t-aretz
wants to merge
24
commits into
cbielow:develop
Choose a base branch
from
t-aretz:featurefindermetabo
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Push MTD #143
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2c28332
Push MTD
t-aretz 54fcc16
Deque for MassTrace
t-aretz 97ab6d2
Works but not pretty or finished, but works
t-aretz 314ee53
Sort In Place, no copies, less memory
t-aretz 3704886
First Steps in queue try
t-aretz b3d8a9c
works but not really parallel, why?
t-aretz a9dbb3a
Different outcome with different threads and slow
t-aretz 4f03fd6
gitignore add smaple file
t-aretz 82a6c42
Another Approach and search_traces function
t-aretz fbe1d4f
noch mit bug, fehler noch nicht gefunden
t-aretz e4fc8ab
Some changes
t-aretz 2a9a523
Searches in Funtions, for trying pragma omp tasks
t-aretz b5711d4
Intensity Version
t-aretz dc98474
Same result with different threads
t-aretz 0ad144d
Other while loop break
t-aretz f9b4c36
Fix small bug, added (add_to_peaks) critical
t-aretz 17d5809
Deadlock ?
t-aretz 306f607
with peak_visited right
t-aretz 5db5572
one thread too many traces, more threads deadlock
t-aretz 6b5d2cc
Changed Interface
t-aretz c434153
more threads lead to memory errors
t-aretz 6e676a8
Läuft, zu viele Traces noch
t-aretz 7d5e4e8
klappt
t-aretz 43c748a
klappt
t-aretz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,4 @@ cmake-*-build | |
| *.code-workspace | ||
| .vs | ||
| .clion.* | ||
| src/tests/class_tests/openms/data/SA1_subset_verysmall.mzML | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #include <boost/dynamic_bitset.hpp> | ||
| #include <OpenMS/CONCEPT/ProgressLogger.h> | ||
| #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h> | ||
| #include <OpenMS/KERNEL/MassTrace.h> | ||
|
|
@@ -84,7 +85,12 @@ namespace OpenMS | |
| */ | ||
|
|
||
| /// Allows the iterative computation of the intensity-weighted mean of a mass trace's centroid m/z. | ||
| void updateIterativeWeightedMeanMZ(const double &, const double &, double &, double &, double &); | ||
| void updateIterativeWeightedMeanMZ(const double added_mz, | ||
| const double added_int, | ||
| double& centroid_mz, | ||
| double& prev_counter, | ||
| double& prev_denom | ||
| ); | ||
|
|
||
| /** @name Main computation methods | ||
| */ | ||
|
|
@@ -97,27 +103,93 @@ namespace OpenMS | |
|
|
||
| /** @name Private methods and members | ||
| */ | ||
|
|
||
|
|
||
| protected: | ||
| void updateMembers_() override; | ||
|
|
||
| private: | ||
|
|
||
| struct Apex | ||
| { | ||
| Apex(double intensity, Size scan_idx, Size peak_idx); | ||
| double intensity; | ||
| Size scan_idx; | ||
| Size peak_idx; | ||
| Apex(PeakMap& map, const Size scan_idx, const Size peak_idx); | ||
| // Default constructors | ||
| Apex() = default; | ||
| Apex(const Apex& other) = default; | ||
| Apex(Apex&& other) = default; | ||
|
|
||
| // Move assignment operator | ||
| Apex& operator=(Apex&& other) | ||
| { | ||
| if (this != &other) { | ||
| map_ = other.map_; | ||
| scan_idx_ = other.scan_idx_; | ||
| peak_idx_ = other.peak_idx_; | ||
| } | ||
| return *this; | ||
| } | ||
|
|
||
| PeakMap& map_; | ||
| Size scan_idx_; | ||
| Size peak_idx_; | ||
|
|
||
| ///get's the corresponding values | ||
| double getMZ() const; | ||
| double getRT() const; | ||
| double getIntensity() const; | ||
| }; | ||
|
|
||
| struct NextIndex | ||
| { | ||
| /// C'tor: init with number of threads in parallel region | ||
| NextIndex(const std::vector<Apex>& data, const Size total_peak_count, const std::vector<Size>& spec_offsets, const double mass_error_ppm); | ||
|
|
||
| /// Get the next free apex index which is not in the neighbourhood of a currently processing apex (in another thread) | ||
| /// (Internally adds the apex's m/z to a blacklist which prevents other threads from obtaining an apex nearby) | ||
| /// This function blocks until the next free apex is not conflicting anymore - i.e. another thread called setApexAsProcessed() | ||
| Size getNextFreeIndex(); | ||
|
|
||
| /// If an apex was processed call this function to remove the apex from the blacklist and increase the current_apex_ | ||
| /// ... doesn't create a feature | ||
| void setApexAsProcessed(); | ||
| /// ... does create a feature | ||
| void setApexAsProcessed(const std::vector<std::pair<Size, Size> >& gathered_idx); | ||
|
|
||
| bool isConflictingApex(const Apex a) const; | ||
|
|
||
| bool isVisited(const Size scan_idx, const Size peak_idx) const; | ||
|
|
||
| void setNumberOfThreads(const Size thread_num); | ||
|
|
||
|
|
||
| /// reference for usage | ||
| const std::vector<Apex>& data_; | ||
| const std::vector<Size>& spec_offsets_; | ||
|
|
||
| /// own datastructure | ||
| std::vector<bool> peak_visited_; | ||
| Size current_Apex_; | ||
| std::vector<std::pair<RangeMZ,RangeRT>> lock_list_; | ||
| std::vector<double> lock_list_2_; | ||
| double mass_error_ppm_; | ||
| }; | ||
|
|
||
| /// internal check for FWHM meta data | ||
| bool checkFWHMMetaData_(const PeakMap& work_exp); | ||
|
|
||
| /// The internal run method | ||
| void run_(const std::vector<Apex>& chrom_apices, | ||
| void run_(std::vector<Apex>& chrom_apices, | ||
| const Size peak_count, | ||
| const PeakMap & work_exp, | ||
| const std::vector<Size>& spec_offsets, | ||
| std::vector<MassTrace> & found_masstraces, | ||
| const Size max_traces = 0); | ||
|
|
||
| // Find Offset for Peak | ||
| static double findOffset_(const double centroid_mz, const double mass_error_ppm_); | ||
| Size calc_right_border_(Size peak_index_in_apices_vec, const PeakMap& input_exp, const std::vector<Apex>& apices_vec); | ||
| Size calc_left_border_(Size peak_index_in_apices_vec, const PeakMap& input_exp, const std::vector<Apex>& apices_vec); | ||
|
|
||
| // parameter stuff | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does stuff mean? Suggestion: more precise description |
||
| double mass_error_ppm_; | ||
| double mass_error_da_; | ||
|
|
@@ -133,4 +205,4 @@ namespace OpenMS | |
|
|
||
| bool reestimate_mt_sd_; | ||
| }; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coding convention! in several function names: instead of foo_bar() do fooBar()