libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::GrpPeptideSet Class Reference

#include <grppeptideset.h>

Public Member Functions

 GrpPeptideSet ()
 GrpPeptideSet (const GrpPeptideSet &other)
 GrpPeptideSet (const GrpProtein *p_protein)
 ~GrpPeptideSet ()
GrpPeptideSetoperator= (const GrpPeptideSet &other)
bool operator== (const GrpPeptideSet &other) const
unsigned int size () const
bool biggerAndContainsAll (const GrpPeptideSet &peptideSet) const
bool contains (const GrpPeptide *p_grp_peptide) const
bool containsAll (const GrpPeptideSet &peptideSet) const
bool containsAny (const GrpPeptideSet &peptideSet) const
void addAll (const GrpPeptideSet &peptideSet)
const QString printInfos () const
void numbering ()
void setGroupNumber (unsigned int i)
std::vector< const GrpPeptide * > getGrpPeptideList () const

Private Member Functions

bool privContainsAll (const GrpPeptideSet &peptideSetIn) const

Private Attributes

std::list< GrpPeptide * > m_peptidePtrList

Friends

class GrpMapPeptideToSubGroupSet
class GrpMapPeptideToGroup

Detailed Description

Definition at line 35 of file grppeptideset.h.

Constructor & Destructor Documentation

◆ GrpPeptideSet() [1/3]

GrpPeptideSet::GrpPeptideSet ( )

◆ GrpPeptideSet() [2/3]

GrpPeptideSet::GrpPeptideSet ( const GrpPeptideSet & other)

Definition at line 41 of file grppeptideset.cpp.

42{
43}
std::list< GrpPeptide * > m_peptidePtrList

References GrpPeptideSet(), and m_peptidePtrList.

◆ GrpPeptideSet() [3/3]

GrpPeptideSet::GrpPeptideSet ( const GrpProtein * p_protein)

Definition at line 32 of file grppeptideset.cpp.

33{
34 auto it = p_protein->begin();
35 while(it != p_protein->end())
36 {
37 m_peptidePtrList.push_back(*it);
38 it++;
39 }
40}
const_iterator end() const
const_iterator begin() const

References pappso::GrpProtein::begin(), pappso::GrpProtein::end(), and m_peptidePtrList.

◆ ~GrpPeptideSet()

GrpPeptideSet::~GrpPeptideSet ( )

Definition at line 45 of file grppeptideset.cpp.

46{
47}

Member Function Documentation

◆ addAll()

void GrpPeptideSet::addAll ( const GrpPeptideSet & peptideSet)

Definition at line 163 of file grppeptideset.cpp.

164{
165
166 qDebug() << "GrpPeptideSet::addAll begin";
167 std::list<GrpPeptide *>::iterator it(m_peptidePtrList.begin());
168 std::list<GrpPeptide *>::iterator itEnd(m_peptidePtrList.end());
169 std::list<GrpPeptide *>::const_iterator itIn(peptideSetIn.m_peptidePtrList.begin());
170 std::list<GrpPeptide *>::const_iterator itInEnd(peptideSetIn.m_peptidePtrList.end());
171
172 while((itIn != itInEnd) && (it != itEnd))
173 {
174 if(*itIn > *it)
175 {
176 it++;
177 continue;
178 }
179 if(*itIn < *it)
180 {
181 it = m_peptidePtrList.insert(it, *itIn);
182 it++;
183 itIn++;
184 continue;
185 }
186 if(*itIn == *it)
187 {
188 itIn++;
189 it++;
190 }
191 }
192 while(itIn != itInEnd)
193 {
194 m_peptidePtrList.push_back(*itIn);
195 itIn++;
196 }
197 qDebug() << "GrpPeptideSet::addAll end";
198}

References GrpPeptideSet(), and m_peptidePtrList.

◆ biggerAndContainsAll()

bool GrpPeptideSet::biggerAndContainsAll ( const GrpPeptideSet & peptideSet) const

Definition at line 88 of file grppeptideset.cpp.

89{
90 if(m_peptidePtrList.size() > peptideSetIn.m_peptidePtrList.size())
91 {
92 return privContainsAll(peptideSetIn);
93 }
94 return false;
95}
bool privContainsAll(const GrpPeptideSet &peptideSetIn) const

References GrpPeptideSet(), m_peptidePtrList, and privContainsAll().

◆ contains()

bool GrpPeptideSet::contains ( const GrpPeptide * p_grp_peptide) const

Definition at line 67 of file grppeptideset.cpp.

68{
69 if(std::find(m_peptidePtrList.begin(), m_peptidePtrList.end(), p_grp_peptide) ==
70 m_peptidePtrList.end())
71 {
72 return false;
73 }
74 return true;
75}

References m_peptidePtrList.

◆ containsAll()

bool GrpPeptideSet::containsAll ( const GrpPeptideSet & peptideSet) const

Definition at line 78 of file grppeptideset.cpp.

79{
80 if(m_peptidePtrList.size() < peptideSetIn.m_peptidePtrList.size())
81 {
82 return false;
83 }
84 return privContainsAll(peptideSetIn);
85}

References GrpPeptideSet(), m_peptidePtrList, and privContainsAll().

◆ containsAny()

bool GrpPeptideSet::containsAny ( const GrpPeptideSet & peptideSet) const

Definition at line 132 of file grppeptideset.cpp.

