374{
375 qDebug();
376 const QJsonObject msrunpeptide_list(
377 documentFind(
"identification_data",
"msrunpeptide_list").toObject());
378 auto it = msrunpeptide_list.begin();
379 while(it != msrunpeptide_list.end())
380 {
381 qDebug() << it.key();
382 QJsonObject jmsrun_peptidelist_object = it.value().toObject();
383 auto it_peptide_obs = jmsrun_peptidelist_object.find("peptide_obs");
384 if(it_peptide_obs == jmsrun_peptidelist_object.end())
385 {
387 QObject::tr("peptide_obs not found in msrunpeptide_list %1").arg(it.key()));
388 }
389 QJsonObject json_msrunobs = it_peptide_obs->toObject();
392 {
394 }
396
397 auto itpep = json_msrunobs.begin();
398 while(itpep != json_msrunobs.end())
399 {
400 qDebug() << itpep.key();
401 QJsonArray json_obs_list = itpep.value().toArray();
404 {
406 }
408 qDebug() << "json_obs_list.size()=" << json_obs_list.size();
409 for(auto json_obs_value : json_obs_list)
410 {
411 QJsonObject observation = json_obs_value.toObject();
412 qint64 scan = observation.value("scan").toInteger();
413 qint64 index = observation.value("index").toInteger();
414 QString label = observation.value("label").toString();
415 std::uint8_t charge =
416 observation.value("precursor").toObject().value("charge").toInt();
417 try
418 {
420 if(!label.isEmpty())
421 {
422 p_label = peptide_sp.get()->getPeptideLabelPtr(label);
423 }
424 if(scan == 0)
425 {
426 msrunpep_sp.get()->addPeptideSpectrumIndexObservation(
427 peptide_sp, p_label, index, charge);
428 }
429 else
430 {
431
432 msrunpep_sp.get()->addPeptideScanNumberObservation(
433 peptide_sp, p_label, scan, charge);
434 }
435
436 peptide_sp.get()->addObservedChargeState(charge);
437 peptide_sp.get()->addObservedInMsRunSp(msrunpep_sp.get()->getMsRunSp());
438 }
440 {
442 QObject::tr("error reading peptide %1 observation scan %2 "
443 "index %3 : %4")
444 .arg(itpep.key())
445 .arg(scan)
446 .arg(index)
448 }
449 }
450
451
453 {
454 if(peptide_sp.get() != nullptr)
455 {
457 }
458 }
459
460
461 itpep++;
462 }
463
464 it++;
465 }
466 qDebug();
467}
virtual const QString & qwhat() const
std::shared_ptr< MsRunPeptideList > MsRunPeptideListSp