Skip to content
Snippets Groups Projects
Commit 05c876e5 authored by Langella Olivier's avatar Langella Olivier
Browse files

try catch around mcqr step code

parent 0c2976c7
No related branches found
No related tags found
No related merge requests found
......@@ -371,8 +371,9 @@ McqrSdsXicWidget::runQualityCheckingXic()
grantlee_context.insert("sds_page",
ui->sds_page_switch->getSwitchValue());
getMcqrRunParentView()->getRProcessRunning()->write(
msp_rscriptTemplate->render(&grantlee_context).toUtf8());
getMcqrRunParentView()->getRProcessRunning()->executeMcqrStep(
"quality_xic", msp_rscriptTemplate->render(&grantlee_context));
}
qDebug();
}
......@@ -700,8 +701,8 @@ McqrSdsXicWidget::runProteinClustering()
transformQStringListInRListFormat(factors_list));
grantlee_context.insert("nb_cluster", ui->cluster_spin->value());
getMcqrRunParentView()->getRProcessRunning()->write(
msp_rscriptTemplate->render(&grantlee_context).toUtf8());
getMcqrRunParentView()->getRProcessRunning()->executeMcqrStep(
"protein_clustering", msp_rscriptTemplate->render(&grantlee_context));
qDebug();
}
......
......@@ -52,3 +52,32 @@ McqrQProcess::getRScriptRun()
{
return m_RscriptRun;
}
qint64
McqrQProcess::executeOffTheRecord(const QString &mcqr_otr)
{
QProcess::write(mcqr_otr.toUtf8());
return 0;
}
qint64
McqrQProcess::executeMcqrStep(const QString &mcqr_step_name,
const QString &mcqr_step)
{
write(QString("message(\"MCQRBegin: %1\")\n").arg(mcqr_step_name).toUtf8());
executeOffTheRecord("vl <- tryCatch({\n");
write(mcqr_step.toUtf8());
// write(mcqr_step.toUtf8());
executeOffTheRecord(
"\n},warning = function(warn) {\n print(paste(\"MY "
"WARNING: "
"\", warn))\n},error "
"= function(err) {\n print(paste(\"MY ERROR: \",err))\n},finally = "
"function(f) "
"{\n print(paste(\"e: \", e))\n})\n print(paste(\"Output: \", vl))\n");
write(QString("message(\"MCQREnd: %1\")\n").arg(mcqr_step_name).toUtf8());
}
......@@ -40,6 +40,9 @@ class McqrQProcess : public QProcess
qint64 write(const QByteArray &byte_array);
qint64 executeOffTheRecord(const QString &mcqr_otr);
qint64 executeMcqrStep(const QString &mcqr_step_name,
const QString &mcqr_step);
QString getRScriptRun();
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment