Skip to content

Commit

Permalink
src/GSvar/MethylationWidget.cpp: Bugfix: fixed methylation image for …
Browse files Browse the repository at this point in the history
…server-client version
  • Loading branch information
leonschuetz committed Jan 14, 2025
1 parent 6197585 commit d38c438
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/GSvar/MethylationWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <FileLocation.h>
#include <GUIHelper.h>
#include <Helper.h>
#include <QMessageBox>
#include "GlobalServiceProvider.h"

MethylationWidget::MethylationWidget(QString filename, QWidget *parent) :
Expand Down Expand Up @@ -82,15 +83,14 @@ void MethylationWidget::openMethylationPlot(int row_idx, int col_idx)

FileLocation methylation_plot = GlobalServiceProvider::fileLocationProvider().getMethylationImage(locus);

qDebug() << methylation_plot.filename;

if (!methylation_plot.exists)
VersatileFile file(methylation_plot.filename);
if (!file.open(QIODevice::ReadOnly))
{
GUIHelper::showMessage("File not found!", "Methylation plot for '" + locus + "' not found!");
QMessageBox::warning(this, "Read error", "Could not open a methylation plot image file: '" + methylation_plot.filename);
return;
}

QPixmap plot_data(methylation_plot.filename);
QPixmap plot_data;
plot_data.loadFromData(file.readAll());

QLabel* image_label = new QLabel();
image_label->setPixmap(plot_data);
Expand Down
1 change: 1 addition & 0 deletions src/GSvarServer/ServerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ HttpResponse ServerController::locateFileByType(const HttpRequest& request)

for (int i = 0; i < file_list.count(); ++i)
{
Log::info("file path: " + file_list.at(i).filename);
QJsonObject cur_json_item;
QJsonObject cur_json_item_without_token;
cur_json_item.insert("id", file_list[i].id);
Expand Down
1 change: 1 addition & 0 deletions src/cppNGSD/FileLocationProviderLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ FileLocation FileLocationProviderLocal::getMethylationImage(QString locus) const
{
QString name = QFileInfo(gsvar_file_).baseName();
QString file = getAnalysisPath() + QDir::separator() + "methylartist" + QDir::separator() + name + "_" + locus + ".png";

return FileLocation(name, PathType::METHYLATION_IMAGE, file, QFile::exists(file));
}

Expand Down

0 comments on commit d38c438

Please sign in to comment.