32#include <odsstream/tsvreader.h>
33#include <odsstream/odsexception.h>
43 const QString &sage_json_file)
76 const QString &sequence_in)
78 QString accession = description_in.split(
" ", Qt::SkipEmptyParts).at(0);
81 const PsmProtein &psm_protein =
mp_self->m_psmProteinMap.getByAccession(accession);
82 psm_protein.
protein_sp.get()->setSequence(sequence_in);
83 psm_protein.
protein_sp.get()->setDescription(description_in);
91 const PsmProtein &psm_protein =
mp_self->m_psmProteinMap.getByAccession(accession);
92 psm_protein.
protein_sp.get()->setSequence(sequence_in);
93 psm_protein.
protein_sp.get()->setDescription(description_in);
118 TsvReader tsv_reader(handler);
120 QFile tsv_file(tsv_file_info.absoluteFilePath());
121 tsv_reader.parse(tsv_file);
124 catch(OdsException &error_ods)
127 .arg(tsv_file_info.absoluteFilePath())
128 .arg(error_ods.qwhat()));
136 reader.
parse(fastaFile);
149 catch(OdsException &error_ods)
152 .arg(tsv_file_info.absoluteFilePath())
153 .arg(error_ods.qwhat()));
163 QJsonObject sage_object = json_doc.object();
164 QJsonValue json_mzml_path_list = sage_object.value(
"mzml_paths");
165 if(json_mzml_path_list.isUndefined())
171 for(
auto path_mzml : json_mzml_path_list.toArray())
182 if(file_path.endsWith(file_msrun))
186 QObject::tr(
"MS run %1 not found in Sage json document").append(file_msrun));
194 QJsonObject sage_object = json_doc.object();
195 QJsonValue output_path = sage_object.value(
"output_paths");
196 if(output_path.isUndefined())
201 if(!output_path.isArray())
205 for(
auto element : output_path.toArray())
207 if(element.isString())
209 if(element.toString().endsWith(
".tsv"))
211 path = element.toString();
222 QJsonObject sage_object = json_doc.object();
223 QJsonValue database = sage_object.value(
"database");
224 if(database.isUndefined())
228 path = database.toObject().value(
"fasta").toString();
237std::vector<pappso::cbor::psm::SageReader::SageModification>
240 std::vector<SageReader::SageModification> list;
242 QJsonValue database = sage_object.value(
"database");
243 if(database.isUndefined())
248 QJsonValue static_mods = database.toObject().value(
"static_mods");
249 if(static_mods.isUndefined())
253 for(QString residue_str : static_mods.toObject().keys())
256 modif.
residue = residue_str.at(0);
259 static_mods.toObject().value(residue_str).toDouble());
261 QString::number(static_mods.toObject().value(residue_str).toDouble(),
'f', 6);
274 list.push_back(modif);
279std::vector<pappso::cbor::psm::SageReader::SageModification>
282 std::vector<SageReader::SageModification> list;
284 QJsonValue database = sage_object.value(
"database");
285 if(database.isUndefined())
290 QJsonValue var_mods = database.toObject().value(
"variable_mods");
291 if(var_mods.isUndefined())
295 for(QString residue_str : var_mods.toObject().keys())
298 modif.
residue = residue_str.at(0);
299 for(QJsonValue one_mass : var_mods.toObject().value(residue_str).toArray())
316 list.push_back(modif);
327 QJsonValue database = sage_object.value(
"database");
328 if(database.isUndefined())
332 path = database.toObject().value(
"decoy_tag").toString();
pappso_double getMass() const
void parse(QFile &fastaFile)
static AaModificationP guessAaModificationPbyMonoisotopicMassDelta(Enums::AminoAcidChar aa, pappso_double mass)
overrides QCborStreamWriter base class to provide convenient functions
void setSequence(const QString &description_in, const QString &sequence_in) override
FastaSeq(SageReader *self)
PsmProteinMap m_psmProteinMap
const QString & getMzmlPath(const QString &file_msrun) const
SageReader(pappso::UiMonitorInterface *p_monitor, pappso::cbor::CborStreamWriter *p_output, const SageFileReader &sage_file_reader, const QString &sage_json_file)
std::vector< SageModification > getStaticModificationList() const
QStringList m_mzmlPathList
pappso::cbor::CborStreamWriter * mp_cborWriter
const QString & getmJsonAbsoluteFilePath() const
void extractMzmlPathList(const QJsonDocument &json_doc)
pappso::cbor::CborStreamWriter & getCborStreamWriter() const
QString m_jsonAbsoluteFilePath
const SageFileReader & m_sageFileReader
std::vector< SageModification > getVariableModificationList() const
QString getFastaFilePath(const QJsonDocument &json_doc)
QString getDecoyTag() const
const SageFileReader & getSageFileReader() const
QString getTsvFilePath(const QJsonDocument &json_doc)
pappso::UiMonitorInterface * mp_monitor
std::shared_ptr< Protein > protein_sp
pappso::AaModificationP modification