diff --git a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/annotations/Annotations.scala b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/annotations/Annotations.scala
index 82d772fcdb72bf0a3b732c976077c969b506b7ad..d1300f0208f9f1ca56e4de0290c9b7e8593bd518 100644
--- a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/annotations/Annotations.scala
+++ b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/annotations/Annotations.scala
@@ -5,13 +5,13 @@ import nl.lumc.sasc.biopet.core.BiopetQScript.InputFile
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 trait AnnotationGtf extends BiopetQScript { qscript: QScript =>
   /** GTF reference file */
   lazy val annotationGtf: File = {
-    val file: File = config("annotation_gtf")
-    inputFiles :+ InputFile(file, config("annotation_gtf_md5"))
+    val file: File = config("annotation_gtf", freeVar = true)
+    inputFiles :+ InputFile(file, config("annotation_gtf_md5", freeVar = true))
     file
   }
 }
@@ -19,8 +19,8 @@ trait AnnotationGtf extends BiopetQScript { qscript: QScript =>
 trait AnnotationBed extends BiopetQScript { qscript: QScript =>
   /** GTF reference file */
   lazy val annotationBed: File = {
-    val file: File = config("annotation_bed")
-    inputFiles :+ InputFile(file, config("annotation_bed_md5"))
+    val file: File = config("annotation_bed", freeVar = true)
+    inputFiles :+ InputFile(file, config("annotation_bed_md5", freeVar = true))
     file
   }
 }
@@ -28,8 +28,8 @@ trait AnnotationBed extends BiopetQScript { qscript: QScript =>
 trait AnnotationRefFlat extends BiopetQScript { qscript: QScript =>
   /** GTF reference file */
   lazy val annotationRefFlat: File = {
-    val file: File = config("annotation_refflat")
-    inputFiles :+ InputFile(file, config("annotation_refflat_md5"))
+    val file: File = config("annotation_refflat", freeVar = true)
+    inputFiles :+ InputFile(file, config("annotation_refflat_md5", freeVar = true))
     file
   }
 }
@@ -37,8 +37,8 @@ trait AnnotationRefFlat extends BiopetQScript { qscript: QScript =>
 trait RibosomalRefFlat extends BiopetQScript { qscript: QScript =>
   /** GTF reference file */
   lazy val ribosomalRefFlat: File = {
-    val file: File = config("ribosome_refflat")
-    inputFiles :+ InputFile(file, config("ribosome_refflat_md5"))
+    val file: File = config("ribosome_refflat", freeVar = true)
+    inputFiles :+ InputFile(file, config("ribosome_refflat_md5", freeVar = true))
     file
   }
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerExon.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerExon.scala
index 3803b5dce9101c66525393a3c3efd4a3037330d3..43f2a4806ffaac00099674b1f25ddaac4def9f88 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerExon.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerExon.scala
@@ -4,21 +4,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class BasesPerExon(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("BasesPerExon.summary.json")
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerGene.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerGene.scala
index a550a02c126cf8875234f892ca31f1054c176449..599fb670c5c87914ef9c2210ad0450cd63404d15 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerGene.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/BasesPerGene.scala
@@ -4,21 +4,9 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class BasesPerGene(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("BasesPerGene.summary.json")
+  //TODO: splitting on strand if strandspecific
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksBlind.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksBlind.scala
index 3615540f2c0a32246cabbf5347f031d635fa716d..f24e0ed80015150945c7c0b0f90b638734776b5b 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksBlind.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksBlind.scala
@@ -4,21 +4,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class CufflinksBlind(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("CufflinksBlind.summary.json")
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksGuided.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksGuided.scala
index 900c707f609ffab36a0ca4c08cff28cc27d3a94b..a8b3e845a6a71b6bea18dad8e3cb223a5581ac00 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksGuided.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksGuided.scala
@@ -4,21 +4,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class CufflinksGuided(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("CufflinksGuided.summary.json")
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksStrict.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksStrict.scala
index 0055d46bcf844675e4eb8fe9298593b3fe951d37..5fa3ce96f8c6ba8fcd6f0f792380672aa7489b4c 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksStrict.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/CufflinksStrict.scala
@@ -4,21 +4,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class CufflinksStrict(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("CufflinksStrict.summary.json")
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerExon.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerExon.scala
index 623dd039bc3052d1952a8dab500b241d72a108d6..1d1fbb56eee141744752a6528203e57beea32c20 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerExon.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerExon.scala
@@ -4,21 +4,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class FragmentsPerExon(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("FragmentsPerExon.summary.json")
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala
index c3c24e268b08fc12502e0be31382a27e01879187..904fcde16b6d3b7f183e44d8799c80413b331a5b 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala
@@ -4,21 +4,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
+ * Created by pjvan_thof on 1/12/16.
+ */
 class FragmentsPerGene(val root: Configurable) extends QScript with Measurement {
-  /** Init for pipeline */
-  def init(): Unit = ???
-
-  /** Pipeline itself */
-  def biopetScript(): Unit = ???
-
-  /** Must return a map with used settings for this pipeline */
-  def summarySettings: Map[String, Any] = Map()
-
-  /** File to put in the summary for thie pipeline */
-  def summaryFiles: Map[String, File] = Map()
-
-  /** Name of summary output file */
-  def summaryFile: File = new File("FragmentsPerGene.summary.json")
+  def bamToCountFile(id: String, bamFile: File): (String, File) = ???
 }
diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala
index eb39c09c9302b6da38979bdb2babebef5099e5a4..37249c5934054783b6ce39c152e36f53101da262 100644
--- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala
+++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala
@@ -5,13 +5,40 @@ import nl.lumc.sasc.biopet.core.summary.SummaryQScript
 import org.broadinstitute.gatk.queue.QScript
 
 /**
-  * Created by pjvan_thof on 1/12/16.
-  */
-trait Measurement extends SummaryQScript with Reference { qscript : QScript =>
-  private var bamFiles: Map[String, File] = Map()
+ * Created by pjvan_thof on 1/12/16.
+ */
+trait Measurement extends SummaryQScript with Reference { qscript: QScript =>
+  protected var bamFiles: Map[String, File] = Map()
 
   def addBamfile(id: String, file: File): Unit = {
     require(!bamFiles.contains(id), s"'$id' already exist")
     bamFiles += id -> file
   }
+
+  def name: String = this.getClass.getSimpleName.toLowerCase
+
+  lazy val countFiles: Map[String, File] = bamFiles.map { case (id, bamFile) => bamToCountFile(id, bamFile) }
+
+  /** Init for pipeline */
+  def init(): Unit = {
+    require(bamFiles.nonEmpty)
+  }
+
+  /** Pipeline itself */
+  def biopetScript(): Unit = {
+    //TODO: Merging
+
+    //TODO: Heatmap
+  }
+
+  def bamToCountFile(id: String, bamFile: File): (String, File)
+
+  /** Must return a map with used settings for this pipeline */
+  def summarySettings: Map[String, Any] = Map()
+
+  /** File to put in the summary for thie pipeline */
+  def summaryFiles: Map[String, File] = Map()
+
+  /** Name of summary output file */
+  def summaryFile: File = new File(s"$name.summary.json")
 }