Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PAPPSO
xtpcpp
Commits
c1cb2a22
Commit
c1cb2a22
authored
Nov 20, 2020
by
Renne Thomas
Browse files
Change histo plot in XicBox
parent
7e27b5b9
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/gui/xic_view/xic_box/xic_box.ui
View file @
c1cb2a22
...
...
@@ -88,7 +88,8 @@
<string>
new XIC
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"tab-new"
/>
<iconset
theme=
"tab-new"
>
<normaloff>
.
</normaloff>
.
</iconset>
</property>
</widget>
</item>
...
...
@@ -176,7 +177,8 @@
<string/>
</property>
<property
name=
"icon"
>
<iconset
theme=
"window-close"
/>
<iconset
theme=
"window-close"
>
<normaloff>
.
</normaloff>
.
</iconset>
</property>
<property
name=
"iconSize"
>
<size>
...
...
@@ -194,7 +196,7 @@
</item>
<item>
<widget
class=
"QWidget"
name=
"widget_2"
native=
"true"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"4,1"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
...
...
src/gui/xic_view/xic_box/xicbox.cpp
View file @
c1cb2a22
...
...
@@ -513,7 +513,8 @@ XicBox::drawObservedAreaBars(
}
// m_observedRatioBars->setPen(QPen(QColor("red")));
m_observedAreaBars
->
setPen
(
QPen
(
QColor
(
"yellow"
)));
m_observedAreaBars
->
setPen
(
QColor
(
180
,
15
,
32
,
200
));
m_observedAreaBars
->
setBrush
(
QColor
(
180
,
15
,
32
,
200
));
//_graph_peak_surface_list.back()->setScatterStyle(QCPScatterStyle::ssDot);
// observed_intensity->setBrush(QBrush(QColor(170, 255, 0, 0)));
...
...
@@ -536,11 +537,27 @@ XicBox::drawObservedAreaBars(
if
(
ticks
.
size
()
>
0
)
{
for
(
double
&
tick
:
ticks
)
{
tick
+=
0.1
;
}
m_observedAreaBars
->
setData
(
ticks
,
observed_intensity_data
);
m_observedAreaBars
->
setWidth
(
0.6
);
// QVector<QString> labels;
// for(double tick : ticks)
// {
// labels.push_back(QString::number(tick));
// }
// QSharedPointer<QCPAxisTickerText> textTicker(new
// QCPAxisTickerText); textTicker->addTicks(ticks, labels);
// ui->histo_widget->yAxis->setTicker(textTicker);
// m_observedRatioBars->setData(ticks, observed_ratio_data);
ui
->
histo_widget
->
yAxis2
->
setVisible
(
true
);
ui
->
histo_widget
->
yAxis2
->
setRange
(
0
,
sum
);
ui
->
histo_widget
->
yAxis2
->
setLabel
(
"observed intensity"
);
ui
->
histo_widget
->
yAxis2
->
setLabelPadding
(
0
);
ui
->
histo_widget
->
replot
();
}
qDebug
();
...
...
@@ -578,6 +595,8 @@ XicBox::setIsotopeMassList(
}
m_theoreticalRatioBars
->
setName
(
"th. ratio"
);
ui
->
histo_widget
->
xAxis
->
setLabel
(
"isotopes"
);
m_theoreticalRatioBars
->
setPen
(
QColor
(
59
,
154
,
178
));
m_theoreticalRatioBars
->
setBrush
(
QColor
(
59
,
154
,
178
));
// ui->histo_widget->yAxis->setLabel("th. ratio");
QVector
<
double
>
theoretical_ratio_data
;
...
...
@@ -605,14 +624,15 @@ XicBox::setIsotopeMassList(
isotope_name
.
append
(
QString
(
" (%1%)"
).
arg
((
int
)(
xic_isotope
.
peptide_natural_isotope_sp
.
get
()
->
getIntensityRatio
()
*
100
)));
labels
<<
isotope_name
;
labels
<<
QString
::
number
(
xic_isotope
.
peptide_natural_isotope_sp
.
get
()
->
getIsotopeNumber
());
ticks
<<
i
;
i
++
;
}
//
QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
//
textTicker->addTicks(ticks, labels);
//
ui->histo_widget->xAxis->setTicker(textTicker);
ui
->
histo_widget
->
xAxis
->
setTickLabelRotation
(
6
0
);
QSharedPointer
<
QCPAxisTickerText
>
textTicker
(
new
QCPAxisTickerText
);
textTicker
->
addTicks
(
ticks
,
labels
);
ui
->
histo_widget
->
xAxis
->
setTicker
(
textTicker
);
ui
->
histo_widget
->
xAxis
->
setTickLabelRotation
(
0
);
// ui->histo_widget->xAxis->setSubTicks(false);
// ui->histo_widget->xAxis->setTickLength(0, 4);
// ui->histo_widget->xAxis->setRange(0, 8);
...
...
@@ -622,12 +642,18 @@ XicBox::setIsotopeMassList(
ui->histo_widget->xAxis->setTickStep(1);
*/
for
(
double
&
tick
:
ticks
)
{
tick
-=
0.1
;
}
m_theoreticalRatioBars
->
setData
(
ticks
,
theoretical_ratio_data
);
m_theoreticalRatioBars
->
setWidth
(
0.6
);
ui
->
histo_widget
->
yAxis
->
setRange
(
0
,
sum
);
ui
->
histo_widget
->
xAxis
->
setRange
(
-
0.8
,
_natural_isotope_list
.
size
());
ui
->
histo_widget
->
yAxis
->
setLabel
(
"intensity ratio"
);
ui
->
histo_widget
->
yAxis
->
setLabelPadding
(
0
);
ui
->
histo_widget
->
xAxis
->
setRange
(
-
0.5
,
_natural_isotope_list
.
size
()
-
0.5
);
ui
->
histo_widget
->
replot
();
}
...
...
src/gui/xic_view/xic_window.ui
View file @
c1cb2a22
...
...
@@ -69,6 +69,39 @@
</attribute>
</widget>
</item>
<item>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
</widget>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton"
>
<property
name=
"toolTip"
>
<string>
Lock X axis through XICs
</string>
</property>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../xtpcpp.qrc"
>
<normaloff>
:/icons/resources/icons/apache/firefox/unlock_icon.svg
</normaloff>
:/icons/resources/icons/apache/firefox/unlock_icon.svg
</iconset>
</property>
<property
name=
"iconSize"
>
<size>
<width>
24
</width>
<height>
24
</height>
</size>
</property>
<property
name=
"shortcut"
>
<string/>
</property>
<property
name=
"autoRaise"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
...
...
@@ -88,7 +121,7 @@
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"spreadsheet"
>
<iconset
theme=
"
x-office-
spreadsheet"
>
<normaloff>
.
</normaloff>
.
</iconset>
</property>
<property
name=
"iconSize"
>
...
...
@@ -252,6 +285,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>
toolButton
</sender>
<signal>
clicked()
</signal>
<receiver>
XicWindow
</receiver>
<slot>
doChangeLockXaxisRule()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
358
</x>
<y>
45
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
407
</x>
<y>
660
</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>
xicPrecisionChanged(pappso::PrecisionPtr)
</slot>
...
...
@@ -259,6 +308,7 @@
<slot>
doEditZivyParams()
</slot>
<slot>
doXicExtractionMethodChanged(pappso::XicExtractMethod)
</slot>
<slot>
doExportXicToCsv()
</slot>
<slot>
doChangeLockXaxisRule()
</slot>
</slots>
<buttongroups>
<buttongroup
name=
"rt_unit_buttongroup"
/>
...
...
src/gui/xic_view/xicwindow.cpp
View file @
c1cb2a22
...
...
@@ -213,3 +213,18 @@ XicWindow::doExportXicToCsv()
}
emit
operateXicAreaToCsv
(
filename
,
xic_boxs
);
}
void
XicWindow
::
doChangeLockXaxisRule
()
{
if
(
m_lockXaxis
)
{
ui
->
toolButton
->
setIcon
(
QIcon
(
":/icons/resources/icons/apache/firefox/unlock_icon.svg"
));
m_lockXaxis
=
false
;
}
else
{
ui
->
toolButton
->
setIcon
(
QIcon
(
":/icons/resources/icons/apache/firefox/lock_icon.svg"
));
m_lockXaxis
=
true
;
}
}
src/gui/xic_view/xicwindow.h
View file @
c1cb2a22
...
...
@@ -75,7 +75,8 @@ class XicWindow : public QMainWindow
void
doAcceptedZivyDialog
();
void
doXicExtractionMethodChanged
(
pappso
::
XicExtractMethod
xic_method
);
void
doExportXicToCsv
();
void
doChangeLockXaxisRule
();
signals:
void
reExtractXicNeeded
();
void
rtUnitChangeNeeded
();
...
...
@@ -92,7 +93,7 @@ class XicWindow : public QMainWindow
private:
ProjectWindow
*
_project_window
;
Ui
::
XicWindow
*
ui
;
bool
m_lockXaxis
=
false
;
std
::
shared_ptr
<
pappso
::
TraceDetectionInterface
>
msp_detect_zivy
;
...
...
src/resources/icons/apache/firefox/lock_icon.svg
0 → 100644
View file @
c1cb2a22
<svg
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
aria-hidden=
"true"
focusable=
"false"
width=
"1em"
height=
"1em"
style=
"-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio=
"xMidYMid meet"
viewBox=
"0 0 512 512"
><path
fill=
"#B1B4B5"
d=
"M376.749 349.097c-13.531 0-24.5-10.969-24.5-24.5V181.932c0-48.083-39.119-87.203-87.203-87.203c-48.083 0-87.203 39.119-87.203 87.203v82.977c0 13.531-10.969 24.5-24.5 24.5s-24.5-10.969-24.5-24.5v-82.977c0-75.103 61.1-136.203 136.203-136.203s136.203 61.1 136.203 136.203v142.665c0 13.531-10.969 24.5-24.5 24.5z"
/><path
fill=
"#FFB636"
d=
"M414.115 497.459H115.977c-27.835 0-50.4-22.565-50.4-50.4V274.691c0-27.835 22.565-50.4 50.4-50.4h298.138c27.835 0 50.4 22.565 50.4 50.4v172.367c0 27.836-22.565 50.401-50.4 50.401z"
/><path
fill=
"#FFD469"
d=
"M109.311 456.841h-2.525c-7.953 0-14.4-6.447-14.4-14.4V279.309c0-7.953 6.447-14.4 14.4-14.4h2.525c7.953 0 14.4 6.447 14.4 14.4v163.132c0 7.953-6.447 14.4-14.4 14.4z"
/><rect
x=
"0"
y=
"0"
width=
"512"
height=
"512"
fill=
"rgba(0, 0, 0, 0)"
/></svg>
src/resources/icons/apache/firefox/unlock_icon.svg
0 → 100644
View file @
c1cb2a22
<svg
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
aria-hidden=
"true"
focusable=
"false"
width=
"1em"
height=
"1em"
style=
"-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio=
"xMidYMid meet"
viewBox=
"0 0 512 512"
><path
fill=
"#B1B4B5"
d=
"M376.749 304.47c-13.531 0-24.5-10.969-24.5-24.5V137.305c0-48.084-39.119-87.203-87.203-87.203c-48.083 0-87.203 39.119-87.203 87.203c0 13.531-10.969 24.5-24.5 24.5s-24.5-10.969-24.5-24.5c0-75.103 61.1-136.203 136.203-136.203s136.203 61.101 136.203 136.203V279.97c0 13.531-10.969 24.5-24.5 24.5z"
/><path
fill=
"#FFB636"
d=
"M414.115 507.459H115.977c-27.835 0-50.4-22.565-50.4-50.4V284.691c0-27.835 22.565-50.4 50.4-50.4h298.138c27.835 0 50.4 22.565 50.4 50.4v172.367c0 27.836-22.565 50.401-50.4 50.401z"
/><path
fill=
"#FFD469"
d=
"M109.311 466.841h-2.525c-7.953 0-14.4-6.447-14.4-14.4V289.309c0-7.953 6.447-14.4 14.4-14.4h2.525c7.953 0 14.4 6.447 14.4 14.4v163.132c0 7.953-6.447 14.4-14.4 14.4z"
/><rect
x=
"0"
y=
"0"
width=
"512"
height=
"512"
fill=
"rgba(0, 0, 0, 0)"
/></svg>
src/xtpcpp.qrc
View file @
c1cb2a22
...
...
@@ -109,6 +109,8 @@
<!-- following icons created by mozilla https://github.com/mozilla/fxemoji -->
<file>resources/icons/apache/firefox/folder_icon.svg</file>
<file>resources/icons/apache/firefox/check_icon.svg</file>
<file>resources/icons/apache/firefox/lock_icon.svg</file>
<file>resources/icons/apache/firefox/unlock_icon.svg</file>
</qresource>
<qresource prefix="/labeling">
<file>resources/catalog_label.xml</file>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment