Commit cc69513c authored by Filippo Rusconi's avatar Filippo Rusconi
Browse files

New upstream version 0.4.23

parent 911c5ede
......@@ -8,9 +8,12 @@ PROJECT(xtpcpp CXX)
set(XTPCPP_VERSION_MAJOR "0")
set(XTPCPP_VERSION_MINOR "4")
set(XTPCPP_VERSION_PATCH "18")
set(XTPCPP_VERSION_PATCH "23")
set(VERSION 0.4.23)
set(XTPCPP_VERSION "${XTPCPP_VERSION_MAJOR}.${XTPCPP_VERSION_MINOR}.${XTPCPP_VERSION_PATCH}")
set(VERSION 0.4.18)
#depending on libpappsomspp version :
set(LIBPAPPSOMSPP_VERSION "0.8.17")
# Add folder where are supportive functions
set(CMAKE_UTILS_PATH ${CMAKE_SOURCE_DIR}/CMakeStuff)
......@@ -131,8 +134,6 @@ endif( CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
message(STATUS "${BoldYellow}CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}.${ColourReset}")
#depending on libpappsomspp version :
set(LIBPAPPSOMSPP_VERSION "0.8.13")
configure_file (${CMAKE_SOURCE_DIR}/debian/control.cmake ${CMAKE_SOURCE_DIR}/debian/control @ONLY)
......
# # Copyright : Thomas Renne (CNRS)
# # License : GPL-3.0+
# # Authors : Thomas Renne
#
# find_path(LibRData_INCLUDE_DIRS librdata/src/rdata.h
# PATHS /usr/local/include /usr/include
# PATH_SUFFIXES librdata ENV PATH)
#
#
# find_library(LibRData_LIBRARY NAMES librdata)
#
# if(LibRData_INCLUDE_DIRS AND LibRData_LIBRARY)
#
# mark_as_advanced(LibRData_INCLUDE_DIRS)
# mark_as_advanced(LibRData_LIBRARY)
#
# message(STATUS "~~~~~~~~~~~~~ ${LibRData_LIBRARY} ~~~~~~~~~~~~~~~")
#
# set(LibRData_FOUND TRUE)
#
# endif()
#
# if(LibRData_FOUND)
#
# if(NOT LibRData_FIND_QUIETLY)
# message(STATUS "Found LibRData_LIBRARY: ${LibRData_LIBRARY}")
# endif()
#
# if(NOT TARGET LibRData::Core)
#
# add_library(LibRData::Core UNKNOWN IMPORTED)
#
# set_target_properties(LibRData::Core PROPERTIES
# IMPORTED_LOCATION "${LibRData_LIBRARY}"
# INTERFACE_INCLUDE_DIRECTORIES "${LibRData_INCLUDE_DIRS}")
#
# endif()
#
# else()
#
# if(LibRData_FIND_REQUIRED)
#
# message(FATAL_ERROR "Could not find librdata. Please do specify the
# LibRData_INCLUDE_DIRS and LibRData_LIBRARY variables using cmake!")
#
# endif()
#
# endif()
......@@ -31,7 +31,7 @@ find_package(SQLite3 REQUIRED)
set(QCustomPlot_FOUND 1)
set(QCustomPlot_INCLUDE_DIR "/win64/qcustomplot-2.0.1+dfsg1")
set(QCustomPlot_LIBRARIES "/win64/qcustomplot-2.0.1+dfsg1/build/libqcustomplot.dll")
set(QCustomPlot_LIBRARIES "/win64/qcustomplot-2.0.1+dfsg1/wbuild/libqcustomplot.dll")
if(NOT TARGET QCustomPlot::QCustomPlot)
add_library(QCustomPlot::QCustomPlot UNKNOWN IMPORTED)
set_target_properties(QCustomPlot::QCustomPlot PROPERTIES
......@@ -66,8 +66,8 @@ endif()
set(Alglib_FOUND 1)
set(Alglib_INCLUDE_DIR "/home/langella/developpement/git/alglib/src")
set(Alglib_LIBRARY "/home/langella/developpement/git/alglib/wbuild/libalglib.dll")
set(Alglib_INCLUDE_DIR "/win64/alglib/src")
set(Alglib_LIBRARY "/win64/alglib/wbuild/libalglib.dll")
if(NOT TARGET Alglib::Alglib)
add_library(Alglib::Alglib UNKNOWN IMPORTED)
set_target_properties(Alglib::Alglib PROPERTIES
......@@ -75,7 +75,6 @@ if(NOT TARGET Alglib::Alglib)
INTERFACE_INCLUDE_DIRECTORIES "${Alglib_INCLUDE_DIR}")
endif()
# All this belly dance does not seem necessary. Just perform like for the other
# libraries...
# Look for the necessary header
......@@ -125,3 +124,14 @@ if(NOT TARGET PappsoMSpp::Widget)
INTERFACE_INCLUDE_DIRECTORIES "${PappsoMSpp_INCLUDE_DIRS}")
endif()
set(RData_FOUND 1)
set(RData_INCLUDE_DIR "/win64/librdata/src")
set(RData_LIBRARY "/win64/librdata/.libs/librdata-0.dll")
if(NOT TARGET RData::Core)
add_library(RData::Core UNKNOWN IMPORTED)
set_target_properties(RData::Core PROPERTIES
IMPORTED_LOCATION "${RData_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${RData_INCLUDE_DIR}")
endif()
......@@ -15,6 +15,10 @@ if (NOT PappsoMSpp_FOUND)
find_package ( PappsoMSpp REQUIRED )
endif (NOT PappsoMSpp_FOUND)
if (NOT LibRData_FOUND)
find_package ( LibRData REQUIRED )
endif (NOT LibRData_FOUND)
#find_package( Boost COMPONENTS iostreams thread filesystem chrono REQUIRED )
#find_package( Boost COMPONENTS thread filesystem iostreams REQUIRED )
......
This diff is collapsed.
......@@ -21,6 +21,18 @@ else(QCustomPlot_FOUND)
endif(QCustomPlot_FOUND)
if(RData_FOUND)
MESSAGE("RData_INCLUDES found ${RData_INCLUDES}")
else(RData_FOUND)
FIND_PACKAGE( RData REQUIRED )
endif(RData_FOUND)
if(Grantlee_FOUND)
else(Grantlee_FOUND)
message("Grantlee library not found")
endif(Grantlee_FOUND)
#sudo apt-get install libpappsomspp-dev
if(PappsoMSpp_FOUND)
......@@ -37,6 +49,13 @@ endif(PappsoMSppWidget_FOUND)
message("PAPPSOms++ library : ${PappsoMSpp_LIBRARY}")
# if(LibRData_FOUND)
# else(LibRData_FOUND)
# message("LibRData library not found")
# message("did you install the LibRData https://github.com/WizardMac/librdata")
# endif(LibRData_FOUND)
configure_file(${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_SOURCE_DIR}/src/config.h)
# File list
......@@ -47,6 +66,7 @@ set(CPP_FILES
core/identificationgroup.cpp
core/identification_sources/identificationdatasource.cpp
core/identification_sources/identificationmascotdatfile.cpp
core/identification_sources/identificationmzidentmlfile.cpp
core/identification_sources/identificationpepxmlfile.cpp
core/identification_sources/identificationpwizfile.cpp
core/identification_sources/identificationxtandemfile.cpp
......@@ -54,6 +74,7 @@ set(CPP_FILES
core/labeling/labelingmethod.cpp
core/masschroq_run/masschroqbatchprocess.cpp
core/masschroq_run/masschroqcondorprocess.cpp
core/mcqr/mcqrexperiment.cpp
core/qvalue/computeqvalues.cpp
core/tandem_run/tandembatchprocess.cpp
core/tandem_run/tandemcondorprocess.cpp
......@@ -83,12 +104,16 @@ set(CPP_FILES
grouping/ptm/ptmsamplescan.cpp
input/mascot/mascotdatparser.cpp
input/mascot/mimeparser.cpp
input/mzidentml/msrunsaxhandler.cpp
input/mzidentml/mzidentmlsaxhandler.cpp
# input/identificationpwizreader.cpp
input/metadataodshandler.cpp
input/pepxmlsaxhandler.cpp
input/xpipsaxhandler.cpp
input/xtandemparamsaxhandler.cpp
input/xtandemsaxhandler.cpp
input/xtpxpipsaxhandler.cpp
output/mcqr/mcqrdata.cpp
output/mcqr/mcqrscprotein.cpp
output/mcqr/mcqrscpeptide.cpp
output/ods/mass_delta/validmassdeltasheet.cpp
......@@ -101,6 +126,7 @@ set(CPP_FILES
output/ods/comparspectrasheet.cpp
output/ods/groupingsheet.cpp
output/ods/infosheet.cpp
output/ods/mcqrmetadatasheet.cpp
output/ods/odsexport.cpp
output/ods/peptidepossheet.cpp
output/ods/peptidesheet.cpp
......@@ -137,6 +163,7 @@ set(CPP_FILES
set(XTPCPP_SRCS
./gui/about_dialog/aboutdialog.cpp
./gui/choose_modification_dialog/choosemodificationdialog.cpp
./gui/edit/deepprot_gui/deepprotgui.cpp
./gui/edit/edit_label_methods/editlabelmethods.cpp
./gui/edit/edit_modifications/editmodifications.cpp
./gui/edit/edit_settings/editsettings.cpp
......@@ -150,6 +177,7 @@ set(XTPCPP_SRCS
./gui/lists/ms_identification_run_list_view/engine_detail_view/enginedetailwindow.cpp
./gui/masschroq_run_dialog/masschroqrundialog.cpp
./gui/masschroq_run_dialog/masschroqfileparameters.cpp
./gui/mcqr_run_dialog/mcqrrundialog.cpp
./gui/mainwindow.cpp
./gui/peptide_detail_view/peptidewindow.cpp
./gui/peptide_list_view/peptidelistwindow.cpp
......@@ -191,6 +219,7 @@ set(XTPCPP_SRCS
set(GUI_UIS
./gui/about_dialog/about_dialog.ui
./gui/choose_modification_dialog/choose_modification_dialog.ui
./gui/edit/deepprot_gui/deepprot_gui.ui
./gui/edit/edit_alignment_param/masschroq_param_view.ui
./gui/edit/edit_label_methods/edit_label_methods.ui
./gui/edit/edit_modifications/edit_modifications.ui
......@@ -201,6 +230,7 @@ set(GUI_UIS
./gui/lists/ms_identification_run_list_view/engine_detail_view/engine_detail_view.ui
./gui/load_results_dialog/load_results_dialog.ui
./gui/masschroq_run_dialog/masschroq_run_dialog.ui
./gui/mcqr_run_dialog/mcqr_run_dialog.ui
./gui/main.ui
./gui/peptide_detail_view/peptide_detail_view.ui
./gui/peptide_list_view/peptide_view.ui
......@@ -249,6 +279,7 @@ target_link_libraries(xtpcpp
OdsStream::Core
PappsoMSpp::Core
PappsoMSpp::Widget
RData::Core
Qt5::Core
Qt5::Gui
Qt5::Xml
......
......@@ -22,15 +22,18 @@
***************************/
#include "msrun.h"
#include "alignmentgroup.h"
#include <core/identification_sources/identificationdatasource.h>
#include <QDir>
#include "identification_sources/identificationdatasource.h"
#include "msrun.h"
#include "project.h"
MsRunAlignmentGroup::MsRunAlignmentGroup(Project *project, QString group_name)
{
m_groupName = group_name;
mp_project = project;
m_status = AlignmentGroupStatus::created;
}
MsRunAlignmentGroup::~MsRunAlignmentGroup()
......@@ -161,3 +164,68 @@ MsRunAlignmentGroup::prepareMsrunRetentionTimesForAlignment() const
}
qDebug() << "end";
}
void
MsRunAlignmentGroup::savePostMassChroqmlParameters(
MasschroqFileParameters file_parameters,
ZivyParams zivy_params,
QString masschroqml_file)
{
m_masschroqFileParameters = file_parameters;
m_zivyParams = zivy_params;
m_masschroqmlPath = masschroqml_file;
}
void
MsRunAlignmentGroup::setMassChroQRunStatus(AlignmentGroupStatus status)
{
m_status = status;
}
void
MsRunAlignmentGroup::setMassChroQRunStatusFromInt(int status)
{
m_status = static_cast<AlignmentGroupStatus>(status);
}
AlignmentGroupStatus
MsRunAlignmentGroup::getGroupStatus()
{
return m_status;
}
MasschroqFileParameters
MsRunAlignmentGroup::getMassChroQFileParams()
{
return m_masschroqFileParameters;
}
QString
MsRunAlignmentGroup::getMassChroqmlPath()
{
return m_masschroqmlPath;
}
ZivyParams
MsRunAlignmentGroup::getZivyParams()
{
return m_zivyParams;
}
void
MsRunAlignmentGroup::setMassChroQFileParams(MasschroqFileParameters mcq_params)
{
m_masschroqFileParameters = mcq_params;
}
void
MsRunAlignmentGroup::setMassChroqmlPath(QString masschroqml_path)
{
m_masschroqmlPath = masschroqml_path;
}
void
MsRunAlignmentGroup::setZivyParams(ZivyParams zivy_params)
{
m_zivyParams = zivy_params;
}
......@@ -26,6 +26,18 @@
#include <memory>
#include "msrun.h"
#include "project.h"
#include "../gui/masschroq_run_dialog/masschroqfileparameters.h"
#include "../gui/xic_view/xic_widgets/zivywidget.h"
enum class AlignmentGroupStatus : std::int8_t
{
created = 0, ///< Group created
masschroqml_written = 1, ///< Group created and masschroqml written
masschroq_run =
2, ///< Group created, masschroqml written and result file produced
rdata_written = 3, ///< Group created, masschroqml written, result file
///< produced and MCQR RData written
};
class MsRunAlignmentGroup;
typedef std::shared_ptr<MsRunAlignmentGroup> MsRunAlignmentGroupSp;
......@@ -48,9 +60,28 @@ class MsRunAlignmentGroup
void removeMsRunFromMsRunAlignmentGroupList(MsRunSp removed_msrun);
void prepareMsrunRetentionTimesForAlignment() const;
void savePostMassChroqmlParameters(MasschroqFileParameters file_parameters,
ZivyParams zivy_params,
QString masschroqml_file);
void setMassChroQRunStatus(AlignmentGroupStatus status);
void setMassChroQRunStatusFromInt(int status);
AlignmentGroupStatus getGroupStatus();
MasschroqFileParameters getMassChroQFileParams();
ZivyParams getZivyParams();
QString getMassChroqmlPath();
void setMassChroQFileParams(MasschroqFileParameters mcq_params);
void setZivyParams(ZivyParams zivy_params);
void setMassChroqmlPath(QString masschroqml_path);
private:
QString m_groupName;
Project *mp_project;
std::list<MsRunSp> m_msrunAlignmentGroupList;
MsRunSp msp_msRunReference = nullptr;
// Post MassChroQ run params
AlignmentGroupStatus m_status;
MasschroqFileParameters m_masschroqFileParameters;
ZivyParams m_zivyParams;
QString m_masschroqmlPath;
};
......@@ -39,7 +39,7 @@ IdentificationDataSource::IdentificationDataSource(const QString resource_name)
IdentificationDataSource::IdentificationDataSource(
const IdentificationDataSource &other)
{
_ms_run_sp = other._ms_run_sp;
msp_msRun = other.msp_msRun;
_resource_name = other._resource_name;
_xml_id = other._xml_id;
_version = other._version;
......@@ -97,35 +97,37 @@ IdentificationDataSource::getResourceName() const
const QString
IdentificationDataSource::getSampleName() const
{
return _ms_run_sp.get()->getSampleName();
return msp_msRun.get()->getSampleName();
}
void
IdentificationDataSource::setMsRunSp(MsRunSp ms_run_sp)
{
_ms_run_sp = ms_run_sp;
msp_msRun = ms_run_sp;
}
MsRunSp
IdentificationDataSource::getMsRunSp() const
{
return (_ms_run_sp);
return (msp_msRun);
}
void
IdentificationDataSource::setIdentificationEngine(IdentificationEngine engine)
{
_engine = engine;
m_identificationEngine = engine;
}
IdentificationEngine
IdentificationDataSource::getIdentificationEngine() const
{
return _engine;
return m_identificationEngine;
}
const QString
IdentificationDataSource::getIdentificationEngineName() const
{
qDebug();
QString name = "unknown";
switch(_engine)
switch(m_identificationEngine)
{
case IdentificationEngine::XTandem:
name = "X!Tandem";
......@@ -152,9 +154,14 @@ IdentificationDataSource::getIdentificationEngineName() const
case IdentificationEngine::MSGFplus:
name = "MS-GF+";
break;
case IdentificationEngine::DeepProt:
name = "DeepProt";
break;
default:
break;
}
qDebug();
return name;
}
const QString &
......@@ -209,60 +216,6 @@ IdentificationDataSource::getIdentificationEngineStatistics(
}
}
pappso::MassSpectrumCstSPtr
IdentificationDataSource::getMassSpectrumCstSPtr(unsigned int scan_number) const
{
qDebug() << "scan=" << scan_number;
if(_ms_run_sp.get()->getMzFormat() == pappso::MzFormat::MGF)
{
scan_number = scan_number - 1;
qDebug() << "MGF format";
}
pappso::MsRunReaderSPtr msrun_reader_sp =
_ms_run_sp.get()->getMsRunReaderSPtr();
if(msrun_reader_sp == nullptr)
{
msrun_reader_sp = _ms_run_sp.get()->findMsRunFile();
if(msrun_reader_sp == nullptr)
{
throw pappso::ExceptionNotFound(
QObject::tr("mz data \"%1\" file not found")
.arg(_ms_run_sp.get()->getFileName()));
}
}
qDebug();
msrun_reader_sp = _ms_run_sp.get()->getMsRunReaderSPtr();
if(msrun_reader_sp == nullptr)
{
throw pappso::ExceptionNotFound(
QObject::tr("mz data \"%1\" file not found")
.arg(_ms_run_sp.get()->getFileName()));
}
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ <<
// _ms_run_sp.get()->getMsRunReaderSp().get()->getSpectrumListSize();
std::size_t spectrum_index = scan_number;
qDebug();
if(msrun_reader_sp.get()->hasScanNumbers())
{
qDebug() << "HAS SCAN NUMBERS";
spectrum_index =
msrun_reader_sp.get()->scanNumber2SpectrumIndex(scan_number);
}
qDebug() << " spectrum file="
<< msrun_reader_sp.get()->getMsRunId().get()->getFileName()
<< " index=" << spectrum_index;
pappso::MassSpectrumCstSPtr spectrum_sp =
msrun_reader_sp.get()->massSpectrumCstSPtr(spectrum_index);
qDebug();
return spectrum_sp;
}
void
IdentificationDataSource::addFastaFile(FastaFileSp file)
{
......@@ -279,7 +232,7 @@ IdentificationDataSource::isValid(
const PeptideEvidence *p_peptide_evidence,
const AutomaticFilterParameters &automatic_filter_parameters) const
{
qDebug();
if(automatic_filter_parameters.useFDR())
{
QVariant qvalue =
......@@ -294,6 +247,7 @@ IdentificationDataSource::isValid(
}
if(qvalue.toDouble() < automatic_filter_parameters.getFilterPeptideFDR())
{
qDebug();
return true;
}
}
......@@ -302,8 +256,10 @@ IdentificationDataSource::isValid(
if(p_peptide_evidence->getEvalue() <=
automatic_filter_parameters.getFilterPeptideEvalue())
{
qDebug();
return true;
}
}
qDebug();
return false;
}
......@@ -59,10 +59,7 @@ class IdentificationDataSource
const QString getSampleName() const;
void setMsRunSp(MsRunSp ms_run_sp);
virtual MsRunSp getMsRunSp() const;
/** @brief get the spectrum with scan number
* */
virtual pappso::MassSpectrumCstSPtr
getMassSpectrumCstSPtr(unsigned int scan_number) const;
/** \brief read source content to store it in project
*/
......@@ -136,8 +133,8 @@ class IdentificationDataSource
protected:
QString _resource_name;
IdentificationEngine _engine = IdentificationEngine::unknown;
MsRunSp _ms_run_sp = nullptr;
IdentificationEngine m_identificationEngine = IdentificationEngine::unknown;
MsRunSp msp_msRun = nullptr;
private:
// static std::map<QString, pappso::MsRunIdSp> _map_msrunidsp;
......
......@@ -39,14 +39,14 @@ IdentificationMascotDatFile::IdentificationMascotDatFile(
: IdentificationDataSource(mascot_dat_file.absoluteFilePath()),
_mascot_dat_file(mascot_dat_file)
{
_engine = IdentificationEngine::mascot;
m_identificationEngine = IdentificationEngine::mascot;
}
IdentificationMascotDatFile::IdentificationMascotDatFile(
const IdentificationMascotDatFile &other)
: IdentificationDataSource(other), _mascot_dat_file(other._mascot_dat_file)
{
_engine = IdentificationEngine::mascot;
m_identificationEngine = IdentificationEngine::mascot;
}
IdentificationMascotDatFile::~IdentificationMascotDatFile()
......@@ -54,16 +54,6 @@ IdentificationMascotDatFile::~IdentificationMascotDatFile()
}
pappso::MassSpectrumCstSPtr
IdentificationMascotDatFile::getMassSpectrumCstSPtr(
unsigned int scan_number) const
{
pappso::MassSpectrumCstSPtr spectrum_sp =
IdentificationDataSource::getMassSpectrumCstSPtr(scan_number);
return spectrum_sp;
}
void
IdentificationMascotDatFile::parseTo(Project *p_project)
{
......
......@@ -40,8 +40,6 @@ class IdentificationMascotDatFile : public IdentificationDataSource
IdentificationMascotDatFile(const IdentificationMascotDatFile &other);
~IdentificationMascotDatFile();
virtual pappso::MassSpectrumCstSPtr
getMassSpectrumCstSPtr(unsigned int scan_number) const override;
virtual void parseTo(Project *p_project) override;
// virtual const bool isValid(const PeptideEvidence * p_peptide_evidence,
......
/**
* \file src/core/identification_sources/identificationmzidentmlfile.cpp
* \date 20/1/2021
* \author Olivier Langella
* \brief parse mzIdentML file
*/
/*******************************************************************************
* Copyright (c) 2021 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.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.