Skip to content
Snippets Groups Projects
Commit 8069995b authored by Langella Olivier's avatar Langella Olivier
Browse files

fix virtual desctructor, psmfeature test added

parent ce731ce8
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,9 @@ PsmFeatures::setPeptideSpectrumCharge(pappso::PeptideSp peptideSp,
0);
m_spectrumSumIntensity = spectrum.sumY();
}
......
......@@ -63,7 +63,7 @@ class PMSPP_LIB_DECL PeptideIsotopeSpectrumMatch
PrecisionPtr precision);
PeptideIsotopeSpectrumMatch(const PeptideIsotopeSpectrumMatch &other);
~PeptideIsotopeSpectrumMatch();
virtual ~PeptideIsotopeSpectrumMatch();
const std::list<PeakIonIsotopeMatch> &getPeakIonIsotopeMatchList() const;
......
......@@ -61,7 +61,7 @@ class PMSPP_LIB_DECL PeptideSpectrumMatch
PrecisionPtr precision);
PeptideSpectrumMatch(const PeptideSpectrumMatch &other);
~PeptideSpectrumMatch();
virtual ~PeptideSpectrumMatch();
bool contains(const PeptideFragmentIon *peptideFragmentIonSp,
unsigned int z) const;
......
......@@ -32,6 +32,7 @@
#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>
......@@ -85,3 +86,36 @@ TEST_CASE("psm test suite.", "[psm]")
REQUIRE(test_count == 0);
}
}
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;
features.setPeptideSpectrumCharge(peptide_sp, &spectrum_simple, 3);
REQUIRE(features.getTotalIntensity() == Approx(441667.0422973642));
REQUIRE(features.getIntensityOfMatchedIon(PeptideIon::b) ==
Approx(3902.8420410157).epsilon(0.001));
REQUIRE(features.getIntensityOfMatchedIon(PeptideIon::y) ==
Approx(55812.58984375).epsilon(0.001));
}
}
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