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);
259 #ifdef OPENMS_HAS_CUDA 262 virtual int initializeScanCuda(
const MSSpectrum& scan,
const UInt c = 0);
265 virtual void finalizeScanCuda();
288 const double ampl_cutoff,
const bool check_PPMs);
303 const UInt RT_votes_cutoff,
const Int front_bound = -1,
const Int end_bound = -1);
324 inline double getLinearInterpolation(
const typename MSSpectrum::const_iterator& left_iter,
const double mz_pos,
const typename MSSpectrum::const_iterator& right_iter)
326 return left_iter->getIntensity() + (right_iter->getIntensity() - left_iter->getIntensity()) / (right_iter->getMZ() - left_iter->getMZ()) * (mz_pos - left_iter->getMZ());
335 inline double getLinearInterpolation(
const double mz_a,
const double intens_a,
const double mz_pos,
const double mz_b,
const double intens_b)
337 return intens_a + (intens_b - intens_a) / (mz_b - mz_a) * (mz_pos - mz_a);
379 virtual double scoreThis_(
const TransSpectrum& candidate,
const UInt peak_cutoff,
380 const double seed_mz,
const UInt c,
const double ampl_cutoff);
389 const double seed_mz,
const UInt c,
const double ampl_cutoff);
400 const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score);
410 const UInt c,
const UInt scan_index,
const bool check_PPMs,
const double transintens,
const double prev_score);
436 const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end,
const double ref_intens);
454 const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end);
469 const UInt scan_index,
const UInt c,
const bool check_PPMs);
476 const UInt scan_index,
const UInt c,
const bool check_PPMs);
490 double old_frac_mass = c_mass - (
Int)(c_mass);
492 double new_frac_mass = new_mass - (
Int)(new_mass);
494 if (new_frac_mass - old_frac_mass > 0.5)
499 if (new_frac_mass - old_frac_mass < -0.5)
510 inline double getPPMs_(
const double mass_a,
const double mass_b)
const 512 return fabs(mass_a - mass_b) / (0.5 * (mass_a + mass_b)) * 1e6;
534 template <
typename PeakType>
540 template <
typename PeakType>
546 template <
typename PeakType>
552 template <
typename PeakType>
558 template <
typename PeakType>
561 tmp_boxes_ =
new std::vector<std::multimap<double, Box> >(1);
565 max_num_peaks_per_pattern_ = 3;
570 template <
typename PeakType>
573 max_charge_ = max_charge;
574 max_scan_size_ = max_scan_size;
576 intenstype_ = intenstype;
577 tmp_boxes_ =
new std::vector<std::multimap<double, Box> >(max_charge);
578 if (max_scan_size <= 0)
587 Int size_estimate((
Int)ceil(max_scan_size_ / (max_mz - min_mz)));
589 psi_.reserve(to_reserve);
590 prod_.reserve(to_reserve);
591 xs_.reserve(to_reserve);
596 template <
typename PeakType>
602 template <
typename PeakType>
605 Int spec_size((
Int)c_ref.size());
609 double value, T_boundary_left, T_boundary_right, old, c_diff, current, old_pos, my_local_MZ, my_local_lambda, origin, c_mz;
611 for (
Int my_local_pos = 0; my_local_pos < spec_size; ++my_local_pos)
614 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_;
619 for (
Int current_conv_pos = std::max(0, my_local_pos - from_max_to_left_); c_diff < T_boundary_right; ++current_conv_pos)
621 if (current_conv_pos >= spec_size)
623 value += 0.5 * old * min_spacing_;
627 c_mz = c_ref[current_conv_pos].getMZ();
628 c_diff = c_mz + origin;
631 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;
633 value += 0.5 * (current + old) * (c_mz - old_pos);
641 c_trans[my_local_pos].setIntensity(value);
645 template <
typename PeakType>
648 Int spec_size((
Int)c_ref.size());
652 double value, T_boundary_left, T_boundary_right, c_diff, current, my_local_MZ, my_local_lambda, origin, c_mz;
654 for (
Int my_local_pos = 0; my_local_pos < spec_size; ++my_local_pos)
663 for (
Int current_conv_pos = std::max(0, my_local_pos - from_max_to_left_); c_diff < T_boundary_right; ++current_conv_pos)
665 if (current_conv_pos >= spec_size)
670 c_mz = c_ref[current_conv_pos].getMZ();
671 c_diff = c_mz + origin;
674 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;
679 c_trans[my_local_pos].setIntensity(value);
683 template <
typename PeakType>
686 data_length_ = (
UInt) c_ref.size();
687 computeMinSpacing(c_ref);
688 Int wavelet_length = 0, quarter_length = 0;
693 typename MSSpectrum::const_iterator start_iter, end_iter;
694 for (
UInt i = 0; i < data_length_; ++i)
697 start_iter = c_ref.
MZEnd(c_ref[i].getMZ());
698 end_iter = c_ref.
MZBegin(c_ref[i].getMZ() + c_mz_cutoff);
699 wavelet_length = std::max((
SignedSize) wavelet_length, distance(start_iter, end_iter) + 1);
701 quarter_length = std::max((
SignedSize) quarter_length, distance(end_iter, start_iter) + 1);
708 wavelet_length = (
UInt) ceil(max_mz_cutoff_ / min_spacing_);
713 if (wavelet_length > (
Int) c_ref.size())
715 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;
716 std::cout <<
"Minimal spacing: " << min_spacing_ << std::endl;
717 std::cout <<
"Warning/Error generated at scan with RT " << c_ref.
getRT() <<
"." << std::endl;
721 from_max_to_left_ = max_index;
722 from_max_to_right_ = wavelet_length - 1 - from_max_to_left_;
725 template <
typename PeakType>
728 min_spacing_ = INT_MAX;
729 for (
UInt c_conv_pos = 1; c_conv_pos < c_ref.size(); ++c_conv_pos)
731 min_spacing_ = std::min(min_spacing_, c_ref[c_conv_pos].getMZ() - c_ref[c_conv_pos - 1].getMZ());
735 template <
typename PeakType>
737 const MSSpectrum& ref,
const UInt scan_index,
const UInt c,
const double ampl_cutoff,
const bool check_PPMs)
739 Size scan_size(candidates.size());
741 typename MSSpectrum::const_iterator iter_start, iter_end, iter_p, seed_iter, iter2;
742 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;
743 UInt MZ_start, MZ_end;
746 diffed[0].setIntensity(0); diffed[scan_size - 1].setIntensity(0);
748 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 749 std::stringstream stream;
750 stream <<
"diffed_" << ref.
getRT() <<
"_" <<
c + 1 <<
".trans\0";
751 std::ofstream ofile(stream.str().c_str());
756 for (
UInt i = 0; i < scan_size - 2; ++i)
758 share = candidates[i + 1].getIntensity(), share_pos = candidates[i + 1].getMZ();
759 bwd = (share - candidates[i].getIntensity()) / (share_pos - candidates[i].getMZ());
760 fwd = (candidates[i + 2].getIntensity() - share) / (candidates[i + 2].getMZ() - share_pos);
762 if (!(bwd >= 0 && fwd <= 0) || share > ref[i + 1].getIntensity())
764 diffed[i + 1].setIntensity(0);
767 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 768 ofile << diffed[i + 1].getMZ() <<
"\t" << diffed[i + 1].getIntensity() << std::endl;
774 for (
UInt i = 0; i < scan_size - 2; ++i)
776 share = candidates[i + 1].getIntensity(), share_pos = candidates[i + 1].getMZ();
777 bwd = (share - candidates[i].getIntensity()) / (share_pos - candidates[i].getMZ());
778 fwd = (candidates[i + 2].getIntensity() - share) / (candidates[i + 2].getMZ() - share_pos);
780 if (!(bwd >= 0 && fwd <= 0))
782 diffed[i + 1].setIntensity(0);
785 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 786 ofile << diffed[i + 1].getMZ() <<
"\t" << diffed[i + 1].getIntensity() << std::endl;
790 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 799 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 800 std::stringstream stream2;
801 stream2 <<
"sorted_cpu_" << candidates.
getRT() <<
"_" <<
c + 1 <<
".trans\0";
802 std::ofstream ofile2(stream2.str().c_str());
803 for (iter = c_sorted_candidate.end() - 1; iter != c_sorted_candidate.begin(); --iter)
805 ofile2 << iter->getMZ() <<
"\t" << iter->getIntensity() << std::endl;
810 std::vector<UInt> processed(scan_size, 0);
818 c_av_intens = getAvIntens_(candidates);
819 c_sd_intens = getSdIntens_(candidates, c_av_intens);
820 threshold = ampl_cutoff * c_sd_intens + c_av_intens;
823 for (iter = c_sorted_candidate.end() - 1; iter != c_sorted_candidate.begin(); --iter)
825 if (iter->getIntensity() <= 0)
830 seed_mz = iter->getMZ();
831 seed_iter = ref.
MZBegin(seed_mz);
833 if (seed_iter == ref.end() || processed[distance(ref.begin(), seed_iter)])
844 iter_end = ref.
MZEnd(seed_iter, seed_mz + mz_cutoff / (
c + 1.), ref.end());
845 if (iter_end == ref.end())
850 MZ_start = distance(ref.begin(), iter_start);
851 MZ_end = distance(ref.begin(), iter_end);
853 memset(&(processed[MZ_start]), 1,
sizeof(
UInt) * (MZ_end - MZ_start + 1));
857 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 858 if (trunc(seed_mz) == 874)
859 std::cout << seed_mz <<
"\t" << c_score << std::endl;
862 if (c_score <= 0 && c_score != -1000)
869 push2TmpBox_(seed_mz, scan_index,
c, c_score, iter->getIntensity(), ref.
getRT(), MZ_start, MZ_end);
872 iter2 = candidates.
MZBegin(help_mz);
873 if (iter2 == candidates.end() || iter2 == candidates.begin())
881 if (iter2 != candidates.end())
883 push2TmpBox_(iter2->getMZ(), scan_index,
c, 0, getLinearInterpolation(iter2 - 1, help_mz, iter2), ref.
getRT(), MZ_start, MZ_end);
888 iter2 = candidates.
MZBegin(help_mz);
889 if (iter2 == candidates.end() || iter2 == candidates.begin())
897 if (iter2 != candidates.end())
899 push2TmpBox_(iter2->getMZ(), scan_index,
c, 0, getLinearInterpolation(iter2 - 1, help_mz, iter2), ref.
getRT(), MZ_start, MZ_end);
904 clusterSeeds_(candidates, ref, scan_index,
c, check_PPMs);
907 template <
typename PeakType>
909 const UInt peak_cutoff,
const double seed_mz,
const UInt c,
const double ampl_cutoff)
911 double c_score = 0, c_val;
912 typename MSSpectrum::const_iterator c_left_iter2, c_right_iter2;
913 Int signal_size((
Int)candidate.size());
918 Int p_h_ind = 1, end = 4 * (peak_cutoff - 1) - 1;
920 std::vector<double> positions(end);
921 for (
Int i = 0; i < end; ++i)
926 double l_score = 0, mid_val = 0;
927 Int start_index = distance(candidate.begin(), candidate.
MZBegin(positions[0])) - 1;
928 for (
Int v = 1; v <= end; ++v, ++p_h_ind)
932 if (start_index < signal_size - 1)
937 while (candidate[start_index].getMZ() < positions[v - 1]);
939 if (start_index <= 0 || start_index >= signal_size - 1)
944 c_left_iter2 = candidate.begin() + start_index - 1;
945 c_right_iter2 = c_left_iter2 + 1;
947 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());
949 if (v == (
int)(ceil(end / 2.)))
955 if (p_h_ind % 2 == 1)
958 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 959 if (trunc(seed_mz) == 874)
960 std::cout << -c_val << std::endl;
966 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 967 if (trunc(seed_mz) == 874)
968 std::cout << c_val << std::endl;
973 start_index = distance(candidate.begin(), c_left_iter2);
976 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 977 std::ofstream ofile_score(
"scores.dat", ios::app);
978 std::ofstream ofile_check_score(
"check_scores.dat", ios::app);
980 ofile_check_score.close();
983 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 984 if (trunc(seed_mz) == 874)
985 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;
988 if (c_score - mid_val <= 0)
993 if (c_score - mid_val <= ampl_cutoff)
998 if (l_score <= 0 || c_score - l_score - mid_val <= 0)
1006 template <
typename PeakType>
1008 const UInt peak_cutoff,
const double seed_mz,
const UInt c,
const double ampl_cutoff)
1010 double c_score = 0, c_val;
1011 typename MSSpectrum::const_iterator c_left_iter2, c_right_iter2;
1015 Int p_h_ind = 1, end = 4 * (peak_cutoff - 1) - 1;
1017 std::vector<double> positions(end);
1018 for (
Int i = 0; i < end; ++i)
1023 double l_score = 0, mid_val = 0;
1024 Int start_index = distance(candidate.
begin(), candidate.
MZBegin(positions[0])) - 1;
1025 for (
Int v = 1; v <= end; ++v, ++p_h_ind)
1029 if (start_index < signal_size - 1)
1034 while (candidate.
getMZ(start_index) < positions[v - 1]);
1036 if (start_index <= 0 || start_index >= signal_size - 1)
1041 c_left_iter2 = candidate.
begin() + start_index - 1;
1042 c_right_iter2 = c_left_iter2 + 1;
1045 if (v == (
int)(ceil(end / 2.)))
1051 if (p_h_ind % 2 == 1)
1060 start_index = distance(candidate.
begin(), c_left_iter2);
1063 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1064 std::ofstream ofile_score(
"scores.dat", ios::app);
1065 std::ofstream ofile_check_score(
"check_scores.dat", ios::app);
1066 ofile_score << c_check_point <<
"\t" << c_score << std::endl;
1067 ofile_score.close();
1068 ofile_check_score.close();
1071 if (l_score <= 0 || c_score - l_score - mid_val <= 0 || c_score - mid_val <= ampl_cutoff)
1079 template <
typename PeakType>
1083 typename std::multimap<double, Box>::iterator iter;
1084 typename Box::iterator box_iter;
1085 std::vector<BoxElement> final_box;
1086 double c_mz, av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1087 double virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1089 typename std::pair<double, double> c_extend;
1090 for (iter = tmp_boxes_->at(
c).begin(); iter != tmp_boxes_->at(
c).end(); ++iter)
1093 Box& c_box = iter->second;
1094 av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1095 virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1098 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1100 if (box_iter->second.score == 0)
1105 c_mz = box_iter->second.mz;
1106 virtual_av_intens += box_iter->second.intens;
1107 virtual_av_abs_intens += fabs(box_iter->second.intens);
1108 virtual_av_mz += c_mz * fabs(box_iter->second.intens);
1113 c_mz = box_iter->second.mz;
1114 av_score += box_iter->second.score;
1115 av_intens += box_iter->second.intens;
1116 av_abs_intens += fabs(box_iter->second.intens);
1117 av_mz += c_mz * fabs(box_iter->second.intens);
1124 av_intens = virtual_av_intens / virtual_count;
1126 av_mz = virtual_av_mz / virtual_av_abs_intens;
1132 av_mz /= av_abs_intens;
1136 c_box_element.
mz = av_mz;
1137 c_box_element.
c =
c;
1138 c_box_element.
score = av_score;
1139 c_box_element.
intens = av_intens;
1141 c_box_element.
RT = c_box.begin()->second.RT;
1142 final_box.push_back(c_box_element);
1145 Size num_o_feature = final_box.size();
1146 if (num_o_feature == 0)
1148 tmp_boxes_->at(
c).clear();
1153 std::vector<double> bwd_diffs(num_o_feature, 0);
1156 for (
Size i = 1; i < num_o_feature; ++i)
1158 bwd_diffs[i] = (final_box[i].intens - final_box[i - 1].intens) / (final_box[i].mz - final_box[i - 1].mz);
1161 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1162 std::ofstream ofile_bwd(
"bwd_cpu.dat");
1163 for (
Size i = 0; i < num_o_feature; ++i)
1165 ofile_bwd << final_box[i].mz <<
"\t" << bwd_diffs[i] << std::endl;
1171 for (
Size i = 0; i < num_o_feature - 1; ++i)
1173 while (i < num_o_feature - 2)
1175 if (final_box[i].score > 0 || final_box[i].score == -1000)
1180 if (bwd_diffs[i] > 0 && bwd_diffs[i + 1] < 0)
1182 checkPositionForPlausibility_(candidate, ref, final_box[i].mz, final_box[i].
c, scan_index, check_PPMs, final_box[i].intens, final_box[i].score);
1187 tmp_boxes_->at(
c).clear();
1190 template <
typename PeakType>
1193 double av_intens = 0;
1194 for (
UInt i = 0; i < scan.size(); ++i)
1196 if (scan[i].getIntensity() >= 0)
1198 av_intens += scan[i].getIntensity();
1201 return av_intens / (
double)scan.size();
1204 template <
typename PeakType>
1207 double res = 0, intens;
1208 for (
UInt i = 0; i < scan.size(); ++i)
1210 if (scan[i].getIntensity() >= 0)
1212 intens = scan[i].getIntensity();
1213 res += (intens -
mean) * (intens -
mean);
1216 return sqrt(res / (
double)(scan.size() - 1));
1219 template <
typename PeakType>
1222 std::vector<double> diffs(scan.size() - 1, 0);
1223 for (
UInt i = 0; i < scan.size() - 1; ++i)
1225 diffs[i] = scan[i + 1].getMZ() - scan[i].getMZ();
1228 sort(diffs.begin(), diffs.end());
1229 double av_MZ_spacing = 0;
1230 for (
UInt i = 0; i < diffs.size() / 2; ++i)
1232 av_MZ_spacing += diffs[i];
1235 return av_MZ_spacing / (diffs.size() / 2);
1238 template <
typename PeakType>
1241 double av_intens = 0;
1242 for (
UInt i = 0; i < scan.
size(); ++i)
1252 template <
typename PeakType>
1255 double res = 0, intens;
1256 for (
UInt i = 0; i < scan.
size(); ++i)
1261 res += (intens -
mean) * (intens -
mean);
1264 return sqrt(res / (
double)(scan.
size() - 1));
1267 template <
typename PeakType>
1269 const double score,
const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end,
double ref_intens)
1273 typename std::multimap<double, Box>::iterator upper_iter(open_boxes_.upper_bound(mz));
1274 typename std::multimap<double, Box>::iterator lower_iter(open_boxes_.lower_bound(mz));
1276 if (lower_iter != open_boxes_.end())
1279 if (mz != lower_iter->first && lower_iter != open_boxes_.begin())
1285 typename std::multimap<double, Box>::iterator insert_iter;
1286 bool create_new_box =
true;
1287 if (lower_iter == open_boxes_.end())
1292 if (!open_boxes_.empty())
1294 if (fabs((--lower_iter)->first - mz) < dist_constraint)
1296 create_new_box =
false;
1297 insert_iter = lower_iter;
1302 create_new_box =
true;
1307 if (upper_iter == open_boxes_.end() && fabs(lower_iter->first - mz) < dist_constraint)
1309 insert_iter = lower_iter;
1310 create_new_box =
false;
1314 create_new_box =
true;
1319 if (upper_iter != open_boxes_.end() && lower_iter != open_boxes_.end())
1324 double dist_lower = fabs(lower_iter->first - mz);
1325 double dist_upper = fabs(upper_iter->first - mz);
1326 dist_lower = (dist_lower < dist_constraint) ? dist_lower : INT_MAX;
1327 dist_upper = (dist_upper < dist_constraint) ? dist_upper : INT_MAX;
1329 if (dist_lower >= dist_constraint && dist_upper >= dist_constraint)
1331 create_new_box =
true;
1335 insert_iter = (dist_lower < dist_upper) ? lower_iter : upper_iter;
1336 create_new_box =
false;
1345 if (create_new_box ==
false)
1347 std::pair<UInt, BoxElement> help2(scan, element);
1348 insert_iter->second.insert(help2);
1351 Box replacement(insert_iter->second);
1355 double c_mz = insert_iter->first * (insert_iter->second.size() - 1) + mz;
1356 c_mz /= ((
double) insert_iter->second.size());
1359 open_boxes_.erase(insert_iter);
1360 std::pair<double, std::multimap<UInt, BoxElement> > help3(c_mz, replacement);
1361 open_boxes_.insert(help3);
1365 std::pair<UInt, BoxElement> help2(scan, element);
1366 std::multimap<UInt, BoxElement> help3;
1367 help3.insert(help2);
1368 std::pair<double, std::multimap<UInt, BoxElement> > help4(mz, help3);
1369 open_boxes_.insert(help4);
1373 template <
typename PeakType>
1375 const double score,
const double intens,
const double rt,
const UInt MZ_begin,
const UInt MZ_end)
1379 std::multimap<double, Box>& tmp_box(tmp_boxes_->at(
c));
1380 typename std::multimap<double, Box>::iterator upper_iter(tmp_box.upper_bound(mz));
1381 typename std::multimap<double, Box>::iterator lower_iter(tmp_box.lower_bound(mz));
1383 if (lower_iter != tmp_box.end())
1386 if (mz != lower_iter->first && lower_iter != tmp_box.begin())
1392 typename std::multimap<double, Box>::iterator insert_iter;
1393 bool create_new_box =
true;
1394 if (lower_iter == tmp_box.end())
1399 if (!tmp_box.empty())
1401 if (fabs((--lower_iter)->first - mz) < dist_constraint)
1403 create_new_box =
false;
1404 insert_iter = lower_iter;
1409 create_new_box =
true;
1414 if (upper_iter == tmp_box.end() && fabs(lower_iter->first - mz) < dist_constraint)
1416 insert_iter = lower_iter;
1417 create_new_box =
false;
1421 create_new_box =
true;
1426 if (upper_iter != tmp_box.end() && lower_iter != tmp_box.end())
1429 double dist_lower = fabs(lower_iter->first - mz);
1430 double dist_upper = fabs(upper_iter->first - mz);
1431 dist_lower = (dist_lower < dist_constraint) ? dist_lower : INT_MAX;
1432 dist_upper = (dist_upper < dist_constraint) ? dist_upper : INT_MAX;
1434 if (dist_lower >= dist_constraint && dist_upper >= dist_constraint)
1436 create_new_box =
true;
1440 insert_iter = (dist_lower < dist_upper) ? lower_iter : upper_iter;
1441 create_new_box =
false;
1449 if (create_new_box ==
false)
1451 std::pair<UInt, BoxElement> help2(scan, element);
1452 insert_iter->second.insert(help2);
1455 Box replacement(insert_iter->second);
1459 double c_mz = insert_iter->first * (insert_iter->second.size() - 1) + mz;
1460 c_mz /= ((
double) insert_iter->second.size());
1463 tmp_box.erase(insert_iter);
1464 std::pair<double, std::multimap<UInt, BoxElement> > help3(c_mz, replacement);
1465 tmp_box.insert(help3);
1469 std::pair<UInt, BoxElement> help2(scan, element);
1470 std::multimap<UInt, BoxElement> help3;
1471 help3.insert(help2);
1473 std::pair<double, std::multimap<UInt, BoxElement> > help4(mz, help3);
1474 tmp_box.insert(help4);
1478 template <
typename PeakType>
1480 const UInt RT_votes_cutoff,
const Int front_bound,
const Int end_bound)
1482 typename std::multimap<double, Box>::iterator iter, iter2;
1484 if ((
Int)scan_index == end_bound && end_bound != (
Int)map.
size() - 1)
1486 for (iter = open_boxes_.begin(); iter != open_boxes_.end(); ++iter)
1488 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1489 std::cout <<
"LOW THREAD insert in end_box " << iter->first << std::endl;
1490 typename Box::iterator dings;
1491 for (dings = iter->second.begin(); dings != iter->second.end(); ++dings)
1492 std::cout << map[dings->first].getRT() <<
"\t" << dings->second.c + 1 << std::endl;
1494 end_boxes_.insert(*iter);
1496 open_boxes_.
clear();
1500 for (iter = open_boxes_.begin(); iter != open_boxes_.end(); )
1502 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1503 if (front_bound > 0)
1505 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;
1510 UInt lastScan = (--(iter->second.end()))->first;
1511 if (scan_index - lastScan > RT_interleave + 1 || scan_index == map.
size() - 1)
1513 if (iter->second.begin()->first - front_bound <= RT_interleave + 1 && front_bound > 0)
1517 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1518 std::cout <<
"HIGH THREAD insert in front_box " << iter->first << std::endl;
1520 front_boxes_.insert(*iter);
1521 open_boxes_.erase(iter);
1531 if (iter->second.size() >= RT_votes_cutoff)
1535 closed_boxes_.insert(*(--iter));
1537 open_boxes_.erase(iter);
1547 template <
typename PeakType>
1550 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1551 std::cout <<
"**** CHECKING FOR BOX EXTENSIONS ****" << std::endl;
1555 typename Box::const_iterator iter;
1556 std::vector<double> elution_profile(box.size());
1558 for (iter = box.begin(); iter != box.end(); ++iter, ++index)
1560 for (
Size i = iter->second.MZ_begin; i != iter->second.MZ_end; ++i)
1562 elution_profile[index] += map[iter->second.RT_index][i].getIntensity();
1564 elution_profile[index] /= iter->second.MZ_end - iter->second.MZ_begin + 1.;
1568 Int max_index = INT_MIN;
1569 for (
Size i = 0; i < elution_profile.size(); ++i)
1571 if (elution_profile[i] > max)
1574 max = elution_profile[i];
1578 Int max_extension = (
Int)(elution_profile.size()) - 2 * max_index;
1580 double av_elution = 0;
1581 for (
Size i = 0; i < elution_profile.size(); ++i)
1583 av_elution += elution_profile[i];
1585 av_elution /= (
double)elution_profile.size();
1587 double sd_elution = 0;
1588 for (
Size i = 0; i < elution_profile.size(); ++i)
1590 sd_elution += (av_elution - elution_profile[i]) * (av_elution - elution_profile[i]);
1592 sd_elution /= (
double)(elution_profile.size() - 1);
1593 sd_elution = sqrt(sd_elution);
1597 for (iter = box.begin(); iter != box.end(); ++iter, ++index)
1599 av_mz += iter->second.mz;
1600 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1601 std::cout << iter->second.RT <<
"\t" << iter->second.mz <<
"\t" << iter->second.c + 1 << std::endl;
1604 av_mz /= (
double)box.size();
1608 if ((
Int)(box.begin()->second.RT_index) - 1 < 0)
1613 UInt pre_index = box.begin()->second.RT_index - 1;
1614 typename MSSpectrum::const_iterator c_iter = map[pre_index].MZBegin(av_mz);
1615 double pre_elution = 0;
1617 double mz_start = map[pre_index + 1][box.begin()->second.MZ_begin].getMZ();
1618 double mz_end = map[pre_index + 1][box.begin()->second.MZ_end].getMZ();
1620 typename MSSpectrum::const_iterator mz_start_iter = map[pre_index].MZBegin(mz_start), mz_end_iter = map[pre_index].MZBegin(mz_end);
1621 for (
typename MSSpectrum::const_iterator mz_iter = mz_start_iter; mz_iter != mz_end_iter; ++mz_iter)
1623 pre_elution += mz_iter->getIntensity();
1628 if (pre_elution <= av_elution - 2 * sd_elution)
1633 Int c_index = max_extension;
1634 Int first_index = box.begin()->second.RT_index;
1635 for (
Int i = 1; i < max_extension; ++i)
1637 c_index = first_index - i;
1644 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1645 std::cout << box.begin()->second.RT <<
"\t" << av_mz <<
"\t" << box.begin()->second.c + 1 <<
"\t" <<
" extending the box " << std::endl;
1648 push2Box_(av_mz, c_index, box.begin()->second.c, box.begin()->second.score, c_iter->getIntensity(),
1649 map[c_index].getRT(), box.
begin()->second.MZ_begin, box.begin()->second.MZ_end);
1653 template <
typename PeakType>
1657 typename std::multimap<double, Box>::iterator iter;
1658 typename Box::iterator box_iter;
1659 std::vector<BoxElement> final_box;
1660 double c_mz, av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1661 double virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1663 typename std::pair<double, double> c_extend;
1664 for (iter = tmp_boxes_->at(
c).begin(); iter != tmp_boxes_->at(
c).end(); ++iter)
1666 Box& c_box = iter->second;
1667 av_score = 0, av_mz = 0, av_intens = 0, av_abs_intens = 0, count = 0;
1668 virtual_av_mz = 0, virtual_av_intens = 0, virtual_av_abs_intens = 0, virtual_count = 0;
1670 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1672 if (box_iter->second.score == 0)
1677 c_mz = box_iter->second.mz;
1678 virtual_av_intens += box_iter->second.intens;
1679 virtual_av_abs_intens += fabs(box_iter->second.intens);
1680 virtual_av_mz += c_mz * fabs(box_iter->second.intens);
1685 c_mz = box_iter->second.mz;
1686 av_score += box_iter->second.score;
1687 av_intens += box_iter->second.intens;
1688 av_abs_intens += fabs(box_iter->second.intens);
1689 av_mz += c_mz * fabs(box_iter->second.intens);
1696 av_intens = virtual_av_intens / virtual_count;
1698 av_mz = virtual_av_mz / virtual_av_abs_intens;
1704 av_mz /= av_abs_intens;
1708 c_box_element.
mz = av_mz;
1709 c_box_element.
c =
c;
1710 c_box_element.
score = av_score;
1711 c_box_element.
intens = av_intens;
1713 c_box_element.
RT = c_box.begin()->second.RT;
1715 final_box.push_back(c_box_element);
1718 UInt num_o_feature = final_box.size();
1719 if (num_o_feature == 0)
1721 tmp_boxes_->at(
c).clear();
1726 std::vector<double> bwd_diffs(num_o_feature, 0);
1729 for (
UInt i = 1; i < num_o_feature; ++i)
1731 bwd_diffs[i] = (final_box[i].intens - final_box[i - 1].intens) / (final_box[i].mz - final_box[i - 1].mz);
1734 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1735 std::ofstream ofile_bwd(
"bwd_gpu.dat");
1736 for (
UInt i = 0; i < num_o_feature; ++i)
1738 ofile_bwd << final_box[i].mz <<
"\t" << bwd_diffs[i] << std::endl;
1743 for (
UInt i = 0; i < num_o_feature - 1; ++i)
1745 while (i < num_o_feature - 2)
1747 if (final_box[i].score > 0 || final_box[i].score == -1000)
1752 if (bwd_diffs[i] > 0 && bwd_diffs[i + 1] < 0)
1754 checkPositionForPlausibility_(candidates, ref, final_box[i].mz, final_box[i].
c, scan_index, check_PPMs, final_box[i].intens, final_box[i].score);
1759 tmp_boxes_->at(
c).clear();
1762 template <
typename PeakType>
1766 typename std::multimap<double, Box>::iterator iter;
1767 typename Box::iterator box_iter;
1768 UInt best_charge_index;
double best_charge_score, c_mz, c_RT;
UInt c_charge;
1769 double av_intens = 0, av_ref_intens = 0, av_score = 0, av_mz = 0, av_RT = 0, mz_cutoff, sum_of_ref_intenses_g;
1770 bool restart =
false;
1772 typename std::pair<double, double> c_extend;
1773 for (iter = closed_boxes_.begin(); iter != closed_boxes_.end(); ++iter)
1775 sum_of_ref_intenses_g = 0;
1776 Box& c_box = iter->second;
1777 std::vector<double> charge_votes(max_charge_, 0), charge_binary_votes(max_charge_, 0);
1782 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1784 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1785 if (trunc(box_iter->second.mz) == 874)
1786 std::cout << box_iter->second.c <<
"\t" << box_iter->second.intens <<
"\t" << box_iter->second.score << std::endl;
1789 if (box_iter->second.score == -1000)
1795 charge_votes[box_iter->second.c] += box_iter->second.intens;
1796 ++charge_binary_votes[box_iter->second.c];
1805 best_charge_index = 0; best_charge_score = 0;
1806 for (
UInt i = 0; i < max_charge_; ++i)
1808 if (charge_votes[i] > best_charge_score)
1810 best_charge_index = i;
1811 best_charge_score = charge_votes[i];
1816 if (charge_binary_votes[best_charge_index] < RT_votes_cutoff && RT_votes_cutoff <= map.
size())
1821 c_charge = best_charge_index + 1;
1823 av_intens = 0, av_ref_intens = 0, av_score = 0, av_mz = 0, av_RT = 0;
1825 std::vector<DPosition<2> > point_set;
1826 double sum_of_ref_intenses_l;
1827 for (box_iter = c_box.begin(); box_iter != c_box.end(); ++box_iter)
1829 sum_of_ref_intenses_l = 0;
1830 c_mz = box_iter->second.mz;
1831 c_RT = box_iter->second.RT;
1837 point_set.push_back(
DPosition<2>(c_RT, c_mz + mz_cutoff / (
double)c_charge));
1839 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1840 std::cout <<
"Intenstype: " << intenstype_ << std::endl;
1842 if (intenstype_ ==
"ref")
1845 const MSSpectrum& c_spec(map[box_iter->second.RT_index]);
1847 for (
unsigned int i = 0; i < mz_cutoff; ++i)
1853 while (h_iter != c_spec.begin())
1856 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1857 if (trunc(c_mz) == 874)
1859 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;
1864 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1874 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1875 if (trunc(c_mz) == 874)
1880 sum_of_ref_intenses_l += hc_iter->getIntensity();
1881 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1882 if (trunc(c_mz) == 874)
1884 std::cout << sum_of_ref_intenses_l <<
"********" << std::endl;
1890 if (best_charge_index == box_iter->second.c)
1892 av_score += box_iter->second.score;
1893 av_intens += box_iter->second.intens;
1894 av_ref_intens += box_iter->second.ref_intens;
1895 sum_of_ref_intenses_g += sum_of_ref_intenses_l;
1896 av_mz += c_mz * box_iter->second.intens;
1902 av_ref_intens /= (
double)charge_binary_votes[best_charge_index];
1903 av_score /= (
double)charge_binary_votes[best_charge_index];
1904 av_RT /= (
double)c_box.size();
1906 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1907 if (trunc(av_mz) == 874)
1908 std::cout << av_mz <<
"\t" << best_charge_index <<
"\t" << best_charge_score << std::endl;
1915 c_feature.
setConvexHulls(std::vector<ConvexHull2D>(1, c_conv_hull));
1918 if (intenstype_ ==
"corrected")
1921 av_intens /= exp(-2 * lambda) * boost::math::cyl_bessel_i(0, 2 * lambda);
1923 if (intenstype_ ==
"ref")
1925 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 1926 if (trunc(c_mz) == 874)
1928 std::cout << sum_of_ref_intenses_g <<
"####" << std::endl;
1932 av_intens = sum_of_ref_intenses_g;
1935 c_feature.
setMZ(av_mz);
1937 c_feature.
setRT(av_RT);
1939 feature_map.push_back(c_feature);
1945 template <
typename PeakType>
1947 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)
1949 typename MSSpectrum::const_iterator iter, ref_iter;
1953 iter = candidate.
MZBegin(seed_mz);
1955 if (iter == candidate.begin() || iter == candidate.end())
1960 std::pair<double, double> reals;
1961 ref_iter = ref.
MZBegin(seed_mz);
1963 double real_mz, real_intens;
1966 reals = checkPPMTheoModel_(ref, iter->getMZ(),
c);
1967 real_mz = reals.first, real_intens = reals.second;
1970 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
1971 while (h_iter != ref.begin())
1974 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
1988 reals = checkPPMTheoModel_(ref, h_iter->getMZ(),
c);
1989 real_mz = reals.first, real_intens = reals.second;
1990 if (real_mz <= 0 || real_intens <= 0)
1994 real_mz = h_iter->getMZ();
1995 real_intens = h_iter->getIntensity();
2000 reals = std::pair<double, double>(seed_mz, ref_iter->getIntensity());
2001 real_mz = reals.first, real_intens = reals.second;
2003 if (real_mz <= 0 || real_intens <= 0)
2005 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
2006 while (h_iter != ref.begin())
2009 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
2023 real_mz = h_iter->getMZ(), real_intens = h_iter->getIntensity();
2024 if (real_mz <= 0 || real_intens <= 0)
2028 real_mz = h_iter->getMZ();
2029 real_intens = h_iter->getIntensity();
2033 double c_score = scoreThis_(candidate, peak_cutoff, real_mz,
c, 0);
2042 typename MSSpectrum::const_iterator real_r_MZ_iter = ref.
MZBegin(real_l_MZ_iter, real_mz + mz_cutoff / (
c + 1.), ref.end());
2043 if (real_r_MZ_iter == ref.end())
2049 UInt real_mz_begin = distance(ref.begin(), real_l_MZ_iter);
2050 UInt real_mz_end = distance(ref.begin(), real_r_MZ_iter);
2052 if (prev_score == -1000)
2054 push2Box_(real_mz, scan_index,
c, prev_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2058 push2Box_(real_mz, scan_index,
c, c_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2063 template <
typename PeakType>
2065 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)
2067 typename MSSpectrum::const_iterator iter, ref_iter;
2071 iter = candidate.
MZBegin(seed_mz);
2073 if (iter == candidate.
begin() || iter == candidate.
end())
2078 std::pair<double, double> reals;
2079 ref_iter = ref.
MZBegin(seed_mz);
2081 double real_mz, real_intens;
2084 reals = checkPPMTheoModel_(ref, iter->getMZ(),
c);
2085 real_mz = reals.first, real_intens = reals.second;
2088 typename MSSpectrum::const_iterator 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))
2107 reals = checkPPMTheoModel_(ref, h_iter->getMZ(),
c);
2108 real_mz = reals.first, real_intens = reals.second;
2110 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 2111 std::cout <<
"Plausibility check old_mz: " << iter->getMZ() <<
"\t" << real_mz << std::endl;
2114 if (real_mz <= 0 || real_intens <= 0)
2118 real_mz = h_iter->getMZ();
2119 real_intens = h_iter->getIntensity();
2124 reals = std::pair<double, double>(seed_mz, ref_iter->getIntensity());
2125 real_mz = reals.first, real_intens = reals.second;
2127 if (real_mz <= 0 || real_intens <= 0)
2129 typename MSSpectrum::const_iterator h_iter = ref_iter, hc_iter = ref_iter;
2130 while (h_iter != ref.begin())
2133 if (h_iter->getIntensity() > hc_iter->getIntensity() || (h_iter->getIntensity() == hc_iter->getIntensity() && hc_iter->getIntensity() == 0))
2147 real_mz = h_iter->getMZ(), real_intens = h_iter->getIntensity();
2148 if (real_mz <= 0 || real_intens <= 0)
2152 real_mz = h_iter->getMZ();
2153 real_intens = h_iter->getIntensity();
2157 double c_score = scoreThis_(candidate, peak_cutoff, real_mz,
c, 0);
2166 typename MSSpectrum::const_iterator real_r_MZ_iter = ref.
MZBegin(real_l_MZ_iter, real_mz + mz_cutoff / (
c + 1.), ref.end());
2167 if (real_r_MZ_iter == ref.end())
2173 UInt real_mz_begin = distance(ref.begin(), real_l_MZ_iter);
2174 UInt real_mz_end = distance(ref.begin(), real_r_MZ_iter);
2176 if (prev_score == -1000)
2178 push2Box_(real_mz, scan_index,
c, prev_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2182 push2Box_(real_mz, scan_index,
c, c_score, transintens, ref.
getRT(), real_mz_begin, real_mz_end, real_intens);
2188 template <
typename PeakType>
2192 double ppms = getPPMs_(peptideMassRule_(mass), mass);
2195 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 2196 std::cout << ::std::setprecision(8) << std::fixed << c_mz <<
"\t =(" <<
"ISO_WAVE" <<
")> " <<
"REJECT \t" << ppms <<
" (rule: " << peptideMassRule_(mass) <<
" got: " << mass <<
")" << std::endl;
2198 return std::pair<double, double>(-1, -1);
2201 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET 2202 std::cout << ::std::setprecision(8) << std::fixed << c_mz <<
"\t =(" <<
"ISO_WAVE" <<
")> " <<
"ACCEPT \t" << ppms <<
" (rule: " << peptideMassRule_(mass) <<
" got: " << mass <<
")" << std::endl;
2204 return std::pair<double, double>(c_mz, ref.
MZBegin(c_mz)->getIntensity());
2209 #pragma clang diagnostic pop
A more convenient string class.
Definition: String.h:57
bool intensityPointerComparator(PeakType *a, PeakType *b)
Definition: IsotopeWaveletTransform.h:547
A 2-dimensional raw data point or peak.
Definition: Peak2D.h:54
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
static double getLambdaL(const double m)
Returns the mass-parameter lambda (linear fit).
const double IW_PROTON_MASS
Definition: IsotopeWaveletConstants.h:68
A container for features.
Definition: FeatureMap.h:93
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:751
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Iterator begin()
Definition: MSExperiment.h:157
Iterator MZEnd(CoordinateType mz)
Binary search for peak range end (returns the past-the-end iterator)
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
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, you do not need to call this function. Please use.
Size size() const
Definition: MSExperiment.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
IntensityType getIntensity() const
Definition: Peak2D.h:166
A 2-dimensional hull representation in [counter]clockwise direction - depending on axis labelling...
Definition: ConvexHull2D.h:72
Iterator MZBegin(CoordinateType mz)
Binary search for peak range begin.
static double mean(IteratorType begin, IteratorType end)
Calculates the mean of a range of values.
Definition: StatisticFunctions.h:134
bool intensityComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:535
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
static UInt getNumPeakCutOff(const double mass, const UInt z)
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
An LC-MS feature.
Definition: Feature.h:70
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:241
bool positionComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:553
const double IW_NEUTRON_MASS
Definition: IsotopeWaveletConstants.h:54
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
void setConvexHulls(const std::vector< ConvexHull2D > &hulls)
Set the convex hulls of single mass traces.
const double PEPTIDE_MASS_RULE_BOUND
Definition: IsotopeWaveletConstants.h:50
void setOverallQuality(QualityType q)
Set the overall quality.
static UInt getMzPeakCutOffAtMonoPos(const double mass, const UInt z)
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
bool intensityAscendingComparator(const PeakType &a, const PeakType &b)
Definition: IsotopeWaveletTransform.h:541
void clear(bool clear_meta_data)
Clears all data and meta data.
void setCharge(const ChargeType &ch)
Set charge state.
void addPoints(const PointArrayType &points)
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:70
const double IW_HALF_NEUTRON_MASS
Definition: IsotopeWaveletConstants.h:55
const double PEPTIDE_MASS_RULE_FACTOR
Definition: IsotopeWaveletConstants.h:49
static IsotopeWavelet * init(const double max_m, const UInt max_charge)
int Int
Signed integer type.
Definition: Types.h:102
const double IW_QUARTER_NEUTRON_MASS
Definition: IsotopeWaveletConstants.h:56
const unsigned int DEFAULT_NUM_OF_INTERPOLATION_POINTS
Definition: IsotopeWaveletConstants.h:43
const double PEPTIDE_MASS_RULE_THEO_PPM_BOUND
Definition: IsotopeWaveletConstants.h:51