From 84e27d07a6c660bc68d4c21bceaaa66c3b370092 Mon Sep 17 00:00:00 2001
From: khalid <khalid.belkhir@umontpellier.fr>
Date: Wed, 8 Dec 2021 10:40:17 +0100
Subject: [PATCH] cases where SeorPe parameter is not set (minion)

---
 tools/mitoz_annotate/mitoz_annotate.prepare.report.R | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/mitoz_annotate/mitoz_annotate.prepare.report.R b/tools/mitoz_annotate/mitoz_annotate.prepare.report.R
index 6ee81bed..c5861969 100755
--- a/tools/mitoz_annotate/mitoz_annotate.prepare.report.R
+++ b/tools/mitoz_annotate/mitoz_annotate.prepare.report.R
@@ -2,10 +2,11 @@ library(yaml)
 
 args = commandArgs(trailingOnly=TRUE)
 parameters = read_yaml(args[1])$params
-
-if (parameters$SeOrPe == "PE") {
-   annotate_dir = parameters$<step_name>__mitoz_annotate_PE_output_dir
-   annotate_results_dir = "mitoz_annotate_PE.result"
+if (exists("parameters$SeOrPe")) {#in case of minion reads this will be absent
+     if (parameters$SeOrPe == "PE") {
+     annotate_dir = parameters$<step_name>__mitoz_annotate_PE_output_dir
+     annotate_results_dir = "mitoz_annotate_PE.result"
+     } 
 } else {
    annotate_dir = parameters$<step_name>__mitoz_annotate_SE_output_dir
    annotate_results_dir = "mitoz_annotate_SE.result"
-- 
GitLab