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

countSpecificSampleScan is able to count distinct labels

parent 8ea82da7
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,8 @@ GroupingGroup::countSubgroupPresence(
std::size_t
GroupingGroup::countSpecificSampleScan(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun_id) const
const MsRun *p_msrun_id,
const Label *p_label) const
{
if(_number_of_subgroup == 1)
{
......@@ -139,11 +140,29 @@ GroupingGroup::countSpecificSampleScan(const ProteinMatch *p_protein_match,
}
else
{
if(p_peptide_match.getPeptideEvidence()->getMsRunP() ==
p_msrun_id)
if(p_label != nullptr)
{
if((p_peptide_match.getPeptideEvidence()->getMsRunP() ==
p_msrun_id) &&
(p_peptide_match.getPeptideEvidence()
->getPeptideXtpSp()
.get()
->getLabel() == p_label))
{
spectrum_list_in.insert(
p_peptide_match.getPeptideEvidence()
->getHashSampleScan());
}
}
else
{
spectrum_list_in.insert(
p_peptide_match.getPeptideEvidence()->getHashSampleScan());
if(p_peptide_match.getPeptideEvidence()->getMsRunP() ==
p_msrun_id)
{
spectrum_list_in.insert(
p_peptide_match.getPeptideEvidence()
->getHashSampleScan());
}
}
}
}
......@@ -235,7 +254,8 @@ unsigned int
GroupingGroup::countProteinInSubgroup(unsigned int subgroup_number) const
{
return std::count_if(
_protein_match_list.begin(), _protein_match_list.end(),
_protein_match_list.begin(),
_protein_match_list.end(),
[subgroup_number](const ProteinMatch *p_protein_match) {
if(p_protein_match->getGrpProteinSp().get()->getSubGroupNumber() ==
subgroup_number)
......
......@@ -30,6 +30,7 @@
#include <QStringList>
#include "../utils/types.h"
#include "../core/msrun.h"
#include "../core/labeling/label.h"
class ProteinMatch;
class PeptideEvidence;
......@@ -48,7 +49,8 @@ class GroupingGroup
void add(const ProteinMatch *p_protein_match);
std::size_t countSpecificSampleScan(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun_id = nullptr) const;
const MsRun *p_msrun_id = nullptr,
const Label *p_label = nullptr) const;
std::size_t countSpecificSequenceLi(const ProteinMatch *p_protein_match,
ValidationState state,
const MsRun *p_msrun_id = nullptr) const;
......
......@@ -52,7 +52,7 @@ ComparSpecificSpectraSheet::writeComparValue(
_p_writer->writeCell(
(unsigned int)p_protein_match->getGroupingGroupSp()
.get()
->countSpecificSampleScan(p_protein_match, state, p_msrun));
->countSpecificSampleScan(p_protein_match, state, p_msrun, p_label));
qDebug() << "ComparSpecificSpectraSheet::writeComparValue end";
}
......
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