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

WIP:handling labeled samples in compar ODS output

parent 751a8100
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,10 @@ ComparBaseSheet::ComparBaseSheet(OdsExport *p_ods_export,
{
_p_ods_export = p_ods_export;
_p_writer = p_writer;
_sp_labelling_method = p_project->getLabelingMethodSp();
_label_list = _sp_labelling_method.get()->getLabelList();
}
void
......@@ -94,9 +98,22 @@ ComparBaseSheet::writeHeaders(IdentificationGroup *p_ident)
_p_writer->writeCell("description");
_p_writer->writeCell("Number of proteins");
for(MsRunSp &msrun_sp : _msrun_list)
{
_p_writer->writeCell(msrun_sp.get()->getSampleName());
if(_sp_labelling_method == nullptr)
{
_p_writer->writeCell(msrun_sp.get()->getSampleName());
}
else
{
for(const Label *p_label : _label_list)
{
_p_writer->writeCell(QString("%1-%2")
.arg(msrun_sp.get()->getSampleName())
.arg(p_label->getXmlId()));
}
}
}
}
......@@ -142,11 +159,27 @@ ComparBaseSheet::writeProteinMatch(const ProteinMatch *p_protein_match)
for(MsRunSp &msrun_sp : _msrun_list)
{
writeComparValue(p_protein_match, ValidationState::validAndChecked,
msrun_sp.get());
if(_first_cell_coordinate.isEmpty())
if(_label_list.size() == 0)
{
writeComparValue(
p_protein_match, ValidationState::validAndChecked, msrun_sp.get());
if(_first_cell_coordinate.isEmpty())
{
_first_cell_coordinate = _p_writer->getOdsCellCoordinate();
}
}
else
{
_first_cell_coordinate = _p_writer->getOdsCellCoordinate();
for(const Label *p_label : _label_list)
{
writeComparValue(p_protein_match,
ValidationState::validAndChecked,
msrun_sp.get(),p_label);
if(_first_cell_coordinate.isEmpty())
{
_first_cell_coordinate = _p_writer->getOdsCellCoordinate();
}
}
}
}
......@@ -175,7 +208,8 @@ ComparBaseSheet::writeIdentificationGroup(IdentificationGroup *p_ident)
}
std::sort(
protein_match_list.begin(), protein_match_list.end(),
protein_match_list.begin(),
protein_match_list.end(),
[](const ProteinMatch *a, const ProteinMatch *b) {
unsigned int agroup = a->getGrpProteinSp().get()->getGroupNumber();
unsigned int asubgroup = a->getGrpProteinSp().get()->getSubGroupNumber();
......
......@@ -39,7 +39,8 @@
class ComparBaseSheet
{
public:
ComparBaseSheet(OdsExport *p_ods_export, CalcWriterInterface *p_writer,
ComparBaseSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project);
private:
......@@ -52,7 +53,8 @@ class ComparBaseSheet
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) = 0;
const MsRun *p_msrun,
const Label *p_label = nullptr) = 0;
void writeProteinMatch(const ProteinMatch *p_protein_match);
......@@ -66,6 +68,9 @@ class ComparBaseSheet
QString _first_cell_coordinate;
IdentificationGroup *_p_current_identification_group;
LabelingMethodSp _sp_labelling_method;
std::vector<Label *> _label_list;
};
#endif // COMPARBASESHEET_H
......@@ -32,7 +32,8 @@
ComparSpecificSpectraSheet::ComparSpecificSpectraSheet(
OdsExport *p_ods_export, CalcWriterInterface *p_writer,
OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project)
: ComparBaseSheet(p_ods_export, p_writer, p_project)
{
......@@ -42,8 +43,10 @@ ComparSpecificSpectraSheet::ComparSpecificSpectraSheet(
void
ComparSpecificSpectraSheet::writeComparValue(
const ProteinMatch *p_protein_match, ValidationState state,
const MsRun *p_msrun)
const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparSpecificSpectraSheet::writeComparValue begin";
_p_writer->writeCell(
......@@ -55,7 +58,8 @@ ComparSpecificSpectraSheet::writeComparValue(
ComparSpecificSequenceSheet::ComparSpecificSequenceSheet(
OdsExport *p_ods_export, CalcWriterInterface *p_writer,
OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project)
: ComparBaseSheet(p_ods_export, p_writer, p_project)
{
......@@ -64,8 +68,10 @@ ComparSpecificSequenceSheet::ComparSpecificSequenceSheet(
void
ComparSpecificSequenceSheet::writeComparValue(
const ProteinMatch *p_protein_match, ValidationState state,
const MsRun *p_msrun)
const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparSpecificSequenceSheet::writeComparValue begin";
_p_writer->writeCell(
......
......@@ -42,7 +42,8 @@ class ComparSpecificSpectraSheet : public ComparBaseSheet
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
};
class ComparSpecificSequenceSheet : public ComparBaseSheet
......@@ -55,7 +56,8 @@ class ComparSpecificSequenceSheet : public ComparBaseSheet
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
};
#endif // COMPARSPECIFICSPECTRASHEET_H
......@@ -46,7 +46,8 @@ ComparSpectraSheet::ComparSpectraSheet(OdsExport *p_ods_export,
void
ComparSpectraSheet::writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun)
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparSpectraSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun));
......@@ -65,7 +66,8 @@ ComparSequenceSheet::ComparSequenceSheet(OdsExport *p_ods_export,
void
ComparSequenceSheet::writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun)
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparSequenceSheet::writeComparValue begin";
_p_writer->writeCell(
......@@ -83,7 +85,9 @@ ComparPaiSheet::ComparPaiSheet(OdsExport *p_ods_export,
void
ComparPaiSheet::writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state, const MsRun *p_msrun)
ValidationState state,
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparPaiSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->getPAI(p_msrun));
......@@ -100,7 +104,9 @@ ComparEmpaiSheet::ComparEmpaiSheet(OdsExport *p_ods_export,
void
ComparEmpaiSheet::writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state, const MsRun *p_msrun)
ValidationState state,
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparEmpaiSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->getEmPAI(p_msrun));
......@@ -117,7 +123,9 @@ ComparNsafSheet::ComparNsafSheet(OdsExport *p_ods_export,
void
ComparNsafSheet::writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state, const MsRun *p_msrun)
ValidationState state,
const MsRun *p_msrun,
const Label *p_label)
{
qDebug() << "ComparNsafSheet::writeComparValue begin";
pappso::pappso_double proto_nsaf_sum = 0;
......
......@@ -36,62 +36,72 @@
class ComparSpectraSheet : public ComparBaseSheet
{
public:
ComparSpectraSheet(OdsExport *p_ods_export, CalcWriterInterface *p_writer,
ComparSpectraSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project);
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
};
class ComparSequenceSheet : public ComparBaseSheet
{
public:
ComparSequenceSheet(OdsExport *p_ods_export, CalcWriterInterface *p_writer,
ComparSequenceSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project);
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
};
class ComparPaiSheet : public ComparBaseSheet
{
public:
ComparPaiSheet(OdsExport *p_ods_export, CalcWriterInterface *p_writer,
ComparPaiSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project);
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
};
class ComparEmpaiSheet : public ComparBaseSheet
{
public:
ComparEmpaiSheet(OdsExport *p_ods_export, CalcWriterInterface *p_writer,
ComparEmpaiSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project);
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
};
class ComparNsafSheet : public ComparBaseSheet
{
public:
ComparNsafSheet(OdsExport *p_ods_export, CalcWriterInterface *p_writer,
ComparNsafSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
const Project *p_project);
protected:
virtual void writeComparValue(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun) override;
const MsRun *p_msrun,
const Label *p_label = nullptr) override;
private:
std::map<const MsRun *, pappso::pappso_double> _map_proto_nsaf_sum_by_msrun;
......
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