diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index 6ae01e73cae6a0239efd5a137d91a9a34a17cd07..a8f9efebc7f54f5434d3d67a54e25b3465719994 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -48,6 +48,17 @@ const GroupStore & IdentificationGroup::getGroupStore() const { return _group_store; } +unsigned int IdentificationGroup::countPeptideMass(ValidationState state) const { + + std::vector<pappso::GrpPeptide *> count_peptide_mass; + for (auto & p_protein_match : _protein_match_list) { + p_protein_match->countPeptideMass(count_peptide_mass, state); + } + std::sort(count_peptide_mass.begin(), count_peptide_mass.end()); + auto last = std::unique(count_peptide_mass.begin(),count_peptide_mass.end()); + return std::distance(count_peptide_mass.begin(),last); +} + unsigned int IdentificationGroup::countPeptideMassSample(ValidationState state) const { std::vector<std::size_t> count_peptide_mass_sample; diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index c9acc25d4c5dd94dddc09501afe1f7ee14d0344d..055785bbe85309ffa4d6a9b1f4f5fd1001b719af 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -50,7 +50,7 @@ public: void addProteinMatch(ProteinMatch * protein_match); std::vector<ProteinMatch *> & getProteinMatchList(); void addIdentificationDataSourceP(IdentificationDataSource * p_identification_source); - + const PtmGroupingExperiment * getPtmGroupingExperiment() const; /** @brief count groups @@ -64,32 +64,36 @@ public: /** @brief count proteins * */ unsigned int countProteinMatch(ValidationState state) const; - + /** @brief count decoy proteins * */ unsigned int countDecoyProteinMatch(ValidationState state) const; - + /** @brief count peptide match (peptide spectrum match + protein match) * */ unsigned int countPeptideMatch(ValidationState state) const; - + /** @brief count decoy peptide match * */ unsigned int countDecoyPeptideMatch(ValidationState state) const; - + + /** @brief count distinct peptides overall samples(peptide+mass) including peptides from decoy proteins + * */ + unsigned int countPeptideMass(ValidationState state) const; + /** @brief count peptide (peptide+mass+sample) including peptides from decoy proteins * */ unsigned int countPeptideMassSample(ValidationState state) const; - + /** @brief count peptide (peptide+mass+sample) only on decoy proteins * */ unsigned int countDecoyPeptideMassSample(ValidationState state) const; - - /** @brief get False Discovery Rate of proteins + + /** @brief get False Discovery Rate of proteins */ pappso::pappso_double getProteinFdr(ValidationState state = ValidationState::valid) const; - - /** @brief get False Discovery Rate of peptide/mass (unique sequence+modifications) + + /** @brief get False Discovery Rate of peptide/mass (unique sequence+modifications) */ pappso::pappso_double getPeptideMassFdr(ValidationState state = ValidationState::valid) const; @@ -114,7 +118,7 @@ public: void collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const; private : - + void addMsRunSp(MsRunSp ms_run_sp); private : GroupingExperiment * _p_grp_experiment= nullptr; diff --git a/src/core/proteinmatch.cpp b/src/core/proteinmatch.cpp index de44379b6e643e38468de60e0c1ca60b6ee6ccbb..6866522fec7ff4a997c2fb8bcea72b5d708d5b77 100644 --- a/src/core/proteinmatch.cpp +++ b/src/core/proteinmatch.cpp @@ -179,6 +179,14 @@ const pappso::GrpProteinSp & ProteinMatch::getGrpProteinSp() const { } +void ProteinMatch::countPeptideMass(std::vector<pappso::GrpPeptide *> & count_peptide_mass, ValidationState state) const { + for (auto & p_peptide_match : _peptide_match_list) { + if (p_peptide_match->getValidationState() >= state) { + count_peptide_mass.push_back(p_peptide_match->getGrpPeptideSp().get()); + } + } +} + void ProteinMatch::countPeptideMassSample(std::vector<size_t> & count_peptide_mass_sample, ValidationState state) const { for (auto & p_peptide_match : _peptide_match_list) { if (p_peptide_match->getValidationState() >= state) { diff --git a/src/core/proteinmatch.h b/src/core/proteinmatch.h index d9a854a3cb40849a6f373e11a9f2388ab178a6f6..01717dd4e013c56c6d5f081847d759acc28ef870 100644 --- a/src/core/proteinmatch.h +++ b/src/core/proteinmatch.h @@ -98,6 +98,10 @@ public: */ unsigned int countSampleScan(ValidationState state, const MsRun * p_msrun_id=nullptr) const; + /** @brief count peptide (peptide+mass) + */ + void countPeptideMass(std::vector<pappso::GrpPeptide *> & count_peptide_mass, ValidationState state) const; + /** @brief count peptide (peptide+mass+sample) */ void countPeptideMassSample(std::vector<size_t> & count_peptide_mass_sample, ValidationState state) const; diff --git a/src/gui/project_view/identification_group_widget/identification_group_widget.ui b/src/gui/project_view/identification_group_widget/identification_group_widget.ui index 657e21d30954fb03b431d64919e00e1eac71217e..c001e747bfae7f63f97a2236d826025ad0570610 100644 --- a/src/gui/project_view/identification_group_widget/identification_group_widget.ui +++ b/src/gui/project_view/identification_group_widget/identification_group_widget.ui @@ -88,13 +88,27 @@ </property> </widget> </item> - <item row="5" column="0"> + <item row="6" column="0"> <widget class="QPushButton" name="view_ptm_island_button"> <property name="text"> <string>View PTM islands</string> </property> </widget> </item> + <item row="5" column="0"> + <widget class="QLabel" name="grouped_peptide_label"> + <property name="text"> + <string>number of grouped distinct peptides</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="grouped_peptide_display"> + <property name="text"> + <string>0</string> + </property> + </widget> + </item> </layout> </item> </layout> diff --git a/src/gui/project_view/identification_group_widget/identificationgroupwidget.cpp b/src/gui/project_view/identification_group_widget/identificationgroupwidget.cpp index 14f2c9e500c145aaa94359747d5783792a3dfa18..d10b748420f1401cadda5428fdb39e630f52df2b 100644 --- a/src/gui/project_view/identification_group_widget/identificationgroupwidget.cpp +++ b/src/gui/project_view/identification_group_widget/identificationgroupwidget.cpp @@ -73,6 +73,7 @@ void IdentificationGroupWidget::doIdentificationGroupGrouped(IdentificationGroup ui->group_number_display->setText(QString("%1").arg(_p_identification_group->countGroup())); ui->subgroup_number_display->setText(QString("%1").arg(_p_identification_group->countSubGroup())); ui->protein_number_display->setText(QString("%1").arg(_p_identification_group->countProteinMatch(ValidationState::grouped))); + ui->grouped_peptide_display->setText(QString("%1").arg(_p_identification_group->countPeptideMass(ValidationState::grouped))); _p_identification_group->countPeptideMatch(ValidationState::grouped); } }