Skip to content
Snippets Groups Projects
Commit 05e670ee authored by Renne Thomas's avatar Renne Thomas
Browse files

Export PTm spectra of checked ptm island

parent eed8eb06
No related branches found
No related tags found
1 merge request!33Multiples Corrections and features implementations
......@@ -62,7 +62,7 @@ PtmIsland::size() const
return _protein_stop - _protein_start;
}
bool PtmIsland::isChecked()
bool PtmIsland::isChecked() const
{
return m_checked;
}
......
......@@ -77,7 +77,7 @@ class PtmIsland
unsigned int getStart() const;
unsigned int size() const;
void setChecked(bool check_status);
bool isChecked();
bool isChecked() const;
std::vector<PtmSampleScanSp> getPtmSampleScanSpList() const;
......
......@@ -237,7 +237,10 @@ PtmSpectraSheet::writeBestPeptideEvidence(
// return _ptm_sample_scan_list.at(row).get()->getObservedPtmPositionList();
for(const PtmIsland *ptm_island : ptmisland_occurence_list)
{
position_list << ptm_island->getGroupingId();
if(ptm_island->isChecked())
{
position_list << ptm_island->getGroupingId();
}
}
_p_writer->writeCell(position_list.join(" "));
......@@ -286,41 +289,48 @@ PtmSpectraSheet::writePtmIslandSubgroupSp(
for(PtmIslandSp ptm_island_sp :
ptm_island_subgroup_sp.get()->getPtmIslandList())
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
for(PeptideMatch peptide_match :
ptm_island_sp.get()->getPeptideMatchList())
if(ptm_island_sp->isChecked())
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
std::vector<PtmSampleScanOccurence>::iterator it_ptm =
ptm_sample_scan_occurence_list.begin();
std::vector<PtmSampleScanOccurence>::iterator it_ptm_end =
ptm_sample_scan_occurence_list.end();
while((it_ptm != it_ptm_end) &&
(it_ptm->ptm_sample_scan.add(peptide_match) == false))
{
// peptide added
it_ptm++;
}
if(it_ptm == it_ptm_end)
for(PeptideMatch peptide_match :
ptm_island_sp.get()->getPeptideMatchList())
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
// peptide NOT added
PtmSampleScanOccurence new_occurence = {
PtmSampleScan(peptide_match), std::set<const PtmIsland *>()};
new_occurence.ptmisland_occurence_list.insert(
ptm_island_sp.get());
ptm_sample_scan_occurence_list.push_back(new_occurence);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
}
else
{
// peptide added
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
it_ptm->ptmisland_occurence_list.insert(ptm_island_sp.get());
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
std::vector<PtmSampleScanOccurence>::iterator it_ptm =
ptm_sample_scan_occurence_list.begin();
std::vector<PtmSampleScanOccurence>::iterator it_ptm_end =
ptm_sample_scan_occurence_list.end();
while((it_ptm != it_ptm_end) &&
(it_ptm->ptm_sample_scan.add(peptide_match) == false))
{
// peptide added
it_ptm++;
}
if(it_ptm == it_ptm_end)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " "
<< __LINE__;
// peptide NOT added
PtmSampleScanOccurence new_occurence = {
PtmSampleScan(peptide_match),
std::set<const PtmIsland *>()};
new_occurence.ptmisland_occurence_list.insert(
ptm_island_sp.get());
ptm_sample_scan_occurence_list.push_back(new_occurence);
qDebug() << __FILE__ << " " << __FUNCTION__ << " "
<< __LINE__;
}
else
{
// peptide added
qDebug() << __FILE__ << " " << __FUNCTION__ << " "
<< __LINE__;
it_ptm->ptmisland_occurence_list.insert(ptm_island_sp.get());
qDebug() << __FILE__ << " " << __FUNCTION__ << " "
<< __LINE__;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment