libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::masschroq::JsonInput Class Reference

#include <jsoninput.h>

Public Member Functions

 JsonInput (pappso::UiMonitorInterface &ui_monitor, const QString &tmp_dir_name, const QJsonDocument &json_doc)
 
 ~JsonInput ()
 
void action (CborOutputStream &cbor_output)
 

Private Member Functions

const QJsonValue documentFind (const QString &key1, const QString &key2) const
 
void readMzDataFiles ()
 
void readAlignmentMethodSp ()
 
void readQuantificationMethodSp ()
 
void readProjectParameters ()
 
void read_protein_list ()
 
void read_peptide_list ()
 
void read_msrun_peptide_observations ()
 
void readAction (CborOutputStream &cbor_output)
 
void computeIsotopologues (double ni_ratio)
 

Private Attributes

const QJsonDocument & m_jsonDocument
 
const QString & m_tmpDirName
 
pappso::UiMonitorInterfacem_uiMonitor
 
std::map< QString, MsRunPeptideListSpm_msfileList
 
AlignmentMethodSp msp_alignmentMethod
 
QuantificationMethodSp msp_quantificationMethod
 
std::map< QString, ProteinSpm_proteinMap
 
std::vector< PeptideSpm_peptideStore
 
std::map< QString, PeptideSpm_peptideMap
 
std::map< QString, MsRunGroupSpm_msRunGroupSpList
 
std::shared_ptr< pappso::IonMobilityGridmsp_ionMobilityGrid
 
pappso::ProjectParameters m_projectParameters
 
bool m_isMatchBetweenRun = true
 

Detailed Description

Todo
write docs

Definition at line 46 of file jsoninput.h.

Constructor & Destructor Documentation

◆ JsonInput()

pappso::masschroq::JsonInput::JsonInput ( pappso::UiMonitorInterface & ui_monitor,
const QString & tmp_dir_name,
const QJsonDocument & json_doc )

Default constructor

Definition at line 42 of file jsoninput.cpp.

45 : m_jsonDocument(json_doc), m_tmpDirName(tmp_dir_name), m_uiMonitor(ui_monitor)
46{
47}
const QJsonDocument & m_jsonDocument
Definition jsoninput.h:77
const QString & m_tmpDirName
Definition jsoninput.h:78
pappso::UiMonitorInterface & m_uiMonitor
Definition jsoninput.h:79

References m_jsonDocument, m_tmpDirName, and m_uiMonitor.

◆ ~JsonInput()

pappso::masschroq::JsonInput::~JsonInput ( )

Destructor

Definition at line 49 of file jsoninput.cpp.

50{
51}

Member Function Documentation

◆ action()

void pappso::masschroq::JsonInput::action ( CborOutputStream & cbor_output)

Definition at line 54 of file jsoninput.cpp.

