Stats.scala 1.05 KB
Newer Older
1
2
package nl.lumc.sasc.biopet.tools.bamstats

3
import scala.collection.mutable
Peter van 't Hof's avatar
Peter van 't Hof committed
4
5
import scala.concurrent.blocking

6

7
8
9
10
11
12
/**
 * Created by pjvanthof on 05/07/16.
 */
case class Stats() {

  var totalReads = 0L
13
14
  var unmapped = 0L
  var secondary = 0L
Peter van 't Hof's avatar
Peter van 't Hof committed
15
16
  val mappingQualityHistogram = Histogram()
  val insertSizeHistogram = Histogram()
Peter van 't Hof's avatar
Peter van 't Hof committed
17
18
19
20
21
  val clippingHistogram = Histogram()
  val leftClippingHistogram = Histogram()
  val rightClippingHistogram = Histogram()
  val _5_ClippingHistogram = Histogram()
  val _3_ClippingHistogram = Histogram()
22
23
24

  def +(other: Stats): Stats = {
    this.totalReads += other.totalReads
25
    this.unmapped += other.unmapped
Peter van 't Hof's avatar
Peter van 't Hof committed
26
27
    this.mappingQualityHistogram += other.mappingQualityHistogram
    this.insertSizeHistogram += other.insertSizeHistogram
Peter van 't Hof's avatar
Peter van 't Hof committed
28
29
30
31
32
    this.clippingHistogram += other.clippingHistogram
    this.leftClippingHistogram += other.leftClippingHistogram
    this.rightClippingHistogram += other.rightClippingHistogram
    this._5_ClippingHistogram += other._5_ClippingHistogram
    this._3_ClippingHistogram += other._3_ClippingHistogram
33
34
35
    this
  }
}