libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
sagetsvhandler.cpp
Go to the documentation of this file.
1/**
2 * \file input/sage/sagereader.h
3 * \date 21/08/2024
4 * \author Olivier Langella
5 * \brief read data files from Sage output
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2024 Olivier Langella
10 *<Olivier.Langella@universite-paris-saclay.fr>.
11 *
12 * This file is part of i2MassChroQ.
13 *
14 * i2MassChroQ is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * i2MassChroQ is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with i2MassChroQ. If not, see <http://www.gnu.org/licenses/>.
26 *
27 ******************************************************************************/
28
29
30#include "sagetsvhandler.h"
35#include "../../../../peptide/peptideproformaparser.h"
37#include <qregularexpression.h>
38
39
40namespace pappso
41{
42namespace cbor
43{
44namespace psm
45{
46
48 const SageReader &sage_reader,
49 PsmProteinMap &psm_protein_map)
50 : m_sageReader(sage_reader), m_psmProteinMap(psm_protein_map)
51{
52 mp_monitor = p_monitor;
55 m_decoyTag = sage_reader.getDecoyTag();
56}
57
61
62void
64{
65 for(auto it_sample_map : m_sampleMap)
66 {
67 writeSample(it_sample_map.second);
68 }
69}
70
71void
78
79void
83
84void
85SageTsvHandler::setCell(const OdsCell &cell)
86{
87 if(m_lineNumber == 0)
88 {
89 // header
90 QString tag = cell.getStringValue();
91 if(tag == "psm_id")
92 {
94 }
95 else if(tag == "peptide")
96 {
98 }
99 else if(tag == "proteins")
100 {
102 }
103 else if(tag == "protein_groups")
104 {
106 }
107 else if(tag == "num_protein_groups")
108 {
110 }
111 else if(tag == "num_proteins")
112 {
114 }
115 else if(tag == "filename")
116 {
118 }
119 else if(tag == "scannr")
120 {
122 }
123 else if(tag == "rank")
124 {
126 }
127 else if(tag == "label")
128 {
130 }
131 else if(tag == "expmass")
132 {
134 }
135
136 else if(tag == "calcmass")
137 {
139 }
140 else if(tag == "charge")
141 {
143 }
144 else if(tag == "peptide_len")
145 {
147 }
148 else if(tag == "missed_cleavages")
149 {
151 }
152 else if(tag == "semi_enzymatic")
153 {
155 }
156 else if(tag == "isotope_error")
157 {
159 }
160 else if(tag == "precursor_ppm")
161 {
163 }
164 else if(tag == "fragment_ppm")
165 {
167 }
168 else if(tag == "hyperscore")
169 {
171 }
172 else if(tag == "delta_next")
173 {
175 }
176 else if(tag == "delta_best")
177 {
179 }
180 else if(tag == "rt")
181 {
182 m_columnTypeList.push_back(Columns::rt);
183 }
184 else if(tag == "aligned_rt")
185 {
187 }
188 else if(tag == "predicted_rt")
189 {
191 }
192 else if(tag == "delta_rt_model")
193 {
195 }
196 else if(tag == "ion_mobility")
197 {
199 }
200 else if(tag == "predicted_mobility")
201 {
203 }
204 else if(tag == "delta_mobility")
205 {
207 }
208 else if(tag == "matched_peaks")
209 {
211 }
212 else if(tag == "longest_b")
213 {
215 }
216 else if(tag == "longest_y")
217 {
219 }
220 else if(tag == "longest_y_pct")
221 {
223 }
224 else if(tag == "matched_intensity_pct")
225 {
227 }
228 else if(tag == "scored_candidates")
229 {
231 }
232 else if(tag == "poisson")
233 {
235 }
236 else if(tag == "sage_discriminant_score")
237 {
239 }
240 else if(tag == "posterior_error")
241 {
243 }
244 else if(tag == "spectrum_q")
245 {
247 }
248 else if(tag == "peptide_q")
249 {
251 }
252 else if(tag == "protein_q")
253 {
255 }
256 else if(tag == "protein_group_q")
257 {
259 }
260 else if(tag == "ms2_intensity")
261 {
263 }
264 else
265 {
266 throw pappso::ExceptionNotPossible(QObject::tr("column \"%1\" not defined").arg(tag));
267 }
268 }
269 else
270 {
271 if(m_columnNumber >= m_columnTypeList.size())
272 {
274 QObject::tr("the value %1 is out of range").arg(cell.getStringValue()));
275 }
277 switch(column_type)
278 {
279 case Columns::psm_id:
280 break;
282 break;
284 break;
286 break;
287 case Columns::peptide:
288 parsePeptide(cell.toString());
289 break;
291 parseProteins(cell.toString());
292 break;
294 if((std::size_t)cell.getDoubleValue() != (std::size_t)m_proteinList.size())
295 {
297 QObject::tr("column \"num_proteins\"!=%1").arg(m_proteinList.size()));
298 }
299 break;
301 parseMsRunFilename(cell.toString());
302 break;
303 case Columns::scannr:
304 parseScanNrColumn(cell.toString());
305 break;
306 case Columns::rank:
307 m_line.rank = cell.getDoubleValue();
308 break;
309 case Columns::label:
310 m_line.label = cell.getDoubleValue();
311 break;
312 case Columns::expmass:
313 m_line.expmass = cell.getDoubleValue();
314 break;
316 m_line.calcmass = cell.getDoubleValue();
317 break;
318 case Columns::charge:
319 m_line.charge = cell.getDoubleValue();
320 break;
322 m_line.peptide_len = cell.getDoubleValue();
323 break;
325 m_line.missed_cleavages = cell.getDoubleValue();
326 break;
328 m_line.semi_enzymatic = cell.getDoubleValue();
329 break;
331 m_line.isotope_error = cell.getDoubleValue();
332 break;
333
335 m_line.precursor_ppm = cell.getDoubleValue();
336 break;
338 m_line.fragment_ppm = cell.getDoubleValue();
339 break;
341 m_line.hyperscore = cell.getDoubleValue();
342 break;
344 m_line.delta_next = cell.getDoubleValue();
345 break;
347 m_line.delta_best = cell.getDoubleValue();
348 break;
349 case Columns::rt:
350 m_line.rt = cell.getDoubleValue() * 60; // to convert retention time in seconds
351 break;
353 m_line.aligned_rt = cell.getDoubleValue();
354 break;
356 m_line.predicted_rt = cell.getDoubleValue();
357 break;
359 m_line.delta_rt_model = cell.getDoubleValue();
360 break;
362 m_line.ion_mobility = cell.getDoubleValue();
363 break;
365 m_line.predicted_mobility = cell.getDoubleValue();
366 break;
368 m_line.delta_mobility = cell.getDoubleValue();
369 break;
371 m_line.matched_peaks = cell.getDoubleValue();
372 break;
374 m_line.longest_b = cell.getDoubleValue();
375 break;
377 m_line.longest_y = cell.getDoubleValue();
378 break;
380 m_line.longest_y_pct = cell.getDoubleValue();
381 break;
383 m_line.matched_intensity_pct = cell.getDoubleValue();
384 break;
386 m_line.scored_candidates = cell.getDoubleValue();
387 break;
388 case Columns::poisson:
389 m_line.poisson = cell.getDoubleValue();
390 break;
392 m_line.sage_discriminant_score = cell.getDoubleValue();
393 break;
395 m_line.posterior_error = cell.getDoubleValue();
396 break;
398 m_line.spectrum_q = cell.getDoubleValue();
399 break;
401 m_line.peptide_q = cell.getDoubleValue();
402 break;
404 m_line.protein_q = cell.getDoubleValue();
405 break;
407 m_line.ms2_intensity = cell.getDoubleValue();
408 break;
409 default:
410 qDebug() << "m_line.calcmass=" << m_line.calcmass;
412 QObject::tr("column type %1 not implemented").arg((std::uint8_t)column_type));
413 break;
414 }
415
416 /*
417
418 2333 TMISDSDYTEFENFTK
419 GRMZM2G018197_P01;GRMZM2G068952_P01;GRMZM5G822976_P01 3
420 20120906_balliau_extract_1_A01_urnb-1.mzML controllerType=0
421 controllerNumber=1 scan=12542 1 1 1926.8225 1926.8193 2 16 0 0
422 0.0 1.6471838 1.9796097 54.06803492297634 28.049970383419556 0.0 38.192993
423 0.76385987 0.7671368 0.0032769442 0.0 0.0 0.0 16 2 14 0.875 32.54396 380
424 -13.375352220427656 1.1570586 -34.13482 0.00016041065 0.00022231363
425 0.00040124074 1271951.1
426 */
427 }
429}
430
431void
433{
434 m_columnNumber = 0;
435 msp_peptide = nullptr;
436 m_proteinList.clear();
437 m_line = Line();
438}
439
440void
444void
445SageTsvHandler::startSheet(const QString &sheet_name [[maybe_unused]])
446{
447 m_columnNumber = 0;
448 m_lineNumber = 0;
449 mp_monitor->setStatus(QObject::tr("reading Sage TSV file"));
450
452 {
453 throw pappso::ExceptionInterrupted(QObject::tr("Sage TSV data reading process interrupted"));
454 }
455}
456
457void
458SageTsvHandler::parsePeptide(const QString &peptide_str)
459{
460 qDebug();
461 QString peptide_str_verif = peptide_str;
462 // fixed modifications :
464 {
465 qDebug() << modif.strModification;
466 qDebug() << modif.modification->getAccession();
467 peptide_str_verif = peptide_str_verif.replace(
468 modif.strModification, QString("[%1]").arg(modif.modification->getAccession()));
469 }
470 // variable modifications :
472 {
473 qDebug() << modif.strModification;
474 qDebug() << modif.modification->getAccession();
475 peptide_str_verif = peptide_str_verif.replace(
476 modif.strModification, QString("[%1]").arg(modif.modification->getAccession()));
477 }
478
479 qDebug() << peptide_str_verif;
480 // LPMFGC[+57.0216]NDATQVYK
482 qDebug();
483 // variable modifications :
484 /*
485 setVariableModifications(peptide_sp,
486 peptide_line.peptide_string_list.at(6));
487*/
488 qDebug() << msp_peptide.get()->toProForma();
489}
490
491
492void
493SageTsvHandler::parseProteins(const QString &proteins_str)
494{
495 m_proteinList.clear();
496 m_proteinList = proteins_str.split(";");
497 for(QString accession : m_proteinList)
498 {
499
500 PsmProtein psm_protein;
501 psm_protein.protein_sp = std::make_shared<pappso::Protein>(accession, "");
502 psm_protein.isTarget = true;
503 if(accession.startsWith(m_decoyTag))
504 {
505 psm_protein.isTarget = false;
506 }
507
508 m_psmProteinMap.insert(psm_protein);
509 }
510}
511
512bool
513SageTsvHandler::parseScanNrColumn(const QString &spectrum_string_id)
514{
515 m_spectrumNativeId = spectrum_string_id;
516 qDebug() << spectrum_string_id;
517 // controllerType=0 controllerNumber=1 scan=176056
518
519 bool is_ok = false;
520 QStringList scan_list = spectrum_string_id.split("scan=");
521 m_scanNumberIsOk = false;
522 if(scan_list.size() == 2)
523 {
524 // we bet that there is a scan number, easy to parse
525 m_scanNumber = scan_list.at(1).toULongLong(&is_ok);
526 m_scanNumberIsOk = is_ok;
527 if(m_scanNumber > 0)
529 }
530 if(is_ok == false)
531 {
532 ;
533 QStringList scan_list = spectrum_string_id.split(QRegularExpression("[^\\d]"));
534 if(scan_list.size() == 2)
535 {
536 m_scanNumber = scan_list.at(0).toULongLong(&is_ok);
537 m_scanNumberIsOk = is_ok;
538 if(m_scanNumber > 0)
540 }
541 /*
542 if(msp_previousMsrun != msp_msrun)
543 {
544 mp_monitor->setStatus(
545 QObject::tr("Reading mz data file %1").arg(msp_msrun.get()->getFileName()));
546 msp_previousMsrun = msp_msrun;
547 }
548
549 pappso::MsRunReader *msrunreader_p = msp_msrun.get()->getMsRunReaderSPtr().get();
550 if(msrunreader_p->getMsRunId()->getMsDataFormat() == pappso::MsDataFormat::brukerTims)
551 {
552 m_spectrumIndex = spectrum_string_id.toInt() * 2 - 1;
553 }
554 else
555 {
556 m_spectrumIndex =
557 msrunreader_p->spectrumStringIdentifier2SpectrumIndex(spectrum_string_id);
558 }*/
559 }
560
561 qDebug() << spectrum_string_id;
562 return is_ok;
563}
564
565void
566SageTsvHandler::parseMsRunFilename(const QString &msrun_filename)
567{
568
569
570 // find the sample :
571 auto it_insert = m_sampleMap.insert({msrun_filename, {}});
572 mp_currentSample = &(it_insert.first->second);
573 if(it_insert.second)
574 {
575 // new sample
576 it_insert.first->second.name = msrun_filename;
577 QCborMap ms_file;
578 QCborMap identification_file;
579
580 it_insert.first->second.cbor_core_sample.insert(QString("name"),
581 QFileInfo(msrun_filename).baseName());
582
583 // identification_file_list
584 QCborArray identification_file_list;
585 identification_file.insert(QString("name"), m_sageReader.getmJsonAbsoluteFilePath());
586 identification_file_list.push_back(identification_file);
587 it_insert.first->second.cbor_core_sample.insert(QString("identification_file_list"),
588 identification_file_list);
589
590
591 ms_file.insert(QString("name"), m_sageReader.getMzmlPath(msrun_filename));
592 it_insert.first->second.cbor_core_sample.insert(QString("peaklist_file"), ms_file);
593 }
594
595 /*
596 msp_msrun = m_sageReader.getSageFileReader().getMsRunSpWithFileName(msrun_filename);
597 qDebug() << msp_msrun.get()->getFileName();
598
599 msp_identificationSageJsonFileSp =
600 m_sageReader.getSageFileReader().getIdentificationSageJsonFileSpWithFileName(msrun_filename);
601
602 mp_identificationGroup =
603 m_sageReader.getSageFileReader().getIdentificationGroupPtrWithFileName(msrun_filename);
604 qDebug() << msp_msrun.get()->getFileName();
605 */
606}
607
608void
610{
611 qDebug();
612
613 for(const QString &accession : m_proteinList)
614 {
615 PsmProtein psm_protein;
616 psm_protein.protein_sp = std::make_shared<pappso::Protein>(accession, "");
617
618 auto it = m_psmProteinMap.insert(psm_protein);
619 it.first->second.cborEval.insert(QString("protein_q"), m_line.protein_q);
620 }
621 /*
622 PeptideEvidence pe(msp_msrun.get(), m_spectrumIndex, true);
623 pe.setCharge(m_line.charge);
624 pe.setChecked(true);
625 pe.setExperimentalMass(m_line.expmass);
626 pe.setPeptideXtpSp(msp_peptide);
627 pe.setIdentificationDataSource(msp_identificationSageJsonFileSp.get());
628 pe.setIdentificationEngine(m_identificationEngine);
629 pe.setRetentionTime(m_line.rt);
630 pe.setParam(PeptideEvidenceParam::tandem_hyperscore, m_line.hyperscore);
631 pe.setParam(PeptideEvidenceParam::sage_sage_discriminant_score,
632 m_line.sage_discriminant_score);
633 pe.setParam(PeptideEvidenceParam::sage_peptide_q, m_line.peptide_q);
634 pe.setParam(PeptideEvidenceParam::sage_posterior_error, m_line.posterior_error);
635 pe.setParam(PeptideEvidenceParam::sage_spectrum_q, m_line.spectrum_q);
636 pe.setParam(PeptideEvidenceParam::sage_predicted_rt, m_line.predicted_rt);
637 pe.setParam(PeptideEvidenceParam::sage_isotope_error, m_line.isotope_error);
638
639
640 PeptideMatch peptide_match;
641 // peptide_match.setStart(mz_peptide_evidence.start);
642 peptide_match.setPeptideEvidenceSp(
643 msp_identificationSageJsonFileSp.get()->getPeptideEvidenceStore().getInstance(&pe));
644 */
645
646 // find the scan in sample
647 auto it_insert = mp_currentSample->scan_map.insert({m_spectrumNativeId, Scan()});
648 Scan *current_cbor_scan_p = &(it_insert.first->second);
649 if(it_insert.second)
650 {
651 // new scan
652 QCborMap &scan_id = it_insert.first->second.cbor_id;
654 {
655 scan_id.insert(QString("index"), (qint64)m_spectrumIndex);
656 scan_id.insert(QString("scan"), (qint64)m_scanNumber);
657 }
658 scan_id.insert(QString("native_id"), m_spectrumNativeId);
659
660 QCborMap &scan_ms2 = it_insert.first->second.cbor_ms2;
661 scan_ms2.insert(QString("rt"), m_line.rt);
662
663 QCborMap &scan_precursor = it_insert.first->second.cbor_precursor;
664 scan_precursor.insert(QString("z"), m_line.charge);
665 double mh = m_line.expmass + MHPLUS;
666 scan_precursor.insert(QString("mh"), mh);
667 double exp_mz = (m_line.expmass + (MHPLUS * m_line.charge)) / m_line.charge;
668 scan_precursor.insert(QString("mz"), exp_mz);
669 }
670
671 Psm one_psm;
672 one_psm.peptide_sequence_li = msp_peptide.get()->getSequenceLi();
673 one_psm.proforma = msp_peptide.get()->toProForma();
674 one_psm.protein_list = m_proteinList;
675
676
677 one_psm.cbor_eval.insert(QString("aligned_rt"), m_line.aligned_rt);
678 one_psm.cbor_eval.insert(QString("calcmass"), m_line.calcmass);
679 one_psm.cbor_eval.insert(QString("delta_best"), m_line.delta_best);
680 one_psm.cbor_eval.insert(QString("delta_mobility"), m_line.delta_mobility);
681 one_psm.cbor_eval.insert(QString("delta_next"), m_line.delta_next);
682 one_psm.cbor_eval.insert(QString("delta_rt_model"), m_line.delta_rt_model);
683 one_psm.cbor_eval.insert(QString("fragment_ppm"), m_line.fragment_ppm);
684 one_psm.cbor_eval.insert(QString("hyperscore"), m_line.hyperscore);
685 one_psm.cbor_eval.insert(QString("ion_mobility"), m_line.ion_mobility);
686 one_psm.cbor_eval.insert(QString("isotope_error"), m_line.isotope_error);
687 one_psm.cbor_eval.insert(QString("label"), m_line.label);
688 one_psm.cbor_eval.insert(QString("longest_b"), (qint64)m_line.longest_b);
689 one_psm.cbor_eval.insert(QString("longest_y"), (qint64)m_line.longest_y);
690 one_psm.cbor_eval.insert(QString("longest_y_pct"), m_line.longest_y_pct);
691 one_psm.cbor_eval.insert(QString("matched_intensity_pct"), m_line.matched_intensity_pct);
692 one_psm.cbor_eval.insert(QString("matched_peaks"), (qint64)m_line.matched_peaks);
693 one_psm.cbor_eval.insert(QString("missed_cleavages"), m_line.missed_cleavages);
694 one_psm.cbor_eval.insert(QString("ms2_intensity"), m_line.ms2_intensity);
695 one_psm.cbor_eval.insert(QString("peptide_len"), (qint64)m_line.peptide_len);
696 one_psm.cbor_eval.insert(QString("peptide_q"), m_line.peptide_q);
697 one_psm.cbor_eval.insert(QString("poisson"), m_line.poisson);
698 one_psm.cbor_eval.insert(QString("posterior_error"), m_line.posterior_error);
699 one_psm.cbor_eval.insert(QString("precursor_ppm"), m_line.precursor_ppm);
700 one_psm.cbor_eval.insert(QString("predicted_mobility"), m_line.predicted_mobility);
701 one_psm.cbor_eval.insert(QString("predicted_rt"), m_line.predicted_rt);
702 one_psm.cbor_eval.insert(QString("protein_q"), m_line.protein_q);
703 one_psm.cbor_eval.insert(QString("rank"), m_line.rank);
704 one_psm.cbor_eval.insert(QString("sage_discriminant_score"), m_line.sage_discriminant_score);
705 one_psm.cbor_eval.insert(QString("scored_candidates"), (qint64)m_line.scored_candidates);
706 one_psm.cbor_eval.insert(QString("semi_enzymatic"), m_line.semi_enzymatic);
707 one_psm.cbor_eval.insert(QString("spectrum_q"), m_line.spectrum_q);
708
709 current_cbor_scan_p->psm_list.emplace_back(one_psm);
710
711
712 std::size_t progress = m_lineNumber / 10000;
713 if(progress > m_progressIndex)
714 {
716 {
718 QObject::tr("Sage TSV data reading process interrupted"));
719 }
720 m_progressIndex = progress;
721 mp_monitor->setStatus(QString("%1K ").arg(m_progressIndex * 10));
722 }
723}
724
725void
727{
729 m_sageReader.getCborStreamWriter().append("name");
730 one_sample.cbor_core_sample.value("name").toCbor(m_sageReader.getCborStreamWriter());
731
732 m_sageReader.getCborStreamWriter().append("identification_file_list");
733 one_sample.cbor_core_sample.value("identification_file_list")
735
736
737 m_sageReader.getCborStreamWriter().append("peaklist_file");
738 one_sample.cbor_core_sample.value("peaklist_file").toCbor(m_sageReader.getCborStreamWriter());
739 //"scan_list": [
740
741 m_sageReader.getCborStreamWriter().append("scan_list");
742 m_sageReader.getCborStreamWriter().startArray(one_sample.scan_map.size());
743 for(auto &it_scan : one_sample.scan_map)
744 {
745 writeScan(it_scan.second);
746 }
748
749
751}
752
753void
755{
757 m_sageReader.getCborStreamWriter().append("id");
758 QCborValue(one_scan.cbor_id).toCbor(m_sageReader.getCborStreamWriter());
759 m_sageReader.getCborStreamWriter().append("precursor");
760 QCborValue(one_scan.cbor_precursor).toCbor(m_sageReader.getCborStreamWriter());
761 m_sageReader.getCborStreamWriter().append("ms2");
762 QCborValue(one_scan.cbor_ms2).toCbor(m_sageReader.getCborStreamWriter());
763
764 m_sageReader.getCborStreamWriter().append("psm_list");
765 m_sageReader.getCborStreamWriter().startArray(one_scan.psm_list.size());
766 for(auto &it_psm : one_scan.psm_list)
767 {
768 writePsm(it_psm);
769 }
771
773}
774
775void
777{
779 m_sageReader.getCborStreamWriter().append("proforma");
780 m_sageReader.getCborStreamWriter().append(one_psm.proforma);
781 m_sageReader.getCborStreamWriter().append("protein_list");
782
783 QCborArray cbor_protein_list;
784 for(const QString &accession : one_psm.protein_list)
785 {
786 // qWarning() << "accession=" << accession;
787 QCborMap cbor_protein;
788 cbor_protein.insert(QString("accession"), accession);
789
790
791 // start/end positions
792 QString protein_sequence =
793 QString(m_psmProteinMap.getByAccession(accession).protein_sp.get()->getSequence())
794 .replace("L", "I");
795 int position = protein_sequence.indexOf(one_psm.peptide_sequence_li);
796
797 QCborArray positions;
798 while(position >= 0)
799 {
800 positions.push_back(position);
801 position = protein_sequence.indexOf(one_psm.peptide_sequence_li, position + 1);
802 }
803
804 cbor_protein.insert(QString("positions"), positions);
805
806 cbor_protein_list.append(cbor_protein);
807 }
808
809
810 QCborValue(cbor_protein_list).toCbor(m_sageReader.getCborStreamWriter());
811
812 m_sageReader.getCborStreamWriter().append("eval");
814 m_sageReader.getCborStreamWriter().append("sage");
815 QCborValue(one_psm.cbor_eval).toCbor(m_sageReader.getCborStreamWriter());
817
819}
820
821
822} // namespace psm
823} // namespace cbor
824} // namespace pappso
static PeptideSp parseString(const QString &pepstr)
virtual void setStatus(const QString &status)=0
current status of the process
virtual bool shouldIstop()=0
should the procces be stopped ? If true, then cancel process Use this function at strategic point of ...
store PsmProtein in a map with accession as key
const pappso::cbor::psm::PsmProtein & getByAccession(const QString &accession) const
retrieve a PsmProtein with its accession
std::pair< std::map< QString, PsmProtein >::iterator, bool > insert(const PsmProtein &psm_protein)
standard map insert of a PsmProtein (accession is the key)
const QString & getMzmlPath(const QString &file_msrun) const
std::vector< SageModification > getStaticModificationList() const
const QString & getmJsonAbsoluteFilePath() const
pappso::cbor::CborStreamWriter & getCborStreamWriter() const
std::vector< SageModification > getVariableModificationList() const
std::vector< SageReader::SageModification > m_staticModificationList
void parseProteins(const QString &proteins_str)
virtual void endSheet() override
pappso::UiMonitorInterface * mp_monitor
virtual void startSheet(const QString &sheet_name) override
std::vector< SageReader::SageModification > m_variableModificationList
void parsePeptide(const QString &peptide_str)
void writeSample(const Sample &one_sample)
virtual void setCell(const OdsCell &cell) override
void writePsm(const Psm &one_psm)
SageTsvHandler(pappso::UiMonitorInterface *p_monitor, const SageReader &sage_reader, PsmProteinMap &psm_protein_map)
void writeScan(const Scan &one_scan)
std::map< QString, Sample > m_sampleMap
virtual void endDocument() override
virtual void startLine() override
void parseMsRunFilename(const QString &msrun_filename)
bool parseScanNrColumn(const QString &spectrum_string_id)
virtual void endLine() override
std::vector< Columns > m_columnTypeList
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
const pappso_double MHPLUS(1.007276466879)
std::shared_ptr< Protein > protein_sp