55{
60 cbor_output.writeActionBegin("quantification");
61
62
64
65 // QJsonDocument doc;
66 // doc.setObject(params);
67 // qDebug() << doc.toJson();
68 m_isMatchBetweenRun = msp_quantificationMethod.get()->getMatchBetweenRun();
69
70 pappso::ProjectParam param({pappso::ProjectParamCategory::quantification, "", QVariant()});
71
72
73 param.name = "mcq_version";
75 m_projectParameters.setProjectParam(param);
76
77 m_projectParameters.merge(msp_alignmentMethod.get()->getProjectParameters());
78 m_projectParameters.merge(msp_quantificationMethod.get()->getProjectParameters());
79
80 cbor_output.writeProjectParameters(m_projectParameters);
81
82 qDebug();
83
84 QJsonObject methods = m_jsonDocument.object().value("masschroq_methods").toObject();
85 cbor_output.writeJsonObject("masschroq_methods", methods);
86
87 cbor_output.getCborStreamWriter().append("identification_data");
88 cbor_output.getCborStreamWriter().startMap();
89 QJsonObject msrun_list = documentFind("identification_data", "msrun_list").toObject();
90 cbor_output.writeJsonObject("msrun_list", msrun_list);
91 QJsonObject protein_list = documentFind("identification_data", "protein_list").toObject();
92 cbor_output.writeJsonObject("protein_list", protein_list);
93 QJsonObject peptide_list = documentFind("identification_data", "peptide_list").toObject();
94 cbor_output.writeJsonObject("peptide_list", peptide_list);
95 QJsonObject msrunpeptide_list =
96 documentFind("identification_data", "msrunpeptide_list").toObject();
97 cbor_output.writeJsonObject("msrunpeptide_list", msrunpeptide_list);
98 cbor_output.getCborStreamWriter().endMap();
99
100 qDebug();
103
104 QJsonObject actions = m_jsonDocument.object().value("actions").toObject();
105 cbor_output.writeJsonObject("actions", actions);
106
107 readAction(cbor_output);
108}
void readAction(CborOutputStream &cbor_output)
pappso::ProjectParameters m_projectParameters
Definition jsoninput.h:92
AlignmentMethodSp msp_alignmentMethod
Definition jsoninput.h:83
QuantificationMethodSp msp_quantificationMethod
Definition jsoninput.h:84
const QJsonValue documentFind(const QString &key1, const QString &key2) const
static QString getVersion()
Definition utils.cpp:37

References documentFind(), pappso::masschroq::CborOutputStream::getCborStreamWriter(), pappso::masschroq::Utils::getVersion(), m_isMatchBetweenRun, m_jsonDocument, m_projectParameters, msp_alignmentMethod, msp_quantificationMethod, pappso::ProjectParam::name, pappso::quantification, read_msrun_peptide_observations(), read_peptide_list(), read_protein_list(), readAction(), readAlignmentMethodSp(), readMzDataFiles(), readProjectParameters(), readQuantificationMethodSp(), pappso::masschroq::CborOutputStream::writeActionBegin(), pappso::masschroq::CborOutputStream::writeJsonObject(), and pappso::masschroq::CborOutputStream::writeProjectParameters().

◆ computeIsotopologues()

void pappso::masschroq::JsonInput::computeIsotopologues ( double ni_ratio)
private

Definition at line 469 of file jsoninput.cpp.

470{
471 if(ni_min_abundance > 0)
472 { /*
473 for(auto &peptide_sp : m_peptideStore)
474 {
475 peptide_sp.get()->computeIsotopologues(ni_min_abundance);
476 }*/
477 std::function<void(const pappso::masschroq::PeptideSp &)> mapComputeIsotopologues =
478 [ni_min_abundance](const pappso::masschroq::PeptideSp &peptide_sp) {
479 peptide_sp.get()->computeIsotopologues(ni_min_abundance);
480 };
481
482
483 QFuture<void> res = QtConcurrent::map<std::vector<pappso::masschroq::PeptideSp>::iterator>(
484 m_peptideStore.begin(), m_peptideStore.end(), mapComputeIsotopologues);
485 m_uiMonitor.appendText(QObject::tr("Computing isotopologues %1").arg(ni_min_abundance));
486 res.waitForFinished();
487
488 m_uiMonitor.appendText("Computing isotopologues OK");
489 }
490}
std::vector< PeptideSp > m_peptideStore
Definition jsoninput.h:86
std::shared_ptr< Peptide > PeptideSp
Definition peptide.h:46

References m_peptideStore, and m_uiMonitor.

Referenced by readAction().

◆ documentFind()

const QJsonValue pappso::masschroq::JsonInput::documentFind ( const QString & key1,
const QString & key2 ) const
private

Definition at line 111 of file jsoninput.cpp.

