-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplis.h
171 lines (118 loc) · 5.1 KB
/
plis.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#ifndef PLIS_H
#define PLIS_H
#include <QMainWindow>
#include <QFileDialog>
#include "qcustomplot.h"
#include "data.h"
#include "fitmrq.h"
#include "simulatedialog.h"
#include "jackknife.h"
#include "modify_data.h"
#include "modify_text.h"
#include "show_result.h"
#include "guess_parameters.h"
#include "help.h"
#include "optimize.h"
#include <iostream>
#include <QFile>
#include <QTextStream>
#include <QKeyEvent>
#include <string>
#include <fstream>
#include <iomanip>
#include <sstream>
namespace Ui {
class Plis;
}
class Plis : public QMainWindow
{
Q_OBJECT
public:
explicit Plis(QWidget *parent = nullptr);
~Plis();
void keyReleaseEvent(QKeyEvent *event);
private slots:
void on_actionImport_data_triggered();
void on_actionExit_triggered();
void closeEvent(QCloseEvent *event);
void on_actionAdd_dataset_triggered();
void on_actionSimulate_data_triggered();
void on_actionRemove_dataset_triggered();
void on_add_row_button_clicked();
void on_remove_row_button_clicked();
void on_actionOpen_project_triggered();
void on_actionSave_image_triggered();
void on_actionSave_project_triggered();
void on_actionRemove_all_datasets_triggered();
void on_actionPaste_data_to_table_triggered();
void on_table_cellChanged(int row, int column);
void on_selected_dataSet_currentIndexChanged(int index);
void on_protein_conc_square_editingFinished();
void on_unit_currentIndexChanged(const QString &arg1);
void on_update_graph_button_clicked();
void selection_changed(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*);
void legend_dubbel_clicked(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*);
void on_ligan_conc_unit_currentIndexChanged(const QString &arg1);
void contextMenuRequest(QPoint pos);
void moveLegend();
void change_title(QMouseEvent *event);
void on_actionOne_bindning_site_triggered();
void on_actionTwo_binding_sites_triggered();
void on_actionFour_binding_sites_triggered();
void on_actionCompetitive_binding_triggered();
void on_actionRemove_a_fitted_curve_triggered();
void on_actionRemove_all_fitted_curves_triggered();
void graph_double_clicked(QCPAbstractPlottable*, int);
void graph_clicked(QCPAbstractPlottable*, int);
void axis_double_clicked(QCPAxis *, QCPAxis::SelectablePart, QMouseEvent*);
void on_pop_result_button_clicked();
void on_actionOptimize_fit_triggered();
void on_actionStandard_triggered();
void on_actionTitration_NMR_triggered();
void on_switch_to_CPGM_triggered();
void CPMG();
void on_actionCopy_data_from_table_triggered();
void on_actionHelp_triggered();
void on_actionInformation_about_PLIS_triggered();
private:
Ui::Plis *ui;
QDoubleValidator *v=new QDoubleValidator(0.1,99999,2,this);
SimulateDialog* sim=new SimulateDialog{};
SimulateDialog* sim_cpmg=new SimulateDialog{this,"cpmg"};
QList<QAction*> s_action;
Help *help=new Help{};
QVector<Data*> dataSets{}; //Data-pointer to the different dataSets
QVector<QCPGraph*> graphSets{};
int current_dataSet{};
QVector<QCPScatterStyle::ScatterShape> shapes{QCPScatterStyle::ssDisc,QCPScatterStyle::ssSquare, QCPScatterStyle::ssDiamond, QCPScatterStyle::ssStar,
QCPScatterStyle::ssCross, QCPScatterStyle::ssPlus, QCPScatterStyle::ssCircle, QCPScatterStyle::ssTriangle, QCPScatterStyle::ssTriangleInverted,
QCPScatterStyle::ssCrossSquare, QCPScatterStyle::ssPlusSquare, QCPScatterStyle::ssCrossCircle, QCPScatterStyle::ssPlusCircle, QCPScatterStyle::ssPeace,
QCPScatterStyle::ssCustom};
int shape{};
bool is_disconnected{false};
void change_penColor(int);
QVector<double> kd_testVector{0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000, 100000, 1000000};
//nM uM mM M
QString xlabel{};
QString ylabel{};
QCPTextElement *title{};
QFont xaxis_font{QFont("Helvetica",9)}, yaxis_font{QFont("Helvetica",9)}, title_font{QFont("Helvetica",9)}, legend_font{QFont("Helvetica",9)};
QString mode{"standard"}; //"standard": normal titration, "chemshift": tiitration where concentration does not affect relevant signal, "CPMG": relaxation dispersion
//private funtions
void render_graphs();
void disconnect_when_no_dataset(bool);
void write_In_Table();
void draw_curve();
void write_In_Result();
void delete_dataSets(int i=(-1));
void check_guess(double &y_calc, double &chi2, double &chi2_temp, int &best_index_kd1, int &best_index_kd2);
QString get_name(QString);
int make_fitmrq(Fitmrq &curve_fit);
int make_fitmrq2(Fitmrq2 &curve_fit);
void set_scatterstyle();
void change_mode(QString new_mode);
void setAxisLabels(QString xlab, QString ylab);
void handleFitDidNotWork(int did_fit_work, Data *dataSet);
void checkMode(bool standard, bool chemshift, bool cpmg);
};
#endif // PLIS_H