libpappsomspp
Library for mass spectrometry
pappso::GrpMapPeptideToGroup Class Reference

#include <grpmappeptidetogroup.h>

Public Member Functions

 GrpMapPeptideToGroup ()
 
 GrpMapPeptideToGroup (const GrpMapPeptideToGroup &other)
 
 ~GrpMapPeptideToGroup ()
 
void getGroupList (const GrpPeptideSet &peptide_set_in, std::list< GrpGroupSp > &impacted_group_list) const
 get all groups concerned by a list of peptides More...
 
void set (const GrpPeptideSet &peptide_set_in, GrpGroupSp grp_group)
 set peptide keys pointing on the group More...
 
void clear (std::list< GrpGroupSp > &grp_group_list)
 

Private Attributes

std::map< GrpPeptide *, GrpGroupSpm_mapPeptideToGroup
 

Detailed Description

Definition at line 42 of file grpmappeptidetogroup.h.

Constructor & Destructor Documentation

◆ GrpMapPeptideToGroup() [1/2]

pappso::GrpMapPeptideToGroup::GrpMapPeptideToGroup ( )

Definition at line 36 of file grpmappeptidetogroup.cpp.

37 {
38 }

◆ GrpMapPeptideToGroup() [2/2]

pappso::GrpMapPeptideToGroup::GrpMapPeptideToGroup ( const GrpMapPeptideToGroup other)

Definition at line 40 of file grpmappeptidetogroup.cpp.

41  : m_mapPeptideToGroup(other.m_mapPeptideToGroup)
42 {
43 }
std::map< GrpPeptide *, GrpGroupSp > m_mapPeptideToGroup

◆ ~GrpMapPeptideToGroup()

pappso::GrpMapPeptideToGroup::~GrpMapPeptideToGroup ( )

Definition at line 45 of file grpmappeptidetogroup.cpp.

46 {
47 }

Member Function Documentation

◆ clear()

void pappso::GrpMapPeptideToGroup::clear ( std::list< GrpGroupSp > &  grp_group_list)

Definition at line 94 of file grpmappeptidetogroup.cpp.

95 {
96 
97  std::list<GrpGroupSp> new_list;
98  for(auto &pair_map : m_mapPeptideToGroup)
99  {
100  new_list.push_back(pair_map.second);
101  }
102  new_list.sort();
103  new_list.unique();
104 
105  grp_group_list.splice(grp_group_list.end(), new_list);
106  m_mapPeptideToGroup.clear();
107 }

References m_mapPeptideToGroup.

Referenced by pappso::GrpExperiment::removeNonInformativeSubGroups(), and pappso::GrpExperiment::startGrouping().

◆ getGroupList()

void pappso::GrpMapPeptideToGroup::getGroupList ( const GrpPeptideSet peptide_set_in,
std::list< GrpGroupSp > &  impacted_group_list 
) const

get all groups concerned by a list of peptides

Definition at line 50 of file grpmappeptidetogroup.cpp.

53 {
54  auto it_peptide_end = peptide_set_in.m_peptidePtrList.end();
55  std::map<GrpPeptide *, GrpGroupSp>::const_iterator it_map_end =
56  m_mapPeptideToGroup.end();
57 
58  for(auto it_peptide = peptide_set_in.m_peptidePtrList.begin();
59  it_peptide != it_peptide_end;
60  it_peptide++)
61  {
62  std::map<GrpPeptide *, GrpGroupSp>::const_iterator it_map =
63  m_mapPeptideToGroup.find(*it_peptide);
64  if(it_map != it_map_end)
65  {
66  impacted_group_list.push_back(it_map->second);
67  }
68  }
69  impacted_group_list.sort();
70  impacted_group_list.unique();
71 }

References m_mapPeptideToGroup, and pappso::GrpPeptideSet::m_peptidePtrList.

Referenced by pappso::GrpExperiment::addSubGroupSp().

◆ set()

void pappso::GrpMapPeptideToGroup::set ( const GrpPeptideSet peptide_set_in,
GrpGroupSp  grp_group 
)

set peptide keys pointing on the group

Definition at line 74 of file grpmappeptidetogroup.cpp.

76 {
77 
78  auto it_peptide_end = peptide_set_in.m_peptidePtrList.end();
79 
80  for(auto it_peptide = peptide_set_in.m_peptidePtrList.begin();
81  it_peptide != it_peptide_end;
82  it_peptide++)
83  {
84  std::pair<std::map<GrpPeptide *, GrpGroupSp>::iterator, bool> ret =
85  m_mapPeptideToGroup.insert(
86  std::pair<GrpPeptide *, GrpGroupSp>(*it_peptide, grp_group));
87  if(ret.second == false)
88  { //=> key already exists : replace by grp_group
89  ret.first->second = grp_group;
90  }
91  }
92 }

References m_mapPeptideToGroup, and pappso::GrpPeptideSet::m_peptidePtrList.

Referenced by pappso::GrpExperiment::addSubGroupSp().

Member Data Documentation

◆ m_mapPeptideToGroup

std::map<GrpPeptide *, GrpGroupSp> pappso::GrpMapPeptideToGroup::m_mapPeptideToGroup
private

Definition at line 45 of file grpmappeptidetogroup.h.

Referenced by clear(), getGroupList(), and set().


The documentation for this class was generated from the following files: