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

compar sequence, specific sequence, PAI and emPAI added

parent 780d4336
No related branches found
No related tags found
No related merge requests found
......@@ -216,17 +216,7 @@ unsigned int ProteinMatch::countPeptideMatch(ValidationState state) const {
});
}
size_t ProteinMatch::countUniqueSequenceLi(ValidationState state)const {
std::set<QString> sequence_list;
for (auto & p_peptide_match : _peptide_match_list) {
if (p_peptide_match->getValidationState() >= state) {
sequence_list.insert(p_peptide_match->getPeptideXtpSp().get()->getSequenceLi());
}
}
return sequence_list.size();
}
unsigned int ProteinMatch::countSequenceLi(ValidationState state, const MsRun * p_msrun_id) const {
size_t ProteinMatch::countSequenceLi(ValidationState state, const MsRun * p_msrun_id) const {
std::set<QString> sequence_list;
for (auto & p_peptide_match : _peptide_match_list) {
if (p_peptide_match->getValidationState() >= state) {
......
......@@ -91,11 +91,6 @@ public:
*/
void countPeptideMassSample(std::vector<size_t> & count_peptide_mass_sample, ValidationState state) const;
/** @brief count unique identified sequences (from valid and cheked spectrums)
* */
size_t countUniqueSequenceLi(ValidationState state)const;
const pappso::GrpProteinSp & getGrpProteinSp() const;
const GroupingGroupSp & getGroupingGroupSp() const;
......@@ -113,7 +108,7 @@ public:
* @param state validation state of peptides to count
* @param p_msrun_id count within the specified sample
*/
unsigned int countSequenceLi(ValidationState state,const MsRun * p_msrun_id) const;
size_t countSequenceLi(ValidationState state,const MsRun * p_msrun_id=nullptr) const;
/** @brief count distinct peptide+mass+charge
* peptide is the peptide sequence LI (Leucine => Isoleucine)
......
......@@ -128,7 +128,7 @@ std::size_t GroupingGroup::countSpecificSampleScan(const ProteinMatch * p_protei
std::size_t GroupingGroup::countSpecificSequenceLi(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun_id) const {
if (_number_of_subgroup == 1) {
return p_protein_match->countUniqueSequenceLi(state);
return p_protein_match->countSequenceLi(state);
}
std::set<QString> sequence_list_in;
for (auto && p_peptide_match :p_protein_match->getPeptideMatchList()) {
......
......@@ -181,7 +181,7 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
}
if (_column_assignment[col] == (std::int8_t) ProteinListColumn::sequence ) {
return QVariant ((qreal) _p_identification_group->getProteinMatchList().at(row)->countUniqueSequenceLi(ValidationState::validAndChecked));
return QVariant ((qreal) _p_identification_group->getProteinMatchList().at(row)->countSequenceLi(ValidationState::validAndChecked));
}
if (_column_assignment[col] == (std::int8_t) ProteinListColumn::specific_sequence ) {
GroupingGroup * p_groupin_group = _p_identification_group->getProteinMatchList().at(row)->getGroupingGroupSp().get();
......
......@@ -41,3 +41,13 @@ void ComparSpecificSpectraSheet::writeComparValue(const ProteinMatch * p_protein
qDebug() << "ComparSpecificSpectraSheet::writeComparValue end";
}
ComparSpecificSequenceSheet::ComparSpecificSequenceSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) {
_title_sheet = "compar specific unique sequence";
}
void ComparSpecificSequenceSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
qDebug() << "ComparSpecificSequenceSheet::writeComparValue begin";
_p_writer->writeCell((unsigned int) p_protein_match->getGroupingGroupSp().get()->countSpecificSequenceLi(p_protein_match, state, p_msrun));
qDebug() << "ComparSpecificSequenceSheet::writeComparValue end";
}
......@@ -39,4 +39,13 @@ protected :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) override;
};
class ComparSpecificSequenceSheet:public ComparBaseSheet
{
public :
ComparSpecificSequenceSheet (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;
};
#endif // COMPARSPECIFICSPECTRASHEET_H
......@@ -43,3 +43,34 @@ void ComparSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match,
_p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun));
qDebug() << "ComparSpectraSheet::writeComparValue end";
}
ComparSequenceSheet::ComparSequenceSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) {
_title_sheet = "compar unique sequence";
}
void ComparSequenceSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
qDebug() << "ComparSequenceSheet::writeComparValue begin";
_p_writer->writeCell((unsigned int) p_protein_match->countSequenceLi(state, p_msrun));
qDebug() << "ComparSequenceSheet::writeComparValue end";
}
ComparPaiSheet::ComparPaiSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) {
_title_sheet = "compar PAI";
}
void ComparPaiSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
qDebug() << "ComparPaiSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->getPAI(p_msrun));
qDebug() << "ComparPaiSheet::writeComparValue end";
}
ComparEmpaiSheet::ComparEmpaiSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) {
_title_sheet = "compar emPAI";
}
void ComparEmpaiSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) {
qDebug() << "ComparEmpaiSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->getEmPAI(p_msrun));
qDebug() << "ComparEmpaiSheet::writeComparValue end";
}
......@@ -41,4 +41,32 @@ protected :
virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) override;
};
class ComparSequenceSheet:public ComparBaseSheet
{
public :
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;
};
class ComparPaiSheet:public ComparBaseSheet
{
public :
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;
};
class ComparEmpaiSheet:public ComparBaseSheet
{
public :
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;
};
#endif // COMPARSPECTRASHEET_H
......@@ -82,4 +82,16 @@ void OdsExport::write(CalcWriterInterface * p_writer) {
if (settings.value("export_ods/comparspecificspectra", "true").toBool()) {
ComparSpecificSpectraSheet(this, p_writer, _p_project).writeSheet();
}
if (settings.value("export_ods/comparuniquesequence", "true").toBool()) {
ComparSequenceSheet(this, p_writer, _p_project).writeSheet();
}
if (settings.value("export_ods/comparspecificuniquesequence", "true").toBool()) {
ComparSpecificSequenceSheet(this, p_writer, _p_project).writeSheet();
}
if (settings.value("export_ods/comparpai", "true").toBool()) {
ComparPaiSheet(this, p_writer, _p_project).writeSheet();
}
if (settings.value("export_ods/comparempai", "true").toBool()) {
ComparEmpaiSheet(this, p_writer, _p_project).writeSheet();
}
}
......@@ -136,7 +136,7 @@ void ProteinSheet::writeOneProtein(const GroupingGroup * p_group, const ProteinM
_p_writer->writeCell((unsigned int) p_group->countSpecificSampleScan(p_protein_match, validation_state));
// _p_writer->writeCell("Uniques");
_p_writer->writeCell((unsigned int) p_protein_match->countUniqueSequenceLi(validation_state));
_p_writer->writeCell((unsigned int) p_protein_match->countSequenceLi(validation_state));
// _p_writer->writeCell("Specific uniques");
_p_writer->writeCell((unsigned int) p_group->countSpecificSequenceLi(p_protein_match, validation_state));
......
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