Commit 4c7b95fc authored by Langella Olivier's avatar Langella Olivier
Browse files

new attempt to fix issue #31

parent 6fc33e78
......@@ -328,6 +328,7 @@ Project::prepareMsrunRetentionTimesForAlignment() const
.getIdentificationDataSourceList())
{
std::map<MsRun *, std::vector<PeptideEvidence *>>
peptide_evidence_list_by_msrun;
for(auto &peptide_evidence :
......@@ -338,61 +339,55 @@ Project::prepareMsrunRetentionTimesForAlignment() const
{
MsRun *p_msrun = peptide_evidence.get()->getMsRunPtr();
try
auto ret = peptide_evidence_list_by_msrun.insert(
std::pair<MsRun *, std::vector<PeptideEvidence *>>(
p_msrun, std::vector<PeptideEvidence *>()));
if(ret.second == false)
{
if(p_msrun->getMsRunRetentionTimePtr() == nullptr)
{
p_msrun->buildMsRunRetentionTime(empty_store);
peptide_evidence_list_by_msrun.insert(
std::pair<MsRun *, std::vector<PeptideEvidence *>>(
p_msrun, std::vector<PeptideEvidence *>()));
}
p_msrun->getMsRunRetentionTimePtr()
->getMsRunReaderSPtr()
.get()
->releaseDevice();
peptide_evidence_list_by_msrun.at(p_msrun).push_back(
peptide_evidence.get());
// "element 'z' already existed";
}
catch(pappso::PappsoException &error)
{
throw pappso::PappsoException(
QString("Error while processing PeptideEvidenceList at "
"evidence %1, size=%2"
":\n %3")
.arg(peptide_evidence.get()
->getPeptideXtpSp()
.get()
->getLiAbsoluteString())
.arg(peptide_evidence_list_by_msrun.at(p_msrun).size())
.arg(error.qwhat()));
}
ret.first->second.push_back(peptide_evidence.get());
qDebug() << "msrun=" << p_msrun->getRunId()
<< " size pe=" << ret.first->second.size();
}
}
for(auto &msrun_list_element : peptide_evidence_list_by_msrun)
{
MsRun *p_msrun = msrun_list_element.first;
qDebug();
if(p_msrun->getMsRunRetentionTimePtr() == nullptr)
{
p_msrun->buildMsRunRetentionTime(empty_store);
}
p_msrun->getMsRunRetentionTimePtr()
->getMsRunReaderSPtr()
.get()
->acquireDevice();
qDebug();
for(auto &peptide_evidence : msrun_list_element.second)
{
qDebug();
try
{
if(peptide_evidence->isValid())
{
std::size_t spectrum_index =
p_msrun->getMsRunRetentionTimePtr()
->getMsRunReaderSPtr()
.get()
->scanNumber2SpectrumIndex(
peptide_evidence->getScanNumber());
qDebug() << "spectrum_index=" << spectrum_index;
p_msrun->getMsRunRetentionTimePtr()->addPeptideAsSeamark(
peptide_evidence->getPeptideXtpSp()
.get()
->getNativePeptideP(),
p_msrun->getMsRunReaderSPtr()
.get()
->scanNumber2SpectrumIndex(
peptide_evidence->getScanNumber()));
spectrum_index);
}
}
catch(pappso::PappsoException &error)
......@@ -409,14 +404,17 @@ Project::prepareMsrunRetentionTimesForAlignment() const
.arg(msrun_list_element.second.size())
.arg(error.qwhat()));
}
qDebug();
}
p_msrun->getMsRunRetentionTimePtr()
->getMsRunReaderSPtr()
.get()
->releaseDevice();
qDebug();
}
}
qDebug();
if(is_ok)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment