100 if(!keys().contains(
"id"))
104 if(keys().contains(
"psm_list"))
108 int precursor_charge = qualified_mass_spectrum.get()->getPrecursorCharge();
110 QCborArray new_psm_arr;
111 for(QCborValue cbor_psm : value(
"psm_list").toArray())
113 QCborMap cbor_psm_map = cbor_psm.toMap();
115 qDebug() <<
"PsmIonSeriesScan::process cbor_psm_map.keys() " << cbor_psm_map.keys();
116 if(!cbor_psm_map.keys().contains(
"proforma"))
119 QObject::tr(
"missing proforma in psm %1").arg(cbor_psm_map.keys().size()));
123 qDebug() << peptide_sp.get()->toString();
125 *(qualified_mass_spectrum.get()->getMassSpectrumSPtr().get()),
142 std::map<pappso::Enums::PeptideIon, std::vector<data_plot>> ion_map;
147 data_plot one_ion_match;
148 one_ion_match.charge = (int)peakion_match.getCharge();
149 one_ion_match.isotope_number =
150 (int)peakion_match.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber();
151 one_ion_match.isotope_rank =
152 (int)peakion_match.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeRank();
153 one_ion_match.mz_th =
154 peakion_match.getPeptideNaturalIsotopeAverageSp().get()->getMz();
155 one_ion_match.point = peakion_match.getPeak();
156 one_ion_match.size = (int)peakion_match.getPeptideFragmentIonSp().get()->size();
158 auto it = ion_map.insert({peakion_match.getPeptideIonType(), {}});
159 it.first->second.push_back(one_ion_match);
162 QCborMap cbor_psm_props_peptide;
163 cbor_psm_props_peptide.insert(QString(
"mz"), peptide_sp.get()->getMz(precursor_charge));
164 cbor_psm_props_peptide.insert(QString(
"mh"), peptide_sp.get()->getMz(1));
166 QCborMap cbor_psm_props_ion_series;
167 for(
auto &cle_valeur : ion_map)
169 std::vector<data_plot> ¤t_vector = cle_valeur.second;
172 current_vector.begin(),
173 current_vector.end(),
174 [](
const data_plot &
a,
const data_plot &
b) { return a.point.x < b.point.x; });
175 QCborArray current_ion_json_arr;
177 for(
const data_plot &one_point : current_vector)
179 QCborMap current_ion;
180 current_ion.insert(QString(
"mz"), one_point.point.x);
181 current_ion.insert(QString(
"mzth"), one_point.mz_th);
182 current_ion.insert(QString(
"intensity"), one_point.point.y);
183 current_ion.insert(QString(
"size"), one_point.size);
184 current_ion.insert(QString(
"charge"), one_point.charge);
185 current_ion.insert(QString(
"isotope"), one_point.isotope_number);
186 current_ion.insert(QString(
"rank"), one_point.isotope_rank);
188 current_ion_json_arr.push_back(current_ion);
192 current_ion_json_arr);
196 QCborMap cbor_psm_props;
197 if(cbor_psm_map.keys().contains(
"props"))
199 cbor_psm_props = cbor_psm_map.value(
"props").toMap();
201 cbor_psm_props.remove(QString(
"peptide"));
202 cbor_psm_props.insert(QString(
"peptide"), cbor_psm_props_peptide);
204 cbor_psm_props.remove(QString(
"ion-series"));
205 cbor_psm_props.insert(QString(
"ion-series"), cbor_psm_props_ion_series);
206 cbor_psm_map.remove(QString(
"props"));
207 cbor_psm_map.insert(QString(
"props"), cbor_psm_props);
209 QCborValue copy_eval = cbor_psm_map.value(
"eval");
210 cbor_psm_map.remove(QString(
"eval"));
211 cbor_psm_map.insert(QString(
"eval"), copy_eval);
213 qDebug() <<
"PsmIonSeriesScan::process cbor_psm_map.keys() " << cbor_psm_map.keys();
214 new_psm_arr.push_back(cbor_psm_map);
219 insert(QString(
"psm_list"), new_psm_arr);