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

WIP: on xic widget

parent 1b4de182
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,10 @@ PeptideEvidence::PeptideEvidence(const PeptideEvidence & other): PeptideEvidence
}
pappso::mz PeptideEvidence::getTheoreticalMz() const {
return (getPeptideXtpSp().get()->getMz(getCharge()));
}
PeptideEvidenceSp PeptideEvidence::makePeptideEvidenceSp() const {
return std::make_shared<PeptideEvidence>(*this);
}
......
......@@ -115,9 +115,14 @@ public :
pappso::mz getDeltaMass() const;
/** @brief get delta in ppm between theoretical mhplus mass and mhplus experimental mass
* theoretical mhplus mass - mhplus experimental mass
* @return theoretical mhplus mass - mhplus experimental mass
*/
pappso::mz getPpmDeltaMass() const;
/** @brief get theoretical (not observed) m/z based on peptide composition and charge
* @return theoretical mz mass
*/
pappso::mz getTheoreticalMz() const;
ValidationState getValidationState() const;
......
......@@ -15,21 +15,82 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="peptide_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="peptide_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>peptide label</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="msrun_label">
<property name="text">
<string>msrun file</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mz_label">
<property name="text">
<string>mz</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="charge_label">
<property name="text">
<string>charge</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>X</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -56,5 +117,25 @@
</customwidget>
</customwidgets>
<resources/>
<connections/>
<connections>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>XicBox</receiver>
<slot>remove()</slot>
<hints>
<hint type="sourcelabel">
<x>378</x>
<y>25</y>
</hint>
<hint type="destinationlabel">
<x>585</x>
<y>98</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>remove()</slot>
</slots>
</ui>
......@@ -64,6 +64,10 @@ XicBox::~XicBox()
_xic_thread.wait();
}
void XicBox::remove() {
_p_xic_window->removeXicBox(this);
}
void XicBox::error(QString error_message) {
QMessageBox::warning(this,
tr("Error trying to save spectrum to SVG file :"), error_message);
......@@ -73,13 +77,16 @@ void XicBox::setPeptideEvidence(const PeptideEvidence * p_peptide_evidence) {
_p_peptide_evidence = p_peptide_evidence;
ui->peptide_label->setText(_p_peptide_evidence->getPeptideXtpSp().get()->toString());
ui->msrun_label->setText(_p_peptide_evidence->getMsRunP()->getFilename());
ui->charge_label->setText(QString("%1").arg(_p_peptide_evidence->getCharge()));
ui->mz_label->setText(QString::number(_p_peptide_evidence->getTheoreticalMz(), 'f', 4));
//get same xic peptide evidence (msrun, peptide, charge)
//p_projet
_peptide_evidence_list.clear();
_p_xic_window->getProjectWindow()->getProjectP()->getSameXicPeptideEvidenceList(p_peptide_evidence, _peptide_evidence_list);
emit loadXic(_p_peptide_evidence->getMsRunP(), _p_peptide_evidence->getPeptideXtpSp().get()->getMz(_p_peptide_evidence->getCharge()), _p_xic_window->getXicExtractPrecision(), XicExtractMethod::max);
emit loadXic(_p_peptide_evidence->getMsRunP(), _p_peptide_evidence->getTheoreticalMz(), _p_xic_window->getXicExtractPrecision(), XicExtractMethod::max);
}
......
......@@ -52,6 +52,7 @@ public:
signals :
void loadXic(const MsRun * p_msrun, pappso::mz mz, pappso::PrecisionP precision, XicExtractMethod method);
private slots:
void remove();
void setXic(pappso::XicSp xic_sp);
void error(QString error_message);
private:
......
......@@ -64,6 +64,13 @@ void XicWindow::addXic(const PeptideEvidence * p_peptide_evidence) {
ui->xic_vertical_layout->layout()->addWidget(p_box);
}
void XicWindow::removeXicBox(XicBox * xic_box) {
xic_box->setVisible(false);
ui->xic_vertical_layout->layout()->removeWidget(xic_box);
delete xic_box;
}
pappso::PrecisionP XicWindow::getXicExtractPrecision() const {
return (pappso::Precision::getPpmInstance(10));
}
......@@ -57,6 +57,7 @@ public:
protected:
ProjectWindow * getProjectWindow();
void removeXicBox(XicBox * xic_box);
private:
ProjectWindow * _project_window;
Ui::XicWindow *ui;
......
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