From ba3e1de5a1b10f55f2deb7358ca6c111097a5f41 Mon Sep 17 00:00:00 2001
From: bow <bow@bow.web.id>
Date: Wed, 4 Mar 2015 10:35:32 +0100
Subject: [PATCH] Add wrapper for bgzip

---
 .../lumc/sasc/biopet/extensions/Bgzip.scala   | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Bgzip.scala

diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Bgzip.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Bgzip.scala
new file mode 100644
index 000000000..2429702c8
--- /dev/null
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Bgzip.scala
@@ -0,0 +1,40 @@
+/**
+ * Biopet is built on top of GATK Queue for building bioinformatic
+ * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
+ * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
+ * should also be able to execute Biopet tools and pipelines.
+ *
+ * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
+ *
+ * Contact us at: sasc@lumc.nl
+ *
+ * A dual licensing mode is applied. The source code within this project that are
+ * not part of GATK Queue is freely available for non-commercial use under an AGPL
+ * license; For commercial users or users who do not want to follow the AGPL
+ * license, please contact us to obtain a separate license.
+ */
+package nl.lumc.sasc.biopet.extensions
+
+import java.io.File
+
+import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
+import nl.lumc.sasc.biopet.core.config.Configurable
+import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
+
+/** Wrapper for the bgzip command */
+class Bgzip(val root: Configurable) extends BiopetCommandLineFunction {
+
+  @Input(doc = "Input files", required = true)
+  var input: List[File] = Nil
+
+  @Output(doc = "Compressed output file", required = true)
+  var output: File = null
+
+  var f: Boolean = config("f", default = false)
+  executable = config("exe", default = "bgzip")
+
+  def cmdLine = required(executable) +
+    conditional(f, "-f") +
+    " -c " + repeat(input) +
+    " > " + required(output)
+}
-- 
GitLab