Commit e7b6a263 authored by 3Yan's avatar 3Yan
Browse files

Added Tree folder view to Prasopes

* New dock of treefolderview
* fixed bug in drltools window closing
parent 6bb3ce92
......@@ -37,7 +37,7 @@ def load_file(parent, chrom_plot, spc, d_set, ms_s, fn, chrom_s,
caption="Open spectrum",
directory=directory,
filter="Finnigan RAW files (*.raw, *.RAW)")[0]
if filename is not '':
if filename is not '' and os.path.isfile(filename):
try:
d_set['chrom_dat'], d_set['masses'], d_set['matrix'] \
= load_raw(filename, settings.value("tmp_location"))
......@@ -86,7 +86,7 @@ def about(parent):
QtWidgets.QMessageBox.information(
parent, "About Prasopes",
"Prasopes Finnigan raw file viewer\n\n"
"Version: 0.0.6 (alpha)")
"Version: 0.0.7 (alpha)")
def main():
......@@ -215,11 +215,29 @@ def main():
toolBar.addSeparator()
toolBar.addAction(autozoomy)
fileModel = QtWidgets.QFileSystemModel()
fileModel.setRootPath(QtCore.QDir.homePath())
fileModel.setRootPath(QtCore.QDir.currentPath())
treeview = QtWidgets.QTreeView()
treeview.setModel(fileModel)
activeDir = fileModel.index(config.value("open_folder"))
treeview.setCurrentIndex(activeDir)
treeview.expand(activeDir)
treedock = QtWidgets.QDockWidget()
treedock.setWidget(treeview)
update.signal.connect(
lambda: treeview.setCurrentIndex(fileModel.index(filename[0])))
treeview.doubleClicked.connect(lambda index: load_file(
main_window, chromatogram, spectrum, ds, ms, filename, chrom,
update, config, filename=fileModel.filePath(index)))
main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, treedock)
layout = QtWidgets.QVBoxLayout(main_widget)
layout.addWidget(toolBar)
layout.addWidget(mpl_canvas)
mpl_canvas.setFocus()
mpl_canvas.mpl_connect('key_press_event', lambda event:
update_spectrum(event, chromatogram, spectrum, ds, ms,
filename, chrom, config))
......
......@@ -626,9 +626,8 @@ def select_all_btn_up(ds, drls, drlspectrum, state=None):
drls['checkAll'].setCheckState(2)
else:
drls['checkAll'].blockSignals(True)
btns = []
for row in range(drls['dt'].rowCount()):
btns.append(drls['dt'].cellWidget(row, 0).checkState())
btns = [drls['dt'].cellWidget(row, 0).checkState()
for row in range(drls['dt'].rowCount())]
if all(btns):
drls['checkAll'].setCheckState(2)
elif any(btns):
......@@ -702,7 +701,7 @@ def main_window(parent, ds, filename, cache, update_signal):
window.setCentralWidget(main_widget)
window.closeEvent = lambda event: onclose(
window, event, cache, drls, graph_canvas, update_fnc)
window, event, cache, drls, graph_canvas, update_fnc, update_ptrows)
time_title = QtWidgets.QLabel("Time shift (min):")
cutoff_title = QtWidgets.QLabel("Cut off (min):")
......
......@@ -208,6 +208,8 @@ def ann_spec(ms_spec, msdata, ann_limit=0.01):
for i in s_peaks:
msdata['annotation'].append(ms_spec.annotate(
#annotation with peak-height
#'{0:.2f}\n{1: .2e}'.format(msdata['x'][i], msdata['y'][i]), xy=(msdata['x'][i], msdata['y'][i]),
'{0:.2f}'.format(msdata['x'][i]), xy=(msdata['x'][i], msdata['y'][i]),
textcoords='data'))
......
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setup(
name="prasopes",
version="0.0.6",
version="0.0.7",
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