From d76b3f66077aec8a58c35cd54a231a7baf561a95 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Sat, 7 Mar 2015 16:31:08 +0100
Subject: [PATCH] Adding scala docs

---
 .../MultisamplePipelineTemplate.scala         | 21 +++++++++++++++++--
 .../biopet/pipelines/PipelineTemplate.scala   |  4 ++++
 .../nl/lumc/sasc/biopet/utils/VcfUtils.scala  |  7 +++++++
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/MultisamplePipelineTemplate.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/MultisamplePipelineTemplate.scala
index b3233ecfe..a75a14246 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/MultisamplePipelineTemplate.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/MultisamplePipelineTemplate.scala
@@ -19,46 +19,63 @@ import nl.lumc.sasc.biopet.core.{ PipelineCommand, MultiSampleQScript, BiopetQSc
 import nl.lumc.sasc.biopet.core.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
+/** Template for a multisample pipeline */
 class MultisamplePipelineTemplate(val root: Configurable) extends QScript with MultiSampleQScript {
   def this() = this(null)
 
+  /** Location of summary file */
   def summaryFile: File = new File(outputDir, "MultisamplePipelineTemplate.summary.json")
 
+  /** File to add to the summary */
   def summaryFiles: Map[String, File] = Map()
 
+  /** Pipeline settings to add to the summary */
   def summarySettings: Map[String, Any] = Map()
 
+  /** Function to make a sample */
   def makeSample(id: String) = new Sample(id)
 
+  /** This class will contain jobs and libraries for a sample */
   class Sample(sampleId: String) extends AbstractSample(sampleId) {
+    /** Sample specific files for summary */
     def summaryFiles: Map[String, File] = Map()
 
+    /** Sample specific stats for summary */
     def summaryStats: Map[String, Any] = Map()
 
+    /** Function to make a library */
     def makeLibrary(id: String) = new Library(id)
+
+    /** This class will contain all jobs for a library */
     class Library(libId: String) extends AbstractLibrary(libId) {
+      /** Library specific files for summary */
       def summaryFiles: Map[String, File] = Map()
 
+      /** Library specific stats for summary */
       def summaryStats: Map[String, Any] = Map()
 
+      /** Method to add library jobs */
       protected def addJobs(): Unit = {
-        // Library jobs
       }
     }
 
+    /** Method to add sample jobs */
     protected def addJobs(): Unit = {
-      // Sample jobs
     }
   }
 
+  /** Method where multisample jobs are added */
   def addMultiSampleJobs(): Unit = {
   }
 
+  /** This is executed before the script starts */
   def init(): Unit = {
   }
 
+  /** Method where jobs must be added */
   def biopetScript() {
   }
 }
 
+/** Object to let to generate a main method */
 object MultisamplePipelineTemplate extends PipelineCommand
\ No newline at end of file
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/PipelineTemplate.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/PipelineTemplate.scala
index 6278ab6f8..d4998770e 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/PipelineTemplate.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/PipelineTemplate.scala
@@ -20,14 +20,18 @@ import nl.lumc.sasc.biopet.core.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 import org.broadinstitute.gatk.queue.function._
 
+/** Template for a pipeline */
 class PipelineTemplate(val root: Configurable) extends QScript with BiopetQScript {
   def this() = this(null)
 
+  /** This is executed before the script starts */
   def init() {
   }
 
+  /** Method where jobs must be added */
   def biopetScript() {
   }
 }
 
+/** Object to let to generate a main method */
 object PipelineTemplate extends PipelineCommand
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/VcfUtils.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/VcfUtils.scala
index 9d6e983a4..7f704c12a 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/VcfUtils.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/VcfUtils.scala
@@ -32,6 +32,13 @@ object VcfUtils {
     alleles(longestAlleleId)
   }
 
+  /**
+   * Method will extend a allele till a new length
+   * @param bases Allele
+   * @param newSize New size of allele
+   * @param fillWith Char to fill gap
+   * @return
+   */
   def fillAllele(bases: String, newSize: Int, fillWith: Char = '-'): String = {
     bases + (Array.fill[Char](newSize - bases.size)(fillWith)).mkString
   }
-- 
GitLab