54std::vector<GrpSubGroupSpConst>
57 std::vector<GrpSubGroupSpConst> subgroup_list;
60 subgroup_list.push_back(subgroup);
65const std::list<GrpSubGroupSp> &
99 return std::make_shared<GrpGroup>(*
this);
112 if(
this == p_group_to_add)
114 throw PappsoException(QObject::tr(
"addGroup ERROR, this == p_group_to_add"));
126 qDebug() <<
"GrpGroup::check begin ";
131 qDebug() <<
"GrpGroup::check impacted_subgroup_list.size() != "
132 "this->m_subGroupList.size()";
133 qDebug() << impacted_subgroup_list.
printInfos();
137 qDebug() << sg->getFirstAccession() <<
" " << sg.get();
142 qDebug() <<
"GrpGroup::check end ";
150 qDebug() <<
"GrpGroup::addSubGroupSp begin " << grpSubGroupSp.get()->
getFirstAccession();
157 impacted_subgroup_list);
158 if(impacted_subgroup_list.
contains(grpSubGroupSp.get()))
160 throw PappsoException(QObject::tr(
"addSubGroupSp ERROR, subgroup %1 is already in group")
165 qDebug() <<
"GrpGroup::addSubGroupSp look for impacted subgroup equal to "
166 "incoming subgroup and merge it and exit";
169 while(it_impacted_sg != it_impacted_sg_end)
172 if((*it_impacted_sg)->merge(grpSubGroupSp.get()))
174 qDebug() <<
"GrpGroup::addSubGroupSp merge";
181 qDebug() <<
"GrpGroup::addSubGroupSp look for impacted subgroup including "
182 "totally the incoming subgroup and exit";
184 while(it_impacted_sg != it_impacted_sg_end)
186 if((*it_impacted_sg)->includes(grpSubGroupSp.get()))
188 qDebug() <<
"GrpGroup::addSubGroupSp includes";
196 qDebug() <<
"GrpGroup::addSubGroupSp look for impacted subgroup totally "
197 "included in incoming subgroup and remove it";
199 while(it_impacted_sg != it_impacted_sg_end)
201 if(grpSubGroupSp.get()->
includes((*it_impacted_sg)))
206 it_impacted_sg = impacted_subgroup_list.
erase(it_impacted_sg);
209 return (sg_to_remove == sub_groupSp.get());
218 qDebug() <<
"GrpGroup::addSubGroupSp finally add the new subgroup to current group";
229 qDebug() <<
"GrpGroup::addSubGroupSp end";
236 qDebug() <<
"GrpGroup::setGroupNumber begin";
240 sub_group_sp->setGroupNumber(i);
243 qDebug() <<
"GrpGroup::setGroupNumber end";
250 qDebug() <<
"GrpGroup::numbering begin";
254 sub_group_sp.get()->numbering();
261 sub_group_sp.get()->setSubGroupNumber(i);
266 qDebug() <<
"GrpGroup::numbering end";
273 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup begin";
274 std::list<GrpSubGroup *> subgroup_list_to_remove;
283 subgroup_list_to_remove.push_back(sub_group_sp.get());
286 if(subgroup_list_to_remove.size() == 0)
288 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup end false";
293 subgroup_list_to_remove.sort(
297 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup "
298 "subgroup_list_to_remove.front()->peptideListSize() "
299 << subgroup_list_to_remove.front()->peptideListSize();
300 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup "
301 "subgroup_list_to_remove.back()->peptideListSize() "
302 << subgroup_list_to_remove.back()->peptideListSize();
305 GrpSubGroup *sg_to_remove = subgroup_list_to_remove.front();
307 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup m_subGroupList.size() "
310 [sg_to_remove](
GrpSubGroupSp &sub_groupSp) {
return (sg_to_remove == sub_groupSp.get()); });
311 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup after remove if "
312 "m_subGroupList.size() "
314 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup end true";
321 qDebug() <<
"GrpGroup::removeNonInformativeSubGroups begin";
326 qDebug() <<
"GrpGroup::removeNonInformativeSubGroups while";
GrpGroupSp makeGrpGroupSp()
bool removeNonInformativeSubGroups()
void setGroupNumber(unsigned int i)
unsigned int getGroupNumber() const
bool containsAny(const GrpPeptideSet &peptideSet) const
bool removeFirstNonInformativeSubGroup()
std::list< GrpSubGroupSp > m_subGroupList
GrpGroup(GrpSubGroupSp &grpSubGroupSp)
unsigned int m_groupNumber
GrpMapPeptideToSubGroupSet m_mapPeptideToSubGroupSet
const GrpPeptideSet & getGrpPeptideSet() const
const std::list< GrpSubGroupSp > & getSubGroupSpList() const
void addSubGroupSp(const GrpSubGroupSp &grpSubGroupSp)
void addGroup(GrpGroup *p_group_to_add)
bool operator<(const GrpGroup &other) const
GrpPeptideSet m_peptideSet
const QString getGroupingId() const
std::vector< GrpSubGroupSpConst > getGrpSubGroupSpList() const
bool contains(GrpSubGroup *get) const
std::list< GrpSubGroup * >::iterator erase(std::list< GrpSubGroup * >::iterator it)
const QString printInfos() const
std::list< GrpSubGroup * > m_grpSubGroupPtrList
const GrpPeptideSet & getPeptideSet() const
bool includes(const GrpSubGroup *p_subgroup) const
const QString & getFirstAccession() const
static const QString getLexicalOrderedString(unsigned int num)
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< GrpSubGroup > GrpSubGroupSp
std::shared_ptr< GrpGroup > GrpGroupSp