Skip to content

Commit

Permalink
GSvar: improved logging to find out why IGV is sometimes cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-sturm committed Dec 11, 2023
1 parent e56c776 commit 46a9e14
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 12 deletions.
27 changes: 17 additions & 10 deletions src/GSvar/IGVSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,24 @@ bool IGVSession::isIgvRunning()
QList<IgvWorkerCommand> commands;
commands << IgvWorkerCommand{-1, "echo running"};

//start command
IGVCommandWorker* command_worker = new IGVCommandWorker(igv_data_, commands, 2000);
command_worker->setAutoDelete(false);
execution_pool_.start(command_worker);

//get answer
execution_pool_.waitForDone();
QString answer = command_worker->answer();
command_worker->deleteLater();
//try up to four times
for (int i=0; i<4; ++i)
{
//start command
IGVCommandWorker* command_worker = new IGVCommandWorker(igv_data_, commands, 500);
command_worker->setAutoDelete(false);
execution_pool_.start(command_worker);

//get answer
execution_pool_.waitForDone();
QString answer = command_worker->answer();
command_worker->deleteLater();

if (answer=="running") return true;
else Log::info("No answer for 'echo running' from IGV (try " + QString::number(i+1) + " of 4)");
}

return answer=="running";
return false;
}

bool IGVSession::hasRunningCommands()
Expand Down
19 changes: 18 additions & 1 deletion src/GSvar/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ void MainWindow::on_actionDeleteIgvFolder_triggered()
return;
}

int res = QMessageBox::question(this, "Delete IGV folder", "Do you want to delete the IGV folder?\nLocation: "+path_canonical+"\n\nYou will use all settings (proxy, alignment options, ...)!");
int res = QMessageBox::question(this, title, "Do you want to delete the IGV folder?\nLocation: "+path_canonical+"\n\nYou will use all settings (proxy, alignment options, ...)!");
if (res==QMessageBox::Yes)
{
QDir(path_canonical).removeRecursively();
Expand Down Expand Up @@ -7046,6 +7046,23 @@ void MainWindow::on_actionBurdenTest_triggered()
addModelessDialog(dlg);
}

void MainWindow::on_actionOpenLogFile_triggered()
{
QDesktopServices::openUrl("file:///"+ Log::fileName());
}

void MainWindow::on_actionClearLogFile_triggered()
{
QString title = "Delete GSvar log file";
QString filename = Log::fileName();

int res = QMessageBox::question(this, title, "Do you want to delete the GSvar log file?\nLocation: "+filename);
if (res==QMessageBox::Yes)
{
QFile::remove(filename);
}
}


void MainWindow::editVariantClassification(VariantList& variants, int index, bool is_somatic)
{
Expand Down
5 changes: 5 additions & 0 deletions src/GSvar/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ public slots:
void on_actionVirusDetection_triggered();
///Perform Burden test
void on_actionBurdenTest_triggered();
///Shows the GSvar log file
void on_actionOpenLogFile_triggered();
///Clears the log file
void on_actionClearLogFile_triggered();

///Load report configuration
void loadReportConfig();
///Store report configuration
Expand Down
13 changes: 13 additions & 0 deletions src/GSvar/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@
<addaction name="actionSettings"/>
<addaction name="actionEncrypt"/>
<addaction name="separator"/>
<addaction name="actionOpenLogFile"/>
<addaction name="actionClearLogFile"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuTools">
Expand Down Expand Up @@ -1454,6 +1457,16 @@
<string>Delete IGV folder</string>
</property>
</action>
<action name="actionOpenLogFile">
<property name="text">
<string>Open log file</string>
</property>
</action>
<action name="actionClearLogFile">
<property name="text">
<string>Clear log file</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down
2 changes: 1 addition & 1 deletion src/cppCORE
Submodule cppCORE updated 1 files
+1 −1 Log.cpp

0 comments on commit 46a9e14

Please sign in to comment.