Commit 5b3d2898 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Remove unused imports

parent 696c64df
......@@ -2,18 +2,15 @@ package nl.lumc.sasc.biopet.tools.bamstats
import java.io.File
import htsjdk.samtools.{ CigarOperator, SAMSequenceDictionary, SamReaderFactory }
import htsjdk.samtools.reference.FastaSequenceFile
import htsjdk.samtools.{ SAMSequenceDictionary, SamReaderFactory }
import nl.lumc.sasc.biopet.utils.BamUtils.SamDictCheck
import nl.lumc.sasc.biopet.utils.ToolCommand
import nl.lumc.sasc.biopet.utils.intervals.{ BedRecord, BedRecordList }
import nl.lumc.sasc.biopet.utils.{ BamUtils, ToolCommand }
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{ Await, Future }
import scala.concurrent.blocking
import scala.util.{ Failure, Success }
import scala.concurrent.duration.Duration
import scala.collection.JavaConversions._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
/**
* Created by pjvanthof on 25/05/16.
......
......@@ -2,9 +2,7 @@ package nl.lumc.sasc.biopet.tools.bamstats
import java.io.{ File, PrintWriter }
import scala.collection.generic.Sorted
import scala.collection.mutable
import scala.math.ScalaNumber
/**
* Created by pjvanthof on 05/07/16.
......@@ -12,15 +10,18 @@ import scala.math.ScalaNumber
case class Histogram() {
protected[Histogram] val histrogram: mutable.Map[Int, Long] = mutable.Map()
/** This will add an other histogram to `this` */
def +=(other: Histogram): Histogram = {
other.histrogram.foreach(x => this.histrogram += x._1 -> (this.histrogram.getOrElse(x._1, 0L) + x._2))
this
}
/** With this a value can be added to the histogram */
def add(value: Int): Unit = {
histrogram += value -> (histrogram.getOrElse(value, 0L) + 1)
}
/** Write histogram to a tsv/count file */
def writeToTsv(file: File): Unit = {
val writer = new PrintWriter(file)
writer.println("value\tcount")
......
package nl.lumc.sasc.biopet.tools.bamstats
import scala.collection.mutable
import scala.concurrent.blocking
/**
* Created by pjvanthof on 05/07/16.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment