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

Add TDF MsRunStatistics to MsIdentification view

parent dba7e823
No related branches found
No related tags found
1 merge request!20Handle tdf for MsRunStatistics
......@@ -335,6 +335,43 @@ MsRun::checkMsRunStatistics(MsRunStatisticsHandler *currentHandler)
}
}
void
MsRun::checkMsRunStatisticsForTdf(MsRunStatisticsHandler *currentHandler)
{
QVariant msrun_var = getMsRunStatistics(MsRunStatistics::total_spectra);
if(msrun_var.isNull())
{
try
{
QString directory =
QFileInfo(getFileName()).absoluteDir().absolutePath();
pappso::TimsData *tims_data = new pappso::TimsData(directory);
if(currentHandler->shouldStop())
{ // statistics handler was stopped : don't use collected statistics
// because it is only partial
}
else
{
setMsRunStatistics(MsRunStatistics::total_spectra, "NA");
setMsRunStatistics(
MsRunStatistics::total_spectra_ms1,
(unsigned int)tims_data->getTotalNumberOfPrecursors());
setMsRunStatistics(
MsRunStatistics::total_spectra_ms2,
(unsigned int)tims_data->getTotalNumberOfScans());
setMsRunStatistics(MsRunStatistics::total_spectra_ms3, 0);
setMsRunStatistics(MsRunStatistics::tic_spectra_ms1, "NA");
setMsRunStatistics(MsRunStatistics::tic_spectra_ms2, "NA");
setMsRunStatistics(MsRunStatistics::tic_spectra_ms3, "NA");
}
}
catch(pappso::ExceptionNotFound &error)
{
// no file found, no statistics
}
}
}
pappso::MsRunXicExtractorInterfaceSp
MsRun::getMsRunXicExtractorInterfaceSp()
{
......
......@@ -83,6 +83,7 @@ class MsRun : public pappso::MsRunId
void checkMsRunStatistics();
void checkMsRunStatistics(MsRunStatisticsHandler *currentHandler);
void checkMsRunStatisticsForTdf(MsRunStatisticsHandler *currentHandler);
pappso::MsRunXicExtractorInterfaceSp getMsRunXicExtractorInterfaceSp();
......
......@@ -180,6 +180,23 @@ MsIdListWorkerStatus::doComputeMsNumberForTDF(
{
try
{
if(mpa_currentHandler == nullptr)
{
mpa_currentHandler =
new MsIdentificationTableMsRunStatisticsHandler;
identificationDataSource->getMsRunSp()
->checkMsRunStatisticsForTdf(mpa_currentHandler);
if(!mpa_currentHandler->shouldStop())
{
// if statistics computing is interrupted : don't take
// into account results because it is partial
m_identificationReady.push_back(
identificationDataSource.get());
}
delete mpa_currentHandler;
mpa_currentHandler = nullptr;
}
}
catch(pappso::PappsoException &error)
{
......
......@@ -63,7 +63,6 @@ enum class WorkerStatus : std::int8_t
Ready = 3,
NotReady = 4,
Error = 5,
NotAvailable = 6,
};
class MsIdentificationListWindow;
class MsIdListWorkerStatus
......@@ -78,8 +77,10 @@ class MsIdListWorkerStatus
*/
WorkerStatus getStatus(IdentificationDataSourceSp identificationDataSource);
void doComputeMsNumber(IdentificationDataSourceSp identificationDataSource);
void doComputeMsNumberForTDF(IdentificationDataSourceSp identificationDataSource);
void doComputeMsNumberForMzXML(IdentificationDataSourceSp identificationDataSource);
void
doComputeMsNumberForTDF(IdentificationDataSourceSp identificationDataSource);
void doComputeMsNumberForMzXML(
IdentificationDataSourceSp identificationDataSource);
void changeWaitingQueue(int row);
......
......@@ -400,18 +400,8 @@ MsIdentificationTableModel::data(const QModelIndex &index, int role) const
}
if(col == (std::int8_t)msIdentificationListColumn::nb_tic_1)
{
// if(QFileInfo(m_identificationDataSourceSpList.at(row)
// ->getMsRunSp()
// ->getFileName())
// .completeSuffix() == "tdf")
// {
// return QVariant("NA");
// }
// else
// {
return getMsRunStatisticsNumber(row,
MsRunStatistics::tic_spectra_ms1);
// }
}
if(col == (std::int8_t)msIdentificationListColumn::nb_tic_2)
{
......
......@@ -109,7 +109,8 @@ class MsIdentificationTableModel : public QAbstractTableModel
private:
static int getColumnWidth(int column);
QVariant getMsRunStatisticsFollowingFormat(MsRunSp msrun_sp, MsRunStatistics column) const;
QVariant getMsRunStatisticsFollowingFormat(MsRunSp msrun_sp,
MsRunStatistics column) const;
private:
std::vector<IdentificationDataSourceSp> m_identificationDataSourceSpList;
......
......@@ -332,7 +332,7 @@ PepXmlSaxHandler::startElement_spectrum_query(QXmlAttributes attributes)
//<alternative_protein protein="sp|P46784|RS10B_YEAST" protein_descr="40S
// ribosomal protein S10-B OS=Saccharomyces cerevisiae (strain ATCC 204508
// \
// \
//S288c) GN=RPS10B PE=1 SV=1" num_tol_term="2" peptide_prev_aa="K"
// peptide_next_aa="N"/>
bool
......
......@@ -88,8 +88,7 @@ enum class PeptideEvidenceParam : std::int8_t
comet_sprank = 18, ///< MS:1002256 "The Comet result 'SpRank'." [PSI:PI]
comet_expectation_value =
19, ///< MS:1002257 "The Comet result 'Expectation value'." [PSI:PI]
pappso_qvalue =
20, ///< q-value computed with FDR = decoy / (decoy + target)
pappso_qvalue = 20, ///< q-value computed with FDR = decoy / (decoy + target)
};
......
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