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

Reformat all src files and handle change MsRunStatistics for tdf format

parent f8109af1
No related branches found
No related tags found
1 merge request!20Handle tdf for MsRunStatistics
Showing
with 68 additions and 44 deletions
......@@ -51,12 +51,12 @@ class AutomaticFilterParameters
unsigned int getFilterMinimumPeptidePerMatch() const;
bool getFilterCrossSamplePeptideNumber() const;
unsigned int getFilterPeptideObservedInLessSamplesThan() const;
bool useFDR() const;
private:
double m_filterFDR = -1;
double m_filterFDR = -1;
pappso::pappso_double _filter_minimum_peptide_evalue = 1;
pappso::pappso_double _filter_minimum_protein_evalue = 1;
unsigned int _filter_minimum_peptide_per_match = 1;
......
......@@ -36,8 +36,8 @@
IdentificationMascotDatFile::IdentificationMascotDatFile(
const QFileInfo &mascot_dat_file)
: IdentificationDataSource(mascot_dat_file.absoluteFilePath())
, _mascot_dat_file(mascot_dat_file)
: IdentificationDataSource(mascot_dat_file.absoluteFilePath()),
_mascot_dat_file(mascot_dat_file)
{
_engine = IdentificationEngine::mascot;
}
......
......@@ -51,4 +51,3 @@ class IdentificationMascotDatFile : public IdentificationDataSource
private:
const QFileInfo _mascot_dat_file;
};
......@@ -52,7 +52,7 @@ MsRun::MsRun(const QString &location) : pappso::MsRunId(location)
MsRun::MsRun(const MsRun &other) : pappso::MsRunId(other)
{
_param_stats = other._param_stats;
_param_stats = other._param_stats;
m_centroidOptions = other.m_centroidOptions;
}
......
......@@ -58,7 +58,7 @@ class PeptideXtp : public pappso::Peptide
/** @brief human readable string that contains modifications
* @param without_label get modifications without existing labels
* */
const QString getModifString(bool without_label =false) const;
const QString getModifString(bool without_label = false) const;
/** @brief replace modification in peptide
*/
......
......@@ -185,9 +185,13 @@ class DigestionHandler : public pappso::EnzymeProductInterface
public:
void
setPeptide(std::int8_t sequence_database_id,
const pappso::ProteinSp &protein_sp, bool is_decoy,
const QString &peptide, unsigned int start, bool is_nter,
unsigned int missed_cleavage_number, bool semi_enzyme) override
const pappso::ProteinSp &protein_sp,
bool is_decoy,
const QString &peptide,
unsigned int start,
bool is_nter,
unsigned int missed_cleavage_number,
bool semi_enzyme) override
{
_peptide_list.append(peptide);
};
......@@ -237,7 +241,7 @@ ProteinXtp::countTrypticPeptidesForPAI() const
void
ProteinXtp::parseAccession2dbxref()
{
//qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
QStringList access_list = getAccession().split("|");
// if (access.length == 1)
QRegExp atg("^[Aa][Tt][MmCc1-5][Gg]\\d{5}\\.?\\d?$");
......
......@@ -216,13 +216,14 @@ ComputeQvalues::writeDistributionsByEngines(CalcWriterInterface *p_writer) const
}
// double qvalue = Utils::computeFdr(count_decoy, count_target);
// pep->setParam(PeptideEvidenceParam::pappso_qvalue, QVariant(qvalue));
p_writer->writeCell((int) count_target);
p_writer->writeCell((int)count_target);
p_writer->writeCell((int) count_decoy);
p_writer->writeCell((int)count_decoy);
p_writer->writeCell(pep->getEvalue());
p_writer->writeCell(pep->getParam(PeptideEvidenceParam::pappso_qvalue).toDouble());
p_writer->writeCell(
pep->getParam(PeptideEvidenceParam::pappso_qvalue).toDouble());
p_writer->writeLine();
}
}
......@@ -46,8 +46,8 @@ class ComputeQvalues
* Destructor
*/
~ComputeQvalues();
void writeDistributionsByEngines(CalcWriterInterface * p_writer) const;
void writeDistributionsByEngines(CalcWriterInterface *p_writer) const;
private:
void computeTandemPeptideEvidenceQvalues(
......@@ -60,7 +60,6 @@ class ComputeQvalues
private:
std::set<const PeptideEvidence *> m_falsePeptideEvidenceList;
std::vector<PeptideEvidence *> m_tandemPeptideEvidenceList;
std::vector<PeptideEvidence *> m_tandemPeptideEvidenceList;
};
......@@ -375,7 +375,7 @@ TandemBatchProcess::runOne(const QString &mz_file)
try
{
//QProcess::ExitStatus Status = xt_process->exitStatus();
// QProcess::ExitStatus Status = xt_process->exitStatus();
const QDateTime dt_begin = QDateTime::currentDateTime();
QSettings settings;
......
......@@ -35,7 +35,8 @@
class TandemBatchProcess
{
public:
TandemBatchProcess(MainWindow *p_main_window, WorkMonitorInterface *p_monitor,
TandemBatchProcess(MainWindow *p_main_window,
WorkMonitorInterface *p_monitor,
const TandemRunBatch &tandem_run_batch);
virtual ~TandemBatchProcess();
......
......@@ -262,9 +262,8 @@ TandemCondorProcess::run()
<< " -t "
<< settings.value("timstof/tmp_dir_path", QDir::tempPath())
.toString()
<< "--tandem" << _tandem_run_batch._tandem_bin_path
<< "--centroid" << centroidOption
<< endl;
<< "--tandem" << _tandem_run_batch._tandem_bin_path
<< "--centroid" << centroidOption << endl;
}
*p_out << "Queue" << endl;
}
......
......@@ -266,7 +266,7 @@ TandemParameters::setParamLabelValue(const QString &label, const QString &value)
(label == "residue, potential modification mass 3") ||
(label == "residue, potential modification motif 1") ||
(label == "residue, potential modification motif 2") ||
(label == "residue, potential modification motif 3")||
(label == "residue, potential modification motif 3") ||
(label == "spectrum, timstof MS2 centroid parameters"))
{
// string
......
......@@ -275,7 +275,8 @@ unsigned int
GroupingGroup::countProteinInSubgroup(unsigned int subgroup_number) const
{
return std::count_if(
_protein_match_list.begin(), _protein_match_list.end(),
_protein_match_list.begin(),
_protein_match_list.end(),
[subgroup_number](const ProteinMatch *p_protein_match) {
if(p_protein_match->getGrpProteinSp().get()->getSubGroupNumber() ==
subgroup_number)
......
......@@ -99,7 +99,8 @@ PtmGroupingExperiment::getPtmIslandList() const
void
PtmGroupingExperiment::numbering()
{
std::sort(_ptm_island_group_list.begin(), _ptm_island_group_list.end(),
std::sort(_ptm_island_group_list.begin(),
_ptm_island_group_list.end(),
[](const PtmIslandGroupSp a, const PtmIslandGroupSp b) {
return *(a.get()) < *(b.get());
});
......@@ -192,7 +193,8 @@ PtmGroupingExperiment::mergePeptideMatchPtmIslandList(
for(PtmIslandSp ptm_island_sp : ptm_island_list)
{
// http://en.cppreference.com/w/cpp/algorithm/all_any_none_of
if(std::none_of(new_ptm_island_list.begin(), new_ptm_island_list.end(),
if(std::none_of(new_ptm_island_list.begin(),
new_ptm_island_list.end(),
[ptm_island_sp](PtmIslandSp element) {
return element.get()->merge(ptm_island_sp);
}))
......
......@@ -152,7 +152,8 @@ bool
PtmIsland::containsPeptideMatch(const PeptideMatch &peptide_match) const
{
return std::any_of(_peptide_match_list.begin(), _peptide_match_list.end(),
return std::any_of(_peptide_match_list.begin(),
_peptide_match_list.end(),
[peptide_match](const PeptideMatch &element) {
return (peptide_match == element);
});
......@@ -199,7 +200,8 @@ PtmIsland::getProteinStartPosition() const
bool
PtmIsland::merge(PtmIslandSp ptm_island_sp)
{
if(std::none_of(_peptide_match_list.begin(), _peptide_match_list.end(),
if(std::none_of(_peptide_match_list.begin(),
_peptide_match_list.end(),
[ptm_island_sp](const PeptideMatch &element) {
return ptm_island_sp.get()->containsPeptideMatch(element);
}))
......@@ -213,7 +215,8 @@ PtmIsland::merge(PtmIslandSp ptm_island_sp)
_peptide_match_list.begin(),
ptm_island_sp.get()->_peptide_match_list.begin(),
ptm_island_sp.get()->_peptide_match_list.end());
std::sort(_peptide_match_list.begin(), _peptide_match_list.end(),
std::sort(_peptide_match_list.begin(),
_peptide_match_list.end(),
[](const PeptideMatch &a, const PeptideMatch &b) {
return (a.operator<(b));
});
......@@ -231,14 +234,16 @@ PtmIsland::merge(PtmIslandSp ptm_island_sp)
std::vector<PeptideMatch>::const_iterator it_result =
std::max_element(_peptide_match_list.begin(), _peptide_match_list.end(),
std::max_element(_peptide_match_list.begin(),
_peptide_match_list.end(),
[](const PeptideMatch &a, const PeptideMatch &b) {
return (a.getStop() < b.getStop());
});
_protein_stop = it_result->getStop();
it_result =
std::min_element(_peptide_match_list.begin(), _peptide_match_list.end(),
std::min_element(_peptide_match_list.begin(),
_peptide_match_list.end(),
[](const PeptideMatch &a, const PeptideMatch &b) {
return a.getStart() < b.getStart();
});
......
......@@ -80,7 +80,8 @@ PtmIslandGroup::setGroupNumber(unsigned int number)
{
ptm_island_subgroup.get()->setPtmIslandGroup(this);
}
std::sort(_ptm_island_subgroup_list.begin(), _ptm_island_subgroup_list.end(),
std::sort(_ptm_island_subgroup_list.begin(),
_ptm_island_subgroup_list.end(),
[](const PtmIslandSubgroupSp &a, const PtmIslandSubgroupSp &b) {
return (a.get()->getFirstPtmIsland()->getProteinStartPosition() <
b.get()->getFirstPtmIsland()->getProteinStartPosition());
......@@ -116,7 +117,8 @@ unsigned int
PtmIslandGroup::maxCountSampleScan() const
{
std::vector<PtmIslandSubgroupSp>::const_iterator it_result = std::max_element(
_ptm_island_subgroup_list.begin(), _ptm_island_subgroup_list.end(),
_ptm_island_subgroup_list.begin(),
_ptm_island_subgroup_list.end(),
[](const PtmIslandSubgroupSp &a, const PtmIslandSubgroupSp &b) {
return (a.get()->countSampleScan() < b.get()->countSampleScan());
});
......
......@@ -73,7 +73,8 @@ PtmIslandSubgroup::setSubgroupNumber(unsigned int number)
ptm_island.get()->setPtmIslandSubgroup(this);
}
std::sort(
_ptm_island_list.begin(), _ptm_island_list.end(),
_ptm_island_list.begin(),
_ptm_island_list.end(),
[](const PtmIslandSp &a, const PtmIslandSp &b) {
return (
a.get()->getProteinMatch()->getProteinXtpSp().get()->getAccession() <
......@@ -92,7 +93,8 @@ PtmIslandSubgroup::setPtmIslandGroup(PtmIslandGroup *p_ptm_island_group)
{
_ptm_island_group_p = p_ptm_island_group;
std::sort(
_ptm_island_list.begin(), _ptm_island_list.end(),
_ptm_island_list.begin(),
_ptm_island_list.end(),
[](const PtmIslandSp &a, const PtmIslandSp &b) {
return (
a.get()->getProteinMatch()->getProteinXtpSp().get()->getAccession() <
......
......@@ -95,7 +95,8 @@ PtmSampleScan::add(const PeptideMatch &peptide_match)
// qDebug() << __FILE__ << " " << __FUNCTION__<< " " << __LINE__ ;
// sort list
std::sort(_peptide_match_list.begin(), _peptide_match_list.end(),
std::sort(_peptide_match_list.begin(),
_peptide_match_list.end(),
[](const PeptideMatch &first, const PeptideMatch &second) {
return (first.getPeptideEvidence()->getEvalue() <
second.getPeptideEvidence()->getEvalue());
......
......@@ -30,7 +30,7 @@
namespace Ui
{
class AboutDialog;
class AboutDialog;
}
class AboutDialog : public QDialog
......
......@@ -48,17 +48,25 @@ ChooseModificationDialog::ChooseModificationDialog(QWidget *parent)
#if QT_VERSION >= 0x050000
// Qt5 code
connect(ui->modification_listview, &QListView::clicked, this,
connect(ui->modification_listview,
&QListView::clicked,
this,
&ChooseModificationDialog::ItemClicked);
connect(ui->modification_listview, &QListView::doubleClicked, this,
connect(ui->modification_listview,
&QListView::doubleClicked,
this,
&ChooseModificationDialog::ItemDoubleClicked);
#else
// Qt4 code
connect(ui->modification_listview, SIGNAL(clicked(const QModelIndex)), this,
connect(ui->modification_listview,
SIGNAL(clicked(const QModelIndex)),
this,
SLOT(ItemClicked(QModelIndex)));
connect(ui->modification_listview, SIGNAL(doubleClicked(const QModelIndex)),
this, SLOT(ItemDoubleClicked(QModelIndex)));
connect(ui->modification_listview,
SIGNAL(doubleClicked(const QModelIndex)),
this,
SLOT(ItemDoubleClicked(QModelIndex)));
#endif
}
......
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