Skip to content
Snippets Groups Projects
Commit 5e243621 authored by Langella Olivier's avatar Langella Olivier
Browse files

new function to get retention time from mz data if needed

parent 229810ad
No related branches found
No related tags found
No related merge requests found
......@@ -315,6 +315,33 @@ PeptideEvidence::getRetentionTime() const
{
return _rt;
}
pappso::pappso_double
PeptideEvidence::getHardenedRetentionTime() const
{
if(_rt == 0)
{
// try to look at mz data file
if(_p_identification_source != nullptr)
{
MsRunSp msrunsp = _p_identification_source->getMsRunSp();
if(msrunsp != nullptr)
{
pappso::MsRunReaderSPtr reader =
msrunsp.get()->getMsRunReaderSPtr();
if(reader != nullptr)
{
pappso::QualifiedMassSpectrum qmassspec =
reader.get()->qualifiedMassSpectrum(m_scan_number, false);
return qmassspec.getRtInSeconds();
}
}
}
}
return _rt;
}
unsigned int
PeptideEvidence::getCharge() const
{
......
......@@ -119,7 +119,22 @@ class PeptideEvidence
MsRun *getMsRunPtr();
IdentificationDataSource *getIdentificationDataSource() const;
unsigned int getScanNumber() const;
/** @brief get retention time of this PSM in seconds
* the retention time must have been present when reading MS identification
* results. If no retention time was set, this returns O
* @return retention time in seconds or zero if data is missing
*/
pappso::pappso_double getRetentionTime() const;
/** @brief get retention time of this PSM in seconds by all means
*
* if retention time is missing, this tries to guess it by all means. It will
* try to look at mz data file.
* This could be time consuming.
* @return retention time in seconds or zero if data is missing
*/
pappso::pappso_double getHardenedRetentionTime() const;
unsigned int getCharge() const;
const PeptideXtpSp &getPeptideXtpSp() const;
pappso::pappso_double getEvalue() const;
......
......@@ -63,7 +63,7 @@ class XicDetectionList : public pappso::TraceDetectionSinkInterface
{
for(const PeptideEvidence *p_evidence : peptide_evidence_list)
{
_rt_list.push_back(p_evidence->getRetentionTime());
_rt_list.push_back(p_evidence->getHardenedRetentionTime());
}
}
void
......@@ -363,9 +363,10 @@ XicBox::setXic(std::vector<pappso::XicCstSPtr> xic_sp_list)
for(const PeptideEvidence *peptide_evidence : _peptide_evidence_list)
{
qDebug() << "XicBox::setXic peptide_evidence "
<< peptide_evidence->getRetentionTime();
<< peptide_evidence->getHardenedRetentionTime();
ui->xic_widget->addMsMsEvent(
xic_isotope.xic_sp.get(), peptide_evidence->getRetentionTime());
xic_isotope.xic_sp.get(),
peptide_evidence->getHardenedRetentionTime());
}
}
}
......
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