Commit 478e8319 authored by Renne Thomas's avatar Renne Thomas
Browse files

Add number of spectra in peptide pos spreadsheet

parent f5c4cd9c
......@@ -86,6 +86,7 @@ PeptidePosSheet::writeHeaders(IdentificationGroup *p_ident)
writeCellHeader(PeptideListColumn::sequence_nter);
writeCellHeader(PeptideListColumn::sequence);
writeCellHeader(PeptideListColumn::sequence_cter);
_p_writer->writeCell("Number of spectra");
writeCellHeader(PeptideListColumn::modifs);
writeCellHeader(PeptideListColumn::start);
_p_writer->writeCell("Stop");
......@@ -101,6 +102,9 @@ PeptidePosSheet::writeBestPeptideMatch(const ProteinMatch *p_protein_match,
const PeptideEvidence *p_peptide_evidence =
peptide_match.getPeptideEvidence();
std::sort(m_sample_scan_list.begin(), m_sample_scan_list.end());
auto last = std::unique(m_sample_scan_list.begin(), m_sample_scan_list.end());
m_sample_scan_list.erase(last, m_sample_scan_list.end());
unsigned int group_number =
p_protein_match->getGrpProteinSp().get()->getGroupNumber();
......@@ -129,6 +133,7 @@ PeptidePosSheet::writeBestPeptideMatch(const ProteinMatch *p_protein_match,
p_peptide_evidence->getPeptideXtpSp().get()->getSequence());
_p_writer->writeCell(
p_protein_match->getFlankingCterRegion(peptide_match, 1));
_p_writer->writeCell((unsigned int)m_sample_scan_list.size());
_p_writer->writeCell(
p_peptide_evidence->getPeptideXtpSp().get()->getModifString());
_p_writer->writeCell(peptide_match.getStart() + 1);
......@@ -136,6 +141,7 @@ PeptidePosSheet::writeBestPeptideMatch(const ProteinMatch *p_protein_match,
peptide_match.getStart() +
p_peptide_evidence->getPeptideXtpSp().get()->getSequence().size());
_p_writer->writeCell(p_peptide_evidence->getPeptideXtpSp().get()->getMz(1));
m_sample_scan_list.clear();
}
void
......@@ -195,9 +201,13 @@ PeptidePosSheet::writeIdentificationGroup(IdentificationGroup *p_ident)
});
const PeptideMatch *p_best_peptide_match = nullptr;
m_sample_scan_list.clear();
for(auto &peptide_match : peptide_match_list)
{
const PeptideEvidence *p_peptide_evidence =
peptide_match.getPeptideEvidence();
if(p_best_peptide_match == nullptr)
{
p_best_peptide_match = &peptide_match;
......@@ -228,6 +238,7 @@ PeptidePosSheet::writeIdentificationGroup(IdentificationGroup *p_ident)
p_best_peptide_match = &peptide_match;
}
}
m_sample_scan_list.push_back(p_peptide_evidence->getHashSampleScan());
}
if(p_best_peptide_match != nullptr)
......
......@@ -29,8 +29,7 @@
******************************************************************************/
#ifndef PEPTIDEPOSSHEET_H
#define PEPTIDEPOSSHEET_H
#pragma once
#include "../../core/project.h"
......@@ -58,6 +57,5 @@ class PeptidePosSheet
OdsExport *_p_ods_export;
const Project *_p_project;
CalcWriterInterface *_p_writer;
std::vector<size_t> m_sample_scan_list;
};
#endif // PEPTIDEPOSSHEET_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment