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

peptide evidence store seems to work

parent 50528077
No related branches found
No related tags found
No related merge requests found
......@@ -85,10 +85,6 @@ public :
const std::map<PeptideMatchParam, QVariant> & getParamList() const;
/** @brief get stop position of this peptide inside the protein sequence
* @return stop position in the protein amino acid sequence (starts at 0)
* */
unsigned int getStop() const;
void setCharge(unsigned int charge);
void setPeptideXtpSp (PeptideXtpSp peptide);
void setIdentificationDataSource(IdentificationDataSource* identification_source);
......
......@@ -128,6 +128,7 @@ void ProteinMatch::setChecked(bool arg1) {
}
void ProteinMatch::addPeptideMatch(const PeptideMatch & peptide_match) {
qDebug() << "ProteinMatch::addPeptideMatch begin " << peptide_match.getPeptideEvidence()->getPeptideXtpSp().get()->toAbsoluteString();
_peptide_match_list.push_back(peptide_match);
}
......
......@@ -30,10 +30,33 @@
******************************************************************************/
#include "peptideevidencestore.h"
#include <QDebug>
#include "../core/peptideevidence.h"
std::shared_ptr<PeptideEvidence> & PeptideEvidenceStore::getInstance(const PeptideEvidence * p_peptide_evidence) {
qDebug() << "PeptideEvidenceStore::getInstance begin" ;
std::multimap<unsigned int ,PeptideEvidenceSp>::iterator it = _multimap_scan_evidence.find(p_peptide_evidence->getScan());
std::multimap<unsigned int ,PeptideEvidenceSp>::iterator find_it = _multimap_scan_evidence.end();
while ((find_it == _multimap_scan_evidence.end()) && (it->first == p_peptide_evidence->getScan())) {
if (it->second.get()->getPeptideXtpSp().get() == p_peptide_evidence->getPeptideXtpSp().get()) {
//it is the same peptide
find_it = it;
}
it++;
}
if (find_it == _multimap_scan_evidence.end()) {
// insert it
find_it = _multimap_scan_evidence.insert(std::pair<unsigned int , PeptideEvidenceSp>(p_peptide_evidence->getScan(), p_peptide_evidence->makePeptideEvidenceSp()));
_peptide_evidence_list.push_back(find_it->second);
}
qDebug() << "PeptideEvidenceStore::getInstance end " << find_it->second.get()->getScan() << " size=" << _multimap_scan_evidence.size();
return find_it->second;
}
void PeptideEvidenceStore::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) {
......
......@@ -33,6 +33,7 @@
#include <memory>
#include <vector>
#include <map>
#include "../core/automaticfilterparameters.h"
class PeptideEvidence;
......@@ -44,6 +45,8 @@ public:
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
private:
std::vector<std::shared_ptr<PeptideEvidence>> _peptide_evidence_list;
std::multimap<unsigned int ,std::shared_ptr<PeptideEvidence>> _multimap_scan_evidence;
};
#endif // PEPTIDEEVIDENCESTORE_H
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