diff --git a/src/core/identification_sources/identificationdatasource.cpp b/src/core/identification_sources/identificationdatasource.cpp index d1c701709fddb9d1dcf82dce52436972c51def85..cabdf57e8d80db59c02ea9aa61e1aa39e4afe32e 100644 --- a/src/core/identification_sources/identificationdatasource.cpp +++ b/src/core/identification_sources/identificationdatasource.cpp @@ -209,7 +209,7 @@ IdentificationDataSource::getMassSpectrumCstSPtr(unsigned int scan_number) const { throw pappso::ExceptionNotFound( QObject::tr("mz data \"%1\" file not found") - .arg(_ms_run_sp.get()->getFilename())); + .arg(_ms_run_sp.get()->getFileName())); } } msrun_reader_sp = _ms_run_sp.get()->getMsRunReaderSp(); @@ -217,7 +217,7 @@ IdentificationDataSource::getMassSpectrumCstSPtr(unsigned int scan_number) const { throw pappso::ExceptionNotFound( QObject::tr("mz data \"%1\" file not found") - .arg(_ms_run_sp.get()->getFilename())); + .arg(_ms_run_sp.get()->getFileName())); } diff --git a/src/core/msrun.cpp b/src/core/msrun.cpp index 5935f6058eed73c8e5efc3cbd020ad80cf365fcb..5347661218eff8d3f08a18a6b3e21a56e1ed5e3f 100644 --- a/src/core/msrun.cpp +++ b/src/core/msrun.cpp @@ -35,7 +35,6 @@ #include <QSettings> #include <QDebug> #include <QDir> -#include <pappsomspp/msrun/msrunreaderfactory.h> #include <pappsomspp/exception/exceptionnotfound.h> #include <pappsomspp/xicextractor/msrunxicextractorfactory.h> #include "../utils/msrunstatisticshandler.h" @@ -55,17 +54,17 @@ MsRun::MsRun(const MsRun &other) : pappso::MsRunId(other) MsRun::~MsRun() { } -pappso::MsRunReaderSp & -MsRun::getMsRunReaderSp() +pappso::MsRunReaderSPtr & +MsRun::getMsRunReaderSPtr() { qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ - << " filename=" << getFilename(); + << " filename=" << getFileName(); if(_msrun_reader_sp == nullptr) { try { - pappso::MsFileAccessor accessor(getFilename(), 0); + pappso::MsFileAccessor accessor(getFileName(), 0); qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()"; auto msrunid_list = accessor.getMsRunIds(); if(msrunid_list.size() == 1) @@ -126,10 +125,10 @@ bool MsRun::findMsRunFile() { // first look at the file path :) - _msrun_reader_sp = getMsRunReaderSp(); + _msrun_reader_sp = getMsRunReaderSPtr(); if(_msrun_reader_sp != nullptr) { - QFileInfo real_file(this->getFilename()); + QFileInfo real_file(this->getFileName()); if(real_file.exists()) { return true; @@ -139,7 +138,7 @@ MsRun::findMsRunFile() _msrun_reader_sp = nullptr; } } - QFileInfo file_original(this->getFilename()); + QFileInfo file_original(this->getFileName()); QString basename = file_original.baseName(); QString onlyfilename = file_original.fileName(); QSettings settings; @@ -165,7 +164,7 @@ MsRun::findMsRunFile() if(_msrun_reader_sp == nullptr) { - pappso::MsFileAccessor accessor(getFilename(), 0); + pappso::MsFileAccessor accessor(getFileName(), 0); qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()"; auto msrunid_list = accessor.getMsRunIds(); @@ -204,7 +203,7 @@ MsRun::findMsRunFile() if(_msrun_reader_sp == nullptr) { - pappso::MsFileAccessor accessor(getFilename(), 0); + pappso::MsFileAccessor accessor(getFileName(), 0); qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()"; auto msrunid_list = accessor.getMsRunIds(); @@ -294,8 +293,9 @@ MsRun::getMsRunXicExtractorInterfaceSp() } else { - _xic_extractor_sp = pappso::MsRunXicExtractorFactory::getInstance() - .buildMsRunXicExtractorDiskBufferSp(_msrun_reader_sp); + _xic_extractor_sp = + pappso::MsRunXicExtractorFactory::getInstance() + .buildMsRunXicExtractorDiskBufferSp(_msrun_reader_sp); } //_xic_extractor_sp = pappso::MsRunXicExtractorFactory::getInstance() // .buildMsRunXicExtractorDiskBufferSp(*this); diff --git a/src/core/msrun.h b/src/core/msrun.h index 81677f42e2645d000b5ad7152822ea8b0f458cb3..94b300cfaefb57aa5bf629f3f4c15ebf4c63f6d8 100644 --- a/src/core/msrun.h +++ b/src/core/msrun.h @@ -30,8 +30,7 @@ ******************************************************************************/ -#ifndef MSRUN_H -#define MSRUN_H +#pragma once #include <memory> #include <QString> @@ -69,7 +68,7 @@ class MsRun : public pappso::MsRunId bool findMsRunFile(); - pappso::MsRunReaderSp &getMsRunReaderSp(); + pappso::MsRunReaderSPtr &getMsRunReaderSPtr(); /** @brief release shared pointer on MSrun reader */ @@ -82,9 +81,7 @@ class MsRun : public pappso::MsRunId private: std::map<MsRunStatistics, QVariant> _param_stats; - pappso::MsRunReaderSp _msrun_reader_sp; + pappso::MsRunReaderSPtr _msrun_reader_sp; pappso::MsRunXicExtractorInterfaceSp _xic_extractor_sp; }; - -#endif // MSRUN_H diff --git a/src/gui/export/export_masschroq_dialog/exportmasschroqdialog.cpp b/src/gui/export/export_masschroq_dialog/exportmasschroqdialog.cpp index 589ae1fe84f65afced9adc2d401adf3babb25ab2..3f841cbe86afc33ab7241a9c1a444ff1692b1307 100644 --- a/src/gui/export/export_masschroq_dialog/exportmasschroqdialog.cpp +++ b/src/gui/export/export_masschroq_dialog/exportmasschroqdialog.cpp @@ -228,7 +228,7 @@ ExportMasschroqDialog::doCheckMsrunFilepath() ui->warningDirectoryLabel->setText( tr("%1 not found : Please choose the directory to look for this MS " "run file.") - .arg(msrun_sp.get()->getFilename())); + .arg(msrun_sp.get()->getFileName())); ui->directorySelectWidget->setHidden(false); break; } diff --git a/src/gui/peptide_detail_view/peptidewindow.cpp b/src/gui/peptide_detail_view/peptidewindow.cpp index 33d21dad54bf3ac853b22a80251891304424c2b2..78da5131ffe72e9b46f91b8f35135ebef17ba110 100644 --- a/src/gui/peptide_detail_view/peptidewindow.cpp +++ b/src/gui/peptide_detail_view/peptidewindow.cpp @@ -306,7 +306,7 @@ PeptideWindow::openInPeptideViewer() QStringList arguments; arguments << _p_peptide_evidence->getPeptideXtpSp().get()->toString() << QString("%1").arg(_p_peptide_evidence->getCharge()) - << _p_peptide_evidence->getMsRunP()->getFilename() + << _p_peptide_evidence->getMsRunP()->getFileName() << QString("%1").arg(_p_peptide_evidence->getScanNumber()); qDebug() << "PeptideWindow::openInPeptideViewer " << program << " " diff --git a/src/gui/peptide_list_view/peptidelistwindow.cpp b/src/gui/peptide_list_view/peptidelistwindow.cpp index d9553771896bc077da40ffe1bfacdc05acf5c9a6..a56f7145ba7f58b76bfd3a4a13b02e3df54e1be6 100644 --- a/src/gui/peptide_list_view/peptidelistwindow.cpp +++ b/src/gui/peptide_list_view/peptidelistwindow.cpp @@ -215,9 +215,9 @@ PeptideListWindow::setProteinMatch(IdentificationGroup *p_identification_group, QStringList msrun_list; for(MsRunSp msrun_sp : _p_identification_group->getMsRunSpList()) { - msrun_list << msrun_sp.get()->getFilename(); + msrun_list << msrun_sp.get()->getFileName(); qDebug() << "PeptideListWindow::setIdentificationGroup " - << msrun_sp.get()->getFilename(); + << msrun_sp.get()->getFileName(); } QCompleter *completer = new QCompleter(msrun_list, this); completer->setCaseSensitivity(Qt::CaseInsensitive); diff --git a/src/gui/protein_list_view/proteinlistwindow.cpp b/src/gui/protein_list_view/proteinlistwindow.cpp index c07b7aa67508f56c04814bfe1637ce96298d205b..4a0f1551a15913ff21e9e55d26d5e4f636f9c1ff 100644 --- a/src/gui/protein_list_view/proteinlistwindow.cpp +++ b/src/gui/protein_list_view/proteinlistwindow.cpp @@ -384,9 +384,9 @@ ProteinListWindow::setIdentificationGroup( QStringList msrun_list; for(MsRunSp msrun_sp : _p_identification_group->getMsRunSpList()) { - msrun_list << msrun_sp.get()->getFilename(); + msrun_list << msrun_sp.get()->getFileName(); qDebug() << "ProteinListWindow::setIdentificationGroup " - << msrun_sp.get()->getFilename(); + << msrun_sp.get()->getFileName(); } QCompleter *completer = new QCompleter(msrun_list, this); completer->setCaseSensitivity(Qt::CaseInsensitive); diff --git a/src/gui/protein_list_view/proteintableproxymodel.cpp b/src/gui/protein_list_view/proteintableproxymodel.cpp index 7ebb39c35d7ecbfcc7ba173c75f88cfc7942d744..a0d2ff59418ff82b93da5d6373550347ad347ace 100644 --- a/src/gui/protein_list_view/proteintableproxymodel.cpp +++ b/src/gui/protein_list_view/proteintableproxymodel.cpp @@ -143,7 +143,7 @@ ProteinTableProxyModel::filterAcceptsRow(int source_row, msrun_ok = false; if(p_peptide_match.getPeptideEvidence() ->getMsRunP() - ->getFilename() + ->getFileName() .toLower() .contains(file_search_string)) { diff --git a/src/gui/xic_view/xic_box/xicbox.cpp b/src/gui/xic_view/xic_box/xicbox.cpp index f5354fcbcee2efa01898fa84e5b9e64d965266c0..9cb7b2265e1cdda70e6bc7109c15ed0f6e9fb4da 100644 --- a/src/gui/xic_view/xic_box/xicbox.cpp +++ b/src/gui/xic_view/xic_box/xicbox.cpp @@ -175,9 +175,9 @@ XicBox::XicBox(XicWindow *parent) : QWidget(parent), ui(new Ui::XicBox) ->getMsRunStore() .getMsRunList()) { - msrun_list << msrun_sp.get()->getFilename(); + msrun_list << msrun_sp.get()->getFileName(); qDebug() << "ProteinListWindow::setIdentificationGroup " - << msrun_sp.get()->getFilename(); + << msrun_sp.get()->getFileName(); } QCompleter *completer = new QCompleter(msrun_list, this); completer->setCaseSensitivity(Qt::CaseInsensitive); @@ -258,7 +258,7 @@ XicBox::setPeptideEvidence(const PeptideEvidence *p_peptide_evidence) ui->peptide_label->setText( _p_peptide_evidence->getPeptideXtpSp().get()->toString()); - ui->msrun_label->setText(_p_peptide_evidence->getMsRunP()->getFilename()); + ui->msrun_label->setText(_p_peptide_evidence->getMsRunP()->getFileName()); ui->charge_label->setText( QString("%1").arg(_p_peptide_evidence->getCharge())); ui->mz_label->setText( @@ -290,7 +290,7 @@ XicBox::setPeptideEvidenceInMsRun(const PeptideEvidence *p_peptide_evidence, ui->peptide_label->setText( _p_peptide_evidence->getPeptideXtpSp().get()->toString()); - ui->msrun_label->setText(msrun_sp->getFilename()); + ui->msrun_label->setText(msrun_sp->getFileName()); ui->charge_label->setText( QString("%1").arg(_p_peptide_evidence->getCharge())); ui->mz_label->setText( diff --git a/src/gui/xic_view/xicworkerthread.cpp b/src/gui/xic_view/xicworkerthread.cpp index 8b9e2386e2bc157bf8f48ee19533153e6d6d9fdb..e038f058889cab4dee9be321119b7158fce333d8 100644 --- a/src/gui/xic_view/xicworkerthread.cpp +++ b/src/gui/xic_view/xicworkerthread.cpp @@ -76,7 +76,7 @@ XicWorkerThread::doXicLoad(MsRunSp p_msrun, catch(pappso::PappsoException &error) { emit operationFailed(tr("Error extracting XIC for MSrun %1:\n%2") - .arg(p_msrun->getFilename()) + .arg(p_msrun->getFileName()) .arg(error.qwhat())); } } diff --git a/src/output/masschroqml.cpp b/src/output/masschroqml.cpp index dd2df33799b0b24d2c706aadb64a889b7c42b96b..1baa9b397ae62eeea40de3ae7659fd39a517de14 100644 --- a/src/output/masschroqml.cpp +++ b/src/output/masschroqml.cpp @@ -150,7 +150,7 @@ MassChroQml::write(ProjectSp sp_project) { _output_stream->writeAttribute("format", "mzxml"); } - _output_stream->writeAttribute("path", msrun.get()->getFilename()); + _output_stream->writeAttribute("path", msrun.get()->getFileName()); _output_stream->writeAttribute("type", "centroid"); // <data_file id="samp1" format="mzxml" path="bsa2.mzXML" type="profile" // /> diff --git a/src/output/mcqrspectralcount.cpp b/src/output/mcqrspectralcount.cpp index 5f0346f4975e38205aab3bd6f1c7fdda2f771bac..60c8e45c0f532e9d1be664f40c39d4ab069fb5a2 100644 --- a/src/output/mcqrspectralcount.cpp +++ b/src/output/mcqrspectralcount.cpp @@ -175,7 +175,7 @@ McqrSpectralCount::writeOneProteinLabel(const pappso::GrpProtein *p_grp_protein, _p_writer->writeCell(p_grp_protein->getGroupingId()); _p_writer->writeCell(p_msrun->getXmlId()); - _p_writer->writeCell(p_msrun->getFilename()); + _p_writer->writeCell(p_msrun->getFileName()); if(p_label != nullptr) { diff --git a/src/output/ods/samplesheet.cpp b/src/output/ods/samplesheet.cpp index 5fe39259fef811b24b10052bfca30773d09984b2..7f4f1570564cb42ef14f8fc4c1580e9ec0a0909f 100644 --- a/src/output/ods/samplesheet.cpp +++ b/src/output/ods/samplesheet.cpp @@ -156,7 +156,7 @@ SampleSheet::writeIdentificationDataSource( _p_writer->writeCell(msrun_sp.get()->getXmlId()); _p_writer->writeCell(msrun_sp.get()->getSampleName()); - _p_writer->writeCell(msrun_sp.get()->getFilename()); + _p_writer->writeCell(msrun_sp.get()->getFileName()); _p_writer->writeCell(p_ident_data_source->getIdentificationEngineName()); _p_writer->writeCell(p_ident_data_source->getIdentificationEngineVersion()); _p_writer->writeCell(p_ident_data_source->getResourceName()); diff --git a/src/output/proticdbml.cpp b/src/output/proticdbml.cpp index ada23f214b992d21b5e31559d0e885707b9f46e7..527fc88b981e206ab81fa0dae166e3291e2f9182 100644 --- a/src/output/proticdbml.cpp +++ b/src/output/proticdbml.cpp @@ -336,7 +336,7 @@ ProticdbMl::writeIdentificationDataSource( _output_stream->writeStartElement("processingMethod"); // mzXml source file name writeCvParam("PROTICdbO:0000343", - p_identification_data_source->getMsRunSp().get()->getFilename(), + p_identification_data_source->getMsRunSp().get()->getFileName(), "MS/MS data source file name"); if(p_identification_data_source->getIdentificationEngine() == IdentificationEngine::XTandem) diff --git a/src/output/xpip.cpp b/src/output/xpip.cpp index 51a542c8af1fdea4e8f46993b030cc2460b59d0b..f740efcd0c163b0e3266dd1ed270e0714fbf7cf7 100644 --- a/src/output/xpip.cpp +++ b/src/output/xpip.cpp @@ -325,10 +325,10 @@ Xpip::writeMsrunList(const MsRunStore &msrun_store) _output_stream->writeAttribute("format", QString("%1").arg(static_cast<std::int8_t>( msrun_sp.get()->getMzFormat()))); - QFileInfo mz_info(msrun_sp.get()->getFilename()); + QFileInfo mz_info(msrun_sp.get()->getFileName()); if(mz_info.exists()) { - _output_stream->writeAttribute("path", msrun_sp.get()->getFilename()); + _output_stream->writeAttribute("path", msrun_sp.get()->getFileName()); } else { diff --git a/src/utils/msrunstore.cpp b/src/utils/msrunstore.cpp index 2a3719c49621132199a3f3ce4c87a8c6a5b9cc5c..e2641ffdd336babc2aeb7e0a3edab55d8fcd9a40 100644 --- a/src/utils/msrunstore.cpp +++ b/src/utils/msrunstore.cpp @@ -79,12 +79,12 @@ MsRunStore::getInstance(const QString &location) _map_msrun.end(), [location](const MsRunSp &msrun_sp) { if(msrun_sp.get()->getSampleName() == - msrun_sp.get()->getFilename()) + msrun_sp.get()->getFileName()) { return msrun_sp.get()->getSampleName() == QFileInfo(location).baseName(); } - return msrun_sp.get()->getFilename() == location; + return msrun_sp.get()->getFileName() == location; }); } if(it != _map_msrun.end()) diff --git a/src/utils/msrunstore.h b/src/utils/msrunstore.h index e0853179a944d34dab9ff0e289cfb4976386ad08..4828d825eb73d93d2d31339c17390d2896db85b2 100644 --- a/src/utils/msrunstore.h +++ b/src/utils/msrunstore.h @@ -29,8 +29,7 @@ *implementation ******************************************************************************/ -#ifndef MSRUNSTORE_H -#define MSRUNSTORE_H +#pragma once #include <QString> #include <map> @@ -52,4 +51,3 @@ class MsRunStore std::vector<MsRunSp> _map_msrun; }; -#endif // MSRUNSTORE_H