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

countSampleScan is able to count dictinctive labels

parent 4dfe2fa9
No related branches found
No related tags found
No related merge requests found
......@@ -283,7 +283,8 @@ ProteinMatch::getPeptideMatchList(ValidationState state,
unsigned int
ProteinMatch::countSampleScan(ValidationState state,
const MsRun *p_msrun_id) const
const MsRun *p_msrun_id,
const Label *p_label) const
{
std::vector<std::size_t> count_sample_scan;
for(auto &peptide_match : _peptide_match_list)
......@@ -299,10 +300,23 @@ ProteinMatch::countSampleScan(ValidationState state,
}
else
{
if(p_peptide_evidence->getMsRunP() == p_msrun_id)
if(p_label != nullptr)
{
if((p_peptide_evidence->getMsRunP() == p_msrun_id) &&
(p_peptide_evidence->getPeptideXtpSp().get()->getLabel() ==
p_label))
{
count_sample_scan.push_back(
p_peptide_evidence->getHashSampleScan());
}
}
else
{
count_sample_scan.push_back(
p_peptide_evidence->getHashSampleScan());
if(p_peptide_evidence->getMsRunP() == p_msrun_id)
{
count_sample_scan.push_back(
p_peptide_evidence->getHashSampleScan());
}
}
}
}
......@@ -316,7 +330,8 @@ unsigned int
ProteinMatch::countPeptideMatch(ValidationState state) const
{
return std::count_if(
_peptide_match_list.begin(), _peptide_match_list.end(),
_peptide_match_list.begin(),
_peptide_match_list.end(),
[state](const PeptideMatch &peptide_match) {
if(peptide_match.getPeptideEvidence()->getValidationState() >= state)
{
......
......@@ -127,7 +127,8 @@ class ProteinMatch
* identification
*/
unsigned int countSampleScan(ValidationState state,
const MsRun *p_msrun_id = nullptr) const;
const MsRun *p_msrun_id = nullptr,
const Label *p_label = nullptr) const;
/** @brief count peptide (peptide+mass)
*/
......
......@@ -50,7 +50,7 @@ ComparSpectraSheet::writeComparValue(const ProteinMatch *p_protein_match,
const Label *p_label)
{
qDebug() << "ComparSpectraSheet::writeComparValue begin";
_p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun));
_p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun,p_label));
qDebug() << "ComparSpectraSheet::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