From c7a39253554f05fe4566901a46f33bfcdf8115e8 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 16 Aug 2021 15:53:43 +0200 Subject: [PATCH] NXF: Automatically flatten single-file outputs --- .../dataintuitive/viash/platforms/NextFlowPlatform.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/dataintuitive/viash/platforms/NextFlowPlatform.scala b/src/main/scala/com/dataintuitive/viash/platforms/NextFlowPlatform.scala index 4431ba2e6..9b5275cb0 100644 --- a/src/main/scala/com/dataintuitive/viash/platforms/NextFlowPlatform.scala +++ b/src/main/scala/com/dataintuitive/viash/platforms/NextFlowPlatform.scala @@ -496,8 +496,12 @@ case class NextFlowPlatform( | : it[1].collect{ k, el -> [ it[0], el, it[2] ] } | }""".stripMargin } else { - """ emit: - | result_""".stripMargin + s""" emit: + | result_.flatMap{ it -> + | (it[1].keySet().size() > 1) + | ? it + | : it[1].collect{ k, el -> [ it[0], el, it[2] ] } + | }""".stripMargin } val setup_main_workflow =