112{
113 QJsonObject obj1 = m_jsonDocument.object();
114 auto it1 = obj1.find(key1);
115 if(it1 != obj1.end())
116 {
117 QJsonObject obj2 = it1.value().toObject();
118 auto it2 = obj2.find(key2);
119 if(it2 != obj2.end())
120 {
121 return it2.value();
122 }
123 else
124 {
125 throw pappso::ExceptionNotFound(
126 QObject::tr("key2 %1 not found in json document element %2").arg(key2).arg(key1));
127 }
128 }
129 else
130 {
131 throw pappso::ExceptionNotFound(QObject::tr("key1 %1 not found in json document").arg(key1));
132 }
133}

References m_jsonDocument.

Referenced by action(), read_msrun_peptide_observations(), read_peptide_list(), read_protein_list(), readAction(), readAlignmentMethodSp(), readMzDataFiles(), and readQuantificationMethodSp().

◆ read_msrun_peptide_observations()

void pappso::masschroq::JsonInput::read_msrun_peptide_observations ( )
private

Definition at line 372 of file jsoninput.cpp.

373{
374 qDebug();
375 const QJsonObject msrunpeptide_list(
376 documentFind("identification_data", "msrunpeptide_list").toObject());
377 auto it = msrunpeptide_list.begin();
378 while(it != msrunpeptide_list.end())
379 {
380 qDebug() << it.key();
381 QJsonObject jmsrun_peptidelist_object = it.value().toObject();
382 auto it_peptide_obs = jmsrun_peptidelist_object.find("peptide_obs");
383 if(it_peptide_obs == jmsrun_peptidelist_object.end())
384 {
385 throw pappso::ExceptionNotFound(
386 QObject::tr("peptide_obs not found in msrunpeptide_list %1").arg(it.key()));
387 }
388 QJsonObject json_msrunobs = it_peptide_obs->toObject();
389 auto it_msrun = m_msfileList.find(it.key());
390 if(it_msrun == m_msfileList.end())
391 {
392 throw pappso::ExceptionNotFound(QObject::tr("msrun %1 not found").arg(it.key()));
393 }
394 pappso::masschroq::MsRunPeptideListSp msrunpep_sp = it_msrun->second;
395
396 auto itpep = json_msrunobs.begin();
397 while(itpep != json_msrunobs.end())
398 {
399 qDebug() << itpep.key();
400 QJsonArray json_obs_list = itpep.value().toArray();
401 auto it_pepmap = m_peptideMap.find(itpep.key());
402 if(it_pepmap == m_peptideMap.end())
403 {
404 throw pappso::ExceptionNotFound(QObject::tr("peptide %1 not found").arg(itpep.key()));
405 }
406 pappso::masschroq::PeptideSp peptide_sp = it_pepmap->second;
407 qDebug() << "json_obs_list.size()=" << json_obs_list.size();
408 for(auto json_obs_value : json_obs_list)
409 {
410 QJsonObject observation = json_obs_value.toObject();
411 qint64 scan = observation.value("scan").toInteger();
412 qint64 index = observation.value("index").toInteger();
413 QString label = observation.value("label").toString();
414 std::uint8_t charge =
415 observation.value("precursor").toObject().value("charge").toInt();
416 try
417 {
418 pappso::masschroq::PeptideLabel *p_label = nullptr;
419 if(!label.isEmpty())
420 {
421 p_label = peptide_sp.get()->getPeptideLabelPtr(label);
422 }
423 if(scan == 0)
424 {
425 msrunpep_sp.get()->addPeptideSpectrumIndexObservation(
426 peptide_sp, p_label, index, charge);
427 }
428 else
429 {
430
431 msrunpep_sp.get()->addPeptideScanNumberObservation(
432 peptide_sp, p_label, scan, charge);
433 }
434
435 peptide_sp.get()->addObservedChargeState(charge);
436 peptide_sp.get()->addObservedInMsRunSp(msrunpep_sp.get()->getMsRunSp());
437 }
438 catch(pappso::PappsoException &err)
439 {
440 throw pappso::PappsoException(
441 QObject::tr("error reading peptide %1 observation scan %2 "
442 "index %3 : %4")
443 .arg(itpep.key())
444 .arg(scan)
445 .arg(index)
446 .arg(err.qwhat()));
447 }
448 }
449
450
451 if(msp_ionMobilityGrid.get() != nullptr)
452 {
453 if(peptide_sp.get() != nullptr)
454 {
455 peptide_sp.get()->populateIonMobilityGrid(msp_ionMobilityGrid.get());
456 }
457 }
458
459
460 itpep++;
461 }
462
463 it++;
464 }
465 qDebug();
466}
virtual const QString & qwhat() const
std::map< QString, PeptideSp > m_peptideMap
Definition jsoninput.h:87
std::map< QString, MsRunPeptideListSp > m_msfileList
Definition jsoninput.h:82
std::shared_ptr< pappso::IonMobilityGrid > msp_ionMobilityGrid
Definition jsoninput.h:90
std::shared_ptr< MsRunPeptideList > MsRunPeptideListSp

