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

theoretical ratio histogram added

parent 8242c7ea
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,12 @@
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
......@@ -93,7 +99,51 @@
</widget>
</item>
<item>
<widget class="pappso::XicWidget" name="xic_widget" native="true"/>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="pappso::XicWidget" name="xic_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QCustomPlot" name="histo_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
......@@ -104,6 +154,12 @@
<header>pappsomspp/widget/xicwidget/xicwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QCustomPlot</class>
<extends>QWidget</extends>
<header>qcustomplot.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
......
......@@ -34,6 +34,7 @@
#include "../../project_view/projectwindow.h"
#include <pappsomspp/xic/detection/xicdetectionzivy.h>
#include <pappsomspp/exception/exceptionnotpossible.h>
#include <qcustomplot.h>
......@@ -193,7 +194,47 @@ void XicBox::setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverage
}
emit loadXic(_p_peptide_evidence->getMsRunP(), mass_list, _p_xic_window->getXicExtractPrecision(), XicExtractMethod::max);
//histogram
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");
QVector<double> theoretical_ratio_data;
QVector<double> ticks;
QVector<QString> labels;
int i = 0;
for (pappso::PeptideNaturalIsotopeAverageSp & natural_isotope_average: _isotope_mass_list) {
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) {
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++;
}
//QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
//textTicker->addTicks(ticks, labels);
//ui->histo_widget->xAxis->setTicker(textTicker);
ui->histo_widget->xAxis->setTickLabelRotation(60);
//ui->histo_widget->xAxis->setSubTicks(false);
//ui->histo_widget->xAxis->setTickLength(0, 4);
//ui->histo_widget->xAxis->setRange(0, 8);
ui->histo_widget->xAxis->setAutoTickStep(false); // <-- disable to use your own value
ui->histo_widget->xAxis->setTickStep(1);
theoretical_ratio->setData(ticks, theoretical_ratio_data);
ui->histo_widget->yAxis->setRange(0, 1);
ui->histo_widget->xAxis->setRange(-0.8, _isotope_mass_list.size());
ui->histo_widget->replot();
}
......
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