Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
i2MassChroQ
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
PAPPSO
i2MassChroQ
Commits
727603c1
Commit
727603c1
authored
7 years ago
by
Olivier Langella
Browse files
Options
Downloads
Patches
Plain Diff
reading Xtandem files seems to work!
parent
2ff5d8a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/identificationgroup.cpp
+16
-15
16 additions, 15 deletions
src/core/identificationgroup.cpp
src/core/identificationgroup.h
+4
-0
4 additions, 0 deletions
src/core/identificationgroup.h
with
20 additions
and
15 deletions
src/core/identificationgroup.cpp
+
16
−
15
View file @
727603c1
...
...
@@ -54,11 +54,19 @@ ProteinMatch * IdentificationGroup::getProteinMatch(const QString accession) {
if
(
accession
.
isEmpty
())
{
throw
pappso
::
PappsoException
(
QObject
::
tr
(
"Error protein match not found : accession is empty"
));
}
for
(
ProteinMatch
*
p_protein_match
:
_protein_match_list
)
{
if
(
p_protein_match
->
getProteinXtpSp
().
get
()
->
getAccession
()
==
accession
)
{
return
p_protein_match
;
auto
it_cache
=
_cache_accession_protein_match
.
find
(
accession
);
if
(
it_cache
==
_cache_accession_protein_match
.
end
())
{
//accession not found in cache
for
(
ProteinMatch
*
p_protein_match
:
_protein_match_list
)
{
if
(
p_protein_match
->
getProteinXtpSp
().
get
()
->
getAccession
()
==
accession
)
{
_cache_accession_protein_match
.
insert
(
std
::
pair
<
QString
,
ProteinMatch
*>
(
accession
,
p_protein_match
));
return
p_protein_match
;
}
}
}
else
{
return
it_cache
->
second
;
}
return
nullptr
;
}
void
IdentificationGroup
::
addProteinMatch
(
ProteinMatch
*
protein_match
)
{
...
...
@@ -66,20 +74,13 @@ void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) {
if
(
accession
.
isEmpty
())
{
throw
pappso
::
PappsoException
(
QObject
::
tr
(
"Error adding protein match : accession is empty"
));
}
bool
push
=
true
;
for
(
ProteinMatch
*
p_protein_match
:
_protein_match_list
)
{
if
(
p_protein_match
==
protein_match
)
{
push
=
false
;
}
else
{
if
(
p_protein_match
->
getProteinXtpSp
().
get
()
->
getAccession
()
==
accession
)
{
throw
pappso
::
PappsoException
(
QObject
::
tr
(
"Error adding protein match : accession %1 already registered"
).
arg
(
accession
));
}
}
}
if
(
push
)
{
auto
it_cache
=
_cache_already_added_protein_match
.
find
(
protein_match
);
if
(
it_cache
==
_cache_already_added_protein_match
.
end
())
{
//accession not found in cache
_cache_already_added_protein_match
.
insert
(
protein_match
);
_protein_match_list
.
push_back
(
protein_match
);
}
}
bool
IdentificationGroup
::
contains
(
const
MsRun
*
p_msrun
)
const
{
...
...
This diff is collapsed.
Click to expand it.
src/core/identificationgroup.h
+
4
−
0
View file @
727603c1
...
...
@@ -31,6 +31,7 @@
#ifndef IDENTIFICATIONGROUP_H
#define IDENTIFICATIONGROUP_H
#include
<set>
class
Project
;
...
...
@@ -92,6 +93,9 @@ private :
std
::
vector
<
ProteinMatch
*>
_protein_match_list
;
std
::
vector
<
MsRunSp
>
_ms_run_list
;
std
::
map
<
QString
,
ProteinMatch
*>
_cache_accession_protein_match
;
std
::
set
<
ProteinMatch
*>
_cache_already_added_protein_match
;
};
#endif // IDENTIFICATIONGROUP_H
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