References pappso::masschroq::Peptide::addObservedChargeState(), pappso::masschroq::Peptide::addObservedInMsRunSp(), pappso::masschroq::MsRunPeptideList::addPeptideScanNumberObservation(), pappso::masschroq::MsRunPeptideList::addPeptideSpectrumIndexObservation(), documentFind(), pappso::masschroq::MsRunPeptideList::getMsRunSp(), pappso::masschroq::Peptide::getPeptideLabelPtr(), m_msfileList, m_peptideMap, msp_ionMobilityGrid, pappso::masschroq::Peptide::populateIonMobilityGrid(), and pappso::PappsoException::qwhat().

Referenced by action().

◆ read_peptide_list()

void pappso::masschroq::JsonInput::read_peptide_list ( )
private

create a new peptide object and set its description

Definition at line 305 of file jsoninput.cpp.

306{
307
308
309 const QJsonObject peptide_list(documentFind("identification_data", "peptide_list").toObject());
310 //<protein desc="conta|P02769|ALBU_BOVIN SERUM ALBUMIN PRECURSOR."
311 // id="P1.1" />
312
313 auto it = peptide_list.begin();
314 while(it != peptide_list.end())
315 {
316 qDebug() << it.key();
317 qDebug() << it.value().toObject().value("proforma");
318
319 /// create a new peptide object and set its description
321 try
322 {
323
324 std::vector<pappso::masschroq::ProteinSp> protein_list;
325 for(auto prot_id : it.value().toObject().value("proteins").toArray())
326 {
327 auto it = m_proteinMap.find(prot_id.toString());
328 if(it != m_proteinMap.end())
329 {
330 protein_list.push_back(it->second);
331 }
332 else
333 {
334 throw pappso::ExceptionNotFound(
335 QObject::tr("protein id %1 not found").arg(prot_id.toString()));
336 }
337 }
338
339
340 peptide_sp = std::make_shared<pappso::masschroq::Peptide>(
341 it.key(),
343 it.value().toObject().value("proforma").toString()),
344 protein_list);
345 m_peptideStore.push_back(peptide_sp);
346 peptide_sp.get()->setMods(it.value().toObject().value("mods").toString());
347 m_peptideMap.insert({peptide_sp.get()->getId(), peptide_sp});
348
349 qDebug();
350 QJsonObject json_label_list = it.value().toObject().value("label_list").toObject();
351
352 qDebug();
353 if(!json_label_list.isEmpty())
354 {
355 qDebug();
356 peptide_sp.get()->setJsonLabelList(json_label_list);
357 qDebug();
358 }
359 }
360 catch(pappso::PappsoException &error)
361 {
362 throw pappso::ExceptionNotFound(
363 QObject::tr("problem creating protein :\n%1").arg(it.key()));
364 }
365 it++;
366 }
367
368 qDebug();
369}
static PeptideSp parseString(const QString &pepstr)
std::map< QString, ProteinSp > m_proteinMap
Definition jsoninput.h:85

