Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FRET (smFRET) fast and efficiently. The key feature is reverse-loading of ASCII
- Memory-free movie batch loading
- Distribution plotting and fitting
- Backwards-compatibility with iSMS-exported data
- Manual blinking interval selection and export
- Manual blinking interval selection, clearing and export

If you'd like to play around with just the Keras/TensorFlow model, please go to https://github.com/komodovaran/DeepFRET-Model

Expand Down
9 changes: 9 additions & 0 deletions src/main/python/ui/MenuBar.ui
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<string>Manually Select Blinking</string>
</property>
<addaction name="actionSelect_Blink_Interval"/>
<addaction name="actionClear_Blink_Intervals"/>
</widget>
<widget class="QMenu" name="menuPredict_Trace_Type">
<property name="title">
Expand Down Expand Up @@ -598,6 +599,14 @@
<string>Blink Interval</string>
</property>
</action>
<action name="actionClear_Blink_Intervals">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Clear Blink Intervals</string>
</property>
</action>
<action name="actionAdvanced_Sort">
<property name="enabled">
<bool>false</bool>
Expand Down
11 changes: 11 additions & 0 deletions src/main/python/ui/_MenuBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ def setupUi(self, MenuBar):
self.actionSelect_Blink_Interval.setObjectName(
"actionSelect_Blink_Interval"
)
self.actionClear_Blink_Intervals = QtWidgets.QAction(MenuBar)
self.actionClear_Blink_Intervals.setEnabled(False)
self.actionClear_Blink_Intervals.setObjectName(
"actionClear_Blink_Intervals"
)
self.actionAdvanced_Sort = QtWidgets.QAction(MenuBar)
self.actionAdvanced_Sort.setEnabled(False)
self.actionAdvanced_Sort.setObjectName("actionAdvanced_Sort")
Expand Down Expand Up @@ -285,6 +290,9 @@ def setupUi(self, MenuBar):
self.menuManually_Select_Blinking.addAction(
self.actionSelect_Blink_Interval
)
self.menuManually_Select_Blinking.addAction(
self.actionClear_Blink_Intervals
)
self.menuPredict_Trace_Type.addAction(
self.actionPredict_Selected_Traces
)
Expand Down Expand Up @@ -518,6 +526,9 @@ def retranslateUi(self, MenuBar):
self.actionSelect_Blink_Interval.setText(
_translate("MenuBar", "Blink Interval")
)
self.actionClear_Blink_Intervals.setText(
_translate("MenuBar", "Clear Blink Intervals")
)
self.actionAdvanced_Sort.setText(_translate("MenuBar", "Advanced Sort"))
self.actionCheck_All.setText(_translate("MenuBar", "Check All"))
self.actionCheck_All.setShortcut(
Expand Down
8 changes: 8 additions & 0 deletions src/main/python/widgets/base_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def setupMenuBarActions(self):
for f in (self.triggerBlink, self.refreshPlot):
self.ui.actionSelect_Blink_Interval.triggered.connect(f)

self.ui.actionClear_Blink_Intervals.triggered.connect(
self.clearBlinkIntervals
)

# self.ui.actionFit_Hmm_Current.triggered.connect(
# partial(self.fitSingleTraceHiddenMarkovModel, True)
# )
Expand Down Expand Up @@ -922,6 +926,10 @@ def triggerBlink(self):
"""Override in subclass."""
pass

def clearBlinkIntervals(self):
"""Override in subclass."""
pass

def triggerBleach(self, color):
"""Override in subclass."""
pass
Expand Down
24 changes: 24 additions & 0 deletions src/main/python/widgets/trace_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def enablePerWindow(self):
self.ui.actionSelect_Bleach_Red_Channel,
self.ui.actionSelect_Bleach_Green_Channel,
self.ui.actionSelect_Blink_Interval,
self.ui.actionClear_Blink_Intervals,
self.ui.actionFit_Hmm_Selected,
self.ui.actionPredict_Selected_Traces,
self.ui.actionPredict_All_traces,
Expand Down Expand Up @@ -767,6 +768,29 @@ def clearCorrectionFactors(self):
self.clearMarkerLines()
self.refreshPlot()

def clearBlinkIntervals(self):
"""Clear manually selected blink intervals for the current trace."""
if self.currName is not None:
trace = self.currentTrace()
trace.blink_intervals = []
trace.hmm = None

self.refreshPlot()

histogram_window = self.windows[gvars.HistogramWindow]
transition_density_window = self.windows[gvars.TransitionDensityWindow]

histogram_window.getHistogramData()
histogram_window.gauss_params = None
if histogram_window.isVisible():
histogram_window.refreshPlot()

histogram_window.setPooledLifetimes()
transition_density_window.setClusteredTransitions()

if transition_density_window.isVisible():
transition_density_window.refreshPlot()

def getCurrentLines(self, ax):
"""Get labels of currently plotted lines"""
if self.currName is not None:
Expand Down