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
Show more breadcrumbs
PAPPSO
xtpcpp
Commits
4b159d25
Commit
4b159d25
authored
7 years ago
by
Langella Olivier
Browse files
Options
Downloads
Patches
Plain Diff
pretty cool xic area intensity viewer
parent
70cc072e
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/CMakeLists.txt
+2
-2
2 additions, 2 deletions
src/CMakeLists.txt
src/gui/xic_view/xic_box/xicbox.cpp
+65
-4
65 additions, 4 deletions
src/gui/xic_view/xic_box/xicbox.cpp
src/gui/xic_view/xic_box/xicbox.h
+1
-1
1 addition, 1 deletion
src/gui/xic_view/xic_box/xicbox.h
with
68 additions
and
7 deletions
src/CMakeLists.txt
+
2
−
2
View file @
4b159d25
...
...
@@ -28,8 +28,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5
#sudo apt-get install libpappsomspp-dev
#FIND_PACKAGE( Pappsomspp REQUIRED )
SET
(
PAPPSOMSPP_DIR
"/home/olivier/eclipse/git/pappsomspp"
)
#
SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp")
#
SET (PAPPSOMSPP_DIR "/home/olivier/eclipse/git/pappsomspp")
SET
(
PAPPSOMSPP_DIR
"/home/langella/developpement/git/pappsomspp"
)
SET
(
PAPPSOMSPP_INCLUDE_DIR
"
${
PAPPSOMSPP_DIR
}
/src"
)
SET
(
PAPPSOMSPP_QT5_LIBRARY
"
${
PAPPSOMSPP_DIR
}
/cbuild/src/libpappsomspp-qt5.so"
)
SET
(
PAPPSOMSPP_WIDGET_QT5_LIBRARY
"
${
PAPPSOMSPP_DIR
}
/cbuild/src/pappsomspp/widget/libpappsomspp-widget-qt5.so"
)
...
...
This diff is collapsed.
Click to expand it.
src/gui/xic_view/xic_box/xicbox.cpp
+
65
−
4
View file @
4b159d25
...
...
@@ -40,18 +40,40 @@
class
XicDetectionList
:
public
pappso
::
XicDetectionSinkInterface
{
public:
XicDetectionList
()
{
_max_peak
.
setArea
(
0
);
}
void
setPeptideEvidenceList
(
const
std
::
vector
<
const
PeptideEvidence
*>
&
peptide_evidence_list
)
{
for
(
const
PeptideEvidence
*
p_evidence
:
peptide_evidence_list
)
{
_rt_list
.
push_back
(
p_evidence
->
getRetentionTime
());
}
}
void
setXicPeak
(
pappso
::
XicPeak
&
xic_peak
)
override
{
_peak_list
.
push_back
(
xic_peak
);
for
(
pappso
::
pappso_double
rt
:
_rt_list
)
{
if
(
xic_peak
.
containsRt
(
rt
))
{
if
(
xic_peak
.
getArea
()
>
_max_peak
.
getArea
())
{
_max_peak
=
xic_peak
;
}
}
}
};
const
pappso
::
XicPeak
&
getMatchedPeak
()
const
{
return
_max_peak
;
}
const
std
::
vector
<
pappso
::
XicPeak
>
&
getXicPeakList
()
const
{
return
_peak_list
;
};
void
clear
()
{
_peak_list
.
clear
();
_max_peak
.
setArea
(
0
);
};
private
:
unsigned
int
_count
=
0
;
std
::
vector
<
pappso
::
XicPeak
>
_peak_list
;
std
::
vector
<
pappso
::
pappso_double
>
_rt_list
;
pappso
::
XicPeak
_max_peak
;
};
...
...
@@ -67,7 +89,10 @@ XicBox::XicBox(XicWindow *parent):
p_worker
->
moveToThread
(
&
_xic_thread
);
_xic_thread
.
start
();
//ui->histo_widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom );
//ui->xic_list_widget->setLayout(new QVBoxLayout(ui->xic_list_widget));
ui
->
histo_widget
->
legend
->
setVisible
(
true
);
#if QT_VERSION >= 0x050000
// Qt5 code
...
...
@@ -156,8 +181,9 @@ void XicBox::setXic(std::vector< pappso::XicSp> xic_sp_list) {
emit loadXic(_p_peptide_evidence->getMsRunP(), _isotope_mass_list[_xic_widget_list.size()].get()->getMz(), _p_xic_window->getXicExtractPrecision(), XicExtractMethod::max);
}
*/
_xic_
detection
_list
.
clear
();
_xic_
peak_match
_list
.
clear
();
XicDetectionList
xic_list
;
xic_list
.
setPeptideEvidenceList
(
_peptide_evidence_list
);
pappso
::
XicDetectionZivy
zivy
;
zivy
.
setSmoothingHalfEdgeWindows
(
2
);
zivy
.
setDetectionThresholdOnMaxmin
(
3
);
...
...
@@ -169,7 +195,7 @@ void XicBox::setXic(std::vector< pappso::XicSp> xic_sp_list) {
try
{
xic_list
.
clear
();
zivy
.
detect
(
*
(
xic_sp_list
[
i
].
get
()),
&
xic_list
);
_xic_
detection
_list
.
push_back
(
xic_list
.
get
XicPeakList
());
_xic_
peak_match
_list
.
push_back
(
xic_list
.
get
MatchedPeak
());
ui
->
xic_widget
->
addXicPeakList
(
xic_sp_list
[
i
].
get
(),
xic_list
.
getXicPeakList
());
}
catch
(
const
pappso
::
ExceptionNotPossible
&
e
)
{
...
...
@@ -180,6 +206,39 @@ void XicBox::setXic(std::vector< pappso::XicSp> xic_sp_list) {
qDebug
()
<<
"XicBox::setXic plot"
;
ui
->
xic_widget
->
plot
();
QCPBars
*
observed_intensity
=
new
QCPBars
(
ui
->
histo_widget
->
xAxis
,
ui
->
histo_widget
->
yAxis2
);
observed_intensity
->
setName
(
"XIC area"
);
//ui->histo_widget->yAxis2->setLabel("intensity");
QVector
<
double
>
observed_intensity_data
;
QVector
<
QString
>
labels
;
QVector
<
double
>
ticks
;
double
sum
=
0
;
int
i
=
0
;
for
(
pappso
::
PeptideNaturalIsotopeAverageSp
&
natural_isotope_average
:
_isotope_mass_list
)
{
sum
+=
_xic_peak_match_list
[
i
].
getArea
();
observed_intensity_data
<<
_xic_peak_match_list
[
i
].
getArea
();
QString
isotope_name
=
QString
(
"+%1"
).
arg
(
_isotope_mass_list
[
i
].
get
()
->
getIsotopeNumber
());
if
(
_isotope_mass_list
[
i
].
get
()
->
getIsotopeRank
()
>
1
)
{
isotope_name
=
QString
(
"+%1 [%2]"
).
arg
(
_isotope_mass_list
[
i
].
get
()
->
getIsotopeNumber
()).
arg
(
_isotope_mass_list
[
i
].
get
()
->
getIsotopeRank
());
}
isotope_name
.
append
(
QString
(
" (%1%)"
).
arg
((
int
)
(
_isotope_mass_list
[
i
].
get
()
->
getIntensityRatio
()
*
100
)));
labels
<<
isotope_name
;
ticks
<<
i
;
i
++
;
}
observed_intensity
->
setPen
(
QPen
(
QColor
(
"red"
)));
//_graph_peak_surface_list.back()->setScatterStyle(QCPScatterStyle::ssDot);
// observed_intensity->setBrush(QBrush(QColor(170, 255, 0, 0)));
observed_intensity
->
setData
(
ticks
,
observed_intensity_data
);
ui
->
histo_widget
->
yAxis2
->
setVisible
(
true
);
ui
->
histo_widget
->
yAxis2
->
setRange
(
0
,
sum
);
ui
->
histo_widget
->
replot
();
qDebug
()
<<
"XicBox::setXic end"
;
}
...
...
@@ -198,14 +257,16 @@ void XicBox::setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverage
QCPBars
*
theoretical_ratio
=
new
QCPBars
(
ui
->
histo_widget
->
xAxis
,
ui
->
histo_widget
->
yAxis
);
theoretical_ratio
->
setName
(
"theoretical ratio"
);
ui
->
histo_widget
->
xAxis
->
setLabel
(
"isotopes"
);
ui
->
histo_widget
->
yAxis
->
setLabel
(
"
intensity
"
);
//
ui->histo_widget->yAxis->setLabel("
th. ratio
");
QVector
<
double
>
theoretical_ratio_data
;
QVector
<
double
>
ticks
;
QVector
<
QString
>
labels
;
int
i
=
0
;
double
sum
=
0
;
for
(
pappso
::
PeptideNaturalIsotopeAverageSp
&
natural_isotope_average
:
_isotope_mass_list
)
{
sum
+=
natural_isotope_average
.
get
()
->
getIntensityRatio
();
theoretical_ratio_data
<<
natural_isotope_average
.
get
()
->
getIntensityRatio
();
QString
isotope_name
=
QString
(
"+%1"
).
arg
(
_isotope_mass_list
[
i
].
get
()
->
getIsotopeNumber
());
if
(
_isotope_mass_list
[
i
].
get
()
->
getIsotopeRank
()
>
1
)
{
...
...
@@ -232,7 +293,7 @@ void XicBox::setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverage
theoretical_ratio
->
setData
(
ticks
,
theoretical_ratio_data
);
ui
->
histo_widget
->
yAxis
->
setRange
(
0
,
1
);
ui
->
histo_widget
->
yAxis
->
setRange
(
0
,
sum
);
ui
->
histo_widget
->
xAxis
->
setRange
(
-
0.8
,
_isotope_mass_list
.
size
());
ui
->
histo_widget
->
replot
();
}
...
...
This diff is collapsed.
Click to expand it.
src/gui/xic_view/xic_box/xicbox.h
+
1
−
1
View file @
4b159d25
...
...
@@ -69,7 +69,7 @@ private:
std
::
vector
<
pappso
::
PeptideNaturalIsotopeAverageSp
>
_isotope_mass_list
;
pappso
::
XicSp
_xic_sp
;
std
::
vector
<
pappso
::
XicWidget
*>
_xic_widget_list
;
std
::
vector
<
std
::
vector
<
pappso
::
XicPeak
>
>
_xic_
detection
_list
;
std
::
vector
<
pappso
::
XicPeak
>
_xic_
peak_match
_list
;
};
...
...
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