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
......@@ -103,13 +103,11 @@ QCPXic::keyReleaseEvent(QKeyEvent *event)
void
QCPXic::mousePressEvent(QMouseEvent *event)
{
qDebug() << "QCPXic::mousePressEvent begin "
<< xAxis->pixelToCoord(event->x()) << " "
<< yAxis->pixelToCoord(event->y());
qDebug() << " begin ";
_mouse_move = false;
_click = true;
_old_x = event->x();
_old_y = yAxis->pixelToCoord(event->y());
_old_x = event->position().x();
_old_y = yAxis->pixelToCoord(event->position().y());
if(_old_y < 0)
{
_old_y = 0;
......@@ -123,8 +121,8 @@ void
QCPXic::mouseReleaseEvent(QMouseEvent *event)
{
qDebug() << "QCPXic::mouseReleaseEvent begin "
<< xAxis->pixelToCoord(event->x()) << " "
<< yAxis->pixelToCoord(event->y());
<< xAxis->pixelToCoord(event->position().x()) << " "
<< yAxis->pixelToCoord(event->position().y());
_click = false;
if(_mouse_move)
{
......@@ -140,13 +138,13 @@ void
QCPXic::mouseMoveEvent(QMouseEvent *event)
{
_mouse_move = true;
pappso::pappso_double x = xAxis->pixelToCoord(event->x());
pappso::pappso_double x = xAxis->pixelToCoord(event->position().x());
if(_click)
{
qDebug() << "QCPXic::mouseMoveEvent begin "
<< xAxis->pixelToCoord(event->x()) << " "
<< yAxis->pixelToCoord(event->y());
pappso::pappso_double y = yAxis->pixelToCoord(event->y());
<< xAxis->pixelToCoord(event->position().x()) << " "
<< yAxis->pixelToCoord(event->position().y());
pappso::pappso_double y = yAxis->pixelToCoord(event->position().y());
if(y < 0)
{
y = 0;
......@@ -161,9 +159,9 @@ QCPXic::mouseMoveEvent(QMouseEvent *event)
else
{
this->xAxis->moveRange(xAxis->pixelToCoord(_old_x) -
xAxis->pixelToCoord(event->x()));
xAxis->pixelToCoord(event->position().x()));
}
_old_x = event->x();
_old_x = event->position().x();
_old_y = y;
replot();
qDebug() << "QCPXic::mouseMoveEvent end";
......@@ -179,7 +177,7 @@ QCPXic::mouseMoveEvent(QMouseEvent *event)
}
}
void
QCPGraph *
QCPXic::addXicP(const Xic *xic_p)
{
......@@ -207,6 +205,8 @@ QCPXic::addXicP(const Xic *xic_p)
if(_intensity_range.upper < xic_p->maxYDataPoint().y)
_intensity_range.upper = xic_p->maxYDataPoint().y;
}
return graph_xic;
}
......
......@@ -49,7 +49,7 @@ class QCPXic : public QCustomPlot
protected:
void clear();
void rescale();
void addXicP(const Xic *xic_p);
QCPGraph *addXicP(const Xic *xic_p);
void addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt);
void
addXicPeakList(const Xic *xic_p,
......
......@@ -63,11 +63,11 @@ XicWidget::addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt)
_qcp_xic->addMsMsEvent(xic_p, rt);
_map_xic_msms_event[xic_p] = rt;
}
void
XicWidget::addXicSp(XicCstSPtr &xic_sp)
QCPGraph *
XicWidget::addXicSp(XicCstSPtr xic_sp)
{
_xic_sp_list.push_back(xic_sp);
_qcp_xic->addXicP(xic_sp.get());
return _qcp_xic->addXicP(xic_sp.get());
}
const QString &
......
......@@ -52,7 +52,7 @@ class PMSPP_LIB_DECL XicWidget : public GraphicDeviceWidget
~XicWidget();
void addXicSp(XicCstSPtr &xic_sp);
QCPGraph *addXicSp(XicCstSPtr xic_sp);
void addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt);
void
addXicPeakList(const Xic *xic_p,
......
......@@ -40,6 +40,10 @@ Xic::Xic()
qDebug() << "Xic::Xic end";
}
Xic::Xic(const Trace &other) : Trace(other)
{
}
Xic::~Xic()
{
}
......
......@@ -44,6 +44,7 @@ class PMSPP_LIB_DECL Xic : public Trace
{
public:
Xic();
Xic(const Trace & other);
virtual ~Xic();
......
......@@ -72,8 +72,6 @@ MsRunXicExtractorInterfaceSp
MsRunXicExtractorFactory::buildMsRunXicExtractorSp(
MsRunReaderSPtr &msrun_reader) const
{
#if 0
// Remove this section because it cripples my work on Qt6 build
pappso::TimsMsRunReaderMs2 *tims2_reader =
dynamic_cast<pappso::TimsMsRunReaderMs2 *>(msrun_reader.get());
......@@ -116,7 +114,6 @@ MsRunXicExtractorFactory::buildMsRunXicExtractorSp(
return (msrun_xic_extractor_sp);
}
return nullptr;
#endif
}
......
......@@ -32,6 +32,7 @@ if(MAKE_TESTS AND (WIN64 OR (UNIX AND NOT APPLE)))
find_package(Catch2 REQUIRED)
if(OdsStream_FOUND)
else (OdsStream_FOUND)
find_package(OdsStream REQUIRED)
......@@ -150,17 +151,17 @@ if(MAKE_TESTS AND (WIN64 OR (UNIX AND NOT APPLE)))
target_link_libraries(test_fasta_reader Qt6::Core pappsomspp-shared)
add_test(test_fasta_reader "test_fasta_reader")
add_executable(test_protein test_protein.cpp)
target_link_libraries(test_protein Qt6::Core pappsomspp-shared)
add_test(test_protein "test_protein")
#add_executable(test_protein test_protein.cpp)
#target_link_libraries(test_protein Qt6::Core pappsomspp-shared)
#add_test(test_protein "test_protein")
add_executable(test_massrange test_massrange.cpp)
target_link_libraries(test_massrange Qt6::Core pappsomspp-shared)
add_test(test_massrange "test_massrange")
add_executable(test_peptide test_peptide.cpp)
target_link_libraries(test_peptide Qt6::Core Qt6::Gui pappsomspp-shared)
add_test(test_peptide "test_peptide")
#add_executable(test_peptide test_peptide.cpp)
#target_link_libraries(test_peptide Qt6::Core Qt6::Gui pappsomspp-shared)
#add_test(test_peptide "test_peptide")
add_executable(test_peptidenaturalisotopelist test_peptidenaturalisotopelist.cpp)
target_link_libraries(test_peptidenaturalisotopelist Qt6::Core Qt6::Gui pappsomspp-shared)
......@@ -179,9 +180,9 @@ if(MAKE_TESTS AND (WIN64 OR (UNIX AND NOT APPLE)))
add_test(test_fragmentationcid "test_fragmentationcid")
#IF (FALSE)
add_executable(test_big_hyperscore test_big_hyperscore.cpp ${CPP_TEST_FILES})
target_link_libraries(test_big_hyperscore Qt6::Core Qt6::Gui Qt6::Xml pappsomspp-shared)
add_test(test_big_hyperscore "test_big_hyperscore")
#add_executable(test_big_hyperscore test_big_hyperscore.cpp ${CPP_TEST_FILES})
#target_link_libraries(test_big_hyperscore Qt6::Core Qt6::Gui Qt6::Xml pappsomspp-shared)
#add_test(test_big_hyperscore "test_big_hyperscore")
#ENDIF(FALSE)
add_executable(test_rawmasslist test_rawmasslist.cpp)
......@@ -189,32 +190,35 @@ if(MAKE_TESTS AND (WIN64 OR (UNIX AND NOT APPLE)))
add_test(test_rawmasslist "test_rawmasslist")
add_executable(test_isotope_with_spectrum common.cpp test_isotope_with_spectrum.cpp)
target_link_libraries(test_isotope_with_spectrum Qt6::Core Qt6::Gui pappsomspp-shared ${Boost_LIBRARIES})
target_link_libraries(test_isotope_with_spectrum Qt6::Core Qt6::Gui
QuaZip::QuaZip pappsomspp-shared ${Boost_LIBRARIES})
add_test(test_isotope_with_spectrum "test_isotope_with_spectrum")
set(TEST_LIST ${TEST_LIST} test_isotope_with_spectrum)
add_executable(test_hyperscore common.cpp test_hyperscore.cpp)
target_link_libraries(test_hyperscore Qt6::Core pappsomspp-shared Qt6::Gui ${Boost_LIBRARIES})
target_link_libraries(test_hyperscore Qt6::Core pappsomspp-shared Qt6::Gui
QuaZip::QuaZip ${Boost_LIBRARIES})
add_test(test_hyperscore "test_hyperscore")
set(TEST_LIST ${TEST_LIST} test_hyperscore)
add_executable(test_xtandem_spectrum common.cpp test_xtandem_spectrum.cpp)
target_link_libraries(test_xtandem_spectrum Qt6::Core pappsomspp-shared Qt6::Gui ${Boost_LIBRARIES})
target_link_libraries(test_xtandem_spectrum Qt6::Core pappsomspp-shared
Qt6::Gui QuaZip::QuaZip ${Boost_LIBRARIES})
add_test(test_xtandem_spectrum "test_xtandem_spectrum")
set(TEST_LIST ${TEST_LIST} test_xtandem_spectrum)
add_executable(test_scan_15968 common.cpp test_scan_15968.cpp)
target_link_libraries(test_scan_15968 Qt6::Core Qt6::Gui pappsomspp-shared ${Boost_LIBRARIES})
target_link_libraries(test_scan_15968 Qt6::Core Qt6::Gui pappsomspp-shared QuaZip::QuaZip ${Boost_LIBRARIES})
add_test(test_scan_15968 "test_scan_15968")
set(TEST_LIST ${TEST_LIST} test_scan_15968)
add_executable(test_psm common.cpp test_psm.cpp)
target_link_libraries(test_psm Qt6::Core pappsomspp-shared Qt6::Gui Qt6::Concurrent ${Boost_LIBRARIES})
target_link_libraries(test_psm Qt6::Core pappsomspp-shared Qt6::Gui Qt6::Concurrent QuaZip::QuaZip ${Boost_LIBRARIES})
add_test(test_psm "test_psm")
set(TEST_LIST ${TEST_LIST} test_psm)
add_executable(test_xicextractor test_xicextractor.cpp)
target_link_libraries(test_xicextractor Qt6::Core Qt6::Gui pappsomspp-shared ${Boost_LIBRARIES} OdsStream::Core)
target_link_libraries(test_xicextractor Qt6::Core Qt6::Gui pappsomspp-shared ${Boost_LIBRARIES} QuaZip::QuaZip OdsStream::Core)
add_test(test_xicextractor "test_xicextractor")
set(TEST_LIST ${TEST_LIST} test_xicextractor)
......@@ -224,14 +228,14 @@ if(MAKE_TESTS AND (WIN64 OR (UNIX AND NOT APPLE)))
set(TEST_LIST ${TEST_LIST} test_msrunoutput)
if(UNIX)
#if(UNIX)
set_property(TEST catch2-only-tests test_big_hyperscore test_fasta_reader
test_massrange test_peptidenaturalisotopelist test_peptidefragment
test_fragmentationcid ${TEST_LIST} test_natural_isotope_average test_rawmasslist
PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:../src")
#set_property(TEST catch2-only-tests test_big_hyperscore test_fasta_reader
#test_massrange test_peptidenaturalisotopelist test_peptidefragment
#test_fragmentationcid ${TEST_LIST} test_natural_isotope_average test_rawmasslist
#PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:../src")
endif()
#endif()
if(WIN32)
set(ENV{PATH} "$ENV{PATH};..\\src")
......
......@@ -27,11 +27,16 @@
******************************************************************************/
// make test ARGS="-V -I 18,18"
// ./tests/catch2-only-tests [psm] -s
// ./tests/catch2-only-tests [psmfeature] -s
#define CATCH_CONFIG_MAIN
#include <algorithm>
#include <catch2/catch.hpp>
#include <pappsomspp/mzrange.h>
#include <pappsomspp/psm/peptidespectrummatch.h>
#include <pappsomspp/psm/features/psmfeatures.h>
#include <iostream>
#include <iomanip>
#include <set>
......@@ -83,5 +88,242 @@ TEST_CASE("psm test suite.", "[psm]")
spectrum_simple, peptide_sp, 2, precision, ion_list);
test_count = psmb.countTotalMatchedIons();
REQUIRE(test_count == 0);
precision = PrecisionFactory::getDaltonInstance(0.02);
PeptideIsotopeSpectrumMatch psm_iso(
spectrum_simple, peptide_sp, 2, precision, ion_list, 2, 0);
std::list<PeakIonIsotopeMatch> peak_ion_isotope_match_list =
psm_iso.getPeakIonIsotopeMatchList();
for(auto peak : peak_ion_isotope_match_list)
{
qDebug() << peak.toString() << " "
<< peak.getPeptideNaturalIsotopeAverageSp().get();
}
REQUIRE(peak_ion_isotope_match_list.size() == 19);
psm_iso.dropPeaksLackingMonoisotope();
peak_ion_isotope_match_list = psm_iso.getPeakIonIsotopeMatchList();
for(auto peak : peak_ion_isotope_match_list)
{
qDebug() << peak.toString() << " "
<< peak.getPeptideNaturalIsotopeAverageSp().get();
}
REQUIRE(peak_ion_isotope_match_list.size() == 19);
qDebug() << peak_ion_isotope_match_list.size();
peak_ion_isotope_match_list.sort(
[](const PeakIonIsotopeMatch &a, const PeakIonIsotopeMatch &b) {
qDebug() << a.getPeak().y << " > ";
qDebug() << b.getPeak().y << " . ";
return (a.getPeak().y > b.getPeak().y);
});
spectrum_simple = readMgf(
QString(CMAKE_SOURCE_DIR).append("/tests/data/peaklist_15046.mgf"));
peptide_sp = Peptide("AIADGSLLDLLR").makePeptideSp();
precision = PrecisionFactory::getDaltonInstance(0.02);
qDebug();
PeptideIsotopeSpectrumMatch psm_iso_check(
spectrum_simple, peptide_sp, 2, precision, ion_list, 2, 0);
qDebug();
peak_ion_isotope_match_list = psm_iso_check.getPeakIonIsotopeMatchList();
REQUIRE(peak_ion_isotope_match_list.size() == 39);
qDebug();
for(auto &peak : peak_ion_isotope_match_list)
{
qDebug() << peak.toString() << " "
<< peak.getPeptideNaturalIsotopeAverageSp().get();
}
peak_ion_isotope_match_list.sort(
[](const PeakIonIsotopeMatch &a, const PeakIonIsotopeMatch &b) {
if(a.getPeptideIonType() < b.getPeptideIonType())
return true;
if(a.getPeptideFragmentIonSp().get()->size() <
b.getPeptideFragmentIonSp().get()->size())
return true;
if(a.getCharge() < b.getCharge())
return true;
if(a.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber() <
b.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber())
return true;
return false;
});
auto it = peak_ion_isotope_match_list.begin();
REQUIRE(it->toString().toStdString() == "b2+isotope0r1mz185.128");
it++;
REQUIRE(it->toString().toStdString() == "b3+isotope0r1mz256.165");
for(auto peak : peak_ion_isotope_match_list)
{
qDebug() << peak.toString() << " "
<< peak.getPeptideNaturalIsotopeAverageSp().get();
}
psm_iso_check.dropPeaksLackingMonoisotope();
peak_ion_isotope_match_list = psm_iso_check.getPeakIonIsotopeMatchList();
for(auto peak : peak_ion_isotope_match_list)
{
qDebug() << peak.toString() << " "
<< peak.getPeptideNaturalIsotopeAverageSp().get();
}
REQUIRE(peak_ion_isotope_match_list.size() == 39);
}
}
TEST_CASE("psm features test suite.", "[psmfeature]")
{
// Set the debugging message formatting pattern.
qSetMessagePattern(QString("%{file}@%{line}, %{function}(): %{message}"));
SECTION("..:: readMgf ::..", "[psm]")
{
cout << std::endl << "..:: readMgf ::.." << std::endl;
// bool refine_spectrum_synthesis = false;
MassSpectrum spectrum_simple =
readMgf(QString(CMAKE_SOURCE_DIR).append("/tests/data/scan_2016.mgf"));
//.applyCutOff(150).takeNmostIntense(100).applyDynamicRange(100);
Peptide peptide("EDKPQPPPEGR");
PeptideSp peptide_sp(peptide.makePeptideSp());
// peptide_sp.get()->addAaModification(AaModification::getInstance("MOD:00397"),
// 0);
PsmFeatures features(PrecisionFactory::getDaltonInstance(0.02), 150);
features.setPeptideSpectrumCharge(peptide_sp, &spectrum_simple, 3);
REQUIRE(features.getTotalIntensity() == Approx(248641.8659667977));
REQUIRE(features.getIntensityOfMatchedIon(PeptideIon::b) ==
Approx(1751.5864257813).epsilon(0.001));
REQUIRE(features.getIntensityOfMatchedIon(PeptideIon::y) ==
Approx(57112.2947998047).epsilon(0.001));
REQUIRE(features.countMatchedIonComplementPairs() == 0);
/*
<group id="15968" mh="1275.731419" z="2" rt="PT2843.58S" expect="1.7e-04"
label="GRMZM5G815453_P01 P00874 Ribulose bisphosphate carboxylase large chain
Precursor..." type="model" sumI="6.08" maxI="111642" fI="1116.42" act="0" >
<protein expect="-191.8" id="15968.1" uid="49237" label="GRMZM5G815453_P01
P00874 Ribulose bisphosphate carboxylase large chain Precursor..." sumI="8.97"
> <note label="description">GRMZM5G815453_P01 P00874 Ribulose bisphosphate
carboxylase large chain Precursor (RuBisCO large subunit)(EC 4.1.1.39)
seq=translation; coord=Pt:56824..58323:1; parent_transcript=GRMZM5G815453_T01;
parent_gene=GRMZM5G815453</note> <file type="peptide"
URL="/gorgone/pappso/formation/TD/Database/Genome_Z_mays_5a.fasta"/> <peptide
start="1" end="483"> <domain id="15968.1.1" start="347" end="357"
expect="1.7e-04" mh="1275.7311" delta="0.0003" hyperscore="29.0"
nextscore="10.8" y_score="10.5" y_ions="8" b_score="3.8" b_ions="1" pre="EGER"
post="DDFI" seq="EITLGFVDLLR" missed_cleavages="0">
</domain>
</peptide>
*/
spectrum_simple =
readMgf(QString(CMAKE_SOURCE_DIR).append("/tests/data/scan_15968.mgf"));
peptide_sp = Peptide("EITLGFVDLLR").makePeptideSp();
features.setPeptideSpectrumCharge(peptide_sp, &spectrum_simple, 2);
REQUIRE(
features.getMaxIntensityMatchedIonComplementPairPrecursorMassDelta() ==
Approx(-0.0036778069).epsilon(0.00001));
REQUIRE(features.countMatchedIonComplementPairs() == 3);
REQUIRE(features.getPeakIonPairs().size() == 3);
REQUIRE(features.getPeakIonPairs()[0].first.toString().toStdString() ==
"b2+isotope0r1mz243.134");
REQUIRE(features.getPeakIonPairs()[0].second.toString().toStdString() ==
"y9+isotope0r1mz1033.61");
REQUIRE(features.getPeakIonPairs()[1].first.toString().toStdString() ==
"b6+isotope0r1mz661.367");
REQUIRE(features.getPeakIonPairs()[1].second.toString().toStdString() ==
"y5+isotope0r1mz615.383");
REQUIRE(features.getPeakIonPairs()[2].first.toString().toStdString() ==
"b7+isotope0r1mz760.435");
REQUIRE(features.getPeakIonPairs()[2].second.toString().toStdString() ==
"y4+isotope0r1mz516.315");
REQUIRE(
features.getIonPairPrecursorMassDelta(features.getPeakIonPairs()[0]) ==
Approx(-0.0036778069).epsilon(0.001));
REQUIRE(
features.getIonPairPrecursorMassDelta(features.getPeakIonPairs()[1]) ==
Approx(-0.0118262069).epsilon(0.001));
REQUIRE(
features.getIonPairPrecursorMassDelta(features.getPeakIonPairs()[2]) ==
Approx(-0.0114600069).epsilon(0.001));
REQUIRE(features.getMaxConsecutiveIon(PeptideIon::y) == 9);
REQUIRE(features.getMaxConsecutiveIon(PeptideIon::b) == 2);
REQUIRE(features.getMaxConsecutiveIon(PeptideIon::a) == 0);
spectrum_simple = readMgf(
QString(CMAKE_SOURCE_DIR).append("/tests/data/peaklist_15046.mgf"));
peptide_sp = Peptide("AIADGSLLDLLR").makePeptideSp();
features.setPeptideSpectrumCharge(peptide_sp, &spectrum_simple, 2);
REQUIRE(features.getMaxConsecutiveIon(PeptideIon::y) == 10);
REQUIRE(features.getMaxConsecutiveIon(PeptideIon::b) == 3);
REQUIRE(features.getAaSequenceCoverage(PeptideIon::y) == 10);
REQUIRE(features.getAaSequenceCoverage(PeptideIon::b) == 5);
REQUIRE(features.getIntensityOfMatchedIon(PeptideIon::y) ==
Approx(863068.6967769999));
REQUIRE(features.getMaxIntensityPeakIonMatch(PeptideIon::y) ==
Approx(114514.0625));
REQUIRE(features.getIntensityOfMatchedIon(PeptideIon::b) ==
Approx(254791.342651));
REQUIRE(features.getMaxIntensityPeakIonMatch(PeptideIon::b) ==
Approx(161016.984375));
// SeqCoverComplementPeaks
REQUIRE(features.getComplementPairsAaSequenceCoverage() == 5);
REQUIRE(((double)features.getComplementPairsAaSequenceCoverage() /
(double)peptide_sp.get()->size()) == Approx(5.0 / 12.0));
REQUIRE(((double)0 / (double)peptide_sp.get()->size()) == Approx(0));
REQUIRE((features.getTotalIntensityOfMatchedIonComplementPairs() /
features.getTotalIntensity()) == Approx(0.1727291768));
REQUIRE((features.getTotalIntensityOfMatchedIonComplementPairs() <
features.getTotalIntensity()));
REQUIRE(
features.getMaxIntensityMatchedIonComplementPairPrecursorMassDelta() ==
Approx(0.0008592852).epsilon(0.00001));
}
}
......@@ -313,15 +313,15 @@ TEST_CASE("XIC test suite.", "[XIC]")
xicprm_test);
INFO("readOdsXic OK");
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
TraceDetectionZivy _zivy(2, 3, 3, 5000, 6000);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
TraceDetectionMaxSink max_peak_tic;
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
try
{
_zivy.detect(xicprm_test, max_peak_tic);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
_zivy.detect(xicprm_test, max_peak_tic, true);
qDebug();
}
catch(PappsoException &error)
{
......@@ -339,41 +339,41 @@ TEST_CASE("XIC test suite.", "[XIC]")
OdsDocWriter writer(&fileods);
TracePeakOdsWriterSink ods_sink(writer);
_zivy.detect(xicprm_test, ods_sink);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
_zivy.detect(xicprm_test, ods_sink, true);
qDebug();
writer.close();
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
fileods.close();
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
Xic realxic_test;
readOdsXic(QString(CMAKE_SOURCE_DIR).append("/tests/data/xic/real_xic.ods"),
realxic_test);
INFO("readOdsXic OK");
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
QFile realfileods(
QString(CMAKE_SOURCE_DIR).append("/tests/data/xic/real_xic_detect.ods"));
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
OdsDocWriter realwriter(&realfileods);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
TracePeakOdsWriterSink real_ods_sink(realwriter);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
//_zivy.setSink(&max_peak_tic);
TraceDetectionZivy _zivyb(2, 4, 3, 30000, 50000);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
try
{
_zivyb.detect(realxic_test, real_ods_sink);
_zivyb.detect(realxic_test, real_ods_sink, true);
}
catch(PappsoException &error)
{
INFO("error TraceDetectionZivy : " << error.qwhat().toStdString());
throw error;
}
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
realwriter.close();
realfileods.close();
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug();
QFile realfilemoulondetectods(
QString(CMAKE_SOURCE_DIR)
......@@ -383,7 +383,7 @@ TEST_CASE("XIC test suite.", "[XIC]")
TraceDetectionMoulon moulon(4, 60000, 40000);
moulon.detect(realxic_test, real_detect_moulonods_sink);
moulon.detect(realxic_test, real_detect_moulonods_sink, true);
realdetectmoulonwriter.close();
realfilemoulondetectods.close();
......@@ -453,25 +453,25 @@ TEST_CASE("test operations on tracepeaklist", "[tracepeaklist]")
Xic empty_xic;
TraceDetectionZivy _zivy(2, 3, 3, 5000, 6000);
TracePeakList peak_list;
_zivy.detect(empty_xic, peak_list);
_zivy.detect(empty_xic, peak_list, true);
REQUIRE(peak_list.size() == 0);
empty_xic.resize(2);
fill(empty_xic.begin(), empty_xic.end(), DataPoint(1, 1));
_zivy.detect(empty_xic, peak_list);
_zivy.detect(empty_xic, peak_list, true);
REQUIRE(peak_list.size() == 0);
empty_xic.resize(3);
fill(empty_xic.begin(), empty_xic.end(), DataPoint(1, 1));
_zivy.detect(empty_xic, peak_list);
_zivy.detect(empty_xic, peak_list, true);
REQUIRE(peak_list.size() == 0);
empty_xic.resize(4);
fill(empty_xic.begin(), empty_xic.end(), DataPoint(1, 1));
_zivy.detect(empty_xic, peak_list);
_zivy.detect(empty_xic, peak_list, true);
REQUIRE(peak_list.size() == 0);
......@@ -484,7 +484,7 @@ TEST_CASE("test operations on tracepeaklist", "[tracepeaklist]")
i++;
}
_zivy.detect(empty_xic, peak_list);
_zivy.detect(empty_xic, peak_list, true);
REQUIRE(peak_list.size() == 0);
......@@ -497,7 +497,7 @@ TEST_CASE("test operations on tracepeaklist", "[tracepeaklist]")
i++;
}
_zivy.detect(empty_xic, peak_list);
_zivy.detect(empty_xic, peak_list, true);
REQUIRE(peak_list.size() == 0);
}
SECTION("test for masschroq issue#15", "[tracepeaklist]")
......@@ -512,7 +512,7 @@ TEST_CASE("test operations on tracepeaklist", "[tracepeaklist]")
TraceDetectionZivy zivy15(2, 4, 3, 5000, 3000);
TracePeakList peak_list;
qDebug();
zivy15.detect(xic, peak_list);
zivy15.detect(xic, peak_list, true);
qDebug();
REQUIRE(peak_list.size() == 0);
}
......@@ -528,8 +528,23 @@ TEST_CASE("test operations on tracepeaklist", "[tracepeaklist]")
readOdsXic(QString(CMAKE_SOURCE_DIR).append("/tests/data/xic/real_xic.ods"),
xicprm_test);
TracePeak peak(
xicprm_test.begin() + 9079, xicprm_test.begin() + 9142, false);
REQUIRE(peak.getArea() == Approx(96163224.06));
TracePeak peak_nobase(
xicprm_test.begin() + 9079, xicprm_test.begin() + 9142, true);
REQUIRE(peak_nobase.getArea() == Approx(76281621.60));
REQUIRE(
peak_nobase.getLeftBoundary().y *
(peak_nobase.getRightBoundary().x - peak_nobase.getLeftBoundary().x) ==
Approx(peak.getArea() - peak_nobase.getArea()));
INFO("readOdsXic OK");
REQUIRE_NOTHROW(_zivy.detect(xicprm_test, peak_list));
REQUIRE_NOTHROW(_zivy.detect(xicprm_test, peak_list, true));
REQUIRE(peak_list.size() == 64);
......
......@@ -28,6 +28,7 @@
******************************************************************************/
#include <QApplication>
#include <QIODevice>
#include <pappsomspp/pappsoexception.h>
#include "testwidgetgui.h"
......