-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbiochooser.cpp
More file actions
128 lines (90 loc) · 3.83 KB
/
biochooser.cpp
File metadata and controls
128 lines (90 loc) · 3.83 KB
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
#include "biochooser.h"
#include "api.h"
#include "ui_biochooser.h"
#include "ui_bioprocesswindow.h"
#include "bioprocesswindow.h"
BioChooser::BioChooser(QWidget *parent) :
QDialog(parent),
ui(new Ui::BioChooser)
{
ui->setupUi(this);
}
BioChooser::~BioChooser()
{
delete ui;
}
void BioChooser::on_MenuButton_clicked()
{
this->close();
emit MenuWindow(); //returns to menuWindow
}
void BioChooser::on_ProcessButton_clicked()
{
biowindow = new bioprocesswindow;
biowindow->setFileObject(files);
connect(biowindow, &bioprocesswindow::chooserWindow, this, &BioChooser::show); //connects menuwindow and colocalizationwindow so that we can navigate between them
this->hide();
biowindow->show();
}
void BioChooser::on_ClusterButton_clicked()
{
cluster1 = new HeatMapWindow(this);
connect(cluster1, &HeatMapWindow::PreviousWindow, this, &HeatMapWindow::show); //connects menuwindow and colocalizationwindow so that we can navigate between them
cluster2 = new HeatMapWindow(this);
connect(cluster2, &HeatMapWindow::PreviousWindow, this, &HeatMapWindow::show); //connects menuwindow and colocalizationwindow so that we can navigate between them
cluster3 = new HeatMapWindow(this);
connect(cluster3, &HeatMapWindow::PreviousWindow, this, &HeatMapWindow::show); //connects menuwindow and colocalizationwindow so that we can navigate between them
cluster4 = new HeatMapWindow(this);
connect(cluster4, &HeatMapWindow::PreviousWindow, this, &HeatMapWindow::show); //connects menuwindow and colocalizationwindow so that we can navigate between them
// perform cluster analysis
qDebug() << "Initialize BiologicalProcess object";
int rows = 0;
int cols = 700;
biologicalprocess object = biologicalprocess(files,rows,cols);
std::string path = "/Users/ninapeuker/Desktop/General_Engineering/5th_semester_2022:23_Ecole/CSE201_Object_Oriented_Programming_in_C++/Transcriptomic++/transcriptomics_development/InputData/test_data_single_cell/MBASS_dd99_genes_subset_4.tsv";
object.addGeneList(path);
qDebug() << "Filter data";
object.filter_simple(true,0.001);
object.filter_genes();
qDebug() << "Normalise data";
object.normalisation();
qDebug() << "Start clustering";
std::vector<std::string> clusters_dict=object.bioprocess_2(4,3);
qDebug() << "Referencing clusters";
std::vector<std::string> bio_process = getOverrep(clusters_dict);
std::vector<std::vector<std::string>> clusters = object.plottable(clusters_dict);
std::vector<HeatMapWindow*> heatmaps;
heatmaps.push_back(cluster1);
heatmaps.push_back(cluster2);
heatmaps.push_back(cluster3);
heatmaps.push_back(cluster4);
HeatMapWindow* tmp;
biologicalprocess clusterObject;
for(int i = 0; i < 4; i++){
if(clusters_dict[i] != "empty"){
qDebug() << "Cluster : " << i ;
tmp = heatmaps[i];
clusterObject = biologicalprocess(files,rows,cols);
clusterObject.addGeneList(clusters[i]);
clusterObject.compute_tot_expr();
tmp->setLabel(bio_process[i]);
tmp->makeHeatMap(clusterObject.getPerc_expression());
tmp->show(); //shows biowindow
}
}
this->hide(); //hides menuwindow
std::cout << "Biological processes: \n";
for (std::string i : bio_process){
std::cout << i << ",";
}
std::cout << std::endl;
// cluster1->makeHeatMap(object.getPerc_expression());
// cluster1->show(); //shows biowindow
// cluster2->makeHeatMap(object.getPerc_expression());
// cluster2->show(); //shows biowindow
// cluster3->makeHeatMap(object.getPerc_expression());
// cluster3->show(); //shows biowindow
// cluster4->makeHeatMap(object.getPerc_expression());
// cluster4->show(); //shows biowindow
// this->hide(); //hides menuwindow
}