Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pappso/pappsomspp
  • thomas.renne/pappsomspp
2 results
Show changes
Commits on Source (85)
Showing
with 350 additions and 81 deletions
...@@ -85,6 +85,11 @@ add_definitions(-Wall) ...@@ -85,6 +85,11 @@ add_definitions(-Wall)
message(STATUS "${BoldGreen}Setting definition -Wextra.${ColourReset}") message(STATUS "${BoldGreen}Setting definition -Wextra.${ColourReset}")
add_definitions(-Wextra) add_definitions(-Wextra)
if(WARN_AS_ERROR)
message(STATUS "${BoldYellow}Setting definition -Werror.${ColourReset}")
add_definitions(-Werror)
endif()
message(STATUS "${BoldRed}CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}${ColourReset}") message(STATUS "${BoldRed}CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}${ColourReset}")
...@@ -105,7 +110,8 @@ elseif(UNIX AND NOT APPLE) ...@@ -105,7 +110,8 @@ elseif(UNIX AND NOT APPLE)
# Run the following cmake command line: # Run the following cmake command line:
# cmake -DBUILD_USER_MANUAL=1 -DCMAKE_BUILD_TYPE=Debug # cmake -DBUILD_USER_MANUAL=1 -DCMAKE_BUILD_TYPE=Debug
include(${CMAKE_TOOLCHAINS_PATH}/unix-toolchain.cmake) #include(${CMAKE_TOOLCHAINS_PATH}/unix-toolchain.cmake)
include(${CMAKE_TOOLCHAINS_PATH}/unix-toolchain-local.cmake)
elseif(WIN32 OR _WIN32) elseif(WIN32 OR _WIN32)
...@@ -180,6 +186,13 @@ message(STATUS "Boost_INCLUDES: ${Boost_INCLUDE_DIRS}") ...@@ -180,6 +186,13 @@ message(STATUS "Boost_INCLUDES: ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost_LIB_DIRS: ${Boost_LIBRARY_DIRS}") message(STATUS "Boost_LIB_DIRS: ${Boost_LIBRARY_DIRS}")
if(QCustomPlot_FOUND)
else (QCustomPlot_FOUND)
set(QCustomPlot_DIR ${CMAKE_MODULE_PATH})
find_package(QCustomPlot REQUIRED)
endif(QCustomPlot_FOUND)
if(Alglib_FOUND) if(Alglib_FOUND)
else (Alglib_FOUND) else (Alglib_FOUND)
set(Alglib_DIR ${CMAKE_MODULE_PATH}) set(Alglib_DIR ${CMAKE_MODULE_PATH})
......
message("UNIX non APPLE environment")
message("Please run the configuration like this:")
message("cmake -G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Debug ../development")
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES /usr/include)
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES /usr/include)
set(LINKER_FLAGS "-Wl,--no-as-needed")
find_package(PwizLite REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Zstd REQUIRED)
find_package(liblzf REQUIRED)
find_package(Qt6 COMPONENTS Widgets Core Gui PrintSupport Svg REQUIRED)
#find_package(QCustomPlotQt6 REQUIRED)
set(QCustomPlotQt6_FOUND 1)
SET(QCustomPlotQt6_INCLUDE_DIR "/home/langella/developpement/git/qcustomplot-qt6")
SET(QCustomPlotQt6_LIBRARIES "/home/langella/developpement/git/qcustomplot-qt6/build-qt6/libQCustomPlotQt6.so" )
add_library(QCustomPlotQt6::QCustomPlotQt6 UNKNOWN IMPORTED)
set_target_properties(QCustomPlotQt6::QCustomPlotQt6 PROPERTIES
IMPORTED_LOCATION "${QCustomPlotQt6_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${QCustomPlotQt6_INCLUDE_DIR}"
INTERFACE_COMPILE_DEFINITIONS QCUSTOMPLOTQT6_USE_LIBRARY)
# Per instructions of the lib author:
# https://www.qcustomplot.com/index.php/tutorials/settingup
message(STATUS "Setting definition -DQCUSTOMPLOT_USE_LIBRARY.")
add_definitions(-fPIC)
message("unix-toolchain.cmake - LOCAL_CMAKE_MODULE_PATH: ${LOCAL_CMAKE_MODULE_PATH}")
# Install the cmake module
message("LOCAL_CMAKE_MODULE_PATH: ${LOCAL_CMAKE_MODULE_PATH}")
install(FILES ${LOCAL_CMAKE_MODULE_PATH}/FindPappsoMSpp.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pappsomspp)
# Configure the cmake config
configure_file (${LOCAL_CMAKE_MODULE_PATH}/PappsoMSppConfig.cmake.in
${CMAKE_BINARY_DIR}/PappsoMSppConfig.cmake)
# Install the cmake config
install(FILES ${CMAKE_BINARY_DIR}/PappsoMSppConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pappsomspp)
...@@ -6,6 +6,52 @@ libpappsomspp (0.9.0-1) unstable; urgency=low ...@@ -6,6 +6,52 @@ libpappsomspp (0.9.0-1) unstable; urgency=low
-- Filippo Rusconi <lopippo@debian.org> Thu, 22 Sep 2022 18:35:01 +0200 -- Filippo Rusconi <lopippo@debian.org> Thu, 22 Sep 2022 18:35:01 +0200
libpappsomspp (0.8.60-1~bullseye+1) bullseye; urgency=medium
* bullseye backport
-- Olivier Langella <olivier.langella@u-psud.fr> Mon, 31 Oct 2022 09:06:33 +0100
libpappsomspp (0.8.60-1) unstable; urgency=low
* Fix the distribution... was working too late at night...
-- Filippo Rusconi <lopippo@debian.org> Fri, 28 Oct 2022 10:20:12 +0200
libpappsomspp (0.8.59-1) bullseye; urgency=low
* New upstream version.
* Incidentally, previous version was to fix a bug that was published in
betwwen the previous version and this one: (Closes: #1022934).
-- Filippo Rusconi <lopippo@debian.org> Fri, 28 Oct 2022 03:30:29 +0200
libpappsomspp (0.8.58-1) bullseye; urgency=low
* New upstream version (see 0.8.57-1~bullseye+1).
* Standards-Version: 4.6.1.
* d/rules: Fix by Adrian Bunk to work around the excess precision of the x87
FPU that causes
https://buildd.debian.org/status/logs.php?pkg=libpappsomspp&arch=i386.
-- Filippo Rusconi <lopippo@debian.org> Thu, 27 Oct 2022 10:38:00 +0200
libpappsomspp (0.8.57-1~bullseye+1) bullseye; urgency=medium
[ Olivier Langella ]
* avoid nullptr calls in custom plot widgets
* new tims frame widget color map
* better tdf handler
* new tests for protein , enzyme, psm, psmfeaures
* new psm feature API
[ Filippo Rusconi ]
* refactoring work to compile using Qt6
-- Olivier Langella <olivier.langella@u-psud.fr> Tue, 04 Oct 2022 17:02:43 +0200
libpappsomspp (0.8.56-1) unstable; urgency=low libpappsomspp (0.8.56-1) unstable; urgency=low
* New version that implements features in the dt|rt,m/z color map realms. * New version that implements features in the dt|rt,m/z color map realms.
......
...@@ -11,6 +11,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all ...@@ -11,6 +11,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1 DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/buildflags.mk
ifneq (,$(filter $(DEB_HOST_ARCH_CPU), i386))
export DEB_CXXFLAGS_MAINT_APPEND += -ffloat-store
endif
%: %:
dh $@ --buildsystem=cmake dh $@ --buildsystem=cmake
......
...@@ -57,7 +57,7 @@ set(CPP_FILES ...@@ -57,7 +57,7 @@ set(CPP_FILES
pappsomspp/processing/filters/filterceilingamplitudepercentage.cpp pappsomspp/processing/filters/filterceilingamplitudepercentage.cpp
pappsomspp/processing/filters/filterlowintensitysignalremoval.cpp pappsomspp/processing/filters/filterlowintensitysignalremoval.cpp
#pappsomspp/processing/tandemwrapper/tandemwrapperrun.cpp pappsomspp/processing/tandemwrapper/tandemwrapperrun.cpp
pappsomspp/processing/tandemwrapper/wraptandeminput.cpp pappsomspp/processing/tandemwrapper/wraptandeminput.cpp
pappsomspp/processing/tandemwrapper/wraptandemresults.cpp pappsomspp/processing/tandemwrapper/wraptandemresults.cpp
pappsomspp/processing/tandemwrapper/xtandempresetreader.cpp pappsomspp/processing/tandemwrapper/xtandempresetreader.cpp
...@@ -90,7 +90,7 @@ set(CPP_FILES ...@@ -90,7 +90,7 @@ set(CPP_FILES
pappsomspp/msfile/msfilereader.cpp pappsomspp/msfile/msfilereader.cpp
pappsomspp/msfile/mzformatenumstr.cpp pappsomspp/msfile/mzformatenumstr.cpp
pappsomspp/msfile/pwizmsfilereader.cpp pappsomspp/msfile/pwizmsfilereader.cpp
#pappsomspp/msfile/timsmsfilereader.cpp pappsomspp/msfile/timsmsfilereader.cpp
pappsomspp/msfile/xymsfilereader.cpp pappsomspp/msfile/xymsfilereader.cpp
pappsomspp/msrun/alignment/msrunretentiontime.cpp pappsomspp/msrun/alignment/msrunretentiontime.cpp
...@@ -102,9 +102,9 @@ set(CPP_FILES ...@@ -102,9 +102,9 @@ set(CPP_FILES
pappsomspp/msrun/msrunid.cpp pappsomspp/msrun/msrunid.cpp
pappsomspp/msrun/msrunreader.cpp pappsomspp/msrun/msrunreader.cpp
pappsomspp/msrun/private/pwizmsrunreader.cpp pappsomspp/msrun/private/pwizmsrunreader.cpp
#pappsomspp/msrun/private/timsmsrunreader.cpp pappsomspp/msrun/private/timsmsrunreader.cpp
#pappsomspp/msrun/private/timsmsrunreaderms2.cpp pappsomspp/msrun/private/timsmsrunreaderms2.cpp
#pappsomspp/msrun/private/timsmsrunreaderms2selected.cpp pappsomspp/msrun/private/timsmsrunreaderms2selected.cpp
pappsomspp/msrun/xiccoord/xiccoord.cpp pappsomspp/msrun/xiccoord/xiccoord.cpp
pappsomspp/msrun/xiccoord/xiccoordtims.cpp pappsomspp/msrun/xiccoord/xiccoordtims.cpp
pappsomspp/msrun/xymsrunreader.cpp pappsomspp/msrun/xymsrunreader.cpp
...@@ -159,18 +159,18 @@ set(CPP_FILES ...@@ -159,18 +159,18 @@ set(CPP_FILES
pappsomspp/trace/maptrace.cpp pappsomspp/trace/maptrace.cpp
pappsomspp/trace/trace.cpp pappsomspp/trace/trace.cpp
#pappsomspp/vendors/tims/mzcalibration/mzcalibrationinterface.cpp pappsomspp/vendors/tims/mzcalibration/mzcalibrationinterface.cpp
#pappsomspp/vendors/tims/mzcalibration/mzcalibrationmodel1.cpp pappsomspp/vendors/tims/mzcalibration/mzcalibrationmodel1.cpp
#pappsomspp/vendors/tims/mzcalibration/mzcalibrationstore.cpp pappsomspp/vendors/tims/mzcalibration/mzcalibrationstore.cpp
#pappsomspp/vendors/tims/xicextractor/timsdirectxicextractor.cpp pappsomspp/vendors/tims/xicextractor/timsdirectxicextractor.cpp
#pappsomspp/vendors/tims/xicextractor/timsxicextractorinterface.cpp pappsomspp/vendors/tims/xicextractor/timsxicextractorinterface.cpp
#pappsomspp/vendors/tims/timsbindec.cpp pappsomspp/vendors/tims/timsbindec.cpp
#pappsomspp/vendors/tims/timsdata.cpp pappsomspp/vendors/tims/timsdata.cpp
#pappsomspp/vendors/tims/timsframe.cpp pappsomspp/vendors/tims/timsframe.cpp
#pappsomspp/vendors/tims/timsframerawdatachunck.cpp pappsomspp/vendors/tims/timsframerawdatachunck.cpp
#pappsomspp/vendors/tims/timsframebase.cpp pappsomspp/vendors/tims/timsframebase.cpp
#pappsomspp/vendors/tims/timsframetype1.cpp pappsomspp/vendors/tims/timsframetype1.cpp
#pappsomspp/vendors/tims/timsms2centroidfilter.cpp pappsomspp/vendors/tims/timsms2centroidfilter.cpp
pappsomspp/xic/xic.cpp pappsomspp/xic/xic.cpp
pappsomspp/xic/qualifiedxic.cpp pappsomspp/xic/qualifiedxic.cpp
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "msfileaccessor.h" #include "msfileaccessor.h"
#include "pwizmsfilereader.h" #include "pwizmsfilereader.h"
//#include "timsmsfilereader.h" #include "timsmsfilereader.h"
#include "xymsfilereader.h" #include "xymsfilereader.h"
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "../utils.h" #include "../utils.h"
#include "../msrun/msrunid.h" #include "../msrun/msrunid.h"
#include "../msrun/private/pwizmsrunreader.h" #include "../msrun/private/pwizmsrunreader.h"
//#include "../msrun/private/timsmsrunreader.h" #include "../msrun/private/timsmsrunreader.h"
//#include "../msrun/private/timsmsrunreaderms2.h" #include "../msrun/private/timsmsrunreaderms2.h"
#include "../msrun/xymsrunreader.h" #include "../msrun/xymsrunreader.h"
...@@ -260,8 +260,6 @@ MsFileAccessor::buildMsRunReaderSPtr( ...@@ -260,8 +260,6 @@ MsFileAccessor::buildMsRunReaderSPtr(
QObject::tr("unable to build a reader for %1 : unknown file format") QObject::tr("unable to build a reader for %1 : unknown file format")
.arg(QFileInfo(ms_run_id.get()->getFileName()).absoluteFilePath()))); .arg(QFileInfo(ms_run_id.get()->getFileName()).absoluteFilePath())));
} }
#if 0
// Remove this section because it cripples my work on Qt6 build
else if(file_format == MzFormat::brukerTims) else if(file_format == MzFormat::brukerTims)
{ {
...@@ -278,7 +276,6 @@ MsFileAccessor::buildMsRunReaderSPtr( ...@@ -278,7 +276,6 @@ MsFileAccessor::buildMsRunReaderSPtr(
qDebug() << "by default, build a TimsMsRunReader."; qDebug() << "by default, build a TimsMsRunReader.";
return std::make_shared<TimsMsRunReader>(ms_run_id); return std::make_shared<TimsMsRunReader>(ms_run_id);
} }
#endif
else else
{ {
qDebug() << "Returning a PwizMsRunReader ."; qDebug() << "Returning a PwizMsRunReader .";
......
...@@ -47,6 +47,43 @@ QRegularExpression OboPsiModTerm::m_findExactPsiModLabel( ...@@ -47,6 +47,43 @@ QRegularExpression OboPsiModTerm::m_findExactPsiModLabel(
QRegularExpression OboPsiModTerm::m_findRelatedPsiMsLabel( QRegularExpression OboPsiModTerm::m_findRelatedPsiMsLabel(
"^(.*)\\sRELATED\\sPSI-MS-label\\s\\[\\]$"); "^(.*)\\sRELATED\\sPSI-MS-label\\s\\[\\]$");
OboPsiModTerm::OboPsiModTerm()
{
}
OboPsiModTerm::~OboPsiModTerm()
{
}
OboPsiModTerm::OboPsiModTerm(const OboPsiModTerm &other)
{
m_accession = other.m_accession;
m_name = other.m_name;
m_definition = other.m_definition;
m_psiModLabel = other.m_psiModLabel;
m_psiMsLabel = other.m_psiMsLabel;
m_diffFormula = other.m_diffFormula;
m_origin = other.m_origin;
m_diffMono = other.m_diffMono;
}
OboPsiModTerm &
OboPsiModTerm::operator=(const OboPsiModTerm &other)
{
m_accession = other.m_accession;
m_name = other.m_name;
m_definition = other.m_definition;
m_psiModLabel = other.m_psiModLabel;
m_psiMsLabel = other.m_psiMsLabel;
m_diffFormula = other.m_diffFormula;
m_origin = other.m_origin;
m_diffMono = other.m_diffMono;
return *this;
}
bool bool
OboPsiModTerm::isValid() const OboPsiModTerm::isValid() const
{ {
......
...@@ -33,10 +33,10 @@ class PMSPP_LIB_DECL OboPsiModTerm ...@@ -33,10 +33,10 @@ class PMSPP_LIB_DECL OboPsiModTerm
friend OboPsiMod; friend OboPsiMod;
public: public:
OboPsiModTerm() = default; OboPsiModTerm();
~OboPsiModTerm() = default; virtual ~OboPsiModTerm();
OboPsiModTerm(const OboPsiModTerm &) = default; OboPsiModTerm(const OboPsiModTerm &);
OboPsiModTerm &operator=(const OboPsiModTerm &) = default; OboPsiModTerm &operator=(const OboPsiModTerm &);
bool isValid() const; bool isValid() const;
...@@ -49,7 +49,7 @@ class PMSPP_LIB_DECL OboPsiModTerm ...@@ -49,7 +49,7 @@ class PMSPP_LIB_DECL OboPsiModTerm
QString m_diffFormula; QString m_diffFormula;
QString m_origin; QString m_origin;
double m_diffMono; double m_diffMono = 0;
private: private:
void parseLine(const QString &line); void parseLine(const QString &line);
...@@ -63,5 +63,4 @@ class PMSPP_LIB_DECL OboPsiModTerm ...@@ -63,5 +63,4 @@ class PMSPP_LIB_DECL OboPsiModTerm
} // namespace pappso } // namespace pappso
extern int oboPsiModTermMetaTypeId; extern int oboPsiModTermMetaTypeId;
...@@ -39,6 +39,22 @@ ...@@ -39,6 +39,22 @@
namespace pappso namespace pappso
{ {
bool
peptideIonTypeIsComplement(PeptideIon ion_type_ref, PeptideIon ion_type)
{
if(peptideIonIsNter(ion_type))
std::swap(ion_type_ref, ion_type);
if(peptideIonIsNter(ion_type))
return false;
if((ion_type_ref == PeptideIon::b) && (ion_type == PeptideIon::y))
return true;
if((ion_type_ref == PeptideIon::ao) && (ion_type == PeptideIon::yo))
return true;
if((ion_type_ref == PeptideIon::bstar) && (ion_type == PeptideIon::ystar))
return true;
return false;
}
bool bool
peptideIonIsNter(PeptideIon ion_type) peptideIonIsNter(PeptideIon ion_type)
......
...@@ -52,14 +52,21 @@ enum class PeptideDirection : std::int8_t ...@@ -52,14 +52,21 @@ enum class PeptideDirection : std::int8_t
/** \brief tells if an ion is Nter /** \brief tells if an ion is Nter
* \param ion_type the ion to test * \param ion_type the ion to test
*/ */
bool peptideIonIsNter(PeptideIon ion_type); PMSPP_LIB_DECL bool peptideIonIsNter(PeptideIon ion_type);
/** \brief tells if an ion type is the complement ion of the other
* \param ion_type_ref the ion type reference
* \param ion_type the ion to test
*/
PMSPP_LIB_DECL bool peptideIonTypeIsComplement(PeptideIon ion_type_ref,
PeptideIon ion_type);
/** \brief get the direction of a peptide ion /** \brief get the direction of a peptide ion
* \param ion_type the ion to test * \param ion_type the ion to test
* \return the peptide direction * \return the peptide direction
*/ */
PeptideDirection getPeptideIonDirection(PeptideIon ion_type); PMSPP_LIB_DECL PeptideDirection getPeptideIonDirection(PeptideIon ion_type);
enum class PeptideIonNter enum class PeptideIonNter
{ {
......
...@@ -48,7 +48,7 @@ class PMSPP_LIB_DECL PeptideNaturalIsotope : public PeptideInterface ...@@ -48,7 +48,7 @@ class PMSPP_LIB_DECL PeptideNaturalIsotope : public PeptideInterface
PeptideNaturalIsotope(const PeptideInterfaceSp &peptide, PeptideNaturalIsotope(const PeptideInterfaceSp &peptide,
const std::map<Isotope, int> &map_isotope); const std::map<Isotope, int> &map_isotope);
PeptideNaturalIsotope(const PeptideNaturalIsotope &other); PeptideNaturalIsotope(const PeptideNaturalIsotope &other);
~PeptideNaturalIsotope(); virtual ~PeptideNaturalIsotope();
virtual unsigned int size() const override; virtual unsigned int size() const override;
virtual const QString getSequence() const override; virtual const QString getSequence() const override;
......
...@@ -29,6 +29,28 @@ ...@@ -29,6 +29,28 @@
namespace pappso namespace pappso
{ {
PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage(
const PeptideInterfaceSp &peptide,
unsigned int isotopeNumber,
unsigned int charge,
PrecisionPtr precision)
: mcsp_peptideSp(peptide),
m_isotopeLevel(isotopeNumber),
m_isotopeRank(1),
m_z(charge),
mp_precision(precision)
{
m_peptideNaturalIsotopeSpList.clear();
double diffC13 = ((double)isotopeNumber * DIFFC12C13) / (double)charge;
m_averageMz = peptide.get()->getMz(charge) + diffC13;
m_abundanceRatio = 0;
}
PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage( PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage(
const PeptideInterfaceSp &peptide, const PeptideInterfaceSp &peptide,
unsigned int askedIsotopeRank, unsigned int askedIsotopeRank,
...@@ -161,6 +183,7 @@ PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage( ...@@ -161,6 +183,7 @@ PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage(
: mcsp_peptideSp(other.mcsp_peptideSp), mp_precision(other.mp_precision) : mcsp_peptideSp(other.mcsp_peptideSp), mp_precision(other.mp_precision)
{ {
qDebug();
m_peptideNaturalIsotopeSpList = other.m_peptideNaturalIsotopeSpList; m_peptideNaturalIsotopeSpList = other.m_peptideNaturalIsotopeSpList;
m_averageMz = other.m_averageMz; m_averageMz = other.m_averageMz;
...@@ -168,6 +191,7 @@ PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage( ...@@ -168,6 +191,7 @@ PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage(
m_isotopeLevel = other.m_isotopeLevel; m_isotopeLevel = other.m_isotopeLevel;
m_isotopeRank = other.m_isotopeRank; m_isotopeRank = other.m_isotopeRank;
m_z = other.m_z; m_z = other.m_z;
qDebug();
} }
PeptideNaturalIsotopeAverage::~PeptideNaturalIsotopeAverage() PeptideNaturalIsotopeAverage::~PeptideNaturalIsotopeAverage()
...@@ -237,4 +261,14 @@ PeptideNaturalIsotopeAverage::isEmpty() const ...@@ -237,4 +261,14 @@ PeptideNaturalIsotopeAverage::isEmpty() const
return (m_peptideNaturalIsotopeSpList.size() == 0); return (m_peptideNaturalIsotopeSpList.size() == 0);
} }
QString
PeptideNaturalIsotopeAverage::toString() const
{
return QString("%1 l%2 mz%3 z%4 N%5")
.arg(getPeptideInterfaceSp().get()->getSequence())
.arg(getPeptideInterfaceSp().get()->size())
.arg(getMz())
.arg(getCharge())
.arg(getIsotopeNumber());
}
} // namespace pappso } // namespace pappso
...@@ -42,6 +42,14 @@ typedef std::shared_ptr<const PeptideNaturalIsotopeAverage> ...@@ -42,6 +42,14 @@ typedef std::shared_ptr<const PeptideNaturalIsotopeAverage>
class PMSPP_LIB_DECL PeptideNaturalIsotopeAverage class PMSPP_LIB_DECL PeptideNaturalIsotopeAverage
{ {
public: public:
/** @brief fast constructor
* simple isotope build, not computing isotope ratio
*/
PeptideNaturalIsotopeAverage(const PeptideInterfaceSp &peptide,
unsigned int isotopeNumber,
unsigned int charge,
PrecisionPtr precision);
PeptideNaturalIsotopeAverage(const PeptideInterfaceSp &peptide, PeptideNaturalIsotopeAverage(const PeptideInterfaceSp &peptide,
unsigned int askedIsotopeRank, unsigned int askedIsotopeRank,
unsigned int isotopeLevel, unsigned int isotopeLevel,
...@@ -54,7 +62,7 @@ class PMSPP_LIB_DECL PeptideNaturalIsotopeAverage ...@@ -54,7 +62,7 @@ class PMSPP_LIB_DECL PeptideNaturalIsotopeAverage
PrecisionPtr precision); PrecisionPtr precision);
PeptideNaturalIsotopeAverage(const PeptideNaturalIsotopeAverage &other); PeptideNaturalIsotopeAverage(const PeptideNaturalIsotopeAverage &other);
~PeptideNaturalIsotopeAverage(); virtual ~PeptideNaturalIsotopeAverage();
PeptideNaturalIsotopeAverageSp makePeptideNaturalIsotopeAverageSp() const; PeptideNaturalIsotopeAverageSp makePeptideNaturalIsotopeAverageSp() const;
pappso_double getMz() const; pappso_double getMz() const;
...@@ -67,6 +75,7 @@ class PMSPP_LIB_DECL PeptideNaturalIsotopeAverage ...@@ -67,6 +75,7 @@ class PMSPP_LIB_DECL PeptideNaturalIsotopeAverage
PrecisionPtr getPrecision() const; PrecisionPtr getPrecision() const;
virtual bool matchPeak(pappso_double peak_mz) const final; virtual bool matchPeak(pappso_double peak_mz) const final;
bool isEmpty() const; bool isEmpty() const;
virtual QString toString() const;
private: private:
void recursiveDepletion(std::vector<PeptideNaturalIsotopeSp> &v_isotope_list, void recursiveDepletion(std::vector<PeptideNaturalIsotopeSp> &v_isotope_list,
......
...@@ -43,8 +43,15 @@ class TraceDetectionSinkInterface ...@@ -43,8 +43,15 @@ class TraceDetectionSinkInterface
class TraceDetectionInterface class TraceDetectionInterface
{ {
public: public:
virtual void detect(const Trace &xic, /** @brief detect peaks on a trace
TraceDetectionSinkInterface &sink) const = 0; * @param trace the trace to detect peaks on
* @param sink the object to store peaks or stream it
* @param remove_peak_base if true, removes the area under the base of the
* peak
*/
virtual void detect(const Trace &trace,
TraceDetectionSinkInterface &sink,
bool remove_peak_base) const = 0;
}; };
......
...@@ -84,7 +84,8 @@ TraceDetectionMoulon::getTicStop() const ...@@ -84,7 +84,8 @@ TraceDetectionMoulon::getTicStop() const
void void
TraceDetectionMoulon::detect(const Trace &xic, TraceDetectionMoulon::detect(const Trace &xic,
TraceDetectionSinkInterface &sink) const TraceDetectionSinkInterface &sink,
bool remove_peak_base) const
{ {
Trace xic_smoothed(xic); Trace xic_smoothed(xic);
...@@ -138,7 +139,7 @@ TraceDetectionMoulon::detect(const Trace &xic, ...@@ -138,7 +139,7 @@ TraceDetectionMoulon::detect(const Trace &xic,
if(banked) if(banked)
{ {
TracePeak peak(it_begin, it + 1); TracePeak peak(it_begin, it + 1, remove_peak_base);
sink.setTracePeak(peak); sink.setTracePeak(peak);
} }
banked = false; banked = false;
......
...@@ -56,7 +56,8 @@ class PMSPP_LIB_DECL TraceDetectionMoulon : public TraceDetectionInterface ...@@ -56,7 +56,8 @@ class PMSPP_LIB_DECL TraceDetectionMoulon : public TraceDetectionInterface
void detect(const Trace &xic, void detect(const Trace &xic,
TraceDetectionSinkInterface &sink) const override; TraceDetectionSinkInterface &sink,
bool remove_peak_base) const override;
}; };
......
...@@ -107,7 +107,8 @@ TraceDetectionZivy::getDetectionThresholdOnMaxmin() const ...@@ -107,7 +107,8 @@ TraceDetectionZivy::getDetectionThresholdOnMaxmin() const
void void
TraceDetectionZivy::detect(const Trace &xic, TraceDetectionZivy::detect(const Trace &xic,
TraceDetectionSinkInterface &sink) const TraceDetectionSinkInterface &sink,
bool remove_peak_base) const
{ {
// detect peak positions on close curve : a peak is an intensity value // detect peak positions on close curve : a peak is an intensity value
...@@ -214,7 +215,7 @@ TraceDetectionZivy::detect(const Trace &xic, ...@@ -214,7 +215,7 @@ TraceDetectionZivy::detect(const Trace &xic,
// peak.setMaxXicElement(*maxYDataPoint(it, xic_position)); // peak.setMaxXicElement(*maxYDataPoint(it, xic_position));
// areaTrace() // areaTrace()
TracePeak peak(it, xic_position); TracePeak peak(it, xic_position, remove_peak_base);
sink.setTracePeak(peak); sink.setTracePeak(peak);
// } // }
//++i; //++i;
......
...@@ -35,12 +35,6 @@ namespace pappso ...@@ -35,12 +35,6 @@ namespace pappso
class PMSPP_LIB_DECL TraceDetectionZivy : public TraceDetectionInterface class PMSPP_LIB_DECL TraceDetectionZivy : public TraceDetectionInterface
{ {
private:
FilterMorphoMean m_smooth;
FilterMorphoMinMax m_minMax;
FilterMorphoMaxMin m_maxMin;
pappso_double m_detectionThresholdOnMinMax;
pappso_double m_detectionThresholdOnMaxMin;
public: public:
TraceDetectionZivy(unsigned int smoothing_half_window_length, TraceDetectionZivy(unsigned int smoothing_half_window_length,
...@@ -65,7 +59,16 @@ class PMSPP_LIB_DECL TraceDetectionZivy : public TraceDetectionInterface ...@@ -65,7 +59,16 @@ class PMSPP_LIB_DECL TraceDetectionZivy : public TraceDetectionInterface
pappso_double getDetectionThresholdOnMaxmin() const; pappso_double getDetectionThresholdOnMaxmin() const;
void detect(const Trace &xic, void detect(const Trace &xic,
TraceDetectionSinkInterface &sink) const override; TraceDetectionSinkInterface &sink,
bool remove_peak_base) const override;
private:
FilterMorphoMean m_smooth;
FilterMorphoMinMax m_minMax;
FilterMorphoMaxMin m_maxMin;
pappso_double m_detectionThresholdOnMinMax;
pappso_double m_detectionThresholdOnMaxMin;
}; };
} // namespace pappso } // namespace pappso
...@@ -31,6 +31,7 @@ namespace pappso ...@@ -31,6 +31,7 @@ namespace pappso
TracePeak::TracePeak() TracePeak::TracePeak()
{ {
} }
TracePeak::TracePeak(std::vector<DataPoint>::const_iterator it_begin, TracePeak::TracePeak(std::vector<DataPoint>::const_iterator it_begin,
std::vector<DataPoint>::const_iterator it_end) std::vector<DataPoint>::const_iterator it_end)
{ {
...@@ -41,6 +42,24 @@ TracePeak::TracePeak(std::vector<DataPoint>::const_iterator it_begin, ...@@ -41,6 +42,24 @@ TracePeak::TracePeak(std::vector<DataPoint>::const_iterator it_begin,
m_area = areaTrace(it_begin, it_end); m_area = areaTrace(it_begin, it_end);
} }
TracePeak::TracePeak(std::vector<DataPoint>::const_iterator it_begin,
std::vector<DataPoint>::const_iterator it_end,
bool remove_base)
{
m_left = *it_begin;
m_right = *(it_end - 1);
m_max = *maxYDataPoint(it_begin, it_end);
m_area = areaTrace(it_begin, it_end);
if(remove_base)
{
// remove the base of this peak
m_area -= std::min(m_left.y, m_right.y) * (m_right.x - m_left.x);
if(m_area < 0)
m_area = 0;
}
}
TracePeak::TracePeak(const TracePeak &other) TracePeak::TracePeak(const TracePeak &other)
{ {
m_area = other.m_area; m_area = other.m_area;
...@@ -117,4 +136,38 @@ TracePeak::containsRt(pappso::pappso_double rt) const ...@@ -117,4 +136,38 @@ TracePeak::containsRt(pappso::pappso_double rt) const
return (false); return (false);
} }
const DataPoint &
TracePeak::getMaxXicElement() const
{
return m_max;
}
const DataPoint &
TracePeak::getLeftBoundary() const
{
return m_left;
}
bool
TracePeak::operator==(const TracePeak &other) const
{
return ((m_area == other.m_area) && (m_max == other.m_max) &&
(m_left == other.m_left) && (m_right == other.m_right));
}
TracePeak &
TracePeak::operator=(const TracePeak &other)
{
if(this == &other)
return *this;
m_area = other.m_area;
m_max = other.m_max;
m_left = other.m_left;
m_right = other.m_right;
return *this;
}
} // namespace pappso } // namespace pappso
...@@ -38,18 +38,22 @@ typedef std::shared_ptr<const TracePeak> TracePeakCstSPtr; ...@@ -38,18 +38,22 @@ typedef std::shared_ptr<const TracePeak> TracePeakCstSPtr;
* */ * */
class PMSPP_LIB_DECL TracePeak class PMSPP_LIB_DECL TracePeak
{ {
protected:
pappso_double m_area = 0;
DataPoint m_max;
DataPoint m_left;
DataPoint m_right;
public: public:
TracePeak(); TracePeak();
/** @brief construct a peak given a trace, begin and end x coordinate /** @brief construct a peak given a trace, begin and end x coordinate
*/ */
TracePeak(std::vector<DataPoint>::const_iterator it_begin, TracePeak(std::vector<DataPoint>::const_iterator it_begin,
std::vector<DataPoint>::const_iterator it_end); std::vector<DataPoint>::const_iterator it_end);
/** @brief construct a peak given a trace, begin and end x coordinate
*
* @param it_begin begining of trace
* @param it_end end of trace
* @param remove_base if true, remove the base peak signal
*/
TracePeak(std::vector<DataPoint>::const_iterator it_begin,
std::vector<DataPoint>::const_iterator it_end,
bool remove_base);
TracePeak(const TracePeak &other); TracePeak(const TracePeak &other);
~TracePeak(); ~TracePeak();
...@@ -57,50 +61,34 @@ class PMSPP_LIB_DECL TracePeak ...@@ -57,50 +61,34 @@ class PMSPP_LIB_DECL TracePeak
TracePeakCstSPtr makeTracePeakCstSPtr() const; TracePeakCstSPtr makeTracePeakCstSPtr() const;
DataPoint &getMaxXicElement(); DataPoint &getMaxXicElement();
const DataPoint & const DataPoint &getMaxXicElement() const;
getMaxXicElement() const
{
return m_max;
};
void setMaxXicElement(const DataPoint &max); void setMaxXicElement(const DataPoint &max);
DataPoint &getLeftBoundary(); DataPoint &getLeftBoundary();
const DataPoint & const DataPoint &getLeftBoundary() const;
getLeftBoundary() const
{
return m_left;
};
void setLeftBoundary(const DataPoint &left); void setLeftBoundary(const DataPoint &left);
DataPoint &getRightBoundary(); DataPoint &getRightBoundary();
const DataPoint &getRightBoundary() const; const DataPoint &getRightBoundary() const;
void setRightBoundary(const DataPoint &right); void setRightBoundary(const DataPoint &right);
pappso_double getArea() const; pappso_double getArea() const;
void setArea(pappso_double area); void setArea(pappso_double area);
bool containsRt(pappso::pappso_double rt) const; bool containsRt(pappso::pappso_double rt) const;
bool bool operator==(const TracePeak &other) const;
operator==(const TracePeak &other) const
{
return ((m_area == other.m_area) && (m_max == other.m_max) &&
(m_left == other.m_left) && (m_right == other.m_right));
};
TracePeak & TracePeak &operator=(const TracePeak &other);
operator=(const TracePeak &other)
{
if(this == &other)
return *this;
m_area = other.m_area;
m_max = other.m_max;
m_left = other.m_left;
m_right = other.m_right;
return *this; protected:
} pappso_double m_area = 0;
DataPoint m_max;
DataPoint m_left;
DataPoint m_right;
}; };
......