133{
134 std::list<GrpPeptide *>::const_iterator innerIt, outerIt, innerEnd, outerEnd;
135
136 innerIt = peptideSetIn.m_peptidePtrList.begin();
137 innerEnd = peptideSetIn.m_peptidePtrList.end();
138 outerIt = m_peptidePtrList.begin();
139 outerEnd = m_peptidePtrList.end();
140
141
142 while((innerIt != innerEnd) && (outerIt != outerEnd))
143 {
144 if(*innerIt > *outerIt)
145 {
146 outerIt++;
147 continue;
148 }
149 if(*innerIt < *outerIt)
150 {
151 innerIt++;
152 continue;
153 }
154 if(*innerIt == *outerIt)
155 {
156 return true;
157 }
158 }
159 return false;
160}

References GrpPeptideSet(), and m_peptidePtrList.

◆ getGrpPeptideList()

std::vector< const GrpPeptide * > GrpPeptideSet::getGrpPeptideList ( ) const

Definition at line 232 of file grppeptideset.cpp.

233{
234 std::vector<const GrpPeptide *> peptide_list;
235 for(GrpPeptide *peptide : m_peptidePtrList)
236 {
237 peptide_list.push_back(peptide);
238 }
239 return peptide_list;
240}

References m_peptidePtrList.

◆ numbering()

void GrpPeptideSet::numbering ( )

Definition at line 202 of file grppeptideset.cpp.

203{
204 qDebug() << "GrpPeptideSet::numbering begin";
205
206 m_peptidePtrList.sort(
207 [](GrpPeptide *first, GrpPeptide *second) { return ((*first) < (*second)); });
208 unsigned int i = 1;
209 for(auto &&p_grp_peptide : m_peptidePtrList)
210 {
211 p_grp_peptide->setRank(i);
212 i++;
213 }
214
215 qDebug() << "GrpPeptideSet::numbering end";
216}

References m_peptidePtrList.

◆ operator=()

GrpPeptideSet & GrpPeptideSet::operator= ( const GrpPeptideSet & other)

Definition at line 50 of file grppeptideset.cpp.

51{
53 return *this;
54}

References GrpPeptideSet(), and m_peptidePtrList.

◆ operator==()

bool GrpPeptideSet::operator== ( const GrpPeptideSet & other) const

Definition at line 57 of file grppeptideset.cpp.

58{
59 if(m_peptidePtrList.size() != other.m_peptidePtrList.size())
60 {
61 return false;
62 }
63 return privContainsAll(other);
64}

References GrpPeptideSet(), m_peptidePtrList, and privContainsAll().

◆ printInfos()

const QString GrpPeptideSet::printInfos ( ) const

Definition at line 243 of file grppeptideset.cpp.

244{
245 QString infos;
246 std::list<GrpPeptide *>::const_iterator it(m_peptidePtrList.begin()),
247 itEnd(m_peptidePtrList.end());
248
249
250 while(it != itEnd)
251 {
252 infos.append((*it)->getSequence() + " " +
253 QString("0x%1").arg((quintptr)*it, QT_POINTER_SIZE * 2, 16, QChar('0')) + "\n");
254 it++;
255 }
256
257 return infos;
258}

References m_peptidePtrList.

◆ privContainsAll()

bool GrpPeptideSet::privContainsAll ( const GrpPeptideSet & peptideSetIn) const
private

Definition at line 98 of file grppeptideset.cpp.

99{
100 std::list<GrpPeptide *>::const_iterator innerIt, outerIt, innerEnd, outerEnd;
101 innerIt = peptideSetIn.m_peptidePtrList.begin();
102 innerEnd = peptideSetIn.m_peptidePtrList.end();
103 outerIt = m_peptidePtrList.begin();
104 outerEnd = m_peptidePtrList.end();
105
106
107 while((innerIt != innerEnd) && (outerIt != outerEnd))
108 {
109 if(*innerIt > *outerIt)
110 {
111 outerIt++;
112 continue;
113 }
114 if(*innerIt < *outerIt)
115 {
116 return false;
117 }
118 if(*innerIt == *outerIt)
119 {
120 innerIt++;
121 outerIt++;
122 }
123 }
124 if(innerIt == innerEnd)
125 {
126 return true;
127 }
128 return false;
129}

References GrpPeptideSet(), and m_peptidePtrList.

Referenced by biggerAndContainsAll(), containsAll(), and operator==().

◆ setGroupNumber()

void GrpPeptideSet::setGroupNumber ( unsigned int i)

Definition at line 220 of file grppeptideset.cpp.

221{
222 qDebug() << "GrpPeptideSet::setGroupNumber begin";
223 for(auto &&p_grp_peptide : m_peptidePtrList)
224 {
225 p_grp_peptide->setGroupNumber(i);
226 }
227
228 qDebug() << "GrpPeptideSet::setGroupNumber end";
229}

References m_peptidePtrList.

◆ size()

unsigned int pappso::GrpPeptideSet::size ( ) const
inline

Definition at line 54 of file grppeptideset.h.

55 {
56 return m_peptidePtrList.size();
57 };

References m_peptidePtrList.

Referenced by pappso::GrpSubGroup::operator<().

◆ GrpMapPeptideToGroup

friend class GrpMapPeptideToGroup
friend

Definition at line 38 of file grppeptideset.h.

References GrpMapPeptideToGroup.

Referenced by GrpMapPeptideToGroup.

◆ GrpMapPeptideToSubGroupSet

friend class GrpMapPeptideToSubGroupSet
friend

Definition at line 37 of file grppeptideset.h.

References GrpMapPeptideToSubGroupSet.

Referenced by GrpMapPeptideToSubGroupSet.

Member Data Documentation

◆ m_peptidePtrList


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