55 #include <boost/math/special_functions/bessel.hpp>
59 #pragma clang diagnostic push
60 #pragma clang diagnostic ignored "-Wfloat-equal"
61 #pragma clang diagnostic ignored "-Wconversion"
62 #pragma clang diagnostic ignored "-Wshorten-64-to-32"
70 template <
typename PeakType>
90 typedef std::multimap<UInt, BoxElement>
Box;
156 (*trans_intens_)[i] = intens;
179 inline typename MSSpectrum::const_iterator
MZBegin(
const double mz)
const
186 inline typename MSSpectrum::const_iterator
MZEnd(
const double mz)
const
193 inline typename MSSpectrum::const_iterator
end()
const
200 inline typename MSSpectrum::const_iterator
begin()
const
257 const double ampl_cutoff,
const bool check_PPMs);
268 const UInt RT_votes_cutoff,
const Int front_bound = -1,
const Int end_bound = -1);
286 inline double getLinearInterpolation(
const typename MSSpectrum::const_iterator& left_iter,
const double mz_pos,
const typename MSSpectrum::const_iterator& right_iter)
288 return left_iter->getIntensity() + (right_iter->getIntensity() - left_iter->getIntensity()) / (right_iter->getMZ() - left_iter->getMZ()) * (mz_pos - left_iter->getMZ());
297 inline double getLinearInterpolation(
const double mz_a,
const double intens_a,
const double mz_pos,
const double mz_b,
const double intens_b)
299 return intens_a + (intens_b - intens_a) / (mz_b - mz_a) * (mz_pos - mz_a);
342 const double seed_mz,
const UInt c,
const double ampl_cutoff);
351 const double seed_mz,
const UInt c,
const double ampl_cutoff);
362 const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score);
372 const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score);
398 const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end,
const double ref_intens);
416 const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end);
431 const UInt scan_index,
const UInt c,
const bool check_PPMs);
438 const UInt scan_index,
const UInt c,
const bool check_PPMs);
452 double old_frac_mass = c_mass - (
Int)(c_mass);
454 double new_frac_mass = new_mass - (
Int)(new_mass);
456 if (new_frac_mass - old_frac_mass > 0.5)
461 if (new_frac_mass - old_frac_mass < -0.5)
472 inline double getPPMs_(
const double mass_a,
const double mass_b)
const
474 return fabs(mass_a - mass_b) / (0.5 * (mass_a + mass_b)) * 1e6;
496 template <
typename PeakType>
502 template <
typename PeakType>
508 template <
typename PeakType>
514 template <
typename PeakType>
520 template <
typename PeakType>
523 tmp_boxes_ =
new std::vector<std::multimap<double, Box> >(1);
527 max_num_peaks_per_pattern_ = 3;
532 template <
typename PeakType>
535 max_charge_ = max_charge;
536 max_scan_size_ = max_scan_size;
538 intenstype_ = intenstype;
539 tmp_boxes_ =
new std::vector<std::multimap<double, Box> >(max_charge);
540 if (max_scan_size <= 0)
549 Int size_estimate((
Int)ceil(max_scan_size_ / (max_mz - min_mz)));
551 psi_.reserve(to_reserve);
552 prod_.reserve(to_reserve);
553 xs_.reserve(to_reserve);
558 template <
typename PeakType>
564 template <
typename PeakType>
567 Int spec_size((
Int)c_ref.size());
571 double value, T_boundary_left, T_boundary_right, old, c_diff, current, old_pos, my_local_MZ, my_local_lambda, origin, c_mz;
573 for (
Int my_local_pos = 0; my_local_pos < spec_size; ++my_local_pos)
576 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_;
581 for (
Int current_conv_pos = std::max(0, my_local_pos - from_max_to_left_); c_diff < T_boundary_right; ++current_conv_pos)
583 if (current_conv_pos >= spec_size)
585 value += 0.5 * old * min_spacing_;
589 c_mz = c_ref[current_conv_pos].getMZ();
590 c_diff = c_mz + origin;
593 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;
595 value += 0.5 * (current + old) * (c_mz - old_pos);
603 c_trans[my_local_pos].setIntensity(value);
607 template <
typename PeakType>
610 Int spec_size((
Int)c_ref.size());
614 double value, T_boundary_left, T_boundary_right, c_diff, current, my_local_MZ, my_local_lambda, origin, c_mz;
616 for (
Int my_local_pos = 0; my_local_pos < spec_size; ++my_local_pos)
625 for (
Int current_conv_pos = std::max(0, my_local_pos - from_max_to_left_); c_diff < T_boundary_right; ++current_conv_pos)
627 if (current_conv_pos >= spec_size)
632 c_mz = c_ref[current_conv_pos].getMZ();
633 c_diff = c_mz + origin;
636 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;
641 c_trans[my_local_pos].setIntensity(value);
645 template <
typename PeakType>
648 data_length_ = (
UInt) c_ref.size();
649 computeMinSpacing(c_ref);
650 Int wavelet_length = 0, quarter_length = 0;
655 typename MSSpectrum::const_iterator start_iter, end_iter;
656 for (
UInt i = 0; i < data_length_; ++i)
659 start_iter = c_ref.
MZEnd(c_ref[i].getMZ());
660 end_iter = c_ref.
MZBegin(c_ref[i].getMZ() + c_mz_cutoff);
661 wavelet_length = std::max((
SignedSize) wavelet_length, distance(start_iter, end_iter) + 1);
663 quarter_length = std::max((
SignedSize) quarter_length, distance(end_iter, start_iter) + 1);
670 wavelet_length = (
UInt) ceil(max_mz_cutoff_ / min_spacing_);
675 if (wavelet_length > (
Int) c_ref.size())
677 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;
678 std::cout <<
"Minimal spacing: " << min_spacing_ << std::endl;
679 std::cout <<
"Warning/Error generated at scan with RT " << c_ref.
getRT() <<
"." << std::endl;
683 from_max_to_left_ = max_index;
684 from_max_to_right_ = wavelet_length - 1 - from_max_to_left_;
687 template <
typename PeakType>
690 min_spacing_ = INT_MAX;
691 for (
UInt c_conv_pos = 1; c_conv_pos < c_ref.size(); ++c_conv_pos)
693 min_spacing_ = std::min(min_spacing_, c_ref[c_conv_pos].getMZ() - c_ref[c_conv_pos - 1].getMZ());
697 template <
typename PeakType>
699 const MSSpectrum& ref,
const UInt scan_index,
const UInt c,
const double ampl_cutoff,
const bool check_PPMs)
701 Size scan_size(candidates.size());
703 typename MSSpectrum::const_iterator iter_start, iter_end, seed_iter, iter2;
704 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;
705 UInt MZ_start, MZ_end;
708 diffed[0].setIntensity(0); diffed[scan_size - 1].setIntensity(0);
710 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
711 std::stringstream stream;
712 stream <<
"diffed_" << ref.
getRT() <<
"_" <<
c + 1 <<
".trans\0";
713 std::ofstream ofile(stream.str().c_str());
718 for (
UInt i = 0; i < scan_size - 2; ++i)
720 share = candidates[i + 1].getIntensity(); share_pos = candidates[i + 1].getMZ();
721 bwd = (share - candidates[i].getIntensity()) / (share_pos - candidates[i].getMZ());
722 fwd = (candidates[i + 2].getIntensity() - share) / (candidates[i + 2].getMZ() - share_pos);
724 if (!(bwd >= 0 && fwd <= 0) || share > ref[i + 1].getIntensity())
726 diffed[i + 1].setIntensity(0);
729 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
730 ofile << diffed[i + 1].getMZ() <<
"\t" << diffed[i + 1].getIntensity() << std::endl;
736 for (
UInt i = 0; i < scan_size - 2; ++i)
738 share = candidates[i + 1].getIntensity(); share_pos = candidates[i + 1].getMZ();
739 bwd = (share - candidates[i].getIntensity()) / (share_pos - candidates[i].getMZ());
740 fwd = (candidates[i + 2].getIntensity() - share) / (candidates[i + 2].getMZ() - share_pos);
742 if (!(bwd >= 0 && fwd <= 0))
744 diffed[i + 1].setIntensity(0);
747 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
748 ofile << diffed[i + 1].getMZ() <<
"\t" << diffed[i + 1].getIntensity() << std::endl;
752 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
761 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
762 std::stringstream stream2;
763 stream2 <<
"sorted_cpu_" << candidates.
getRT() <<
"_" <<
c + 1 <<
".trans\0";
764 std::ofstream ofile2(stream2.str().c_str());
765 for (iter = c_sorted_candidate.
end() - 1; iter != c_sorted_candidate.
begin(); --iter)
767 ofile2 << iter->getMZ() <<
"\t" << iter->getIntensity() << std::endl;
772 std::vector<UInt> processed(scan_size, 0);
780 c_av_intens = getAvIntens_(candidates);
781 c_sd_intens = getSdIntens_(candidates, c_av_intens);
782 threshold = ampl_cutoff * c_sd_intens + c_av_intens;
785 for (iter = c_sorted_candidate.
end() - 1; iter != c_sorted_candidate.
begin(); --iter)
787 if (iter->getIntensity() <= 0)
792 seed_mz = iter->getMZ();
793 seed_iter = ref.
MZBegin(seed_mz);
795 if (seed_iter == ref.end() || processed[distance(ref.begin(), seed_iter)])
806 iter_end = ref.
MZEnd(seed_iter, seed_mz + mz_cutoff / (
c + 1.), ref.end());
807 if (iter_end == ref.end())
812 MZ_start = distance(ref.begin(), iter_start);
813 MZ_end = distance(ref.begin(), iter_end);
815 memset(&(processed[MZ_start]), 1,
sizeof(
UInt) * (MZ_end - MZ_start + 1));
819 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
820 if (trunc(seed_mz) == 874)
821 std::cout << seed_mz <<
"\t" << c_score << std::endl;
824 if (c_score <= 0 && c_score != -1000)
831 push2TmpBox_(seed_mz, scan_index,
c, c_score, iter->getIntensity(), ref.
getRT(), MZ_start, MZ_end);
834 iter2 = candidates.
MZBegin(help_mz);
835 if (iter2 == candidates.end() || iter2 == candidates.begin())
843 if (iter2 != candidates.end())
845 push2TmpBox_(iter2->getMZ(), scan_index,
c, 0, getLinearInterpolation(iter2 - 1, help_mz, iter2), ref.
getRT(), MZ_start, MZ_end);
850 iter2 = candidates.
MZBegin(help_mz);
851 if (iter2 == candidates.end() || iter2 == candidates.begin())
859 if (iter2 != candidates.end())
861 push2TmpBox_(iter2->getMZ(), scan_index,
c, 0, getLinearInterpolation(iter2 - 1, help_mz, iter2), ref.
getRT(), MZ_start, MZ_end);
866 clusterSeeds_(candidates, ref, scan_index,
c, check_PPMs);
869 template <
typename PeakType>
871 const UInt peak_cutoff,
const double seed_mz,
const UInt c,
const double ampl_cutoff)
873 double c_score = 0, c_val;
874 typename MSSpectrum::const_iterator c_left_iter2, c_right_iter2;
875 Int signal_size((
Int)candidate.size());
880 Int p_h_ind = 1, end = 4 * (peak_cutoff - 1) - 1;
882 std::vector<double> positions(end);
883 for (
Int i = 0; i < end; ++i)
888 double l_score = 0, mid_val = 0;
889 Int start_index = distance(candidate.begin(), candidate.
MZBegin(positions[0])) - 1;
890 for (
Int v = 1; v <= end; ++v, ++p_h_ind)
894 if (start_index < signal_size - 1)
899 while (candidate[start_index].getMZ() < positions[v - 1]);
901 if (start_index <= 0 || start_index >= signal_size - 1)
906 c_left_iter2 = candidate.begin() + start_index - 1;
907 c_right_iter2 = c_left_iter2 + 1;
909 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());
911 if (v == (
int)(ceil(end / 2.)))
917 if (p_h_ind % 2 == 1)
920 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
921 if (trunc(seed_mz) == 874)
922 std::cout << -c_val << std::endl;
928 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
929 if (trunc(seed_mz) == 874)
930 std::cout << c_val << std::endl;
935 start_index = distance(candidate.begin(), c_left_iter2);
938 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
939 std::ofstream ofile_score(
"scores.dat", ios::app);
940 std::ofstream ofile_check_score(
"check_scores.dat", ios::app);
942 ofile_check_score.close();
945 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
946 if (trunc(seed_mz) == 874)
947 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;
950 if (c_score - mid_val <= 0)
955 if (c_score - mid_val <= ampl_cutoff)
960 if (l_score <= 0 || c_score - l_score - mid_val <= 0)
968 template <
typename PeakType>
970 const UInt peak_cutoff,
const double seed_mz,
const UInt c,
const double ampl_cutoff)
972 double c_score = 0, c_val;
973 typename MSSpectrum::const_iterator c_left_iter2, c_right_iter2;
977 Int p_h_ind = 1, end = 4 * (peak_cutoff - 1) - 1;
979 std::vector<double> positions(end);
980 for (
Int i = 0; i < end; ++i)
985 double l_score = 0, mid_val = 0;
986 Int start_index = distance(candidate.
begin(), candidate.
MZBegin(positions[0])) - 1;
987 for (
Int v = 1; v <= end; ++v, ++p_h_ind)
991 if (start_index < signal_size - 1)
996 while (candidate.
getMZ(start_index) < positions[v - 1]);
998 if (start_index <= 0 || start_index >= signal_size - 1)
1003 c_left_iter2 = candidate.
begin() + start_index - 1;
1004 c_right_iter2 = c_left_iter2 + 1;
1007 if (v == (
int)(ceil(end / 2.)))
1013 if (p_h_ind % 2 == 1)
1022 start_index = distance(candidate.
begin(), c_left_iter2);
1025 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1026 std::ofstream ofile_score(
"scores.dat", ios::app);
1027 std::ofstream ofile_check_score(
"check_scores.dat", ios::app);
1028 ofile_score << c_check_point <<
"\t" << c_score << std::endl;
1029 ofile_score.close();
1030 ofile_check_score.close();
1033 if (l_score <= 0 || c_score - l_score - mid_val <= 0 || c_score - mid_val <= ampl_cutoff)
1041 template <
typename PeakType>
1045 typename std::multimap<double, Box>::iterator iter;
1046 typename Box::iterator box_iter;
1047 std::vector<BoxElement> final_box;
1048 double c_mz, av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1049 double virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1051 for (iter = tmp_boxes_->at(
c).begin(); iter != tmp_boxes_->at(
c).end(); ++iter)
1054 Box& c_box = iter->second;
1055 av_score = 0; av_mz = 0; av_intens = 0; av_abs_intens = 0; count = 0;
1056 virtual_av_mz = 0; virtual_av_intens = 0; virtual_av_abs_intens = 0; virtual_count = 0;
1059 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1061 if (box_iter->second.score == 0)
1066 c_mz = box_iter->second.mz;
1067 virtual_av_intens += box_iter->second.intens;
1068 virtual_av_abs_intens += fabs(box_iter->second.intens);
1069 virtual_av_mz += c_mz * fabs(box_iter->second.intens);
1074 c_mz = box_iter->second.mz;
1075 av_score += box_iter->second.score;
1076 av_intens += box_iter->second.intens;
1077 av_abs_intens += fabs(box_iter->second.intens);
1078 av_mz += c_mz * fabs(box_iter->second.intens);
1085 av_intens = virtual_av_intens / virtual_count;
1087 av_mz = virtual_av_mz / virtual_av_abs_intens;
1093 av_mz /= av_abs_intens;
1097 c_box_element.
mz = av_mz;
1098 c_box_element.
c =
c;
1099 c_box_element.
score = av_score;
1100 c_box_element.
intens = av_intens;
1102 c_box_element.
RT = c_box.begin()->second.RT;
1103 final_box.push_back(c_box_element);
1106 Size num_o_feature = final_box.size();
1107 if (num_o_feature == 0)
1109 tmp_boxes_->at(
c).clear();
1114 std::vector<double> bwd_diffs(num_o_feature, 0);
1117 for (
Size i = 1; i < num_o_feature; ++i)
1119 bwd_diffs[i] = (final_box[i].intens - final_box[i - 1].intens) / (final_box[i].mz - final_box[i - 1].mz);
1122 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1123 std::ofstream ofile_bwd(
"bwd_cpu.dat");
1124 for (
Size i = 0; i < num_o_feature; ++i)
1126 ofile_bwd << final_box[i].mz <<
"\t" << bwd_diffs[i] << std::endl;
1132 for (
Size i = 0; i < num_o_feature - 1; ++i)
1134 while (i < num_o_feature - 2)
1136 if (final_box[i].score > 0 || final_box[i].score == -1000)
1141 if (bwd_diffs[i] > 0 && bwd_diffs[i + 1] < 0)
1143 checkPositionForPlausibility_(candidate, ref, final_box[i].mz, final_box[i].
c, scan_index, check_PPMs, final_box[i].intens, final_box[i].score);
1148 tmp_boxes_->at(
c).clear();
1151 template <
typename PeakType>
1154 double av_intens = 0;
1155 for (
UInt i = 0; i < scan.size(); ++i)
1157 if (scan[i].getIntensity() >= 0)
1159 av_intens += scan[i].getIntensity();
1162 return av_intens / (double)scan.size();
1165 template <
typename PeakType>
1168 double res = 0, intens;
1169 for (
UInt i = 0; i < scan.size(); ++i)
1171 if (scan[i].getIntensity() >= 0)
1173 intens = scan[i].getIntensity();
1174 res += (intens -
mean) * (intens -
mean);
1177 return sqrt(res / (
double)(scan.size() - 1));
1180 template <
typename PeakType>
1183 std::vector<double> diffs(scan.size() - 1, 0);
1184 for (
UInt i = 0; i < scan.size() - 1; ++i)
1186 diffs[i] = scan[i + 1].getMZ() - scan[i].getMZ();
1189 sort(diffs.begin(), diffs.end());
1190 double av_MZ_spacing = 0;
1191 for (
UInt i = 0; i < diffs.size() / 2; ++i)
1193 av_MZ_spacing += diffs[i];
1196 return av_MZ_spacing / (diffs.size() / 2);
1199 template <
typename PeakType>
1202 double av_intens = 0;
1203 for (
UInt i = 0; i < scan.
size(); ++i)
1210 return av_intens / (double)scan.
size();
1213 template <
typename PeakType>
1216 double res = 0, intens;
1217 for (
UInt i = 0; i < scan.
size(); ++i)
1222 res += (intens -
mean) * (intens -
mean);
1225 return sqrt(res / (
double)(scan.
size() - 1));
1228 template <
typename PeakType>
1230 const double score,
const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end,
double ref_intens)
1234 typename std::multimap<double, Box>::iterator upper_iter(open_boxes_.upper_bound(mz));
1235 typename std::multimap<double, Box>::iterator lower_iter(open_boxes_.lower_bound(mz));
1237 if (lower_iter != open_boxes_.end())
1240 if (mz != lower_iter->first && lower_iter != open_boxes_.begin())
1246 typename std::multimap<double, Box>::iterator insert_iter;
1247 bool create_new_box =
true;
1248 if (lower_iter == open_boxes_.end())
1253 if (!open_boxes_.empty())
1255 if (fabs((--lower_iter)->first - mz) < dist_constraint)
1257 create_new_box =
false;
1258 insert_iter = lower_iter;
1263 create_new_box =
true;
1268 if (upper_iter == open_boxes_.end() && fabs(lower_iter->first - mz) < dist_constraint)
1270 insert_iter = lower_iter;
1271 create_new_box =
false;
1275 create_new_box =
true;
1280 if (upper_iter != open_boxes_.end() && lower_iter != open_boxes_.end())
1285 double dist_lower = fabs(lower_iter->first - mz);
1286 double dist_upper = fabs(upper_iter->first - mz);
1287 dist_lower = (dist_lower < dist_constraint) ? dist_lower : INT_MAX;
1288 dist_upper = (dist_upper < dist_constraint) ? dist_upper : INT_MAX;
1290 if (dist_lower >= dist_constraint && dist_upper >= dist_constraint)
1292 create_new_box =
true;
1296 insert_iter = (dist_lower < dist_upper) ? lower_iter : upper_iter;
1297 create_new_box =
false;
1306 if (create_new_box ==
false)
1308 std::pair<UInt, BoxElement> help2(scan, element);
1309 insert_iter->second.insert(help2);
1312 Box replacement(insert_iter->second);
1316 double c_mz = insert_iter->first * (insert_iter->second.size() - 1) + mz;
1317 c_mz /= ((double) insert_iter->second.size());
1320 open_boxes_.erase(insert_iter);
1321 std::pair<double, std::multimap<UInt, BoxElement> > help3(c_mz, replacement);
1322 open_boxes_.insert(help3);
1326 std::pair<UInt, BoxElement> help2(scan, element);
1327 std::multimap<UInt, BoxElement> help3;
1328 help3.insert(help2);
1329 std::pair<double, std::multimap<UInt, BoxElement> > help4(mz, help3);
1330 open_boxes_.insert(help4);
1334 template <
typename PeakType>
1336 const double score,
const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end)
1340 std::multimap<double, Box>& tmp_box(tmp_boxes_->at(
c));
1341 typename std::multimap<double, Box>::iterator upper_iter(tmp_box.upper_bound(mz));
1342 typename std::multimap<double, Box>::iterator lower_iter(tmp_box.lower_bound(mz));
1344 if (lower_iter != tmp_box.end())
1347 if (mz != lower_iter->first && lower_iter != tmp_box.begin())
1353 typename std::multimap<double, Box>::iterator insert_iter;
1354 bool create_new_box =
true;
1355 if (lower_iter == tmp_box.end())
1360 if (!tmp_box.empty())
1362 if (fabs((--lower_iter)->first - mz) < dist_constraint)
1364 create_new_box =
false;
1365 insert_iter = lower_iter;
1370 create_new_box =
true;
1375 if (upper_iter == tmp_box.end() && fabs(lower_iter->first - mz) < dist_constraint)
1377 insert_iter = lower_iter;
1378 create_new_box =
false;
1382 create_new_box =
true;
1387 if (upper_iter != tmp_box.end() && lower_iter != tmp_box.end())
1390 double dist_lower = fabs(lower_iter->first - mz);
1391 double dist_upper = fabs(upper_iter->first - mz);
1392 dist_lower = (dist_lower < dist_constraint) ? dist_lower : INT_MAX;
1393 dist_upper = (dist_upper < dist_constraint) ? dist_upper : INT_MAX;
1395 if (dist_lower >= dist_constraint && dist_upper >= dist_constraint)
1397 create_new_box =
true;
1401 insert_iter = (dist_lower < dist_upper) ? lower_iter : upper_iter;
1402 create_new_box =
false;
1410 if (create_new_box ==
false)
1412 std::pair<UInt, BoxElement> help2(scan, element);
1413 insert_iter->second.insert(help2);
1416 Box replacement(insert_iter->second);
1420 double c_mz = insert_iter->first * (insert_iter->second.size() - 1) + mz;
1421 c_mz /= ((double) insert_iter->second.size());
1424 tmp_box.erase(insert_iter);
1425 std::pair<double, std::multimap<UInt, BoxElement> > help3(c_mz, replacement);
1426 tmp_box.insert(help3);
1430 std::pair<UInt, BoxElement> help2(scan, element);
1431 std::multimap<UInt, BoxElement> help3;
1432 help3.insert(help2);
1434 std::pair<double, std::multimap<UInt, BoxElement> > help4(mz, help3);
1435 tmp_box.insert(help4);
1439 template <
typename PeakType>
1441 const UInt RT_votes_cutoff,
const Int front_bound,
const Int end_bound)
1443 typename std::multimap<double, Box>::iterator iter, iter2;
1445 if ((
Int)scan_index == end_bound && end_bound != (
Int)map.
size() - 1)
1447 for (iter = open_boxes_.begin(); iter != open_boxes_.end(); ++iter)
1449 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1450 std::cout <<
"LOW THREAD insert in end_box " << iter->first << std::endl;
1451 typename Box::iterator dings;
1452 for (dings = iter->second.begin(); dings != iter->second.end(); ++dings)
1453 std::cout << map[dings->first].getRT() <<
"\t" << dings->second.c + 1 << std::endl;
1455 end_boxes_.insert(*iter);
1457 open_boxes_.
clear();
1461 for (iter = open_boxes_.begin(); iter != open_boxes_.end(); )
1463 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1464 if (front_bound > 0)
1466 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;
1471 UInt lastScan = (--(iter->second.end()))->first;
1472 if (scan_index - lastScan > RT_interleave + 1 || scan_index == map.
size() - 1)
1474 if (iter->second.begin()->first - front_bound <= RT_interleave + 1 && front_bound > 0)
1478 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1479 std::cout <<
"HIGH THREAD insert in front_box " << iter->first << std::endl;
1481 front_boxes_.insert(*iter);
1482 open_boxes_.erase(iter);
1492 if (iter->second.size() >= RT_votes_cutoff)
1496 closed_boxes_.insert(*(--iter));
1498 open_boxes_.erase(iter);
1508 template <
typename PeakType>
1511 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1512 std::cout <<
"**** CHECKING FOR BOX EXTENSIONS ****" << std::endl;
1516 typename Box::const_iterator iter;
1517 std::vector<double> elution_profile(box.size());
1519 for (iter = box.begin(); iter != box.end(); ++iter, ++index)
1521 for (
Size i = iter->second.MZ_begin; i != iter->second.MZ_end; ++i)
1523 elution_profile[index] += map[iter->second.RT_index][i].getIntensity();
1525 elution_profile[index] /= iter->second.MZ_end - iter->second.MZ_begin + 1.;
1529 Int max_index = INT_MIN;
1530 for (
Size i = 0; i < elution_profile.size(); ++i)
1532 if (elution_profile[i] > max)
1535 max = elution_profile[i];
1539 Int max_extension = (
Int)(elution_profile.size()) - 2 * max_index;
1541 double av_elution = 0;
1542 for (
Size i = 0; i < elution_profile.size(); ++i)
1544 av_elution += elution_profile[i];
1546 av_elution /= (double)elution_profile.
size();
1548 double sd_elution = 0;
1549 for (
Size i = 0; i < elution_profile.size(); ++i)
1551 sd_elution += (av_elution - elution_profile[i]) * (av_elution - elution_profile[i]);
1553 sd_elution /= (double)(elution_profile.size() - 1);
1554 sd_elution = sqrt(sd_elution);
1558 for (iter = box.begin(); iter != box.end(); ++iter, ++index)
1560 av_mz += iter->second.mz;
1561 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1562 std::cout << iter->second.RT <<
"\t" << iter->second.mz <<
"\t" << iter->second.c + 1 << std::endl;
1565 av_mz /= (double)box.size();
1569 if ((
Int)(box.begin()->second.RT_index) - 1 < 0)
1574 UInt pre_index = box.begin()->second.RT_index - 1;
1575 typename MSSpectrum::const_iterator c_iter = map[pre_index].MZBegin(av_mz);
1576 double pre_elution = 0;
1578 double mz_start = map[pre_index + 1][box.begin()->second.MZ_begin].getMZ();
1579 double mz_end = map[pre_index + 1][box.begin()->second.MZ_end].getMZ();
1581 typename MSSpectrum::const_iterator mz_start_iter = map[pre_index].MZBegin(mz_start), mz_end_iter = map[pre_index].MZBegin(mz_end);
1582 for (
typename MSSpectrum::const_iterator mz_iter = mz_start_iter; mz_iter != mz_end_iter; ++mz_iter)
1584 pre_elution += mz_iter->getIntensity();
1589 if (pre_elution <= av_elution - 2 * sd_elution)
1594 Int c_index = max_extension;
1595 Int first_index = box.
begin()->second.RT_index;
1596 for (
Int i = 1; i < max_extension; ++i)
1598 c_index = first_index - i;
1605 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1606 std::cout << box.begin()->second.RT <<
"\t" << av_mz <<
"\t" << box.begin()->second.c + 1 <<
"\t" <<
" extending the box " << std::endl;
1609 push2Box_(av_mz, c_index, box.begin()->second.c, box.begin()->second.score, c_iter->getIntensity(),
1610 map[c_index].getRT(), box.
begin()->second.MZ_begin, box.begin()->second.MZ_end);
1614 template <
typename PeakType>
1618 typename std::multimap<double, Box>::iterator iter;
1619 typename Box::iterator box_iter;
1620 std::vector<BoxElement> final_box;
1621 double c_mz, av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1622 double virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1624 for (iter = tmp_boxes_->at(
c).begin(); iter != tmp_boxes_->at(
c).end(); ++iter)
1626 Box& c_box = iter->second;
1627 av_score = 0; av_mz = 0; av_intens = 0; av_abs_intens = 0; count = 0;
1628 virtual_av_mz = 0; virtual_av_intens = 0; virtual_av_abs_intens = 0; virtual_count = 0;
1630 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1632 if (box_iter->second.score == 0)
1637 c_mz = box_iter->second.mz;
1638 virtual_av_intens += box_iter->second.intens;
1639 virtual_av_abs_intens += fabs(box_iter->second.intens);
1640 virtual_av_mz += c_mz * fabs(box_iter->second.intens);
1645 c_mz = box_iter->second.mz;
1646 av_score += box_iter->second.score;
1647 av_intens += box_iter->second.intens;
1648 av_abs_intens += fabs(box_iter->second.intens);
1649 av_mz += c_mz * fabs(box_iter->second.intens);
1656 av_intens = virtual_av_intens / virtual_count;
1658 av_mz = virtual_av_mz / virtual_av_abs_intens;
1664 av_mz /= av_abs_intens;
1668 c_box_element.
mz = av_mz;
1669 c_box_element.
c =
c;
1670 c_box_element.
score = av_score;
1671 c_box_element.
intens = av_intens;
1673 c_box_element.
RT = c_box.begin()->second.RT;
1675 final_box.push_back(c_box_element);
1678 UInt num_o_feature = final_box.size();
1679 if (num_o_feature == 0)
1681 tmp_boxes_->at(
c).clear();
1686 std::vector<double> bwd_diffs(num_o_feature, 0);
1689 for (
UInt i = 1; i < num_o_feature; ++i)
1691 bwd_diffs[i] = (final_box[i].intens - final_box[i - 1].intens) / (final_box[i].mz - final_box[i - 1].mz);
1694 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1695 std::ofstream ofile_bwd(
"bwd_gpu.dat");
1696 for (
UInt i = 0; i < num_o_feature; ++i)
1698 ofile_bwd << final_box[i].mz <<
"\t" << bwd_diffs[i] << std::endl;
1703 for (
UInt i = 0; i < num_o_feature - 1; ++i)
1705 while (i < num_o_feature - 2)
1707 if (final_box[i].score > 0 || final_box[i].score == -1000)
1712 if (bwd_diffs[i] > 0 && bwd_diffs[i + 1] < 0)
1714 checkPositionForPlausibility_(candidates, ref, final_box[i].mz, final_box[i].
c, scan_index, check_PPMs, final_box[i].intens, final_box[i].score);
1719 tmp_boxes_->at(
c).clear();
1722 template <
typename PeakType>
1726 typename std::multimap<double, Box>::iterator iter;
1727 typename Box::iterator box_iter;
1728 UInt best_charge_index;
double best_charge_score, c_mz, c_RT;
UInt c_charge;
1729 double av_intens = 0, av_ref_intens = 0, av_score = 0, av_mz = 0, av_RT = 0, mz_cutoff, sum_of_ref_intenses_g;
1730 bool restart =
false;
1732 for (iter = closed_boxes_.begin(); iter != closed_boxes_.end(); ++iter)
1734 sum_of_ref_intenses_g = 0;
1735 Box& c_box = iter->second;
1736 std::vector<double> charge_votes(max_charge_, 0), charge_binary_votes(max_charge_, 0);
1741 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1743 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1744 if (trunc(box_iter->second.mz) == 874)
1745 std::cout << box_iter->second.c <<
"\t" << box_iter->second.intens <<
"\t" << box_iter->second.score << std::endl;
1748 if (box_iter->second.score == -1000)
1754 charge_votes[box_iter->second.c] += box_iter->second.intens;
1755 ++charge_binary_votes[box_iter->second.c];
1764 best_charge_index = 0; best_charge_score = 0;
1765 for (
UInt i = 0; i < max_charge_; ++i)
1767 if (charge_votes[i] > best_charge_score)
1769 best_charge_index = i;
1770 best_charge_score = charge_votes[i];
1775 if (charge_binary_votes[best_charge_index] < RT_votes_cutoff && RT_votes_cutoff <= map.
size())
1780 c_charge = best_charge_index + 1;
1782 av_intens = 0; av_ref_intens = 0; av_score = 0; av_mz = 0; av_RT = 0;
1784 std::vector<DPosition<2> > point_set;
1785 double sum_of_ref_intenses_l;
1786 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1788 sum_of_ref_intenses_l = 0;
1789 c_mz = box_iter->second.mz;
1790 c_RT = box_iter->second.RT;
1796 point_set.push_back(
DPosition<2>(c_RT, c_mz + mz_cutoff / (
double)c_charge));
1798 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1799 std::cout <<
"Intenstype: " << intenstype_ << std::endl;
1801 if (intenstype_ ==
"ref")
1804 const MSSpectrum& c_spec(map[box_iter->second.RT_index]);
1806 for (
unsigned int i = 0; i < mz_cutoff; ++i)
1812 while (h_iter != c_spec.begin())
1815 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1816 if (trunc(c_mz) == 874)
1818 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;
1823 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1833 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1834 if (trunc(c_mz) == 874)
1839 sum_of_ref_intenses_l += hc_iter->getIntensity();
1840 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1841 if (trunc(c_mz) == 874)
1843 std::cout << sum_of_ref_intenses_l <<
"********" << std::endl;
1849 if (best_charge_index == box_iter->second.c)
1851 av_score += box_iter->second.score;
1852 av_intens += box_iter->second.intens;
1853 av_ref_intens += box_iter->second.ref_intens;
1854 sum_of_ref_intenses_g += sum_of_ref_intenses_l;
1855 av_mz += c_mz * box_iter->second.intens;
1861 av_ref_intens /= (double)charge_binary_votes[best_charge_index];
1862 av_score /= (double)charge_binary_votes[best_charge_index];
1863 av_RT /= (double)c_box.size();
1865 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1866 if (trunc(av_mz) == 874)
1867 std::cout << av_mz <<
"\t" << best_charge_index <<
"\t" << best_charge_score << std::endl;
1874 c_feature.
setConvexHulls(std::vector<ConvexHull2D>(1, c_conv_hull));
1877 if (intenstype_ ==
"corrected")
1880 av_intens /= exp(-2 * lambda) * boost::math::cyl_bessel_i(0.0, 2.0 * lambda);
1882 if (intenstype_ ==
"ref")
1884 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
1885 if (trunc(c_mz) == 874)
1887 std::cout << sum_of_ref_intenses_g <<
"####" << std::endl;
1891 av_intens = sum_of_ref_intenses_g;
1894 c_feature.
setMZ(av_mz);
1896 c_feature.
setRT(av_RT);
1898 feature_map.push_back(c_feature);
1904 template <
typename PeakType>
1906 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)
1908 typename MSSpectrum::const_iterator iter, ref_iter;
1912 iter = candidate.
MZBegin(seed_mz);
1914 if (iter == candidate.begin() || iter == candidate.end())
1919 std::pair<double, double> reals;
1920 ref_iter = ref.
MZBegin(seed_mz);
1922 double real_mz, real_intens;
1925 reals = checkPPMTheoModel_(ref, iter->getMZ(),
c);
1926 real_mz = reals.first; real_intens = reals.second;
1929 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
1930 while (h_iter != ref.begin())
1933 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1947 reals = checkPPMTheoModel_(ref, h_iter->getMZ(),
c);
1948 real_mz = reals.first; real_intens = reals.second;
1949 if (real_mz <= 0 || real_intens <= 0)
1953 real_mz = h_iter->getMZ();
1954 real_intens = h_iter->getIntensity();
1959 reals = std::pair<double, double>(seed_mz, ref_iter->getIntensity());
1960 real_mz = reals.first; real_intens = reals.second;
1962 if (real_mz <= 0 || real_intens <= 0)
1964 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
1965 while (h_iter != ref.begin())
1968 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1982 real_mz = h_iter->getMZ(); real_intens = h_iter->getIntensity();
1983 if (real_mz <= 0 || real_intens <= 0)
1987 real_mz = h_iter->getMZ();
1988 real_intens = h_iter->getIntensity();
1992 double c_score = scoreThis_(candidate, peak_cutoff, real_mz,
c, 0);
2001 typename MSSpectrum::const_iterator real_r_MZ_iter = ref.
MZBegin(real_l_MZ_iter, real_mz + mz_cutoff / (
c + 1.), ref.end());
2002 if (real_r_MZ_iter == ref.end())
2008 UInt real_mz_begin = distance(ref.begin(), real_l_MZ_iter);
2009 UInt real_mz_end = distance(ref.begin(), real_r_MZ_iter);
2011 if (prev_score == -1000)
2013 push2Box_(real_mz, scan_index,
c, prev_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2017 push2Box_(real_mz, scan_index,
c, c_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2022 template <
typename PeakType>
2024 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)
2026 typename MSSpectrum::const_iterator iter, ref_iter;
2030 iter = candidate.
MZBegin(seed_mz);
2032 if (iter == candidate.
begin() || iter == candidate.
end())
2037 std::pair<double, double> reals;
2038 ref_iter = ref.
MZBegin(seed_mz);
2040 double real_mz, real_intens;
2043 reals = checkPPMTheoModel_(ref, iter->getMZ(),
c);
2044 real_mz = reals.first; real_intens = reals.second;
2047 auto h_iter = ref_iter, hc_iter = ref_iter;
2048 while (h_iter != ref.begin())
2051 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
2066 reals = checkPPMTheoModel_(ref, h_iter->getMZ(),
c);
2067 real_mz = reals.first; real_intens = reals.second;
2069 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
2070 std::cout <<
"Plausibility check old_mz: " << iter->getMZ() <<
"\t" << real_mz << std::endl;
2073 if (real_mz <= 0 || real_intens <= 0)
2077 real_mz = h_iter->getMZ();
2078 real_intens = h_iter->getIntensity();
2083 reals = std::pair<double, double>(seed_mz, ref_iter->getIntensity());
2084 real_mz = reals.first; real_intens = reals.second;
2086 if (real_mz <= 0 || real_intens <= 0)
2088 auto h_iter = ref_iter, hc_iter = ref_iter;
2089 while (h_iter != ref.begin())
2092 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
2106 real_mz = h_iter->getMZ(); real_intens = h_iter->getIntensity();
2107 if (real_mz <= 0 || real_intens <= 0)
2111 real_mz = h_iter->getMZ();
2112 real_intens = h_iter->getIntensity();
2116 double c_score = scoreThis_(candidate, peak_cutoff, real_mz,
c, 0);
2125 typename MSSpectrum::const_iterator real_r_MZ_iter = ref.
MZBegin(real_l_MZ_iter, real_mz + mz_cutoff / (
c + 1.), ref.end());
2126 if (real_r_MZ_iter == ref.end())
2132 UInt real_mz_begin = distance(ref.begin(), real_l_MZ_iter);
2133 UInt real_mz_end = distance(ref.begin(), real_r_MZ_iter);
2135 if (prev_score == -1000)
2137 push2Box_(real_mz, scan_index,
c, prev_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2141 push2Box_(real_mz, scan_index,
c, c_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2147 template <
typename PeakType>
2151 double ppms = getPPMs_(peptideMassRule_(mass), mass);
2154 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
2155 std::cout << ::std::setprecision(8) << std::fixed << c_mz <<
"\t =(" <<
"ISO_WAVE" <<
")> " <<
"REJECT \t" << ppms <<
" (rule: " << peptideMassRule_(mass) <<
" got: " << mass <<
")" << std::endl;
2157 return std::pair<double, double>(-1, -1);
2160 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
2161 std::cout << ::std::setprecision(8) << std::fixed << c_mz <<
"\t =(" <<
"ISO_WAVE" <<
")> " <<
"ACCEPT \t" << ppms <<
" (rule: " << peptideMassRule_(mass) <<
" got: " << mass <<
")" << std::endl;
2163 return std::pair<double, double>(c_mz, ref.
MZBegin(c_mz)->getIntensity());
2168 #pragma clang diagnostic pop
void setCharge(const ChargeType &ch)
Set charge state.
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:222
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:70
Iterator begin()
See std::vector documentation.
Definition: ConstRefVector.h:397
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:719
Iterator end()
See std::vector documentation.
Definition: ConstRefVector.h:403
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:106
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 run.
Definition: MSExperiment.h:73
Iterator begin()
Definition: MSExperiment.h:150
Size size() const
Definition: MSExperiment.h:120
void clear(bool clear_meta_data)
Clears all data and meta data.
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
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)
Sets data point intensity (height)
Definition: Peak2D.h:172
A more convenient string class.
Definition: String.h:60
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:120
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:497
bool intensityPointerComparator(PeakType *a, PeakType *b)
Definition: IsotopeWaveletTransform.h:509
bool positionComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:515
bool intensityAscendingComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:503