Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pappsomspp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
⚠
INSTANCE de PREPROD
⚠
Les données peuvent être supprimées à tout moment.
Show more breadcrumbs
PAPPSO
pappsomspp
Commits
1c8f48a7
Commit
1c8f48a7
authored
1 year ago
by
Langella Olivier
Browse files
Options
Downloads
Patches
Plain Diff
test refactoring
parent
b56815d1
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_proteincode.cpp
+28
-24
28 additions, 24 deletions
tests/test_proteincode.cpp
with
28 additions
and
24 deletions
tests/test_proteincode.cpp
+
28
−
24
View file @
1c8f48a7
...
...
@@ -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
.
make
ProteinSp
();
pappso
::
ProteinSp
protein_sp
=
coded_
protein
.
get
ProteinSp
();
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
(
4
00
).
filter
(
spectrum
);
pappso
::
FilterGreatestY
(
5
00
).
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);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment