Conversation
| // calc_left_border_ | ||
| Size calc_left_border_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& input_exp, const std::vector<Apex>& apices_vec); | ||
|
|
||
| // parameter stuff |
There was a problem hiding this comment.
what does stuff mean?
Suggestion: more precise description
| #include <omp.h> | ||
| // #include <parallel/algorithm> | ||
| // #include <ctime> | ||
| #include <chrono> | ||
|
|
||
| #include <OpenMS/MATH/MISC/MathFunctions.h> |
|
|
||
| void MassTraceDetection::run(const PeakMap& input_exp, std::vector<MassTrace>& found_masstraces, const Size max_traces) | ||
| { | ||
|
|
| return; | ||
| } // end of MassTraceDetection::run | ||
|
|
||
| double MassTraceDetection::find_offset_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& input_exp, const std::vector<Apex>& apices_vec) |
There was a problem hiding this comment.
| double MassTraceDetection::find_offset_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& input_exp, const std::vector<Apex>& apices_vec) | |
| double MassTraceDetection::find_offset_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& intput_map, const std::vector<Apex>& apices_vec) |
input_exp may not be concise name.
| { | ||
| double centroid_mz = input_exp[apices_vec[peak_index_in_apices_vec].scan_idx][apices_vec[peak_index_in_apices_vec].peak_idx].getMZ(); //create function | ||
| // double ftl_sd((centroid_mz / 1e6) * mass_error_ppm_); | ||
| double ftl_sd = Math::ppmToMass(mass_error_ppm_,centroid_mz); // mit formel ergänzen header ppm to dalton |
There was a problem hiding this comment.
what is the name "ftl_sd" supposed to mean?
more precise naming
There was a problem hiding this comment.
coding convention! in several function names: instead of foo_bar() do fooBar()
double find_offset_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& input_exp, const std::vector& apices_vec);
| Size j{}; | ||
| while (input_exp[apices_vec[peak_index_in_apices_vec + j].scan_idx][apices_vec[peak_index_in_apices_vec + j].peak_idx].getMZ() <= right_bound) | ||
| { | ||
| if(peak_index_in_apices_vec + j >= apices_vec.size()) break; |
There was a problem hiding this comment.
| if(peak_index_in_apices_vec + j >= apices_vec.size()) break; | |
| if(peak_index_in_apices_vec + j >= apices_vec.size()) | |
| { | |
| break; | |
| } |
|
|
||
| Size MassTraceDetection::calc_right_border_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& input_exp, const std::vector<Apex>& apices_vec) | ||
| { | ||
| double right_bound = (input_exp[apices_vec[peak_index_in_apices_vec].scan_idx][apices_vec[peak_index_in_apices_vec].peak_idx].getMZ()) + (3 /* border gerade 3 mal so groß wie "noetig" */ * find_offset_(peak_index_in_apices_vec, mass_error_ppm_, input_exp, apices_vec)); |
There was a problem hiding this comment.
| double right_bound = (input_exp[apices_vec[peak_index_in_apices_vec].scan_idx][apices_vec[peak_index_in_apices_vec].peak_idx].getMZ()) + (3 /* border gerade 3 mal so groß wie "noetig" */ * find_offset_(peak_index_in_apices_vec, mass_error_ppm_, input_exp, apices_vec)); | |
| double tmp_mz = input_exp[apices_vec[peak_index_in_apices_vec].scan_idx][apices_vec[peak_index_in_apices_vec].peak_idx].getMZ(); | |
| double right_bound = tmp_mz + 3 * find_offset_(peak_index_in_apices_vec, mass_error_ppm_, input_exp, apices_vec); //border gerade 3 mal so groß wie "noetig" |
| return peak_index_in_apices_vec + j; | ||
| } | ||
|
|
||
| Size MassTraceDetection::calc_left_border_(Size peak_index_in_apices_vec, double mass_error_ppm_, const PeakMap& input_exp, const std::vector<Apex>& apices_vec) |
| for (auto m_it = chrom_apices.crbegin(); m_it != chrom_apices.crend(); ++m_it) | ||
|
|
||
| // Size binnumber{1}; | ||
| Size binnumber = omp_get_max_threads(); |
There was a problem hiding this comment.
| Size binnumber = omp_get_max_threads(); | |
| Size bin_number = omp_get_max_threads(); |
| double prev_counter(apex_peak.getIntensity() * apex_peak.getMZ()); | ||
| double prev_denom(apex_peak.getIntensity()); | ||
| #pragma omp parallel for num_threads(binnumber) | ||
| for (Size i = 0; i < binnumber; ++i) |
There was a problem hiding this comment.
| for (Size i = 0; i < binnumber; ++i) | |
| for(Size i = 0; i < binnumber; ++i) |
| { | ||
| return a.intensity > b.intensity; | ||
| }); | ||
| for (auto m_it = chrom_apices_2.cbegin(); m_it != chrom_apices_2.cend(); ++m_it) // iterate reverse from high intensity to low intensity |
There was a problem hiding this comment.
| for (auto m_it = chrom_apices_2.cbegin(); m_it != chrom_apices_2.cend(); ++m_it) // iterate reverse from high intensity to low intensity | |
| for(auto m_it = chrom_apices_2.cbegin(); m_it != chrom_apices_2.cend(); ++m_it) // iterate reverse from high intensity to low intensity |
| std::sort(chrom_apices_2.begin(), chrom_apices_2.end(), // sort by intensity | ||
| [](const Apex & a, const Apex & b) -> bool | ||
| { | ||
| return a.intensity > b.intensity; | ||
| }); |
There was a problem hiding this comment.
| std::sort(chrom_apices_2.begin(), chrom_apices_2.end(), // sort by intensity | |
| [](const Apex & a, const Apex & b) -> bool | |
| { | |
| return a.intensity > b.intensity; | |
| }); | |
| std::sort(chrom_apices_2.begin(), chrom_apices_2.end(), // sort by intensity | |
| [](const Apex & a, const Apex & b) -> bool | |
| { | |
| return a.intensity > b.intensity; | |
| }); |
| // Step 2.1 MOVE DOWN in RT dim | ||
| // *********************************************************** // | ||
| if ((trace_down_idx > 0) && toggle_down) | ||
| std::list<PeakType> current_trace; |
| std::list<PeakType> current_trace; | ||
| double startint = work_exp[apex_scan_idx][apex_peak_idx].getIntensity(); | ||
| current_trace.push_back(apex_peak); | ||
| std::vector<double> fwhms_mz; // peak-FWHM meta values of collected peaks |
| double prev_counter(apex_peak.getIntensity() * apex_peak.getMZ()); | ||
| double prev_denom(apex_peak.getIntensity()); | ||
|
|
||
| updateIterativeWeightedMeanMZ(apex_peak.getMZ(), apex_peak.getIntensity(), centroid_mz, prev_counter, prev_denom); |
There was a problem hiding this comment.
| updateIterativeWeightedMeanMZ(apex_peak.getMZ(), apex_peak.getIntensity(), centroid_mz, prev_counter, prev_denom); | |
| updateIterativeWeightedMeanMZ(centroid_mz, prev_denom, centroid_mz, prev_counter, prev_denom); |
| while (((trace_down_idx > 0) && toggle_down) || | ||
| ((trace_up_idx < work_exp.size() - 1) && toggle_up) | ||
| ) |
There was a problem hiding this comment.
| while (((trace_down_idx > 0) && toggle_down) || | |
| ((trace_up_idx < work_exp.size() - 1) && toggle_up) | |
| ) | |
| while (trace_down_idx > 0 && toggle_down || trace_up_idx < work_exp.size() - 1 && toggle_up) |
| // *********************************************************** // | ||
| // Step 2.1 MOVE DOWN in RT dim | ||
| // *********************************************************** // | ||
| if ((trace_down_idx > 0) && toggle_down) |
There was a problem hiding this comment.
| if ((trace_down_idx > 0) && toggle_down) | |
| if (trace_down_idx > 0 && toggle_down) |
| if ((next_down_peak_mz <= right_bound) && | ||
| (next_down_peak_mz >= left_bound) && | ||
| !peak_visited_1[spec_offsets[trace_down_idx - 1] + next_down_peak_idx] | ||
| ) |
There was a problem hiding this comment.
| if ((next_down_peak_mz <= right_bound) && | |
| (next_down_peak_mz >= left_bound) && | |
| !peak_visited_1[spec_offsets[trace_down_idx - 1] + next_down_peak_idx] | |
| ) | |
| if (next_down_peak_mz <= right_bound && | |
| next_down_peak_mz >= left_bound && | |
| !peak_visited_1[spec_offsets[trace_down_idx - 1] + next_down_peak_idx]) |
| // Update the m/z mean of the current trace as we added a new peak | ||
| updateIterativeWeightedMeanMZ(next_down_peak_mz, next_down_peak_int, centroid_mz, prev_counter, prev_denom); | ||
| gathered_idx.emplace_back(trace_down_idx - 1, next_down_peak_idx); | ||
| if(next_down_peak_int > startint) |
| // *********************************************************** // | ||
| // Step 2.2 MOVE UP in RT dim | ||
| // *********************************************************** // | ||
| if ((trace_up_idx < work_exp.size() - 1) && toggle_up) |
There was a problem hiding this comment.
| if ((trace_up_idx < work_exp.size() - 1) && toggle_up) | |
| if (trace_up_idx < work_exp.size() - 1 && toggle_up) |
| if ((next_up_peak_mz <= right_bound) && | ||
| (next_up_peak_mz >= left_bound) && | ||
| !peak_visited_1[spec_offsets[trace_up_idx + 1] + next_up_peak_idx]) |
There was a problem hiding this comment.
| if ((next_up_peak_mz <= right_bound) && | |
| (next_up_peak_mz >= left_bound) && | |
| !peak_visited_1[spec_offsets[trace_up_idx + 1] + next_up_peak_idx]) | |
| if (next_up_peak_mz <= right_bound && | |
| next_up_peak_mz >= left_bound && | |
| !peak_visited_1[spec_offsets[trace_up_idx + 1] + next_up_peak_idx]) |
| // Update the m/z variance dynamically | ||
| if (reestimate_mt_sd_) // && (up_hitting_peak+1 > min_flank_scans)) | ||
| { | ||
| // if (ftl_t > min_fwhm_scans) | ||
| { | ||
| updateWeightedSDEstimateRobust(next_peak, centroid_mz, ftl_sd, intensity_so_far); | ||
| } | ||
| } |
There was a problem hiding this comment.
| // Update the m/z variance dynamically | |
| if (reestimate_mt_sd_) // && (up_hitting_peak+1 > min_flank_scans)) | |
| { | |
| // if (ftl_t > min_fwhm_scans) | |
| { | |
| updateWeightedSDEstimateRobust(next_peak, centroid_mz, ftl_sd, intensity_so_far); | |
| } | |
| } | |
| // Update the m/z variance dynamically | |
| if (reestimate_mt_sd_)// && (up_hitting_peak+1 > min_flank_scans)) | |
| { | |
| updateWeightedSDEstimateRobust(next_peak, centroid_mz, ftl_sd, intensity_so_far); | |
| } |
maxvk79
left a comment
There was a problem hiding this comment.
Mainly checked for syntax and coding convention
Description
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI builds