Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xtpcpp
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
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
PAPPSO
xtpcpp
Commits
30cef4a7
Commit
30cef4a7
authored
8 years ago
by
Olivier Langella
Browse files
Options
Downloads
Patches
Plain Diff
load spectrum in a separate thread
parent
a5357f06
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/gui/peptide_detail_view/peptidewindow.cpp
+43
-10
43 additions, 10 deletions
src/gui/peptide_detail_view/peptidewindow.cpp
src/gui/peptide_detail_view/peptidewindow.h
+30
-0
30 additions, 0 deletions
src/gui/peptide_detail_view/peptidewindow.h
with
73 additions
and
10 deletions
src/gui/peptide_detail_view/peptidewindow.cpp
+
43
−
10
View file @
30cef4a7
...
...
@@ -28,15 +28,30 @@
#include
<pappsomspp/spectrum/qualifiedspectrum.h>
#include
<QMessageBox>
#include
<QSettings>
#include
<QDebug>
void
SpectrumSpLoaderThread
::
doLoadSpectrumSp
(
PeptideMatch
*
p_peptide_match
)
{
qDebug
()
<<
"SpectrumSpLoaderThread::doLoadSpectrumSp begin"
;
pappso
::
SpectrumSp
spectrum
=
p_peptide_match
->
getIdentificationDataSource
()
->
getSpectrumSp
(
p_peptide_match
->
getScan
());
emit
spectrumSpReady
(
spectrum
,
QString
(
""
));
qDebug
()
<<
"SpectrumSpLoaderThread::doLoadSpectrumSp end"
;
}
PeptideWindow
::
PeptideWindow
(
ProjectWindow
*
parent
)
:
QMainWindow
(
parent
),
ui
(
new
Ui
::
PeptideDetailView
)
{
qDebug
()
<<
"PeptideWindow::PeptideWindow begin"
;
_p_project_window
=
parent
;
ui
->
setupUi
(
this
);
/*
*/
SpectrumSpLoaderThread
*
worker
=
new
SpectrumSpLoaderThread
;
worker
->
moveToThread
(
&
_spectrum_loader_thread
);
_spectrum_loader_thread
.
start
();
QSettings
settings
;
QString
unit
=
settings
.
value
(
"peptideview/precision_unit"
,
"dalton"
).
toString
();
...
...
@@ -47,7 +62,8 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
}
else
{
_p_precision
=
Precision
::
getPpmInstance
(
precision
);
}
qRegisterMetaType
<
pappso
::
SpectrumSp
>
(
"pappso::SpectrumSp"
);
#if QT_VERSION >= 0x050000
// Qt5 code
/*
...
...
@@ -59,8 +75,13 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
// Qt4 code
connect
(
_p_project_window
,
SIGNAL
(
identificationGroupGrouped
(
IdentificationGroup
*
)),
this
,
SLOT
(
doIdentificationGroupGrouped
(
IdentificationGroup
*
)));
connect
(
this
,
SIGNAL
(
loadSpectrumSp
(
PeptideMatch
*
)),
worker
,
SLOT
(
doLoadSpectrumSp
(
PeptideMatch
*
)));
connect
(
worker
,
SIGNAL
(
spectrumSpReady
(
pappso
::
SpectrumSp
,
QString
)),
this
,
SLOT
(
doSpectrumSpReady
(
pappso
::
SpectrumSp
,
QString
)));
//connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
#endif
qDebug
()
<<
"PeptideWindow::PeptideWindow end"
;
}
PeptideWindow
::~
PeptideWindow
()
...
...
@@ -80,8 +101,8 @@ void PeptideWindow::updateDisplay() {
ui
->
z_label
->
setText
(
QString
(
"%1"
).
arg
(
_p_peptide_match
->
getCharge
()));
ui
->
scan_label
->
setText
(
QString
(
"%1"
).
arg
(
_p_peptide_match
->
getScan
()));
ui
->
modification_label
->
setText
(
_p_peptide_match
->
getPeptideXtpSp
().
get
()
->
getModifString
());
}
catch
(
pappso
::
PappsoException
exception_pappso
)
{
QMessageBox
::
warning
(
this
,
...
...
@@ -94,17 +115,29 @@ void PeptideWindow::updateDisplay() {
}
void
PeptideWindow
::
setPeptideMatch
(
PeptideMatch
*
p_peptide_match
)
{
_p_peptide_match
=
p_peptide_match
;
SpectrumSp
spectrum
=
_p_peptide_match
->
getIdentificationDataSource
()
->
getSpectrumSp
(
_p_peptide_match
->
getScan
());
void
PeptideWindow
::
doSpectrumSpReady
(
SpectrumSp
spectrum_sp
,
QString
error
)
{
qDebug
()
<<
"PeptideWindow::doSpectrumSpReady begin"
;
pappso
::
QualifiedSpectrum
spectrum_copy
;
spectrum_copy
.
setPrecursorCharge
(
_p_peptide_match
->
getCharge
());
spectrum_copy
.
setOriginalSpectrumSp
(
spectrum
);
spectrum_copy
.
setOriginalSpectrumSp
(
spectrum_sp
);
ui
->
spectrumWidget
->
setQualifiedSpectrum
(
spectrum_copy
);
qDebug
()
<<
"PeptideWindow::doSpectrumSpReady end"
;
}
pappso
::
PeptideSp
peptide
=
p_peptide_match
->
getPeptideXtpSp
();
void
PeptideWindow
::
setPeptideMatch
(
PeptideMatch
*
p_peptide_match
)
{
qDebug
()
<<
"PeptideWindow::setPeptideMatch begin"
;
_p_peptide_match
=
p_peptide_match
;
qDebug
()
<<
"PeptideWindow::setPeptideMatch emit loadSpectrumSp(_p_peptide_match)"
;
emit
loadSpectrumSp
(
_p_peptide_match
);
pappso
::
PeptideSp
peptide
=
_p_peptide_match
->
getPeptideXtpSp
();
ui
->
spectrumWidget
->
setPrecision
(
_p_precision
);
ui
->
spectrumWidget
->
setPeptideSp
(
peptide
);
ui
->
spectrumWidget
->
setQualifiedSpectrum
(
spectrum_copy
);
updateDisplay
();
qDebug
()
<<
"PeptideWindow::setPeptideMatch end"
;
}
This diff is collapsed.
Click to expand it.
src/gui/peptide_detail_view/peptidewindow.h
+
30
−
0
View file @
30cef4a7
...
...
@@ -25,7 +25,9 @@
#include
<QMainWindow>
#include
<QTextDocument>
#include
<QThread>
#include
<pappsomspp/mass_range.h>
#include
<pappsomspp/spectrum/spectrum.h>
#include
"../../core/peptidematch.h"
#include
"../../core/identificationgroup.h"
...
...
@@ -35,6 +37,26 @@ namespace Ui {
class
PeptideDetailView
;
}
class
SpectrumSpLoaderThread
:
public
QObject
{
Q_OBJECT
public:
public
slots
:
void
doLoadSpectrumSp
(
PeptideMatch
*
p_peptide_match
);
signals:
void
spectrumSpReady
(
pappso
::
SpectrumSp
spectrum_sp
,
QString
error
);
protected:
void
closeEvent
(
QCloseEvent
*
event
);
};
class
PeptideWindow
:
public
QMainWindow
{
Q_OBJECT
...
...
@@ -47,10 +69,18 @@ public:
public
slots
:
void
doIdentificationGroupGrouped
(
IdentificationGroup
*
p_identification_group
);
signals:
void
loadSpectrumSp
(
PeptideMatch
*
p_peptide_match
);
protected
slots
:
void
doSpectrumSpReady
(
pappso
::
SpectrumSp
spectrum_sp
,
QString
error
);
protected
:
void
updateDisplay
();
private:
QThread
_spectrum_loader_thread
;
Ui
::
PeptideDetailView
*
ui
;
ProjectWindow
*
_p_project_window
;
PeptideMatch
*
_p_peptide_match
=
nullptr
;
...
...
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