Skip to content

Commit

Permalink
[Fix] Set absolute slice bounds for manual integration
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-el committed Mar 3, 2021
1 parent 1c5cc0b commit e6df501
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/gui/mzroll/eicwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "boxplot.h"
#include "classifierNeuralNet.h"
#include "datastructures/adduct.h"
#include "datastructures/mzSlice.h"
#include "eiclogic.h"
#include "globals.h"
#include "isotopeswidget.h"
Expand Down Expand Up @@ -201,11 +200,15 @@ void EicWidget::mouseDoubleClickEvent(QMouseEvent* event) {
void EicWidget::integrateRegion(float rtMin, float rtMax)
{
const auto& visibleSamples = getMainWindow()->getVisibleSamples();
auto slice = eicParameters->_slice;
auto bounds = visibleSamplesBounds();
slice.rtmin = bounds.rtmin;
slice.rtmax = bounds.rtmax;
auto integratedGroup = PeakDetector::integrateEicRegion(
eicParameters->eics,
rtMin,
rtMax,
eicParameters->_slice,
slice,
visibleSamples,
getMainWindow()->mavenParameters,
getMainWindow()->getClassifier(),
Expand Down
3 changes: 2 additions & 1 deletion src/gui/mzroll/eicwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "stable.h"

#include "datastructures/isotope.h"
#include "datastructures/mzSlice.h"

class EIC;
class EICLogic;
Expand Down Expand Up @@ -37,6 +38,7 @@ Q_OBJECT
void addPeakPositions();
void setBarplotPosition(PeakGroup* group);
void renderPdf(shared_ptr<PeakGroup> group, QPainter* painter);
mzSlice visibleSamplesBounds();

public Q_SLOTS:
void setMzSlice(float mz1, float mz2 = 0.0);
Expand Down Expand Up @@ -255,7 +257,6 @@ public Q_SLOTS:
void cleanup(); //deallocate eics, fragments, peaks, peakgroups
void clearPlot(); //removes non permenent graphics objects
void findPlotBounds(); //find _minX, _maxX...etc
mzSlice visibleSamplesBounds();

float toX(float x);
float toY(float y);
Expand Down
5 changes: 5 additions & 0 deletions src/gui/mzroll/point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ void EicPoint::mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) {
if (_group != nullptr) {
_group = make_shared<PeakGroup>(*_group,
PeakGroup::IntegrationType::Manual);
auto slice = _group->getSlice();
auto bounds = _mw->getEicWidget()->visibleSamplesBounds();
slice.rtmin = bounds.rtmin;
slice.rtmax = bounds.rtmax;
_group->setSlice(slice);
_mw->isotopeWidget->setPeakGroupAndMore(_group, true);
}

Expand Down

0 comments on commit e6df501

Please sign in to comment.