From 3b55324c923a985582b2191e93538f2efe8c81bd Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Tue, 29 Dec 2015 13:18:09 +0100
Subject: [PATCH] Added count seqs

---
 .../pipelines/gears/GearsSeqCount.scala       | 29 +++++++++++++++++++
 .../biopet/pipelines/gears/GearsSingle.scala  |  7 +++++
 2 files changed, 36 insertions(+)
 create mode 100644 public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSeqCount.scala

diff --git a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSeqCount.scala b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSeqCount.scala
new file mode 100644
index 000000000..94968849c
--- /dev/null
+++ b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSeqCount.scala
@@ -0,0 +1,29 @@
+package nl.lumc.sasc.biopet.pipelines.gears
+
+import nl.lumc.sasc.biopet.core.{BiopetQScript, SampleLibraryTag}
+import nl.lumc.sasc.biopet.core.summary.SummaryQScript
+import nl.lumc.sasc.biopet.extensions.tools.SageCountFastq
+import nl.lumc.sasc.biopet.utils.config.Configurable
+import org.broadinstitute.gatk.queue.QScript
+
+/**
+  * Created by pjvan_thof on 12/29/15.
+  */
+class GearsSeqCount(val root: Configurable) extends QScript with BiopetQScript with SampleLibraryTag {
+
+  var fastqInput: File = _
+
+  def countFile = swapExt(outputDir, fastqInput, ".fastq.gz", ".counts.txt")
+
+  /** Init for pipeline */
+  def init(): Unit = {
+  }
+
+  /** Pipeline itself */
+  def biopetScript(): Unit = {
+    val seqCount = new SageCountFastq(this)
+    seqCount.input = fastqInput
+    seqCount.output = countFile
+    add(seqCount)
+  }
+}
diff --git a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala
index f94fe96e2..def9eedd3 100644
--- a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala
+++ b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala
@@ -44,6 +44,7 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
   lazy val krakenScript = if (config("gears_use_kraken", default = true)) Some(new GearsKraken(this)) else None
   lazy val qiimeRatx = if (config("gear_use_qiime_rtax", default = false)) Some(new GearsQiimeRtax(this)) else None
   lazy val qiimeClosed = if (config("gear_use_qiime_closed", default = false)) Some(new GearsQiimeClosed(this)) else None
+  lazy val seqCount = if (config("gear_use_seq_count", default = false)) Some(new GearsSeqCount(this)) else None
 
   /** Executed before running the script */
   def init(): Unit = {
@@ -137,6 +138,12 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
       //TODO: Plots
     }
 
+    seqCount.foreach { seqCount =>
+      seqCount.fastqInput = combinedFastq
+      seqCount.outputDir = new File(outputDir, "seq_count")
+      add(seqCount)
+    }
+
     addSummaryJobs()
   }
 
-- 
GitLab