libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
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
void set (const GrpPeptideSet &peptide_set_in, GrpGroupSp grp_group)
 set peptide keys pointing on the group
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}

Referenced by GrpMapPeptideToGroup().

◆ 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

References GrpMapPeptideToGroup(), and 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 88 of file grpmappeptidetogroup.cpp.

89{
90
91 std::list<GrpGroupSp> new_list;
92 for(auto &pair_map : m_mapPeptideToGroup)
93 {
94 new_list.push_back(pair_map.second);
95 }
96 new_list.sort();
97 new_list.unique();
98
99 grp_group_list.splice(grp_group_list.end(), new_list);
100 m_mapPeptideToGroup.clear();
101}

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.

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

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 71 of file grpmappeptidetogroup.cpp.

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

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 GrpMapPeptideToGroup(), clear(), getGroupList(), and set().


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