Skip to content
Snippets Groups Projects
Commit f0100c37 authored by Olivier Langella's avatar Olivier Langella
Browse files

check psimod compliance

parent 3803da40
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,9 @@ Project::~Project()
}
}
bool Project::checkPsimodCompliance() const {
return _peptide_store.checkPsimodCompliance();
}
void Project::readResultFile(QString filename) {
IdentificationDataSourceSp ident_source = _identification_data_source_store.getInstance(filename);
......
......@@ -65,6 +65,10 @@ public:
void setCombineMode(bool is_combine_mode);
bool isCombineMode() const;
void readResultFile(QString filename);
/** @brief check that modifications are coded with PSI MOD accessions
*/
bool checkPsimodCompliance() const;
private :
bool _is_combine_mode =true;
......
......@@ -179,11 +179,11 @@ void MainWindow::doAcceptedExportSpreadsheetDialog() {
}
settings.setValue("path/export_ods", QFileInfo(filename).absolutePath());
OdsDocWriter writer(filename);
OdsExport export_ods(_project_sp.get());
export_ods.write(&writer);
writer.close();
//emit operateXpipFile(filename);
}
......@@ -222,7 +222,7 @@ void MainWindow::doProjectReady(ProjectSp project_sp) {
viewError(tr("Error while grouping :\n%1").arg(error.qwhat()));
}
_project_window->setProjectSp(project_sp);
ui->menu_export_files->setDisabled(false);
ui->menu_export_files->setDisabled(false);
qDebug() << "MainWindow::doProjectReady end";
}
......@@ -259,22 +259,24 @@ void MainWindow::selectXpipFile() {
}
void MainWindow::doActionSpreadsheet() {
void MainWindow::doActionSpreadsheet() {
qDebug() << "MainWindow::doActionSpreadsheet begin";
try {
_p_export_spreadsheet_dialog->show();
_p_export_spreadsheet_dialog->raise();
_p_export_spreadsheet_dialog->activateWindow();
_p_export_spreadsheet_dialog->show();
_p_export_spreadsheet_dialog->raise();
_p_export_spreadsheet_dialog->activateWindow();
}
catch (pappso::PappsoException & error) {
viewError(tr("Error doActionSpreadsheet :\n%1").arg(error.qwhat()));
}
qDebug() << "MainWindow::doActionSpreadsheet end";
}
}
void MainWindow::doActionMassChroQ() {
qDebug() << "MainWindow::doActionMassChroQ begin";
try {
_project_sp.get()->checkPsimodCompliance();
QSettings settings;
QString default_location = settings.value("path/mcqfile", "").toString();
......
......@@ -29,6 +29,7 @@
#include "peptidestore.h"
#include <pappsomspp/amino_acid/Aa.h>
#include <pappsomspp/pappsoexception.h>
PeptideStore::PeptideStore()
{
......@@ -52,9 +53,20 @@ PeptideXtpSp & PeptideStore::getInstance(PeptideXtpSp & peptide_in) {
for (auto && aa : *(ret.first->second.get())) {
std::list<pappso::AaModificationP> mod_list = aa.getModificationList();
_modification_collection.insert(mod_list.begin(), mod_list.end());
_modification_collection.insert(mod_list.begin(), mod_list.end());
}
}
return ret.first->second;
}
bool PeptideStore::checkPsimodCompliance() const {
for (pappso::AaModificationP modification :_modification_collection) {
if (modification->getAccession().startsWith("MOD:")) {
}
else {
throw pappso::PappsoException(QObject::tr("Modification %1 is not a PSIMOD accession").arg(modification->getAccession()));
}
}
return true;
}
......@@ -41,6 +41,10 @@ public:
~PeptideStore();
PeptideXtpSp & getInstance(PeptideXtpSp & peptide_in);
/** @brief check that modifications are coded with PSI MOD accessions
*/
bool checkPsimodCompliance() const;
private :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment