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
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
PAPPSO
i2MassChroQ
Commits
3cb08a1e
Commit
3cb08a1e
authored
7 years ago
by
Olivier Langella
Browse files
Options
Downloads
Patches
Plain Diff
FDR and contaminant selection now works selecting fasta files
parent
42378830
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/files/fastafile.cpp
+2
-1
2 additions, 1 deletion
src/files/fastafile.cpp
src/gui/project_view/projectwindow.cpp
+17
-1
17 additions, 1 deletion
src/gui/project_view/projectwindow.cpp
src/utils/proteinstore.cpp
+15
-9
15 additions, 9 deletions
src/utils/proteinstore.cpp
with
34 additions
and
11 deletions
src/files/fastafile.cpp
+
2
−
1
View file @
3cb08a1e
...
...
@@ -32,9 +32,10 @@ public:
};
void
setSequence
(
const
QString
&
description
,
const
QString
&
sequence
)
override
{
qDebug
()
<<
"PeptideReader::setSequence "
<<
description
<<
" "
<<
sequence
;
//
qDebug() << "PeptideReader::setSequence " << description << " " <<sequence;
QStringList
descr_split
=
description
.
simplified
().
split
(
" "
);
QString
accession
=
descr_split
.
at
(
0
);
//qDebug() << "PeptideReader::setSequence " << accession << " " <<accession;
_protein_store
.
setContaminantAccession
(
accession
);
};
private
:
...
...
This diff is collapsed.
Click to expand it.
src/gui/project_view/projectwindow.cpp
+
17
−
1
View file @
3cb08a1e
...
...
@@ -54,6 +54,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
ui
->
contaminant_database_listview
->
setModel
(
_p_fasta_str_li
);
QItemSelectionModel
*
selection_model
=
ui
->
contaminant_database_listview
->
selectionModel
();
ui
->
contaminant_database_listview
->
setSelectionMode
(
QAbstractItemView
::
MultiSelection
);
ui
->
decoy_database_listview
->
setSelectionMode
(
QAbstractItemView
::
MultiSelection
);
_p_automatic_filter_widget
=
new
AutomaticFilterWidget
(
this
);
ui
->
filter_parameter_layout
->
addWidget
(
_p_automatic_filter_widget
);
...
...
@@ -259,7 +260,22 @@ void ProjectWindow::doFdrChanged() {
qDebug
()
<<
"ProjectWindow::doFdrChanged begin "
;
showWaitingMessage
(
tr
(
"FDR modifications"
));
doDisplayLoadingMessage
(
tr
(
"tagging decoy proteins"
));
_project_sp
.
get
()
->
getProteinStore
().
setRegexpDecoyPattern
(
ui
->
decoy_protein_regexp_line_edit
->
text
());
QModelIndexList
index_list
=
ui
->
decoy_database_listview
->
selectionModel
()
->
selectedIndexes
();
if
(
index_list
.
size
()
>
0
)
{
_project_sp
.
get
()
->
getProteinStore
().
clearDecoys
();
for
(
QModelIndex
index
:
index_list
)
{
if
(
index
.
data
(
Qt
::
UserRole
).
canConvert
<
FastaFile
*>
())
{
FastaFile
*
p_fasta_file
=
index
.
data
(
Qt
::
UserRole
).
value
<
FastaFile
*>
();
p_fasta_file
->
setDecoys
(
_project_sp
.
get
()
->
getProteinStore
());
}
else
{
throw
pappso
::
PappsoException
(
QObject
::
tr
(
"can not convert to FastaFile index.data().canConvert<FastaFile *>()"
));
}
}
}
else
{
_project_sp
.
get
()
->
getProteinStore
().
setRegexpDecoyPattern
(
ui
->
decoy_protein_regexp_line_edit
->
text
());
}
doDisplayLoadingMessage
(
tr
(
"updating filters"
));
_project_sp
.
get
()
->
updateAutomaticFilters
(
_project_sp
.
get
()
->
getAutomaticFilterParameters
());
...
...
This diff is collapsed.
Click to expand it.
src/utils/proteinstore.cpp
+
15
−
9
View file @
3cb08a1e
...
...
@@ -34,12 +34,12 @@
ProteinStore
::
ProteinStore
()
{
QSettings
settings
;
QSettings
settings
;
_regexp_contaminant
.
setPattern
(
settings
.
value
(
"automatic_filter/contaminant_regexp"
,
"^conta
\\
|"
).
toString
());
_regexp_decoy
.
setPattern
(
settings
.
value
(
"automatic_filter/decoy_regexp"
,
".*
\\
|reversed$"
).
toString
());
}
ProteinStore
::~
ProteinStore
()
...
...
@@ -51,7 +51,7 @@ QRegExp ProteinStore::getRegexpContaminant() const {
}
void
ProteinStore
::
setRegexpContaminantPattern
(
const
QString
&
pattern
)
{
_regexp_contaminant
.
setPattern
(
pattern
);
for
(
std
::
pair
<
const
QString
,
ProteinXtpSp
>
&
acc_protein
:
_map_accession_protein_list
)
{
setProteinInformations
(
acc_protein
.
second
);
}
...
...
@@ -63,11 +63,11 @@ QRegExp ProteinStore::getRegexpDecoy() const {
}
void
ProteinStore
::
setRegexpDecoyPattern
(
const
QString
&
pattern
)
{
_regexp_decoy
.
setPattern
(
pattern
);
for
(
std
::
pair
<
const
QString
,
ProteinXtpSp
>
&
acc_protein
:
_map_accession_protein_list
)
{
setProteinInformations
(
acc_protein
.
second
);
}
QSettings
settings
;
QSettings
settings
;
settings
.
setValue
(
"automatic_filter/decoy_regexp"
,
pattern
);
}
...
...
@@ -84,10 +84,16 @@ void ProteinStore::clearContaminants() {
}
void
ProteinStore
::
setDecoyAccession
(
QString
accession
)
{
_map_accession_protein_list
.
at
(
accession
).
get
()
->
setIsDecoy
(
true
);
std
::
map
<
QString
,
ProteinXtpSp
>::
iterator
it
=
_map_accession_protein_list
.
find
(
accession
);
if
(
it
!=
_map_accession_protein_list
.
end
())
{
it
->
second
.
get
()
->
setIsDecoy
(
true
);
}
}
void
ProteinStore
::
setContaminantAccession
(
QString
accession
)
{
_map_accession_protein_list
.
at
(
accession
).
get
()
->
setIsContaminant
(
true
);
std
::
map
<
QString
,
ProteinXtpSp
>::
iterator
it
=
_map_accession_protein_list
.
find
(
accession
);
if
(
it
!=
_map_accession_protein_list
.
end
())
{
it
->
second
.
get
()
->
setIsContaminant
(
true
);
}
}
ProteinXtpSp
&
ProteinStore
::
getInstance
(
ProteinXtpSp
&
peptide_in
)
{
...
...
@@ -106,7 +112,7 @@ void ProteinStore::setProteinInformations(ProteinXtpSp & peptide_in) {
peptide_in
.
get
()
->
setIsDecoy
(
false
);
QString
accession
=
peptide_in
.
get
()
->
getAccession
();
peptide_in
.
get
()
->
parseAccession2dbxref
();
if
((
!
_regexp_contaminant
.
isEmpty
())
&&
(
_regexp_contaminant
.
indexIn
(
accession
,
0
)
>-
1
))
{
//qDebug() << "ProteinStore::setProteinInformations is contaminant " << accession;
peptide_in
.
get
()
->
setIsContaminant
(
true
);
...
...
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