Commit ecb52362 authored by Langella Olivier's avatar Langella Olivier
Browse files

merge

parents 7e6fd8ba 2af2709a
......@@ -48,7 +48,7 @@ else ()
endif ()
#depending on libpappsomspp version :
SET(LIBPAPPSOMSPP_VERSION "0.6.3-1")
SET(LIBPAPPSOMSPP_VERSION "0.6.3-2")
configure_file (${CMAKE_SOURCE_DIR}/debian/control.cmake ${CMAKE_SOURCE_DIR}/debian/control @ONLY)
......
......@@ -2,7 +2,7 @@ xtpcpp (0.2.40-2) buster; urgency=medium
* buster package
-- Olivier Langella <olivier.langella@u-psud.fr> Thu, 12 Sep 2019 15:41:05 +0200
-- Olivier Langella <olivier.langella@u-psud.fr> Thu, 12 Sep 2019 20:25:49 +0200
xtpcpp (0.2.40-1) stretch; urgency=medium
......
......@@ -6,10 +6,10 @@ Priority: optional
Build-Depends: debhelper (>= 9),
cmake (>= 2.6),
qtbase5-dev,
libpappsomspp-widget-dev (= @LIBPAPPSOMSPP_VERSION@),
libpappsomspp-widget-qt5-dev (= @LIBPAPPSOMSPP_VERSION@),
libpwiz-dev,
libodsstream-qt5-dev,
libboost1.62-dev,
libboost1.67-dev,
libqt5svg5-dev,
libboost-dev,
libqcustomplot-dev
......
......@@ -145,6 +145,7 @@ SET(CPP_FILES
output/ods/peptidepossheet.cpp
output/ods/peptidesheet.cpp
output/ods/proteinsheet.cpp
output/ods/qvaluessheet.cpp
output/ods/samplesheet.cpp
output/ods/simplesheet.cpp
output/ods/spectrasheet.cpp
......
......@@ -144,7 +144,7 @@ ComputeQvalues::computeMascotPeptideEvidenceQvalues(
void
ComputeQvalues::computeTandemPeptideEvidenceQvalues(
std::vector<PeptideEvidence *> &tandem_peptide_evidence_list) const
std::vector<PeptideEvidence *> &tandem_peptide_evidence_list)
{
std::sort(tandem_peptide_evidence_list.begin(),
tandem_peptide_evidence_list.end(),
......@@ -169,6 +169,7 @@ ComputeQvalues::computeTandemPeptideEvidenceQvalues(
}
cleanPeptideEvidenceList(tandem_peptide_evidence_list);
m_tandemPeptideEvidenceList = tandem_peptide_evidence_list;
}
void
......@@ -194,3 +195,34 @@ ComputeQvalues::cleanPeptideEvidenceList(
}
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
}
void
ComputeQvalues::writeDistributionsByEngines(CalcWriterInterface *p_writer) const
{
std::size_t count_decoy = 0;
std::size_t count_target = 0;
for(PeptideEvidence *pep : m_tandemPeptideEvidenceList)
{
if(m_falsePeptideEvidenceList.find(pep) !=
m_falsePeptideEvidenceList.end())
{
count_decoy++;
}
else
{
count_target++;
}
// 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_decoy);
p_writer->writeCell(pep->getEvalue());
p_writer->writeCell(pep->getParam(PeptideEvidenceParam::pappso_qvalue).toDouble());
p_writer->writeLine();
}
}
......@@ -28,6 +28,7 @@
#pragma once
#include "../project.h"
#include <odsstream/calcwriterinterface.h>
/**
......@@ -45,10 +46,12 @@ class ComputeQvalues
* Destructor
*/
~ComputeQvalues();
void writeDistributionsByEngines(CalcWriterInterface * p_writer) const;
private:
void computeTandemPeptideEvidenceQvalues(
std::vector<PeptideEvidence *> &tandem_peptide_evidence_list) const;
std::vector<PeptideEvidence *> &tandem_peptide_evidence_list);
void computeMascotPeptideEvidenceQvalues(
std::vector<PeptideEvidence *> &mascot_peptide_evidence_list) const;
......@@ -57,4 +60,7 @@ class ComputeQvalues
private:
std::set<const PeptideEvidence *> m_falsePeptideEvidenceList;
std::vector<PeptideEvidence *> m_tandemPeptideEvidenceList;
};
......@@ -535,7 +535,7 @@ WorkerThread::doWritingOdsFile(QString filename,
p_writer = new OdsDocWriter(filename);
}
OdsExport export_ods(project_sp.get());
OdsExport export_ods(project_sp);
try
{
export_ods.write(p_writer, _p_work_monitor);
......
......@@ -34,6 +34,7 @@
#include "peptidesheet.h"
#include "spectrasheet.h"
#include "peptidepossheet.h"
#include "qvaluessheet.h"
#include "comparspectrasheet.h"
#include "comparspecificspectrasheet.h"
#include "comparspectrabypeptide.h"
......@@ -46,7 +47,7 @@
#include <odsstream/odsexception.h>
#include <pappsomspp/pappsoexception.h>
OdsExport::OdsExport(const Project *project) : _p_project(project)
OdsExport::OdsExport(ProjectSp project) : _p_project(project)
{
}
void
......@@ -76,36 +77,36 @@ OdsExport::write(CalcWriterInterface *p_writer, WorkMonitorInterface *p_monitor)
style.setBackgroundColor(QColor("orange"));
_even_style = p_writer->getTableCellStyleRef(style);
InfoSheet(this, p_writer, _p_project);
InfoSheet(this, p_writer, _p_project.get());
if(settings.value("export_ods/groups", "true").toBool())
{
p_monitor->message(QObject::tr("writing groups"));
GroupingSheet(this, p_writer, _p_project);
GroupingSheet(this, p_writer, _p_project.get());
}
if(settings.value("export_ods/simple", "false").toBool())
{
SimpleSheet(p_writer, _p_project);
SimpleSheet(p_writer, _p_project.get());
}
if(settings.value("export_ods/proteins", "true").toBool())
{
p_monitor->message(QObject::tr("writing proteins"));
ProteinSheet(this, p_writer, _p_project);
ProteinSheet(this, p_writer, _p_project.get());
}
if(settings.value("export_ods/peptides", "true").toBool())
{
p_monitor->message(QObject::tr("writing peptides"));
PeptideSheet(this, p_writer, _p_project);
PeptideSheet(this, p_writer, _p_project.get());
}
if(settings.value("export_ods/spectra", "true").toBool())
{
p_monitor->message(QObject::tr("writing spectra"));
SpectraSheet(this, p_writer, _p_project);
SpectraSheet(this, p_writer, _p_project.get());
}
if(settings.value("export_ods/peptidepos", "true").toBool())
{
p_monitor->message(
QObject::tr("writing peptide and positions on proteins"));
PeptidePosSheet(this, p_writer, _p_project);
PeptidePosSheet(this, p_writer, _p_project.get());
}
if(_p_project->getProjectMode() != ProjectMode::individual)
{
......@@ -116,69 +117,76 @@ OdsExport::write(CalcWriterInterface *p_writer, WorkMonitorInterface *p_monitor)
{
p_monitor->message(
QObject::tr("writing spectra comparisons for peptidomic"));
ComparSpectraByPeptide(this, p_writer, _p_project).writeSheet();
ComparSpectraByPeptide(this, p_writer, _p_project.get())
.writeSheet();
}
if(settings.value("export_ods/comparspectra", "true").toBool())
{
p_monitor->message(QObject::tr("writing spectra comparisons"));
ComparSpectraSheet(this, p_writer, _p_project).writeSheet();
ComparSpectraSheet(this, p_writer, _p_project.get()).writeSheet();
}
if(settings.value("export_ods/comparspecificspectra", "true")
.toBool())
{
p_monitor->message(
QObject::tr("writing specific spectra comparisons"));
ComparSpecificSpectraSheet(this, p_writer, _p_project)
ComparSpecificSpectraSheet(this, p_writer, _p_project.get())
.writeSheet();
}
if(settings.value("export_ods/comparuniquesequence", "true").toBool())
{
p_monitor->message(
QObject::tr("writing unique sequence comparisons"));
ComparSequenceSheet(this, p_writer, _p_project).writeSheet();
ComparSequenceSheet(this, p_writer, _p_project.get())
.writeSheet();
}
if(settings.value("export_ods/comparspecificuniquesequence", "true")
.toBool())
{
p_monitor->message(
QObject::tr("writing specific unique sequence comparisons"));
ComparSpecificSequenceSheet(this, p_writer, _p_project)
ComparSpecificSequenceSheet(this, p_writer, _p_project.get())
.writeSheet();
}
if(settings.value("export_ods/comparpai", "true").toBool())
{
p_monitor->message(QObject::tr("writing PAI comparisons"));
ComparPaiSheet(this, p_writer, _p_project).writeSheet();
ComparPaiSheet(this, p_writer, _p_project.get()).writeSheet();
}
if(settings.value("export_ods/comparempai", "true").toBool())
{
p_monitor->message(QObject::tr("writing emPAI comparisons"));
ComparEmpaiSheet(this, p_writer, _p_project).writeSheet();
ComparEmpaiSheet(this, p_writer, _p_project.get()).writeSheet();
}
if(settings.value("export_ods/comparnsaf", "true").toBool())
{
p_monitor->message(QObject::tr("writing NSAF comparisons"));
ComparNsafSheet(this, p_writer, _p_project).writeSheet();
ComparNsafSheet(this, p_writer, _p_project.get()).writeSheet();
}
}
if(settings.value("export_ods/samples", "true").toBool())
{
p_monitor->message(QObject::tr("writing samples"));
SampleSheet(this, p_writer, _p_project);
SampleSheet(this, p_writer, _p_project.get());
}
if(settings.value("export_ods/qvalues", "false").toBool())
{
p_monitor->message(QObject::tr("writing q-values"));
QvaluesSheet(this, p_writer, _p_project);
}
if(_p_project->hasPtmExperiment())
{
if(settings.value("export_ods/ptmislands", "true").toBool())
{
p_monitor->message(QObject::tr("writing PTM islands"));
PtmIslandSheet(this, p_writer, _p_project);
PtmIslandSheet(this, p_writer, _p_project.get());
}
if(settings.value("export_ods/ptmspectra", "true").toBool())
{
p_monitor->message(QObject::tr("writing PTM spectra"));
PtmSpectraSheet(this, p_writer, _p_project);
PtmSpectraSheet(this, p_writer, _p_project.get());
}
}
}
......
......@@ -28,8 +28,7 @@
*implementation
******************************************************************************/
#ifndef ODSEXPORT_H
#define ODSEXPORT_H
#pragma once
#include "../../core/project.h"
#include <odsstream/calcwriterinterface.h>
......@@ -38,16 +37,14 @@
class OdsExport
{
public:
OdsExport(const Project *project);
OdsExport(ProjectSp project);
void write(CalcWriterInterface *p_writer, WorkMonitorInterface *p_monitor);
void setEvenOrOddStyle(unsigned int number, CalcWriterInterface *p_writer);
private:
const Project *_p_project;
ProjectSp _p_project;
OdsTableCellStyleRef _even_style;
OdsTableCellStyleRef _odd_style;
};
#endif // ODSEXPORT_H
/**
* \file /output/ods/qvaluessheet.cpp
* \date 16/09/2019
* \author Olivier Langella
* \brief ODS Q-values sheet
*/
/*******************************************************************************
* Copyright (c) 2019 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "qvaluessheet.h"
#include "../../core/qvalue/computeqvalues.h"
QvaluesSheet::QvaluesSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
ProjectSp p_project)
{
_p_writer = p_writer;
_p_ods_export = p_ods_export;
p_writer->writeSheet("q-values");
OdsTableSettings table_settings;
table_settings.setVerticalSplit(1);
_p_writer->setCurrentOdsTableSettings(table_settings);
// writeHeaders();
ComputeQvalues qvalues(p_project);
qvalues.writeDistributionsByEngines(_p_writer);
}
/**
* \file /output/ods/qvaluessheet.h
* \date 16/09/2019
* \author Olivier Langella
* \brief ODS Q-values sheet
*/
/*******************************************************************************
* Copyright (c) 2019 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "../../core/project.h"
#include <odsstream/calcwriterinterface.h>
#include "odsexport.h"
class QvaluesSheet
{
public:
QvaluesSheet(OdsExport *p_ods_export,
CalcWriterInterface *p_writer,
ProjectSp p_project);
private:
private:
OdsExport *_p_ods_export;
const Project *_p_project;
CalcWriterInterface *_p_writer;
};
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