-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbioprocesswindow.cpp
More file actions
89 lines (65 loc) · 2.6 KB
/
bioprocesswindow.cpp
File metadata and controls
89 lines (65 loc) · 2.6 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
#include "bioprocesswindow.h"
#include "filedata.h"
#include "ui_bioprocesswindow.h"
#include <QMessageBox>
#include <QFileDialog>
#include "api_bio_pro_to_gene.h"
bioprocesswindow::bioprocesswindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::bioprocesswindow)
{
ui->setupUi(this);
uploadChecker=false;
}
bioprocesswindow::~bioprocesswindow()
{
delete ui;
}
void bioprocesswindow::on_MenuWindowButton_clicked()
{
this->close();
emit chooserWindow(); //returns to chooserWindow
}
void bioprocesswindow::on_UploadGenesButton_clicked(){
QString FileFilter = "Txt File (*.txt);;";
QString userText = QFileDialog::getOpenFileName(this, "Open a File", "C:\\Users\\", FileFilter);
FileData geneNames;
filename = userText.toStdString();
uploadChecker = geneNames.readGenes(filename); //checks for successful upload and reads the genes
if(uploadChecker){
QMessageBox::information(this, "Success", "File has been uploaded.", QMessageBox::Ok);
}
else{
QMessageBox::information(this, "Error", "Could not find file, please specify the entire file location.", QMessageBox::Ok);
}
};
void bioprocesswindow::openHeatMapWindow(){
heatmapWindow = new HeatMapWindow(this);
connect(heatmapWindow, &HeatMapWindow::PreviousWindow, this, &HeatMapWindow::show); //connects menuwindow and colocalizationwindow so that we can navigate between them
// perform biological process analysis
// crop data at 5000 columns due to computational constraints
biologicalprocess object = biologicalprocess(files,0,5000);
// retrieve genes that appear both in the list containing genes correlated to the
// biological process of interest provided by the researcher and genes that are supported by the
// data base
std::vector<std::string> geneSubsetBioPro;
int nb_study = 50;
geneSubsetBioPro = api_bio_pro_to_gene::api_bio_pro_to_gene_function(files.getGenePath(),filename,nb_study);
object.addGeneList(geneSubsetBioPro);
// compute expression ratio
object.compute_tot_expr();
// plot expression ratio
heatmapWindow->makeHeatMap(object.getPerc_expression());
this->hide(); //hides menuwindow
heatmapWindow->show(); //shows biowindow
//heatmapWindow->makeHeatMap(); //generates the heatmap
}
void bioprocesswindow::on_AnalyzeButton_clicked()
{
if(uploadChecker){
QMessageBox::information(this, "Success", "File has been uploaded correctly. \n" , QMessageBox::Ok);
openHeatMapWindow();
}else{
QMessageBox::information(this, "Error", "Please upload a file. \n" , QMessageBox::Ok);
}
}