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

test refactoring

parent b56815d1
Branches main
No related tags found
No related merge requests found
......@@ -581,6 +581,24 @@ TEST_CASE("proteincode test suite.", "[proteincode]")
reader.parse(file2);
pappso::AaCode aa_code;
aa_code.addAaModification('C',
pappso::AaModification::getInstance("MOD:00397"));
pappso::AaStringCodec aa_codec(aa_code);
std::vector<pappso::ProteinIntegerCode> arr_codedProtein;
for(auto &protein : protein_handler.getProteinArray())
{
pappso::ProteinSp protein_sp = protein.makeProteinSp();
qDebug() << protein_sp.get()->getAccession();
// pappso::ProteinIntegerCode protein_code(protein_sp, aa_codec, 5);
arr_codedProtein.push_back({protein_sp, aa_codec, 5});
}
SECTION("..:: scan spectrum on fasta file ::..", "[proteincodefasta]")
{
// compute spectrum code :
......@@ -604,12 +622,6 @@ TEST_CASE("proteincode test suite.", "[proteincode]")
// ok spectrum code
pappso::AaCode aa_code;
aa_code.addAaModification('C',
pappso::AaModification::getInstance("MOD:00397"));
pappso::AaStringCodec aa_codec(aa_code);
pappso::ProteinSp max_protein;
double max_score = 0;
......@@ -630,15 +642,13 @@ TEST_CASE("proteincode test suite.", "[proteincode]")
std::vector<double> convolution_score;
for(auto &protein : protein_handler.getProteinArray())
for(auto &coded_protein : arr_codedProtein)
{
pappso::ProteinSp protein_sp = protein.makeProteinSp();
pappso::ProteinSp protein_sp = coded_protein.getProteinSp();
qDebug() << protein_sp.get()->getAccession();
pappso::ProteinIntegerCode protein_code(protein_sp, aa_codec, 5);
std::vector<double> vec_score =
protein_code.convolution(code_list_from_spectrum);
coded_protein.convolution(code_list_from_spectrum);
auto it_score = std::max_element(vec_score.begin(), vec_score.end());
// double score = std::accumulate(it_score - 2, it_score + 5, 0);
......@@ -687,17 +697,11 @@ TEST_CASE("proteincode test suite.", "[proteincode]")
pappso::FilterPeakDelta filter_peak_delta;
filter_peak_delta.filter(spectrum);
pappso::FilterGreatestY(400).filter(spectrum);
pappso::FilterGreatestY(500).filter(spectrum);
std::vector<double> mass_list = spectrum.xValues();
// ok spectrum code
pappso::AaCode aa_code;
aa_code.addAaModification('C',
pappso::AaModification::getInstance("MOD:00397"));
pappso::AaStringCodec aa_codec(aa_code);
pappso::ProteinSp max_protein;
double max_score = 0;
......@@ -718,15 +722,15 @@ TEST_CASE("proteincode test suite.", "[proteincode]")
std::vector<double> convolution_score;
for(auto &protein : protein_handler.getProteinArray())
{
pappso::ProteinSp protein_sp = protein.makeProteinSp();
qDebug() << protein_sp.get()->getAccession();
pappso::ProteinIntegerCode protein_code(protein_sp, aa_codec, 5);
for(auto &coded_protein : arr_codedProtein)
{
pappso::ProteinSp protein_sp = coded_protein.getProteinSp();
// qDebug() << protein_sp.get()->getAccession();
std::vector<double> vec_score =
protein_code.convolution(code_list_from_spectrum);
coded_protein.convolution(code_list_from_spectrum);
auto it_score = std::max_element(vec_score.begin(), vec_score.end());
// double score = std::accumulate(it_score - 2, it_score + 5, 0);
......
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