libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
psmfilescanprocessandcopy.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/cbor/psm/psmfilescanprocessandcopy.cpp
3 * \date 15/07/2025
4 * \author Olivier Langella
5 * \brief PSM file reader designed to parallelize scan process and then copy the results in PSM cbor
6 * output stream
7 */
8
9/*******************************************************************************
10 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
11 *
12 * This file is part of PAPPSOms-tools.
13 *
14 * PAPPSOms-tools 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 * PAPPSOms-tools 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 PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
26 *
27 ******************************************************************************/
28
32
33
34namespace pappso
35{
36namespace cbor
37{
38namespace psm
39{
40
42 std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QString &operation)
43 : PsmFileScanProcess(buffer_scan_size)
44{
45 mp_cborOutput = cbor_output_p;
46 m_operation = operation;
47
48
49 mp_cborOutput->startMap();
50}
51
52
56
57void
62
63void
65{
66 mp_cborOutput->writeInformations("pappsomspp_copy", Utils::getVersion(), "psm", m_operation);
67}
68
69
70void
77
78void
84
85void
87{
88 // "target_fasta_files": ["zea_mays.fasta", "contaminant.fasta"],
89 if(!m_targetFastaFiles.isEmpty())
90 {
91 mp_cborOutput->append("target_fasta_files");
93 }
94 //"decoy_fasta_files" : ["rev_zea_mays.fasta", "rev_contaminant.fasta"],
95
96 if(!m_decoyFastaFiles.isEmpty())
97 {
98 mp_cborOutput->append("decoy_fasta_files");
100 }
101}
102
103void
110
111
112void
115{
116 for(const CborScanMapBase *cbor_scan_p : m_cborScanList)
117 {
118 // qDebug() << cbor_scan_p->keys();
119
120
121 mp_cborOutput->writeCborMap(*cbor_scan_p);
122
123 if(!cbor_scan_p->keys().contains("id"))
124 {
126 QObject::tr("missing scan id %1").arg(cbor_scan_p->keys().size()));
127 }
128 }
129}
130
131void
133 [[maybe_unused]])
134{
135 mp_cborOutput->startMap();
136 mp_cborOutput->append("name");
139 {
140 mp_cborOutput->append("identification_file_list");
142 }
143 mp_cborOutput->append("peaklist_file");
145
146 mp_cborOutput->append("scan_list");
147 mp_cborOutput->startArray();
148}
149
150void
152 [[maybe_unused]])
153{
154
155 mp_cborOutput->endArray();
156 mp_cborOutput->endMap();
157}
158
159void
161 [[maybe_unused]])
162{
163 mp_cborOutput->append("sample_list");
164 mp_cborOutput->startArray();
165}
166
167void
169 [[maybe_unused]])
170{
171 mp_cborOutput->endArray();
172}
173
174
175} // namespace psm
176} // namespace cbor
177} // namespace pappso
static QString getVersion()
Definition utils.cpp:623
void writePsmFileList(CborStreamWriter &writer, const std::vector< PsmFile > &file_list)
std::vector< PsmFile > m_currentIdentificationFileList
void writePsmFile(CborStreamWriter &writer, const PsmFile &psm_file)
void sampleStarted(pappso::UiMonitorInterface &monitor) override
void fastaFilesReady(pappso::UiMonitorInterface &monitor) override
void sampleFinished(pappso::UiMonitorInterface &monitor) override
PsmFileScanProcessAndCopy(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QString &operation)
void sampleListStarted(pappso::UiMonitorInterface &monitor) override
void sampleListFinished(pappso::UiMonitorInterface &monitor) override
void proteinMapReady(pappso::UiMonitorInterface &monitor) override
void informationsReady(pappso::UiMonitorInterface &monitor) override
void processBufferScanDone(pappso::UiMonitorInterface &monitor) override
void parameterMapReady(pappso::UiMonitorInterface &monitor) override
void logReady(pappso::UiMonitorInterface &monitor) override
std::vector< CborScanMapBase * > m_cborScanList
PsmFileScanProcess(std::size_t buffer_scan_size)
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39