From d20257388821052bd90c3301e4c69eaa90cc6292 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Thu, 24 Dec 2015 14:40:27 +0100
Subject: [PATCH] Added unclasified reads

---
 .../sasc/biopet/pipelines/gears/GearsKraken.scala   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsKraken.scala b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsKraken.scala
index d9d2fd063..3c7b0d0f5 100644
--- a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsKraken.scala
+++ b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsKraken.scala
@@ -124,9 +124,16 @@ object GearsKraken {
         case (k, v) =>
           val node = <node name={ k }></node>
           val sizes = samples.map { sample =>
-            <val>
-              { getValue(sample, (path ::: k :: Nil).tail, "size").getOrElse(0) }
-            </val>
+            if (k == "root") {
+              val unclassified = summaries(sample)("unclassified").asInstanceOf[Map[String, Any]]("size").asInstanceOf[Long]
+              <val>
+                {getValue(sample, (path ::: k :: Nil).tail, "size").getOrElse(0).toString.toLong + unclassified}
+              </val>
+            } else {
+              <val>
+                {getValue(sample, (path ::: k :: Nil).tail, "size").getOrElse(0)}
+              </val>
+            }
           }
           val size = <size>{ sizes }</size>
           node.copy(child = size ++ createNodes(v.asInstanceOf[mutable.Map[String, Any]], path ::: k :: Nil))
-- 
GitLab