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

writing compar sheets is ok

parent 30d68610
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,15 @@
#include <QDebug>
ComparBaseSheet::ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project, const QString & title_sheet): _p_project(p_project) {
ComparBaseSheet::ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) {
_p_ods_export = p_ods_export;
_p_writer = p_writer;
p_writer->writeSheet(title_sheet);
}
void ComparBaseSheet::writeSheet () {
_p_writer->writeSheet(_title_sheet);
std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList();
std::vector<IdentificationGroup *> identification_list = _p_project->getIdentificationGroupList();
for (IdentificationGroup * p_ident:identification_list) {
//writeHeaders(p_ident);
writeIdentificationGroup(p_ident);
......@@ -105,7 +108,6 @@ void ComparBaseSheet::writeProteinMatch(const ProteinMatch * p_protein_match) {
_p_writer->writeCell(p_protein_match->getGroupingGroupSp().get()->countProteinInSubgroup(subgroup_number));
for (MsRunSp & msrun_sp: _msrun_list) {
writeComparValue(p_protein_match, ValidationState::validAndChecked, msrun_sp.get());
}
......
......@@ -38,12 +38,15 @@
class ComparBaseSheet
{
public :
ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project,const QString & title_sheet);
ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project);
private :
void writeIdentificationGroup(IdentificationGroup * p_ident);
void writeHeaders(IdentificationGroup * p_ident);
void writeProteinMatch(const ProteinMatch * p_protein_match);
public :
void writeSheet();
protected :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun)=0;
protected :
......@@ -51,6 +54,8 @@ protected :
const Project * _p_project;
CalcWriterInterface * _p_writer;
std::vector<MsRunSp> _msrun_list;
QString _title_sheet;
};
#endif // COMPARBASESHEET_H
......@@ -30,11 +30,14 @@
#include "comparspecificspectrasheet.h"
ComparSpecificSpectraSheet::ComparSpecificSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project, QString("compar specific spectra")) {
ComparSpecificSpectraSheet::ComparSpecificSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) {
_title_sheet = "compar specific spectra";
}
void ComparSpecificSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
qDebug() << "ComparSpecificSpectraSheet::writeComparValue begin";
_p_writer->writeCell((unsigned int) p_protein_match->getGroupingGroupSp().get()->countSpecificSampleScan(p_protein_match, state, p_msrun));
qDebug() << "ComparSpecificSpectraSheet::writeComparValue end";
}
......@@ -35,8 +35,8 @@ class ComparSpecificSpectraSheet: public ComparBaseSheet
{
public :
ComparSpecificSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project);
private :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun);
protected :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) override;
};
#endif // COMPARSPECIFICSPECTRASHEET_H
......@@ -34,19 +34,12 @@
#include <QDebug>
ComparSpectraSheet::ComparSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) {
_p_ods_export = p_ods_export;
_p_writer = p_writer;
p_writer->writeSheet("compar spectra");
std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList();
for (IdentificationGroup * p_ident:identification_list) {
//writeHeaders(p_ident);
writeIdentificationGroup(p_ident);
}
ComparSpectraSheet::ComparSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) {
_title_sheet = "compar spectra";
}
void ComparSpecificSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
void ComparSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
qDebug() << "ComparSpectraSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun));
qDebug() << "ComparSpectraSheet::writeComparValue end";
}
......@@ -37,8 +37,8 @@ class ComparSpectraSheet:public ComparBaseSheet
public :
ComparSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project);
private :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun);
protected :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) override;
};
#endif // COMPARSPECTRASHEET_H
......@@ -77,9 +77,9 @@ void OdsExport::write(CalcWriterInterface * p_writer) {
PeptidePosSheet(this, p_writer, _p_project);
}
if (settings.value("export_ods/comparspectra", "true").toBool()) {
ComparSpectraSheet(this, p_writer, _p_project);
ComparSpectraSheet(this, p_writer, _p_project).writeSheet();
}
if (settings.value("export_ods/comparspecificspectra", "true").toBool()) {
ComparSpecificSpectraSheet(this, p_writer, _p_project);
ComparSpecificSpectraSheet(this, p_writer, _p_project).writeSheet();
}
}
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