References documentFind(), pappso::masschroq::Peptide::getId(), m_peptideMap, m_peptideStore, m_proteinMap, pappso::PeptideProFormaParser::parseString(), pappso::masschroq::Peptide::setJsonLabelList(), and pappso::masschroq::Peptide::setMods().

Referenced by action().

◆ read_protein_list()

void pappso::masschroq::JsonInput::read_protein_list ( )
private

create a new Protein object and set its description

add this protein to _p_proteins (: map<id, Protein *>)

Definition at line 272 of file jsoninput.cpp.

273{
274
275
276 const QJsonObject protein_list(documentFind("identification_data", "protein_list").toObject());
277 //<protein desc="conta|P02769|ALBU_BOVIN SERUM ALBUMIN PRECURSOR."
278 // id="P1.1" />
279
280 auto it = protein_list.begin();
281 while(it != protein_list.end())
282 {
283 qDebug() << it.key();
284 qDebug() << it.value().toObject().value("description");
285
286 /// create a new Protein object and set its description
288 try
289 {
290 p_protein = std::make_shared<pappso::masschroq::Protein>(
291 it.key(), it.value().toObject().value("description").toString());
292 }
293 catch(pappso::PappsoException &error)
294 {
295 throw pappso::ExceptionNotFound(
296 QObject::tr("problem creating protein :\n%1").arg(it.key()));
297 }
298 /// add this protein to _p_proteins (: map<id, Protein *>)
299 m_proteinMap.insert({p_protein.get()->getId(), p_protein});
300 it++;
301 }
302}
std::shared_ptr< Protein > ProteinSp
Definition protein.h:39

References documentFind(), pappso::masschroq::Protein::getId(), and m_proteinMap.

Referenced by action().

◆ readAction()

void pappso::masschroq::JsonInput::readAction ( CborOutputStream & cbor_output)
private

Definition at line 494 of file jsoninput.cpp.

495{
496 const QJsonObject group_list(documentFind("actions", "group_list").toObject());
497
498 auto it_group = group_list.begin();
499 while(it_group != group_list.end())
500 {
501 QString id = it_group.key();
502 QJsonArray json_msrun_list = it_group.value().toArray();
503 std::vector<pappso::masschroq::MsRunPeptideListSp> msrun_list;
504 for(auto json_msrun : json_msrun_list)
505 {
506
507 auto it_msrun = m_msfileList.find(json_msrun.toString());
508 if(it_msrun == m_msfileList.end())
509 {
510 throw pappso::ExceptionNotFound(
511 QObject::tr("msrun %1 not found").arg(json_msrun.toString()));
512 }
513 msrun_list.push_back(it_msrun->second);
514 }
515
516 m_msRunGroupSpList.insert({id, std::make_shared<MsRunGroup>(id, msrun_list)});
517 it_group++;
518 }
519
520
521 QJsonObject align_list;
522 try
523 {
524 align_list = documentFind("actions", "align_group").toObject();
525 }
526 catch(const pappso::ExceptionNotFound &notfound)
527 {
528 }
529 if(!align_list.isEmpty())
530 {
531 cbor_output.getCborStreamWriter().append("alignment_data");
532 cbor_output.getCborStreamWriter().startArray();
533
534 std::size_t count_q = 1;
535 QStringList group_keys = align_list.keys();
536 for(auto group_id : group_keys)
537 {
538 auto itgroup = m_msRunGroupSpList.find(group_id);
539 if(itgroup == m_msRunGroupSpList.end())
540 {
541 throw pappso::ExceptionNotFound(QObject::tr("group id %1 not found").arg(group_id));
542 }
543 else
544 {
545 QString ref_id =
546 align_list.value(group_id).toObject().value("alignment_reference").toString();
547 if(!ref_id.isEmpty())
548 {
549 itgroup->second.get()->setAlignmentMethodSp(msp_alignmentMethod, ref_id);
550 }
551 itgroup->second.get()->setIonMobilityGridSp(msp_ionMobilityGrid);
552 itgroup->second.get()->align(cbor_output, QString("a%1").arg(count_q), m_uiMonitor);
553 }
554 count_q++;
555 }
556 cbor_output.getCborStreamWriter().endArray();
557 }
558
559 QVariant quantify_all;
560 try
561 {
562 quantify_all = documentFind("actions", "quantify_all").toVariant();
563 }
564 catch(const pappso::ExceptionNotFound &notfound)
565 {
566 }
567 if(!quantify_all.isNull())
568 {
569 if(quantify_all.toBool())
570 {
571 double ni_ratio = msp_quantificationMethod.get()->getIsotopeMinimumRatio();
572 computeIsotopologues(ni_ratio);
573 std::size_t count_q = 1;
574 cbor_output.getCborStreamWriter().append("quantification_data");
575 cbor_output.getCborStreamWriter().startArray();
576 for(auto &pair_group : m_msRunGroupSpList)
577 {
578 pair_group.second.get()->setIonMobilityGridSp(msp_ionMobilityGrid);
579 pair_group.second.get()->quantify(cbor_output,
580 QString("q%1").arg(count_q),
585 }
586
587 cbor_output.getCborStreamWriter().endArray();
588 count_q++;
589 }
590 }
591}
std::map< QString, MsRunGroupSp > m_msRunGroupSpList
Definition jsoninput.h:88
void computeIsotopologues(double ni_ratio)

References computeIsotopologues(), documentFind(), pappso::masschroq::CborOutputStream::getCborStreamWriter(), m_msfileList, m_msRunGroupSpList, m_peptideStore, m_tmpDirName, m_uiMonitor, msp_alignmentMethod, msp_ionMobilityGrid, and msp_quantificationMethod.

Referenced by action().

◆ readAlignmentMethodSp()

void pappso::masschroq::JsonInput::readAlignmentMethodSp ( )
private

Definition at line 239 of file jsoninput.cpp.

240{
241 msp_alignmentMethod = std::make_shared<pappso::masschroq::AlignmentMethod>("align1");
242
243 msp_alignmentMethod.get()->setJsonObject(
244 documentFind("masschroq_methods", "alignment_method").toObject());
245}

References documentFind(), and msp_alignmentMethod.

Referenced by action().

◆ readMzDataFiles()

void pappso::masschroq::JsonInput::readMzDataFiles ( )
private

Definition at line 137 of file jsoninput.cpp.

138{
139 qDebug();
140 std::map<QString, QString> msfilepathlist;
141 const QJsonObject msrun_list(documentFind("identification_data", "msrun_list").toObject());
142 auto it = msrun_list.begin();
143 while(it != msrun_list.end())
144 {
145 qDebug() << it.key();
146 qDebug() << it.value().toObject().value("file");
147 //<data_file id="samp0" format="mzxml" path="bsa1.mzXML"
148 // type="profile" />
149 msfilepathlist.insert({it.key(), it.value().toObject().value("file").toString()});
150 it++;
151 }
152
153
154 qDebug();
155 std::function<pappso::masschroq::MsRunPeptideListSp(const std::pair<QString, QString> &)>
156 mapFilenameList = [](const std::pair<QString, QString> &mapit) {
157 pappso::MsFileAccessor file_access(mapit.second, mapit.first);
158 file_access.setPreferredFileReaderType(Enums::MsDataFormat::brukerTims,
160
161 std::vector<pappso::MsRunIdCstSPtr> msrunid_list = file_access.getMsRunIds();
162
163
164 if(file_access.getFileFormat() == Enums::MsDataFormat::unknown)
165 {
166 throw pappso::ExceptionNotRecognized("MS data file format not recognized");
167 }
168 if(msrunid_list.size() == 0)
169 {
170 throw pappso::PappsoException("msrunid_list.size() == 0");
171 }
172
173
174 pappso::MsRunReaderSPtr run_reader = file_access.getMsRunReaderSPtrByRunId("", mapit.first);
175 run_reader.get()->setMonoThread(true);
176 pappso::masschroq::MsRunSp msrun = std::make_shared<pappso::masschroq::MsRun>(run_reader);
177 run_reader.get()->releaseDevice();
178 run_reader.get()->setMonoThread(false);
179 return std::make_shared<pappso::masschroq::MsRunPeptideList>(msrun);
180 };
181
182 qDebug();
183
184 m_uiMonitor.appendText(QObject::tr("reading %1 msruns").arg(msfilepathlist.size()));
185
186
187 pappso::UiMonitorInterface *local_monitor = &m_uiMonitor;
188 std::map<QString, pappso::masschroq::MsRunPeptideListSp> *p_localPtrOnmsrunpeptidelist =
190
191 std::function<void(std::size_t, const pappso::masschroq::MsRunPeptideListSp)> reduce_function =
192 [local_monitor, p_localPtrOnmsrunpeptidelist](
193 std::size_t result, const pappso::masschroq::MsRunPeptideListSp msrun) {
194 local_monitor->setStatus(QObject::tr("MS run '%1' from file %2: added ")
195 .arg(msrun.get()
196 ->getMsRunSp()
197 .get()
198 ->getMsRunReaderSPtr()
199 .get()
200 ->getMsRunId()
201 .get()
202 ->getXmlId())
203 .arg(msrun.get()
204 ->getMsRunSp()
205 .get()
206 ->getMsRunReaderSPtr()
207 .get()
208 ->getMsRunId()
209 .get()
210 ->getFileName()));
211
212 p_localPtrOnmsrunpeptidelist->insert({msrun.get()
213 ->getMsRunSp()
214 .get()
215 ->getMsRunReaderSPtr()
216 .get()
217 ->getMsRunId()
218 .get()
219 ->getXmlId(),
220 msrun});
221 result++;
222 };
223
224 QFuture<std::size_t> res = QtConcurrent::mappedReduced<std::size_t>(msfilepathlist.begin(),
225 msfilepathlist.end(),
226 mapFilenameList,
227 reduce_function,
228 QtConcurrent::OrderedReduce);
229 res.waitForFinished();
230
231 if(m_msfileList.begin()->second.get()->getMsRunSp().get()->hasTimsTofMobilityIndex())
232 {
233 m_uiMonitor.appendText("ion mobility grid enabled");
234 msp_ionMobilityGrid = std::make_shared<pappso::IonMobilityGrid>();
235 }
236}
virtual void setStatus(const QString &status)=0
current status of the process
@ unknown
unknown format
Definition types.h:151
std::shared_ptr< MsRun > MsRunSp
Definition msrun.h:44
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition msrunreader.h:57

References pappso::Enums::brukerTims, documentFind(), pappso::MsFileAccessor::getFileFormat(), pappso::MsFileAccessor::getMsRunIds(), pappso::MsFileAccessor::getMsRunReaderSPtrByRunId(), m_msfileList, m_uiMonitor, msp_ionMobilityGrid, pappso::MsFileAccessor::setPreferredFileReaderType(), pappso::UiMonitorInterface::setStatus(), pappso::Enums::tims_ms2, and pappso::Enums::unknown.

Referenced by action().

◆ readProjectParameters()

void pappso::masschroq::JsonInput::readProjectParameters ( )
private

Definition at line 594 of file jsoninput.cpp.

595{
596
597 QJsonObject params = m_jsonDocument.object().value("project_parameters").toObject();
598
599 pappso::ProjectParameters parameters(params);
600 m_projectParameters.merge(parameters);
601}

References m_jsonDocument, and m_projectParameters.

Referenced by action().

◆ readQuantificationMethodSp()

void pappso::masschroq::JsonInput::readQuantificationMethodSp ( )
private

Definition at line 248 of file jsoninput.cpp.

249{
250 msp_quantificationMethod = std::make_shared<pappso::masschroq::QuantificationMethod>("qm1");
251
252
253 msp_quantificationMethod.get()->setJsonObject(
254 documentFind("masschroq_methods", "quantification_method").toObject());
255
256 /*
257 "quantification_method": {
258 "detection": {
259 "type": "zivy",
260 "meanfilter": 1,
261 "minmax": 3,
262 "maxmin": 2,
263 "threshold_on_max": 5000,
264 "threshold_on_min": 3000,
265 }
266 }
267 */
268}

References documentFind(), and msp_quantificationMethod.

Referenced by action().

Member Data Documentation

◆ m_isMatchBetweenRun

bool pappso::masschroq::JsonInput::m_isMatchBetweenRun = true
private

Definition at line 94 of file jsoninput.h.

Referenced by action().

◆ m_jsonDocument

const QJsonDocument& pappso::masschroq::JsonInput::m_jsonDocument
private

Definition at line 77 of file jsoninput.h.

Referenced by JsonInput(), action(), documentFind(), and readProjectParameters().

◆ m_msfileList

std::map<QString, MsRunPeptideListSp> pappso::masschroq::JsonInput::m_msfileList
private

Definition at line 82 of file jsoninput.h.

Referenced by read_msrun_peptide_observations(), readAction(), and readMzDataFiles().

◆ m_msRunGroupSpList

std::map<QString, MsRunGroupSp> pappso::masschroq::JsonInput::m_msRunGroupSpList
private

Definition at line 88 of file jsoninput.h.

Referenced by readAction().

◆ m_peptideMap

std::map<QString, PeptideSp> pappso::masschroq::JsonInput::m_peptideMap
private

Definition at line 87 of file jsoninput.h.

Referenced by read_msrun_peptide_observations(), and read_peptide_list().

◆ m_peptideStore

std::vector<PeptideSp> pappso::masschroq::JsonInput::m_peptideStore
private

Definition at line 86 of file jsoninput.h.

Referenced by computeIsotopologues(), read_peptide_list(), and readAction().

◆ m_projectParameters

pappso::ProjectParameters pappso::masschroq::JsonInput::m_projectParameters
private

Definition at line 92 of file jsoninput.h.

Referenced by action(), and readProjectParameters().

◆ m_proteinMap

std::map<QString, ProteinSp> pappso::masschroq::JsonInput::m_proteinMap
private

Definition at line 85 of file jsoninput.h.

Referenced by read_peptide_list(), and read_protein_list().

◆ m_tmpDirName

const QString& pappso::masschroq::JsonInput::m_tmpDirName
private

Definition at line 78 of file jsoninput.h.

Referenced by JsonInput(), and readAction().

◆ m_uiMonitor

pappso::UiMonitorInterface& pappso::masschroq::JsonInput::m_uiMonitor
private

Definition at line 79 of file jsoninput.h.

Referenced by JsonInput(), computeIsotopologues(), readAction(), and readMzDataFiles().

◆ msp_alignmentMethod

AlignmentMethodSp pappso::masschroq::JsonInput::msp_alignmentMethod
private

Definition at line 83 of file jsoninput.h.

Referenced by action(), readAction(), and readAlignmentMethodSp().

◆ msp_ionMobilityGrid

std::shared_ptr<pappso::IonMobilityGrid> pappso::masschroq::JsonInput::msp_ionMobilityGrid
private

Definition at line 90 of file jsoninput.h.

Referenced by read_msrun_peptide_observations(), readAction(), and readMzDataFiles().

◆ msp_quantificationMethod

QuantificationMethodSp pappso::masschroq::JsonInput::msp_quantificationMethod
private

Definition at line 84 of file jsoninput.h.

Referenced by action(), readAction(), and readQuantificationMethodSp().


The documentation for this class was generated from the following files: