Skip to content

Commit 848b36c

Browse files
committed
adjust ui
1 parent 96d183d commit 848b36c

File tree

6 files changed

+821
-0
lines changed

6 files changed

+821
-0
lines changed

AnalDist.py

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Form implementation generated from reading ui file 'AnalDist.ui'
4+
#
5+
# Created by: PyQt5 UI code generator 5.9.2
6+
#
7+
# WARNING! All changes made in this file will be lost!
8+
9+
from PyQt5 import QtCore, QtGui, QtWidgets
10+
11+
class Ui_Form(object):
12+
def setupUi(self, Form):
13+
Form.setObjectName("Form")
14+
Form.resize(1082, 784)
15+
Form.setMinimumSize(QtCore.QSize(1082, 784))
16+
Form.setMaximumSize(QtCore.QSize(1082, 784))
17+
self.gridLayout = QtWidgets.QGridLayout(Form)
18+
self.gridLayout.setObjectName("gridLayout")
19+
self.tableWidgetProteinList = QtWidgets.QTableWidget(Form)
20+
self.tableWidgetProteinList.setObjectName("tableWidgetProteinList")
21+
self.tableWidgetProteinList.setColumnCount(0)
22+
self.tableWidgetProteinList.setRowCount(0)
23+
self.gridLayout.addWidget(self.tableWidgetProteinList, 7, 0, 1, 5)
24+
self.label_7 = QtWidgets.QLabel(Form)
25+
font = QtGui.QFont()
26+
font.setPointSize(11)
27+
self.label_7.setFont(font)
28+
self.label_7.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
29+
self.label_7.setObjectName("label_7")
30+
self.gridLayout.addWidget(self.label_7, 1, 0, 1, 1)
31+
self.progressBar = QtWidgets.QProgressBar(Form)
32+
self.progressBar.setProperty("value", 0)
33+
self.progressBar.setObjectName("progressBar")
34+
self.gridLayout.addWidget(self.progressBar, 8, 11, 1, 1)
35+
self.ButtonShow = QtWidgets.QPushButton(Form)
36+
self.ButtonShow.setObjectName("ButtonShow")
37+
self.gridLayout.addWidget(self.ButtonShow, 8, 1, 1, 1)
38+
self.label = QtWidgets.QLabel(Form)
39+
font = QtGui.QFont()
40+
font.setFamily("Arial")
41+
font.setPointSize(11)
42+
self.label.setFont(font)
43+
self.label.setObjectName("label")
44+
self.gridLayout.addWidget(self.label, 6, 0, 1, 1)
45+
self.label_4 = QtWidgets.QLabel(Form)
46+
font = QtGui.QFont()
47+
font.setFamily("Arial")
48+
font.setPointSize(13)
49+
self.label_4.setFont(font)
50+
self.label_4.setObjectName("label_4")
51+
self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1)
52+
self.label_5 = QtWidgets.QLabel(Form)
53+
self.label_5.setText("")
54+
self.label_5.setObjectName("label_5")
55+
self.gridLayout.addWidget(self.label_5, 8, 0, 1, 1)
56+
self.pushButtonSave = QtWidgets.QPushButton(Form)
57+
self.pushButtonSave.setObjectName("pushButtonSave")
58+
self.gridLayout.addWidget(self.pushButtonSave, 8, 2, 1, 1)
59+
self.ButtonCancel = QtWidgets.QPushButton(Form)
60+
self.ButtonCancel.setObjectName("ButtonCancel")
61+
self.gridLayout.addWidget(self.ButtonCancel, 4, 2, 1, 1)
62+
self.groupBoxAvg = QtWidgets.QGroupBox(Form)
63+
self.groupBoxAvg.setMinimumSize(QtCore.QSize(0, 200))
64+
font = QtGui.QFont()
65+
font.setFamily("Arial")
66+
font.setPointSize(11)
67+
self.groupBoxAvg.setFont(font)
68+
self.groupBoxAvg.setObjectName("groupBoxAvg")
69+
self.gridLayout.addWidget(self.groupBoxAvg, 0, 11, 6, 1)
70+
self.comboBox = QtWidgets.QComboBox(Form)
71+
self.comboBox.setObjectName("comboBox")
72+
self.gridLayout.addWidget(self.comboBox, 2, 0, 1, 1)
73+
self.ButtonConfirm = QtWidgets.QPushButton(Form)
74+
self.ButtonConfirm.setObjectName("ButtonConfirm")
75+
self.gridLayout.addWidget(self.ButtonConfirm, 3, 2, 1, 1)
76+
self.groupBox = QtWidgets.QGroupBox(Form)
77+
font = QtGui.QFont()
78+
font.setFamily("Arial")
79+
font.setPointSize(11)
80+
self.groupBox.setFont(font)
81+
self.groupBox.setObjectName("groupBox")
82+
self.gridLayout.addWidget(self.groupBox, 6, 11, 2, 1)
83+
self.label_6 = QtWidgets.QLabel(Form)
84+
font = QtGui.QFont()
85+
font.setPointSize(11)
86+
self.label_6.setFont(font)
87+
self.label_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
88+
self.label_6.setObjectName("label_6")
89+
self.gridLayout.addWidget(self.label_6, 3, 0, 1, 1)
90+
self.BoxR2 = QtWidgets.QDoubleSpinBox(Form)
91+
self.BoxR2.setSingleStep(0.01)
92+
self.BoxR2.setProperty("value", 0.8)
93+
self.BoxR2.setObjectName("BoxR2")
94+
self.gridLayout.addWidget(self.BoxR2, 4, 0, 1, 1)
95+
96+
self.retranslateUi(Form)
97+
QtCore.QMetaObject.connectSlotsByName(Form)
98+
99+
def retranslateUi(self, Form):
100+
_translate = QtCore.QCoreApplication.translate
101+
Form.setWindowTitle(_translate("Form", "Form"))
102+
self.label_7.setText(_translate("Form", "Method Selection"))
103+
self.ButtonShow.setText(_translate("Form", "Show Curve"))
104+
self.label.setText(_translate("Form", "Protein list sorted by scores:"))
105+
self.label_4.setText(_translate("Form", "Distance-based TPP analysis:"))
106+
self.pushButtonSave.setText(_translate("Form", "Save Result"))
107+
self.ButtonCancel.setText(_translate("Form", "Cancel"))
108+
self.groupBoxAvg.setTitle(_translate("Form", "Average thermal shift curves:"))
109+
self.ButtonConfirm.setText(_translate("Form", "Confirm"))
110+
self.groupBox.setTitle(_translate("Form", "Thermal shift curves comparison:"))
111+
self.label_6.setText(_translate("Form", "minR2"))
112+
113+
114+
if __name__ == "__main__":
115+
import sys
116+
app = QtWidgets.QApplication(sys.argv)
117+
Form = QtWidgets.QWidget()
118+
ui = Ui_Form()
119+
ui.setupUi(Form)
120+
Form.show()
121+
sys.exit(app.exec_())
122+

AnalDist.ui

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Form</class>
4+
<widget class="QWidget" name="Form">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>1082</width>
10+
<height>784</height>
11+
</rect>
12+
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>1082</width>
16+
<height>784</height>
17+
</size>
18+
</property>
19+
<property name="maximumSize">
20+
<size>
21+
<width>1082</width>
22+
<height>784</height>
23+
</size>
24+
</property>
25+
<property name="windowTitle">
26+
<string>Form</string>
27+
</property>
28+
<layout class="QGridLayout" name="gridLayout">
29+
<item row="7" column="0" colspan="5">
30+
<widget class="QTableWidget" name="tableWidgetProteinList"/>
31+
</item>
32+
<item row="1" column="0">
33+
<widget class="QLabel" name="label_7">
34+
<property name="font">
35+
<font>
36+
<pointsize>11</pointsize>
37+
</font>
38+
</property>
39+
<property name="text">
40+
<string>Method Selection</string>
41+
</property>
42+
<property name="alignment">
43+
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
44+
</property>
45+
</widget>
46+
</item>
47+
<item row="8" column="11">
48+
<widget class="QProgressBar" name="progressBar">
49+
<property name="value">
50+
<number>0</number>
51+
</property>
52+
</widget>
53+
</item>
54+
<item row="8" column="1">
55+
<widget class="QPushButton" name="ButtonShow">
56+
<property name="text">
57+
<string>Show Curve</string>
58+
</property>
59+
</widget>
60+
</item>
61+
<item row="6" column="0">
62+
<widget class="QLabel" name="label">
63+
<property name="font">
64+
<font>
65+
<family>Arial</family>
66+
<pointsize>11</pointsize>
67+
</font>
68+
</property>
69+
<property name="text">
70+
<string>Protein list sorted by scores:</string>
71+
</property>
72+
</widget>
73+
</item>
74+
<item row="0" column="0">
75+
<widget class="QLabel" name="label_4">
76+
<property name="font">
77+
<font>
78+
<family>Arial</family>
79+
<pointsize>13</pointsize>
80+
</font>
81+
</property>
82+
<property name="text">
83+
<string>Distance-based TPP analysis:</string>
84+
</property>
85+
</widget>
86+
</item>
87+
<item row="8" column="0">
88+
<widget class="QLabel" name="label_5">
89+
<property name="text">
90+
<string/>
91+
</property>
92+
</widget>
93+
</item>
94+
<item row="8" column="2">
95+
<widget class="QPushButton" name="pushButtonSave">
96+
<property name="text">
97+
<string>Save Result</string>
98+
</property>
99+
</widget>
100+
</item>
101+
<item row="4" column="2">
102+
<widget class="QPushButton" name="ButtonCancel">
103+
<property name="text">
104+
<string>Cancel</string>
105+
</property>
106+
</widget>
107+
</item>
108+
<item row="0" column="11" rowspan="6">
109+
<widget class="QGroupBox" name="groupBoxAvg">
110+
<property name="minimumSize">
111+
<size>
112+
<width>0</width>
113+
<height>200</height>
114+
</size>
115+
</property>
116+
<property name="font">
117+
<font>
118+
<family>Arial</family>
119+
<pointsize>11</pointsize>
120+
</font>
121+
</property>
122+
<property name="title">
123+
<string>Average thermal shift curves:</string>
124+
</property>
125+
</widget>
126+
</item>
127+
<item row="2" column="0">
128+
<widget class="QComboBox" name="comboBox"/>
129+
</item>
130+
<item row="3" column="2">
131+
<widget class="QPushButton" name="ButtonConfirm">
132+
<property name="text">
133+
<string>Confirm</string>
134+
</property>
135+
</widget>
136+
</item>
137+
<item row="6" column="11" rowspan="2">
138+
<widget class="QGroupBox" name="groupBox">
139+
<property name="font">
140+
<font>
141+
<family>Arial</family>
142+
<pointsize>11</pointsize>
143+
</font>
144+
</property>
145+
<property name="title">
146+
<string>Thermal shift curves comparison:</string>
147+
</property>
148+
</widget>
149+
</item>
150+
<item row="3" column="0">
151+
<widget class="QLabel" name="label_6">
152+
<property name="font">
153+
<font>
154+
<pointsize>11</pointsize>
155+
</font>
156+
</property>
157+
<property name="text">
158+
<string>minR2</string>
159+
</property>
160+
<property name="alignment">
161+
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
162+
</property>
163+
</widget>
164+
</item>
165+
<item row="4" column="0">
166+
<widget class="QDoubleSpinBox" name="BoxR2">
167+
<property name="singleStep">
168+
<double>0.010000000000000</double>
169+
</property>
170+
<property name="value">
171+
<double>0.800000000000000</double>
172+
</property>
173+
</widget>
174+
</item>
175+
</layout>
176+
</widget>
177+
<resources/>
178+
<connections/>
179+
</ui>

AnalDistUI.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Tue May 11 10:00:45 2021
4+
5+
@author: hcji
6+
"""
7+
8+
import numpy as np
9+
10+
from PyQt5 import QtCore, QtGui, QtWidgets
11+
from PyQt5.QtCore import Qt, QVariant
12+
from PyQt5.QtWidgets import QApplication, QMainWindow, QGridLayout, QHBoxLayout
13+
14+
from AnalDist import Ui_Form
15+
from MakeFigure import MakeFigure
16+
from matplotlib.backends.backend_qt5 import NavigationToolbar2QT as NavigationToolbar
17+
18+
class AnalDistUI(QtWidgets.QWidget, Ui_Form):
19+
20+
def __init__(self, parent=None):
21+
super(AnalDistUI, self).__init__(parent)
22+
self.setupUi(self)
23+
self.setWindowTitle("NPTSA Analysis")
24+
self.setWindowIcon(QtGui.QIcon("img/TPCA.ico"))
25+
26+
self.figureTSA = MakeFigure(10, 10, dpi=250)
27+
self.figureTSA_ntb = NavigationToolbar(self.figureTSA, self)
28+
self.gridlayoutTSA = QGridLayout(self.groupBox)
29+
self.gridlayoutTSA.addWidget(self.figureTSA)
30+
self.gridlayoutTSA.addWidget(self.figureTSA_ntb)
31+
32+
self.figureAvg = MakeFigure(10, 10, dpi=150)
33+
self.gridlayoutAvg = QGridLayout(self.groupBoxAvg)
34+
self.gridlayoutAvg.addWidget(self.figureAvg)
35+
36+
self.tableWidgetProteinList.setSortingEnabled(True)
37+
self.comboBox.addItems(['euclidean', 'cityblock', 'chebychev', 'cosine'])
38+
39+
40+
def FillTable(self, TSA_table):
41+
self.tableWidgetProteinList.setRowCount(TSA_table.shape[0])
42+
self.tableWidgetProteinList.setColumnCount(TSA_table.shape[1])
43+
self.tableWidgetProteinList.setHorizontalHeaderLabels(TSA_table.columns)
44+
self.tableWidgetProteinList.setVerticalHeaderLabels(TSA_table.index.astype(str))
45+
for i in range(TSA_table.shape[0]):
46+
for j in range(TSA_table.shape[1]):
47+
if type(TSA_table.iloc[i,j]) == np.float64:
48+
item = QtWidgets.QTableWidgetItem()
49+
item.setData(Qt.EditRole, QVariant(float(TSA_table.iloc[i,j])))
50+
# item = QtWidgets.QTableWidgetItem(str(TSA_table.iloc[i,j]))
51+
else:
52+
item = QtWidgets.QTableWidgetItem(str(TSA_table.iloc[i,j]))
53+
self.tableWidgetProteinList.setItem(i, j, item)
54+
55+
56+
57+
if __name__ == '__main__':
58+
import sys
59+
60+
app = QApplication(sys.argv)
61+
ui = AnalDistUI()
62+
ui.show()
63+
sys.exit(app.exec_())

0 commit comments

Comments
 (0)