Skip to content
Snippets Groups Projects
Commit c30ec13e authored by Langella Olivier's avatar Langella Olivier
Browse files

display xic retention time in minutes or seconds

parent 6dc70d43
No related branches found
No related tags found
No related merge requests found
......@@ -245,4 +245,6 @@ void PeptideTableProxyModel::setPeptideListColumnDisplay(PeptideListColumn colum
settings.setValue(QString("peptide_list_columns/%1").arg(_peptide_table_model_p->getTitle(column)),toggled);
_column_display[(std::int8_t) column] = toggled;
endResetModel();
//emit columnsRemoved(createIndex(1, 2), (int) column, (int) column)
}
......@@ -191,7 +191,7 @@
<item>
<widget class="QLabel" name="rt_label">
<property name="text">
<string>TextLabel</string>
<string/>
</property>
</widget>
</item>
......
......@@ -94,6 +94,13 @@ XicBox::XicBox(XicWindow *parent):
//ui->xic_list_widget->setLayout(new QVBoxLayout(ui->xic_list_widget));
ui->histo_widget->legend->setVisible(true);
if (_p_xic_window->isRetentionTimeSeconds()) {
ui->xic_widget->setRetentionTimeInSeconds();
}
else {
ui->xic_widget->setRetentionTimeInMinutes();
}
#if QT_VERSION >= 0x050000
// Qt5 code
connect(this, &XicBox::loadXic, p_worker, &XicWorkerThread::doXicLoad);
......@@ -106,6 +113,8 @@ XicBox::XicBox(XicWindow *parent):
connect(_p_xic_window, &XicWindow::reExtractXicNeeded,this, &XicBox::reExtractXic);
connect(ui->xic_widget, &pappso::XicWidget::xicPeakListChanged,this, &XicBox::setXicPeakList);
connect(_p_xic_window, &XicWindow::rtUnitChangeNeeded,this, &XicBox::onRtUnitChanged);
#else
// Qt4 code
#endif
......@@ -231,7 +240,7 @@ void XicBox::setXic(std::vector< pappso::XicSp> xic_sp_list) {
_xic_peak_match_list.clear();
XicDetectionList xic_list;
xic_list.setPeptideEvidenceList(_peptide_evidence_list);
for (int i=0; i < xic_sp_list.size(); i++) {
try {
......@@ -359,7 +368,7 @@ void XicBox::reExtractXic() {
void XicBox::setRetentionTime(double rt) {
qDebug() << "XicBox::setRetentionTime begin";
ui->rt_label->setText(tr("rt=%1").arg(rt));
ui->rt_label->setText(tr("rt=%1 (sec) rt=%2 (min)").arg(rt).arg(rt/60));
}
void XicBox::setXicPeakList(std::vector<std::pair<pappso::XicSp, pappso::XicPeakSp>> xic_peak_list) {
qDebug() << "XicBox::setXicPeakList begin";
......@@ -368,9 +377,9 @@ void XicBox::setXicPeakList(std::vector<std::pair<pappso::XicSp, pappso::XicPeak
for (std::pair<pappso::XicSp, pappso::XicPeakSp> & pair_xic_peak: xic_peak_list) {
html.append(tr("<p>%1<br/>area: %2<br/>rt begin: %3<br/>rt max: %4<br/>rt end: %5<br/></p>").arg(ui->xic_widget->getName(pair_xic_peak.first.get())).arg(pair_xic_peak.second.get()->getArea()).arg(pair_xic_peak.second.get()->getLeftBoundary().rt)
.arg(pair_xic_peak.second.get()->getMaxXicElement().rt)
.arg(pair_xic_peak.second.get()->getRightBoundary().rt)
);
.arg(pair_xic_peak.second.get()->getMaxXicElement().rt)
.arg(pair_xic_peak.second.get()->getRightBoundary().rt)
);
}
ui->xic_widget->setToolTip(html);
......@@ -384,3 +393,13 @@ void XicBox::setXicPeakList(std::vector<std::pair<pappso::XicSp, pappso::XicPeak
}
void XicBox::onRtUnitChanged() {
if (_p_xic_window->isRetentionTimeSeconds()) {
ui->xic_widget->setRetentionTimeInSeconds();
}
else {
ui->xic_widget->setRetentionTimeInMinutes();
}
}
......@@ -65,6 +65,7 @@ private slots:
void extractXicInOtherMsRun();
void setRetentionTime(double rt);
void setXicPeakList(std::vector<std::pair<pappso::XicSp, pappso::XicPeakSp>> xic_peak_list);
void onRtUnitChanged();
private:
Ui::XicBox *ui;
......
......@@ -19,7 +19,7 @@
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
<number>5</number>
</property>
<property name="leftMargin">
<number>0</number>
......@@ -43,6 +43,29 @@
<item>
<widget class="pappso::PrecisionWidget" name="xic_precision" native="true"/>
</item>
<item>
<widget class="QRadioButton" name="rt_sec_radiobutton">
<property name="text">
<string>&amp;rt in seconds</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">rt_unit_buttongroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rt_min_radiobutton">
<property name="text">
<string>rt in &amp;minutes</string>
</property>
<attribute name="buttonGroup">
<string notr="true">rt_unit_buttongroup</string>
</attribute>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
......@@ -70,7 +93,7 @@
<x>0</x>
<y>0</y>
<width>780</width>
<height>504</height>
<height>498</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"/>
......@@ -120,8 +143,28 @@
</hint>
</hints>
</connection>
<connection>
<sender>rt_unit_buttongroup</sender>
<signal>buttonClicked(QAbstractButton*)</signal>
<receiver>XicWindow</receiver>
<slot>rtUnitChanged(QAbstractButton*)</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>xicPrecisionChanged(pappso::PrecisionP)</slot>
<slot>rtUnitChanged(QAbstractButton*)</slot>
</slots>
<buttongroups>
<buttongroup name="rt_unit_buttongroup"/>
</buttongroups>
</ui>
......@@ -111,3 +111,16 @@ void XicWindow::xicPrecisionChanged(pappso::PrecisionP precision) {
void XicWindow::xicDetect(const pappso::Xic & xic,pappso::XicDetectionSinkInterface * sink) const {
_detect_zivy.detect(xic, sink);
}
void XicWindow::rtUnitChanged(QAbstractButton* button) {
qDebug() << "XicWindow::rtUnitChanged begin";
emit rtUnitChangeNeeded();
qDebug() << "XicWindow::rtUnitChanged end";
}
bool XicWindow::isRetentionTimeSeconds() const {
if (ui->rt_sec_radiobutton->isChecked()) {
return true;
}
return false;
}
......@@ -30,6 +30,7 @@
#define XICWINDOW_H
#include <QMainWindow>
#include <QAbstractButton>
#include <pappsomspp/xic/xic.h>
#include <pappsomspp/xic/detection/xicdetectionzivy.h>
......@@ -57,13 +58,17 @@ public:
void addXicInMsRun(const PeptideEvidence * p_peptide_evidence, MsRunSp msrun_sp);
pappso::PrecisionP getXicExtractPrecision() const;
bool isRetentionTimeSeconds() const;
void clear();
public slots:
void xicPrecisionChanged(pappso::PrecisionP precision);
void rtUnitChanged(QAbstractButton* button);
signals :
void reExtractXicNeeded();
void rtUnitChangeNeeded();
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment