Commit 5ba79b8f authored by 3Yan's avatar 3Yan
Browse files

DRL signals bugfixing, loading fix

* fixed signal issues when loading DRL from cache (long-time bug)
* reformatting (less-sphagetti in DRL)
* loading of files by dropping and cli fixed (broken in v0.0.3)
parent 672c94f9
......@@ -69,10 +69,10 @@ def update_spectrum(event, chromatogram, spect, ds,
def dropped(event, parent, chromatogram, spectrum, ds, ms, filename,
chrom, config):
chrom, update, config):
dropurl = event.mimeData().urls()[0].toLocalFile()
load_file(parent, chromatogram, spectrum, ds, ms, filename,
chrom, config, filename=dropurl)
chrom, update, config, filename=dropurl)
def drag_entered(event):
......@@ -86,7 +86,7 @@ def about(parent):
QtWidgets.QMessageBox.information(
parent, "About Prasopes",
"Prasopes Finnigan raw file viewer\n\n"
"Version: 0.0.3 (alpha)")
"Version: 0.0.4 (alpha)")
def main():
......@@ -226,12 +226,12 @@ def main():
main_window.dragEnterEvent = lambda event: drag_entered(event)
main_window.dropEvent = lambda event: dropped(
event, main_window, chromatogram, spectrum, ds, ms, filename,
chrom, config)
chrom, update, config)
main_window.setAcceptDrops(True)
if len(sys.argv) == 2:
load_file(main_window, chromatogram, spectrum, ds, ms,
filename, chrom, config, filename=sys.argv[1])
filename, chrom, update, config, filename=sys.argv[1])
else:
gt.pop_plot(spectrum, ms)
gt.pop_plot(chromatogram, chrom)
......
......@@ -648,11 +648,6 @@ def main_window(parent, ds, filename, cache, update_signal):
def update_fnc():
update_drlspectrum(ds, drls, chromplot)
# pt = parenttable
# dt = daughtertable
drls = dict(pt=None, dt=None, tshift=None, cutoff=None, cors=None,
rel=None, checkAll=None)
window = QtWidgets.QMainWindow(
parent, windowTitle='Delayed reactant labeling')
main_widget = QtWidgets.QWidget(window)
......@@ -661,18 +656,6 @@ def main_window(parent, ds, filename, cache, update_signal):
window.closeEvent = lambda event: onclose(
window, event, cache, drls, graph_canvas, update_fnc)
dial_graph = Figure(figsize=(5, 2), dpi=100, facecolor="None")
chromplot = dial_graph.add_subplot(111, facecolor=(1, 1, 1, 0.8))
graph_canvas = FigureCanvas(dial_graph)
graph_canvas.setStyleSheet("background-color:transparent;")
graph_canvas.setAutoFillBackground(False)
drls['graphlabels'] = dict(x=[0], y=[0], line=None, name="",
xlabel="time(min)",
ylabel="relative intensity")
gt.pan_factory(chromplot)
gt.zoom_factory(chromplot, 1.15)
gt.pop_plot(chromplot, drls['graphlabels'])
time_title = QtWidgets.QLabel("Time shift (min):")
drls['tshift'] = QtWidgets.QDoubleSpinBox(
minimum=-100, maximum=1440, decimals=3)
......@@ -694,6 +677,24 @@ def main_window(parent, ds, filename, cache, update_signal):
btn_rem = QtWidgets.QPushButton("Remove")
if cache == [None, None]:
dial_graph = Figure(figsize=(5, 2), dpi=100, facecolor="None")
chromplot = dial_graph.add_subplot(111, facecolor=(1, 1, 1, 0.8))
graph_canvas = FigureCanvas(dial_graph)
graph_canvas.setStyleSheet("background-color:transparent;")
graph_canvas.setAutoFillBackground(False)
drls['graphlabels'] = dict(x=[0], y=[0], line=None, name="",
xlabel="time(min)",
ylabel="relative intensity")
gt.pan_factory(chromplot)
gt.zoom_factory(chromplot, 1.15)
gt.pop_plot(chromplot, drls['graphlabels'])
# pt = parenttable
# dt = daughtertable
drls = dict(pt=None, dt=None, tshift=None, cutoff=None, cors=None,
rel=None, checkAll=None)
dcolums = ["Name"]
drls['cors'].setValue(3)
for i in range(drls['cors'].value()):
......@@ -710,6 +711,7 @@ def main_window(parent, ds, filename, cache, update_signal):
else:
drls = cache[0]
graph_canvas = cache[1]
chromplot = graph_canvas.figure.axes[0]
window.keyPressEvent = lambda event: key_pressed(
event, ds, drls, chromplot)
......
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setup(
name="prasopes",
version="0.0.3",
version="0.0.4",
author="Jan Zelenka",
author_email="3yanyanyan@gmail.com",
description="Thermo/Finnigan .raw file viewer based on rawprasslib",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment