48 #include <boost/math/special_functions/bessel.hpp>
57 #pragma clang diagnostic push
58 #pragma clang diagnostic ignored "-Wfloat-equal"
59 #pragma clang diagnostic ignored "-Wconversion"
60 #pragma clang diagnostic ignored "-Wshorten-64-to-32"
68 template <
typename PeakType>
88 typedef std::multimap<UInt, BoxElement>
Box;
154 (*trans_intens_)[i] = intens;
177 inline typename MSSpectrum::const_iterator
MZBegin(
const double mz)
const
184 inline typename MSSpectrum::const_iterator
MZEnd(
const double mz)
const
191 inline typename MSSpectrum::const_iterator
end()
const
198 inline typename MSSpectrum::const_iterator
begin()
const
255 const double ampl_cutoff,
const bool check_PPMs);
266 const UInt RT_votes_cutoff,
const Int front_bound = -1,
const Int end_bound = -1);
284 inline double getLinearInterpolation(
const typename MSSpectrum::const_iterator& left_iter,
const double mz_pos,
const typename MSSpectrum::const_iterator& right_iter)
286 return left_iter->getIntensity() + (right_iter->getIntensity() - left_iter->getIntensity()) / (right_iter->getMZ() - left_iter->getMZ()) * (mz_pos - left_iter->getMZ());
295 inline double getLinearInterpolation(
const double mz_a,
const double intens_a,
const double mz_pos,
const double mz_b,
const double intens_b)
297 return intens_a + (intens_b - intens_a) / (mz_b - mz_a) * (mz_pos - mz_a);
340 const double seed_mz,
const UInt c,
const double ampl_cutoff);
349 const double seed_mz,
const UInt c,
const double ampl_cutoff);
360 const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score);
370 const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score);
396 const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end,
const double ref_intens);
414 const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end);
429 const UInt scan_index,
const UInt c,
const bool check_PPMs);
436 const UInt scan_index,
const UInt c,
const bool check_PPMs);
450 double old_frac_mass = c_mass - (
Int)(c_mass);
452 double new_frac_mass = new_mass - (
Int)(new_mass);
454 if (new_frac_mass - old_frac_mass > 0.5)
459 if (new_frac_mass - old_frac_mass < -0.5)
470 inline double getPPMs_(
const double mass_a,
const double mass_b)
const
472 return fabs(mass_a - mass_b) / (0.5 * (mass_a + mass_b)) * 1e6;
494 template <
typename PeakType>
500 template <
typename PeakType>
506 template <
typename PeakType>
512 template <
typename PeakType>
518 template <
typename PeakType>
521 tmp_boxes_ =
new std::vector<std::multimap<double, Box> >(1);
525 max_num_peaks_per_pattern_ = 3;
530 template <
typename PeakType>
533 max_charge_ = max_charge;
534 max_scan_size_ = max_scan_size;
536 intenstype_ = intenstype;
537 tmp_boxes_ =
new std::vector<std::multimap<double, Box> >(max_charge);
538 if (max_scan_size <= 0)
547 Int size_estimate((
Int)ceil(max_scan_size_ / (max_mz - min_mz)));
549 psi_.reserve(to_reserve);
550 prod_.reserve(to_reserve);
551 xs_.reserve(to_reserve);
556 template <
typename PeakType>
562 template <
typename PeakType>
565 Int spec_size((
Int)c_ref.size());
569 double value, T_boundary_left, T_boundary_right, old, c_diff, current, old_pos, my_local_MZ, my_local_lambda, origin, c_mz;
571 for (
Int my_local_pos = 0; my_local_pos < spec_size; ++my_local_pos)
574 old = 0; old_pos = (my_local_pos - from_max_to_left_ - 1 >= 0) ? c_ref[my_local_pos - from_max_to_left_ - 1].getMZ() : c_ref[0].getMZ() - min_spacing_;
579 for (
Int current_conv_pos = std::max(0, my_local_pos - from_max_to_left_); c_diff < T_boundary_right; ++current_conv_pos)
581 if (current_conv_pos >= spec_size)
583 value += 0.5 * old * min_spacing_;
587 c_mz = c_ref[current_conv_pos].getMZ();
588 c_diff = c_mz + origin;
591 current = c_diff > T_boundary_left && c_diff <= T_boundary_right ?
IsotopeWavelet::getValueByLambda(my_local_lambda, c_diff * charge + 1.) * c_ref[current_conv_pos].getIntensity() : 0;
593 value += 0.5 * (current + old) * (c_mz - old_pos);
601 c_trans[my_local_pos].setIntensity(value);
605 template <
typename PeakType>
608 Int spec_size((
Int)c_ref.size());
612 double value, T_boundary_left, T_boundary_right, c_diff, current, my_local_MZ, my_local_lambda, origin, c_mz;
614 for (
Int my_local_pos = 0; my_local_pos < spec_size; ++my_local_pos)
623 for (
Int current_conv_pos = std::max(0, my_local_pos - from_max_to_left_); c_diff < T_boundary_right; ++current_conv_pos)
625 if (current_conv_pos >= spec_size)
630 c_mz = c_ref[current_conv_pos].getMZ();
631 c_diff = c_mz + origin;
634 current = c_diff > T_boundary_left && c_diff <= T_boundary_right ?
IsotopeWavelet::getValueByLambda(my_local_lambda, c_diff * charge + 1.) * c_ref[current_conv_pos].getIntensity() : 0;
639 c_trans[my_local_pos].setIntensity(value);
643 template <
typename PeakType>
646 data_length_ = (
UInt) c_ref.size();
647 computeMinSpacing(c_ref);
648 Int wavelet_length = 0, quarter_length = 0;
653 typename MSSpectrum::const_iterator start_iter, end_iter;
654 for (
UInt i = 0; i < data_length_; ++i)
657 start_iter = c_ref.
MZEnd(c_ref[i].getMZ());
658 end_iter = c_ref.
MZBegin(c_ref[i].getMZ() + c_mz_cutoff);
659 wavelet_length = std::max((
SignedSize) wavelet_length, distance(start_iter, end_iter) + 1);
661 quarter_length = std::max((
SignedSize) quarter_length, distance(end_iter, start_iter) + 1);
668 wavelet_length = (
UInt) ceil(max_mz_cutoff_ / min_spacing_);
673 if (wavelet_length > (
Int) c_ref.size())
675 std::cout <<
"Warning: the extremal length of the wavelet is larger (" << wavelet_length <<
") than the number of data points (" << c_ref.size() <<
"). This might (!) severely affect the transform." << std::endl;
676 std::cout <<
"Minimal spacing: " << min_spacing_ << std::endl;
677 std::cout <<
"Warning/Error generated at scan with RT " << c_ref.
getRT() <<
"." << std::endl;
681 from_max_to_left_ = max_index;
682 from_max_to_right_ = wavelet_length - 1 - from_max_to_left_;
685 template <
typename PeakType>
688 min_spacing_ = INT_MAX;
689 for (
UInt c_conv_pos = 1; c_conv_pos < c_ref.size(); ++c_conv_pos)
691 min_spacing_ = std::min(min_spacing_, c_ref[c_conv_pos].getMZ() - c_ref[c_conv_pos - 1].getMZ());
695 template <
typename PeakType>
697 const MSSpectrum& ref,
const UInt scan_index,
const UInt c,
const double ampl_cutoff,
const bool check_PPMs)
699 Size scan_size(candidates.size());
701 typename MSSpectrum::const_iterator iter_start, iter_end, seed_iter, iter2;
702 double mz_cutoff, seed_mz, c_av_intens = 0, c_score = 0, c_sd_intens = 0, threshold = 0, help_mz, share, share_pos, bwd, fwd;
703 UInt MZ_start, MZ_end;
706 diffed[0].setIntensity(0); diffed[scan_size - 1].setIntensity(0);
708 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
709 std::stringstream stream;
710 stream <<
"diffed_" << ref.
getRT() <<
"_" <<
c + 1 <<
".trans\0";
711 std::ofstream ofile(stream.str().c_str());
716 for (
UInt i = 0; i < scan_size - 2; ++i)
718 share = candidates[i + 1].getIntensity(); share_pos = candidates[i + 1].getMZ();
719 bwd = (share - candidates[i].getIntensity()) / (share_pos - candidates[i].getMZ());
720 fwd = (candidates[i + 2].getIntensity() - share) / (candidates[i + 2].getMZ() - share_pos);
722 if (!(bwd >= 0 && fwd <= 0) || share > ref[i + 1].getIntensity())
724 diffed[i + 1].setIntensity(0);
727 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
728 ofile << diffed[i + 1].getMZ() <<
"\t" << diffed[i + 1].getIntensity() << std::endl;
734 for (
UInt i = 0; i < scan_size - 2; ++i)
736 share = candidates[i + 1].getIntensity(); share_pos = candidates[i + 1].getMZ();
737 bwd = (share - candidates[i].getIntensity()) / (share_pos - candidates[i].getMZ());
738 fwd = (candidates[i + 2].getIntensity() - share) / (candidates[i + 2].getMZ() - share_pos);
740 if (!(bwd >= 0 && fwd <= 0))
742 diffed[i + 1].setIntensity(0);
745 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
746 ofile << diffed[i + 1].getMZ() <<
"\t" << diffed[i + 1].getIntensity() << std::endl;
750 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
759 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
760 std::stringstream stream2;
761 stream2 <<
"sorted_cpu_" << candidates.
getRT() <<
"_" <<
c + 1 <<
".trans\0";
762 std::ofstream ofile2(stream2.str().c_str());
763 for (iter = c_sorted_candidate.
end() - 1; iter != c_sorted_candidate.
begin(); --iter)
765 ofile2 << iter->getMZ() <<
"\t" << iter->getIntensity() << std::endl;
770 std::vector<UInt> processed(scan_size, 0);
778 c_av_intens = getAvIntens_(candidates);
779 c_sd_intens = getSdIntens_(candidates, c_av_intens);
780 threshold = ampl_cutoff * c_sd_intens + c_av_intens;
783 for (iter = c_sorted_candidate.
end() - 1; iter != c_sorted_candidate.
begin(); --iter)
785 if (iter->getIntensity() <= 0)
790 seed_mz = iter->getMZ();
791 seed_iter = ref.
MZBegin(seed_mz);
793 if (seed_iter == ref.end() || processed[distance(ref.begin(), seed_iter)])
804 iter_end = ref.
MZEnd(seed_iter, seed_mz + mz_cutoff / (
c + 1.), ref.end());
805 if (iter_end == ref.end())
810 MZ_start = distance(ref.begin(), iter_start);
811 MZ_end = distance(ref.begin(), iter_end);
813 memset(&(processed[MZ_start]), 1,
sizeof(
UInt) * (MZ_end - MZ_start + 1));
817 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
818 if (trunc(seed_mz) == 874)
819 std::cout << seed_mz <<
"\t" << c_score << std::endl;
822 if (c_score <= 0 && c_score != -1000)
829 push2TmpBox_(seed_mz, scan_index,
c, c_score, iter->getIntensity(), ref.
getRT(), MZ_start, MZ_end);
832 iter2 = candidates.
MZBegin(help_mz);
833 if (iter2 == candidates.end() || iter2 == candidates.begin())
841 if (iter2 != candidates.end())
843 push2TmpBox_(iter2->getMZ(), scan_index,
c, 0, getLinearInterpolation(iter2 - 1, help_mz, iter2), ref.
getRT(), MZ_start, MZ_end);
848 iter2 = candidates.
MZBegin(help_mz);
849 if (iter2 == candidates.end() || iter2 == candidates.begin())
857 if (iter2 != candidates.end())
859 push2TmpBox_(iter2->getMZ(), scan_index,
c, 0, getLinearInterpolation(iter2 - 1, help_mz, iter2), ref.
getRT(), MZ_start, MZ_end);
864 clusterSeeds_(candidates, ref, scan_index,
c, check_PPMs);
867 template <
typename PeakType>
869 const UInt peak_cutoff,
const double seed_mz,
const UInt c,
const double ampl_cutoff)
871 double c_score = 0, c_val;
872 typename MSSpectrum::const_iterator c_left_iter2, c_right_iter2;
873 Int signal_size((
Int)candidate.size());
878 Int p_h_ind = 1, end = 4 * (peak_cutoff - 1) - 1;
880 std::vector<double> positions(end);
881 for (
Int i = 0; i < end; ++i)
886 double l_score = 0, mid_val = 0;
887 Int start_index = distance(candidate.begin(), candidate.
MZBegin(positions[0])) - 1;
888 for (
Int v = 1; v <= end; ++v, ++p_h_ind)
892 if (start_index < signal_size - 1)
897 while (candidate[start_index].getMZ() < positions[v - 1]);
899 if (start_index <= 0 || start_index >= signal_size - 1)
904 c_left_iter2 = candidate.begin() + start_index - 1;
905 c_right_iter2 = c_left_iter2 + 1;
907 c_val = c_left_iter2->getIntensity() + (c_right_iter2->getIntensity() - c_left_iter2->getIntensity()) / (c_right_iter2->getMZ() - c_left_iter2->getMZ()) * (positions[v - 1] - c_left_iter2->getMZ());
909 if (v == (
int)(ceil(end / 2.)))
915 if (p_h_ind % 2 == 1)
918 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
919 if (trunc(seed_mz) == 874)
920 std::cout << -c_val << std::endl;
926 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
927 if (trunc(seed_mz) == 874)
928 std::cout << c_val << std::endl;
933 start_index = distance(candidate.begin(), c_left_iter2);
936 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
937 std::ofstream ofile_score(
"scores.dat", ios::app);
938 std::ofstream ofile_check_score(
"check_scores.dat", ios::app);
940 ofile_check_score.close();
943 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
944 if (trunc(seed_mz) == 874)
945 std::cout <<
"final_score: " << seed_mz <<
"\t" << c_score <<
"\t l_score: " << l_score <<
"\t" << c_score - l_score - mid_val <<
"\t" << c_score - mid_val <<
"\t" << ampl_cutoff << std::endl;
948 if (c_score - mid_val <= 0)
953 if (c_score - mid_val <= ampl_cutoff)
958 if (l_score <= 0 || c_score - l_score - mid_val <= 0)
966 template <
typename PeakType>
968 const UInt peak_cutoff,
const double seed_mz,
const UInt c,
const double ampl_cutoff)
970 double c_score = 0, c_val;
971 typename MSSpectrum::const_iterator c_left_iter2, c_right_iter2;
975 Int p_h_ind = 1, end = 4 * (peak_cutoff - 1) - 1;
977 std::vector<double> positions(end);
978 for (
Int i = 0; i < end; ++i)
983 double l_score = 0, mid_val = 0;
984 Int start_index = distance(candidate.
begin(), candidate.
MZBegin(positions[0])) - 1;
985 for (
Int v = 1; v <= end; ++v, ++p_h_ind)
989 if (start_index < signal_size - 1)
994 while (candidate.
getMZ(start_index) < positions[v - 1]);
996 if (start_index <= 0 || start_index >= signal_size - 1)
1001 c_left_iter2 = candidate.
begin() + start_index - 1;
1002 c_right_iter2 = c_left_iter2 + 1;
1005 if (v == (
int)(ceil(end / 2.)))
1011 if (p_h_ind % 2 == 1)
1020 start_index = distance(candidate.
begin(), c_left_iter2);
1023 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1024 std::ofstream ofile_score(
"scores.dat", ios::app);
1025 std::ofstream ofile_check_score(
"check_scores.dat", ios::app);
1026 ofile_score << c_check_point <<
"\t" << c_score << std::endl;
1027 ofile_score.close();
1028 ofile_check_score.close();
1031 if (l_score <= 0 || c_score - l_score - mid_val <= 0 || c_score - mid_val <= ampl_cutoff)
1039 template <
typename PeakType>
1043 typename std::multimap<double, Box>::iterator iter;
1044 typename Box::iterator box_iter;
1045 std::vector<BoxElement> final_box;
1046 double c_mz, av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1047 double virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1049 for (iter = tmp_boxes_->at(
c).begin(); iter != tmp_boxes_->at(
c).end(); ++iter)
1052 Box& c_box = iter->second;
1053 av_score = 0; av_mz = 0; av_intens = 0; av_abs_intens = 0; count = 0;
1054 virtual_av_mz = 0; virtual_av_intens = 0; virtual_av_abs_intens = 0; virtual_count = 0;
1057 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1059 if (box_iter->second.score == 0)
1064 c_mz = box_iter->second.mz;
1065 virtual_av_intens += box_iter->second.intens;
1066 virtual_av_abs_intens += fabs(box_iter->second.intens);
1067 virtual_av_mz += c_mz * fabs(box_iter->second.intens);
1072 c_mz = box_iter->second.mz;
1073 av_score += box_iter->second.score;
1074 av_intens += box_iter->second.intens;
1075 av_abs_intens += fabs(box_iter->second.intens);
1076 av_mz += c_mz * fabs(box_iter->second.intens);
1083 av_intens = virtual_av_intens / virtual_count;
1085 av_mz = virtual_av_mz / virtual_av_abs_intens;
1091 av_mz /= av_abs_intens;
1095 c_box_element.
mz = av_mz;
1096 c_box_element.
c =
c;
1097 c_box_element.
score = av_score;
1098 c_box_element.
intens = av_intens;
1100 c_box_element.
RT = c_box.begin()->second.RT;
1101 final_box.push_back(c_box_element);
1104 Size num_o_feature = final_box.size();
1105 if (num_o_feature == 0)
1107 tmp_boxes_->at(
c).clear();
1112 std::vector<double> bwd_diffs(num_o_feature, 0);
1115 for (
Size i = 1; i < num_o_feature; ++i)
1117 bwd_diffs[i] = (final_box[i].intens - final_box[i - 1].intens) / (final_box[i].mz - final_box[i - 1].mz);
1120 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1121 std::ofstream ofile_bwd(
"bwd_cpu.dat");
1122 for (
Size i = 0; i < num_o_feature; ++i)
1124 ofile_bwd << final_box[i].mz <<
"\t" << bwd_diffs[i] << std::endl;
1130 for (
Size i = 0; i < num_o_feature - 1; ++i)
1132 while (i < num_o_feature - 2)
1134 if (final_box[i].score > 0 || final_box[i].score == -1000)
1139 if (bwd_diffs[i] > 0 && bwd_diffs[i + 1] < 0)
1141 checkPositionForPlausibility_(candidate, ref, final_box[i].mz, final_box[i].
c, scan_index, check_PPMs, final_box[i].intens, final_box[i].score);
1146 tmp_boxes_->at(
c).clear();
1149 template <
typename PeakType>
1152 double av_intens = 0;
1153 for (
UInt i = 0; i < scan.size(); ++i)
1155 if (scan[i].getIntensity() >= 0)
1157 av_intens += scan[i].getIntensity();
1160 return av_intens / (double)scan.size();
1163 template <
typename PeakType>
1166 double res = 0, intens;
1167 for (
UInt i = 0; i < scan.size(); ++i)
1169 if (scan[i].getIntensity() >= 0)
1171 intens = scan[i].getIntensity();
1172 res += (intens -
mean) * (intens -
mean);
1175 return sqrt(res / (
double)(scan.size() - 1));
1178 template <
typename PeakType>
1181 std::vector<double> diffs(scan.size() - 1, 0);
1182 for (
UInt i = 0; i < scan.size() - 1; ++i)
1184 diffs[i] = scan[i + 1].getMZ() - scan[i].getMZ();
1187 sort(diffs.begin(), diffs.end());
1188 double av_MZ_spacing = 0;
1189 for (
UInt i = 0; i < diffs.size() / 2; ++i)
1191 av_MZ_spacing += diffs[i];
1194 return av_MZ_spacing / (diffs.size() / 2);
1197 template <
typename PeakType>
1200 double av_intens = 0;
1201 for (
UInt i = 0; i < scan.
size(); ++i)
1208 return av_intens / (double)scan.
size();
1211 template <
typename PeakType>
1214 double res = 0, intens;
1215 for (
UInt i = 0; i < scan.
size(); ++i)
1220 res += (intens -
mean) * (intens -
mean);
1223 return sqrt(res / (
double)(scan.
size() - 1));
1226 template <
typename PeakType>
1228 const double score,
const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end,
double ref_intens)
1232 typename std::multimap<double, Box>::iterator upper_iter(open_boxes_.upper_bound(mz));
1233 typename std::multimap<double, Box>::iterator lower_iter(open_boxes_.lower_bound(mz));
1235 if (lower_iter != open_boxes_.end())
1238 if (mz != lower_iter->first && lower_iter != open_boxes_.begin())
1244 typename std::multimap<double, Box>::iterator insert_iter;
1245 bool create_new_box =
true;
1246 if (lower_iter == open_boxes_.end())
1251 if (!open_boxes_.empty())
1253 if (fabs((--lower_iter)->first - mz) < dist_constraint)
1255 create_new_box =
false;
1256 insert_iter = lower_iter;
1261 create_new_box =
true;
1266 if (upper_iter == open_boxes_.end() && fabs(lower_iter->first - mz) < dist_constraint)
1268 insert_iter = lower_iter;
1269 create_new_box =
false;
1273 create_new_box =
true;
1278 if (upper_iter != open_boxes_.end() && lower_iter != open_boxes_.end())
1283 double dist_lower = fabs(lower_iter->first - mz);
1284 double dist_upper = fabs(upper_iter->first - mz);
1285 dist_lower = (dist_lower < dist_constraint) ? dist_lower : INT_MAX;
1286 dist_upper = (dist_upper < dist_constraint) ? dist_upper : INT_MAX;
1288 if (dist_lower >= dist_constraint && dist_upper >= dist_constraint)
1290 create_new_box =
true;
1294 insert_iter = (dist_lower < dist_upper) ? lower_iter : upper_iter;
1295 create_new_box =
false;
1304 if (create_new_box ==
false)
1306 std::pair<UInt, BoxElement> help2(scan, element);
1307 insert_iter->second.insert(help2);
1310 Box replacement(insert_iter->second);
1314 double c_mz = insert_iter->first * (insert_iter->second.size() - 1) + mz;
1315 c_mz /= ((double) insert_iter->second.size());
1318 open_boxes_.erase(insert_iter);
1319 std::pair<double, std::multimap<UInt, BoxElement> > help3(c_mz, replacement);
1320 open_boxes_.insert(help3);
1324 std::pair<UInt, BoxElement> help2(scan, element);
1325 std::multimap<UInt, BoxElement> help3;
1326 help3.insert(help2);
1327 std::pair<double, std::multimap<UInt, BoxElement> > help4(mz, help3);
1328 open_boxes_.insert(help4);
1332 template <
typename PeakType>
1334 const double score,
const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end)
1338 std::multimap<double, Box>& tmp_box(tmp_boxes_->at(
c));
1339 typename std::multimap<double, Box>::iterator upper_iter(tmp_box.upper_bound(mz));
1340 typename std::multimap<double, Box>::iterator lower_iter(tmp_box.lower_bound(mz));
1342 if (lower_iter != tmp_box.end())
1345 if (mz != lower_iter->first && lower_iter != tmp_box.begin())
1351 typename std::multimap<double, Box>::iterator insert_iter;
1352 bool create_new_box =
true;
1353 if (lower_iter == tmp_box.end())
1358 if (!tmp_box.empty())
1360 if (fabs((--lower_iter)->first - mz) < dist_constraint)
1362 create_new_box =
false;
1363 insert_iter = lower_iter;
1368 create_new_box =
true;
1373 if (upper_iter == tmp_box.end() && fabs(lower_iter->first - mz) < dist_constraint)
1375 insert_iter = lower_iter;
1376 create_new_box =
false;
1380 create_new_box =
true;
1385 if (upper_iter != tmp_box.end() && lower_iter != tmp_box.end())
1388 double dist_lower = fabs(lower_iter->first - mz);
1389 double dist_upper = fabs(upper_iter->first - mz);
1390 dist_lower = (dist_lower < dist_constraint) ? dist_lower : INT_MAX;
1391 dist_upper = (dist_upper < dist_constraint) ? dist_upper : INT_MAX;
1393 if (dist_lower >= dist_constraint && dist_upper >= dist_constraint)
1395 create_new_box =
true;
1399 insert_iter = (dist_lower < dist_upper) ? lower_iter : upper_iter;
1400 create_new_box =
false;
1408 if (create_new_box ==
false)
1410 std::pair<UInt, BoxElement> help2(scan, element);
1411 insert_iter->second.insert(help2);
1414 Box replacement(insert_iter->second);
1418 double c_mz = insert_iter->first * (insert_iter->second.size() - 1) + mz;
1419 c_mz /= ((double) insert_iter->second.size());
1422 tmp_box.erase(insert_iter);
1423 std::pair<double, std::multimap<UInt, BoxElement> > help3(c_mz, replacement);
1424 tmp_box.insert(help3);
1428 std::pair<UInt, BoxElement> help2(scan, element);
1429 std::multimap<UInt, BoxElement> help3;
1430 help3.insert(help2);
1432 std::pair<double, std::multimap<UInt, BoxElement> > help4(mz, help3);
1433 tmp_box.insert(help4);
1437 template <
typename PeakType>
1439 const UInt RT_votes_cutoff,
const Int front_bound,
const Int end_bound)
1441 typename std::multimap<double, Box>::iterator iter, iter2;
1443 if ((
Int)scan_index == end_bound && end_bound != (
Int)map.
size() - 1)
1445 for (iter = open_boxes_.begin(); iter != open_boxes_.end(); ++iter)
1447 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1448 std::cout <<
"LOW THREAD insert in end_box " << iter->first << std::endl;
1449 typename Box::iterator dings;
1450 for (dings = iter->second.begin(); dings != iter->second.end(); ++dings)
1451 std::cout << map[dings->first].getRT() <<
"\t" << dings->second.c + 1 << std::endl;
1453 end_boxes_.insert(*iter);
1455 open_boxes_.
clear();
1459 for (iter = open_boxes_.begin(); iter != open_boxes_.end(); )
1461 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1462 if (front_bound > 0)
1464 std::cout <<
"HIGH THREAD open box. " << iter->first <<
"\t current scan index " << scan_index <<
"\t" << ((iter->second.begin()))->first <<
"\t of last scan " << map.
size() - 1 <<
"\t" << front_bound << std::endl;
1469 UInt lastScan = (--(iter->second.end()))->first;
1470 if (scan_index - lastScan > RT_interleave + 1 || scan_index == map.
size() - 1)
1472 if (iter->second.begin()->first - front_bound <= RT_interleave + 1 && front_bound > 0)
1476 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1477 std::cout <<
"HIGH THREAD insert in front_box " << iter->first << std::endl;
1479 front_boxes_.insert(*iter);
1480 open_boxes_.erase(iter);
1490 if (iter->second.size() >= RT_votes_cutoff)
1494 closed_boxes_.insert(*(--iter));
1496 open_boxes_.erase(iter);
1506 template <
typename PeakType>
1509 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1510 std::cout <<
"**** CHECKING FOR BOX EXTENSIONS ****" << std::endl;
1514 typename Box::const_iterator iter;
1515 std::vector<double> elution_profile(box.size());
1517 for (iter = box.begin(); iter != box.end(); ++iter, ++index)
1519 for (
Size i = iter->second.MZ_begin; i != iter->second.MZ_end; ++i)
1521 elution_profile[index] += map[iter->second.RT_index][i].getIntensity();
1523 elution_profile[index] /= iter->second.MZ_end - iter->second.MZ_begin + 1.;
1527 Int max_index = INT_MIN;
1528 for (
Size i = 0; i < elution_profile.size(); ++i)
1530 if (elution_profile[i] > max)
1533 max = elution_profile[i];
1537 Int max_extension = (
Int)(elution_profile.size()) - 2 * max_index;
1539 double av_elution = 0;
1540 for (
Size i = 0; i < elution_profile.size(); ++i)
1542 av_elution += elution_profile[i];
1544 av_elution /= (double)elution_profile.
size();
1546 double sd_elution = 0;
1547 for (
Size i = 0; i < elution_profile.size(); ++i)
1549 sd_elution += (av_elution - elution_profile[i]) * (av_elution - elution_profile[i]);
1551 sd_elution /= (double)(elution_profile.size() - 1);
1552 sd_elution = sqrt(sd_elution);
1556 for (iter = box.begin(); iter != box.end(); ++iter, ++index)
1558 av_mz += iter->second.mz;
1559 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1560 std::cout << iter->second.RT <<
"\t" << iter->second.mz <<
"\t" << iter->second.c + 1 << std::endl;
1563 av_mz /= (double)box.size();
1567 if ((
Int)(box.begin()->second.RT_index) - 1 < 0)
1572 UInt pre_index = box.begin()->second.RT_index - 1;
1573 typename MSSpectrum::const_iterator c_iter = map[pre_index].MZBegin(av_mz);
1574 double pre_elution = 0;
1576 double mz_start = map[pre_index + 1][box.begin()->second.MZ_begin].getMZ();
1577 double mz_end = map[pre_index + 1][box.begin()->second.MZ_end].getMZ();
1579 typename MSSpectrum::const_iterator mz_start_iter = map[pre_index].MZBegin(mz_start), mz_end_iter = map[pre_index].MZBegin(mz_end);
1580 for (
typename MSSpectrum::const_iterator mz_iter = mz_start_iter; mz_iter != mz_end_iter; ++mz_iter)
1582 pre_elution += mz_iter->getIntensity();
1587 if (pre_elution <= av_elution - 2 * sd_elution)
1592 Int c_index = max_extension;
1593 Int first_index = box.
begin()->second.RT_index;
1594 for (
Int i = 1; i < max_extension; ++i)
1596 c_index = first_index - i;
1603 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1604 std::cout << box.begin()->second.RT <<
"\t" << av_mz <<
"\t" << box.begin()->second.c + 1 <<
"\t" <<
" extending the box " << std::endl;
1607 push2Box_(av_mz, c_index, box.begin()->second.c, box.begin()->second.score, c_iter->getIntensity(),
1608 map[c_index].getRT(), box.
begin()->second.MZ_begin, box.begin()->second.MZ_end);
1612 template <
typename PeakType>
1616 typename std::multimap<double, Box>::iterator iter;
1617 typename Box::iterator box_iter;
1618 std::vector<BoxElement> final_box;
1619 double c_mz, av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1620 double virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1622 for (iter = tmp_boxes_->at(
c).begin(); iter != tmp_boxes_->at(
c).end(); ++iter)
1624 Box& c_box = iter->second;
1625 av_score = 0; av_mz = 0; av_intens = 0; av_abs_intens = 0; count = 0;
1626 virtual_av_mz = 0; virtual_av_intens = 0; virtual_av_abs_intens = 0; virtual_count = 0;
1628 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1630 if (box_iter->second.score == 0)
1635 c_mz = box_iter->second.mz;
1636 virtual_av_intens += box_iter->second.intens;
1637 virtual_av_abs_intens += fabs(box_iter->second.intens);
1638 virtual_av_mz += c_mz * fabs(box_iter->second.intens);
1643 c_mz = box_iter->second.mz;
1644 av_score += box_iter->second.score;
1645 av_intens += box_iter->second.intens;
1646 av_abs_intens += fabs(box_iter->second.intens);
1647 av_mz += c_mz * fabs(box_iter->second.intens);
1654 av_intens = virtual_av_intens / virtual_count;
1656 av_mz = virtual_av_mz / virtual_av_abs_intens;
1662 av_mz /= av_abs_intens;
1666 c_box_element.
mz = av_mz;
1667 c_box_element.
c =
c;
1668 c_box_element.
score = av_score;
1669 c_box_element.
intens = av_intens;
1671 c_box_element.
RT = c_box.begin()->second.RT;
1673 final_box.push_back(c_box_element);
1676 UInt num_o_feature = final_box.size();
1677 if (num_o_feature == 0)
1679 tmp_boxes_->at(
c).clear();
1684 std::vector<double> bwd_diffs(num_o_feature, 0);
1687 for (
UInt i = 1; i < num_o_feature; ++i)
1689 bwd_diffs[i] = (final_box[i].intens - final_box[i - 1].intens) / (final_box[i].mz - final_box[i - 1].mz);
1692 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1693 std::ofstream ofile_bwd(
"bwd_gpu.dat");
1694 for (
UInt i = 0; i < num_o_feature; ++i)
1696 ofile_bwd << final_box[i].mz <<
"\t" << bwd_diffs[i] << std::endl;
1701 for (
UInt i = 0; i < num_o_feature - 1; ++i)
1703 while (i < num_o_feature - 2)
1705 if (final_box[i].score > 0 || final_box[i].score == -1000)
1710 if (bwd_diffs[i] > 0 && bwd_diffs[i + 1] < 0)
1712 checkPositionForPlausibility_(candidates, ref, final_box[i].mz, final_box[i].
c, scan_index, check_PPMs, final_box[i].intens, final_box[i].score);
1717 tmp_boxes_->at(
c).clear();
1720 template <
typename PeakType>
1724 typename std::multimap<double, Box>::iterator iter;
1725 typename Box::iterator box_iter;
1726 UInt best_charge_index;
double best_charge_score, c_mz, c_RT;
UInt c_charge;
1727 double av_intens = 0, av_ref_intens = 0, av_score = 0, av_mz = 0, av_RT = 0, mz_cutoff, sum_of_ref_intenses_g;
1728 bool restart =
false;
1730 for (iter = closed_boxes_.begin(); iter != closed_boxes_.end(); ++iter)
1732 sum_of_ref_intenses_g = 0;
1733 Box& c_box = iter->second;
1734 std::vector<double> charge_votes(max_charge_, 0), charge_binary_votes(max_charge_, 0);
1739 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1741 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1742 if (trunc(box_iter->second.mz) == 874)
1743 std::cout << box_iter->second.c <<
"\t" << box_iter->second.intens <<
"\t" << box_iter->second.score << std::endl;
1746 if (box_iter->second.score == -1000)
1752 charge_votes[box_iter->second.c] += box_iter->second.intens;
1753 ++charge_binary_votes[box_iter->second.c];
1762 best_charge_index = 0; best_charge_score = 0;
1763 for (
UInt i = 0; i < max_charge_; ++i)
1765 if (charge_votes[i] > best_charge_score)
1767 best_charge_index = i;
1768 best_charge_score = charge_votes[i];
1773 if (charge_binary_votes[best_charge_index] < RT_votes_cutoff && RT_votes_cutoff <= map.
size())
1778 c_charge = best_charge_index + 1;
1780 av_intens = 0; av_ref_intens = 0; av_score = 0; av_mz = 0; av_RT = 0;
1782 std::vector<DPosition<2> > point_set;
1783 double sum_of_ref_intenses_l;
1784 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1786 sum_of_ref_intenses_l = 0;
1787 c_mz = box_iter->second.mz;
1788 c_RT = box_iter->second.RT;
1794 point_set.push_back(
DPosition<2>(c_RT, c_mz + mz_cutoff / (
double)c_charge));
1796 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1797 std::cout <<
"Intenstype: " << intenstype_ << std::endl;
1799 if (intenstype_ ==
"ref")
1802 const MSSpectrum& c_spec(map[box_iter->second.RT_index]);
1804 for (
unsigned int i = 0; i < mz_cutoff; ++i)
1810 while (h_iter != c_spec.begin())
1813 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1814 if (trunc(c_mz) == 874)
1816 std::cout <<
"cmz: " << c_mz + i *
Constants::IW_NEUTRON_MASS / c_charge <<
"\t" << hc_iter->getMZ() <<
"\t" << hc_iter->getIntensity() <<
"\t" << h_iter->getMZ() <<
"\t" << h_iter->getIntensity() << std::endl;
1821 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1831 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1832 if (trunc(c_mz) == 874)
1837 sum_of_ref_intenses_l += hc_iter->getIntensity();
1838 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1839 if (trunc(c_mz) == 874)
1841 std::cout << sum_of_ref_intenses_l <<
"********" << std::endl;
1847 if (best_charge_index == box_iter->second.c)
1849 av_score += box_iter->second.score;
1850 av_intens += box_iter->second.intens;
1851 av_ref_intens += box_iter->second.ref_intens;
1852 sum_of_ref_intenses_g += sum_of_ref_intenses_l;
1853 av_mz += c_mz * box_iter->second.intens;
1859 av_ref_intens /= (double)charge_binary_votes[best_charge_index];
1860 av_score /= (double)charge_binary_votes[best_charge_index];
1861 av_RT /= (double)c_box.size();
1863 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1864 if (trunc(av_mz) == 874)
1865 std::cout << av_mz <<
"\t" << best_charge_index <<
"\t" << best_charge_score << std::endl;
1872 c_feature.
setConvexHulls(std::vector<ConvexHull2D>(1, c_conv_hull));
1875 if (intenstype_ ==
"corrected")
1878 av_intens /= exp(-2 * lambda) * boost::math::cyl_bessel_i(0, 2 * lambda);
1880 if (intenstype_ ==
"ref")
1882 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1883 if (trunc(c_mz) == 874)
1885 std::cout << sum_of_ref_intenses_g <<
"####" << std::endl;
1889 av_intens = sum_of_ref_intenses_g;
1892 c_feature.
setMZ(av_mz);
1894 c_feature.
setRT(av_RT);
1896 feature_map.push_back(c_feature);
1902 template <
typename PeakType>
1904 const MSSpectrum& ref,
const double seed_mz,
const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score)
1906 typename MSSpectrum::const_iterator iter, ref_iter;
1910 iter = candidate.
MZBegin(seed_mz);
1912 if (iter == candidate.begin() || iter == candidate.end())
1917 std::pair<double, double> reals;
1918 ref_iter = ref.
MZBegin(seed_mz);
1920 double real_mz, real_intens;
1923 reals = checkPPMTheoModel_(ref, iter->getMZ(),
c);
1924 real_mz = reals.first; real_intens = reals.second;
1927 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
1928 while (h_iter != ref.begin())
1931 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1945 reals = checkPPMTheoModel_(ref, h_iter->getMZ(),
c);
1946 real_mz = reals.first; real_intens = reals.second;
1947 if (real_mz <= 0 || real_intens <= 0)
1951 real_mz = h_iter->getMZ();
1952 real_intens = h_iter->getIntensity();
1957 reals = std::pair<double, double>(seed_mz, ref_iter->getIntensity());
1958 real_mz = reals.first; real_intens = reals.second;
1960 if (real_mz <= 0 || real_intens <= 0)
1962 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
1963 while (h_iter != ref.begin())
1966 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1980 real_mz = h_iter->getMZ(); real_intens = h_iter->getIntensity();
1981 if (real_mz <= 0 || real_intens <= 0)
1985 real_mz = h_iter->getMZ();
1986 real_intens = h_iter->getIntensity();
1990 double c_score = scoreThis_(candidate, peak_cutoff, real_mz,
c, 0);
1999 typename MSSpectrum::const_iterator real_r_MZ_iter = ref.
MZBegin(real_l_MZ_iter, real_mz + mz_cutoff / (
c + 1.), ref.end());
2000 if (real_r_MZ_iter == ref.end())
2006 UInt real_mz_begin = distance(ref.begin(), real_l_MZ_iter);
2007 UInt real_mz_end = distance(ref.begin(), real_r_MZ_iter);
2009 if (prev_score == -1000)
2011 push2Box_(real_mz, scan_index,
c, prev_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2015 push2Box_(real_mz, scan_index,
c, c_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2020 template <
typename PeakType>
2022 const MSSpectrum& ref,
const double seed_mz,
const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score)
2024 typename MSSpectrum::const_iterator iter, ref_iter;
2028 iter = candidate.
MZBegin(seed_mz);
2030 if (iter == candidate.
begin() || iter == candidate.
end())
2035 std::pair<double, double> reals;
2036 ref_iter = ref.
MZBegin(seed_mz);
2038 double real_mz, real_intens;
2041 reals = checkPPMTheoModel_(ref, iter->getMZ(),
c);
2042 real_mz = reals.first; real_intens = reals.second;
2045 auto h_iter = ref_iter, hc_iter = ref_iter;
2046 while (h_iter != ref.begin())
2049 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
2064 reals = checkPPMTheoModel_(ref, h_iter->getMZ(),
c);
2065 real_mz = reals.first; real_intens = reals.second;
2067 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
2068 std::cout <<
"Plausibility check old_mz: " << iter->getMZ() <<
"\t" << real_mz << std::endl;
2071 if (real_mz <= 0 || real_intens <= 0)
2075 real_mz = h_iter->getMZ();
2076 real_intens = h_iter->getIntensity();
2081 reals = std::pair<double, double>(seed_mz, ref_iter->getIntensity());
2082 real_mz = reals.first; real_intens = reals.second;
2084 if (real_mz <= 0 || real_intens <= 0)
2086 auto h_iter = ref_iter, hc_iter = ref_iter;
2087 while (h_iter != ref.begin())
2090 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
2104 real_mz = h_iter->getMZ(); real_intens = h_iter->getIntensity();
2105 if (real_mz <= 0 || real_intens <= 0)
2109 real_mz = h_iter->getMZ();
2110 real_intens = h_iter->getIntensity();
2114 double c_score = scoreThis_(candidate, peak_cutoff, real_mz,
c, 0);
2123 typename MSSpectrum::const_iterator real_r_MZ_iter = ref.
MZBegin(real_l_MZ_iter, real_mz + mz_cutoff / (
c + 1.), ref.end());
2124 if (real_r_MZ_iter == ref.end())
2130 UInt real_mz_begin = distance(ref.begin(), real_l_MZ_iter);
2131 UInt real_mz_end = distance(ref.begin(), real_r_MZ_iter);
2133 if (prev_score == -1000)
2135 push2Box_(real_mz, scan_index,
c, prev_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2139 push2Box_(real_mz, scan_index,
c, c_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2145 template <
typename PeakType>
2149 double ppms = getPPMs_(peptideMassRule_(mass), mass);
2152 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
2153 std::cout << ::std::setprecision(8) << std::fixed << c_mz <<
"\t =(" <<
"ISO_WAVE" <<
")> " <<
"REJECT \t" << ppms <<
" (rule: " << peptideMassRule_(mass) <<
" got: " << mass <<
")" << std::endl;
2155 return std::pair<double, double>(-1, -1);
2158 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
2159 std::cout << ::std::setprecision(8) << std::fixed << c_mz <<
"\t =(" <<
"ISO_WAVE" <<
")> " <<
"ACCEPT \t" << ppms <<
" (rule: " << peptideMassRule_(mass) <<
" got: " << mass <<
")" << std::endl;
2161 return std::pair<double, double>(c_mz, ref.
MZBegin(c_mz)->getIntensity());
2166 #pragma clang diagnostic pop
void setCharge(const ChargeType &ch)
Set charge state.
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:223
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:71
Iterator begin()
See std::vector documentation.
Definition: ConstRefVector.h:398
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:720
Iterator end()
See std::vector documentation.
Definition: ConstRefVector.h:404
A 2-dimensional hull representation in [counter]clockwise direction - depending on axis labelling.
Definition: ConvexHull2D.h:73
void addPoints(const PointArrayType &points)
A container for features.
Definition: FeatureMap.h:105
An LC-MS feature.
Definition: Feature.h:72
void setConvexHulls(const std::vector< ConvexHull2D > &hulls)
Set the convex hulls of single mass traces.
void setOverallQuality(QualityType q)
Set the overall quality.
static UInt getNumPeakCutOff(const double mass, const UInt z)
static IsotopeWavelet * init(const double max_m, const UInt max_charge)
static double getLambdaL(const double m)
Returns the mass-parameter lambda (linear fit).
static double getValueByLambda(const double lambda, const double tz1)
Returns the value of the isotope wavelet at position t via a fast table lookup. Usually,...
static UInt getMzPeakCutOffAtMonoPos(const double mass, const UInt z)
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:80
Iterator begin()
Definition: MSExperiment.h:157
Size size() const
Definition: MSExperiment.h:127
void clear(bool clear_meta_data)
Clears all data and meta data.
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
Iterator MZBegin(CoordinateType mz)
Binary search for peak range begin.
Iterator MZEnd(CoordinateType mz)
Binary search for peak range end (returns the past-the-end iterator)
A 2-dimensional raw data point or peak.
Definition: Peak2D.h:55
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
IntensityType getIntensity() const
Definition: Peak2D.h:166
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
A more convenient string class.
Definition: String.h:61
int Int
Signed integer type.
Definition: Types.h:102
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
static double mean(IteratorType begin, IteratorType end)
Calculates the mean of a range of values.
Definition: StatisticFunctions.h:133
const double IW_PROTON_MASS
Definition: IsotopeWaveletConstants.h:68
const double PEPTIDE_MASS_RULE_FACTOR
Definition: IsotopeWaveletConstants.h:49
const double IW_NEUTRON_MASS
Definition: IsotopeWaveletConstants.h:54
const unsigned int DEFAULT_NUM_OF_INTERPOLATION_POINTS
Definition: IsotopeWaveletConstants.h:43
const double c
Definition: Constants.h:209
const double PEPTIDE_MASS_RULE_THEO_PPM_BOUND
Definition: IsotopeWaveletConstants.h:51
const double PEPTIDE_MASS_RULE_BOUND
Definition: IsotopeWaveletConstants.h:50
const double IW_HALF_NEUTRON_MASS
Definition: IsotopeWaveletConstants.h:55
const double IW_QUARTER_NEUTRON_MASS
Definition: IsotopeWaveletConstants.h:56
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
bool intensityComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:495
bool intensityPointerComparator(PeakType *a, PeakType *b)
Definition: IsotopeWaveletTransform.h:507
bool positionComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:513
bool intensityAscendingComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:501