32 #include "../pappsoexception.h"
44 : m_subGroupList(other.m_subGroupList),
45 m_peptideSet(other.m_peptideSet),
46 m_mapPeptideToSubGroupSet(other.m_mapPeptideToSubGroupSet)
54 std::vector<GrpSubGroupSpConst>
57 std::vector<GrpSubGroupSpConst> subgroup_list;
60 subgroup_list.push_back(subgroup);
65 const std::list<GrpSubGroupSp> &
100 return std::make_shared<GrpGroup>(*
this);
113 if(
this == p_group_to_add)
116 QObject::tr(
"addGroup ERROR, this == p_group_to_add"));
128 qDebug() <<
"GrpGroup::check begin ";
131 impacted_subgroup_list);
134 qDebug() <<
"GrpGroup::check impacted_subgroup_list.size() != "
135 "this->m_subGroupList.size()";
136 qDebug() << impacted_subgroup_list.
printInfos();
140 qDebug() << sg->getFirstAccession() <<
" " << sg.get();
145 qDebug() <<
"GrpGroup::check end ";
153 qDebug() <<
"GrpGroup::addSubGroupSp begin "
154 << grpSubGroupSp.get()->getFirstAccession();
161 impacted_subgroup_list);
162 if(impacted_subgroup_list.
contains(grpSubGroupSp.get()))
165 QObject::tr(
"addSubGroupSp ERROR, subgroup %1 is already in group")
166 .arg(grpSubGroupSp.get()->getFirstAccession()));
170 qDebug() <<
"GrpGroup::addSubGroupSp look for impacted subgroup equal to "
171 "incoming subgroup and merge it and exit";
174 while(it_impacted_sg != it_impacted_sg_end)
177 if((*it_impacted_sg)->merge(grpSubGroupSp.get()))
179 qDebug() <<
"GrpGroup::addSubGroupSp merge";
186 qDebug() <<
"GrpGroup::addSubGroupSp look for impacted subgroup including "
187 "totally the incoming subgroup and exit";
189 while(it_impacted_sg != it_impacted_sg_end)
191 if((*it_impacted_sg)->includes(grpSubGroupSp.get()))
193 qDebug() <<
"GrpGroup::addSubGroupSp includes";
201 qDebug() <<
"GrpGroup::addSubGroupSp look for impacted subgroup totally "
202 "included in incoming subgroup and remove it";
204 while(it_impacted_sg != it_impacted_sg_end)
206 if(grpSubGroupSp.get()->includes((*it_impacted_sg)))
211 it_impacted_sg = impacted_subgroup_list.
erase(it_impacted_sg);
214 return (sg_to_remove == sub_groupSp.get());
224 <<
"GrpGroup::addSubGroupSp finally add the new subgroup to current group";
235 qDebug() <<
"GrpGroup::addSubGroupSp end";
242 qDebug() <<
"GrpGroup::setGroupNumber begin";
246 sub_group_sp->setGroupNumber(i);
249 qDebug() <<
"GrpGroup::setGroupNumber end";
256 qDebug() <<
"GrpGroup::numbering begin";
260 sub_group_sp.get()->numbering();
263 return ((*first.get()) < (*second.get()));
268 sub_group_sp.get()->setSubGroupNumber(i);
273 qDebug() <<
"GrpGroup::numbering end";
280 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup begin";
281 std::list<GrpSubGroup *> subgroup_list_to_remove;
290 subgroup_list_to_remove.push_back(sub_group_sp.get());
293 if(subgroup_list_to_remove.size() == 0)
295 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup end false";
301 return ((*first) < (*second));
305 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup "
306 "subgroup_list_to_remove.front()->peptideListSize() "
307 << subgroup_list_to_remove.front()->peptideListSize();
308 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup "
309 "subgroup_list_to_remove.back()->peptideListSize() "
310 << subgroup_list_to_remove.back()->peptideListSize();
313 GrpSubGroup *sg_to_remove = subgroup_list_to_remove.front();
316 <<
"GrpGroup::removeFirstNonInformativeSubGroup m_subGroupList.size() "
319 return (sg_to_remove == sub_groupSp.get());
321 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup after remove if "
322 "m_subGroupList.size() "
324 qDebug() <<
"GrpGroup::removeFirstNonInformativeSubGroup end true";
331 qDebug() <<
"GrpGroup::removeNonInformativeSubGroups begin";
336 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 hasSpecificPeptide(const GrpSubGroup *get) const
tells if this subgroup contains a specific peptide
void getSubGroupSet(const GrpPeptideSet &peptide_set_in, GrpSubGroupSet &impacted_subgroup_set) const
get all subgroups concerned by a list of peptides
void remove(GrpSubGroup *p_remove_sub_group)
removes in the map all references of the group to remove (p_remove_sub_group)
const QString printInfos() const
void add(GrpSubGroup *p_add_sub_group)
add in the map all peptides of the subgroup to add
const QString printInfos() const
void addAll(const GrpPeptideSet &peptideSet)
bool containsAny(const GrpPeptideSet &peptideSet) const
void setGroupNumber(unsigned int i)
bool contains(GrpSubGroup *get) const
const QString printInfos() const
std::list< GrpSubGroup * >::iterator erase(std::list< GrpSubGroup * >::iterator it)
std::list< GrpSubGroup * > m_grpSubGroupPtrList
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