Summarizable.scala 985 Bytes
Newer Older
1
2
3
4
5
6
7
package nl.lumc.sasc.biopet.core.summary

import java.io.File

import nl.lumc.sasc.biopet.core.config.Configurable

/**
Peter van 't Hof's avatar
Peter van 't Hof committed
8
9
 * Trait for class to let them accept into a Summary
 *
10
11
 * Created by pjvan_thof on 2/14/15.
 */
Peter van 't Hof's avatar
Peter van 't Hof committed
12
trait Summarizable {
13

Peter van 't Hof's avatar
Peter van 't Hof committed
14
  /** Must return files to store into summary */
15
16
  def summaryFiles: Map[String, File]

Peter van 't Hof's avatar
Peter van 't Hof committed
17
  /** Must returns stats to store into summary */
18
  def summaryStats: Map[String, Any]
19

20
21
22
  /** Can be used to add additional Summarizable, this is executed at the start of WriteSummary*/
  def addToQscriptSummary(qscript: SummaryQScript) {}

23
  /**
Peter van 't Hof's avatar
Peter van 't Hof committed
24
25
26
27
   * This function is used to merge value that are found at the same path in the map. Default there will throw a exception at conflicting values.
   * @param v1 Value of new map
   * @param v2 Value of old map
   * @param key Key of value
28
29
   * @return
   */
30
31
32
  def resolveSummaryConflict(v1: Any, v2: Any, key: String): Any = {
    throw new IllegalStateException("Merge can not have same key by default")
  }
33
}