Commit 8de54663 authored by Sander Bollen's avatar Sander Bollen
Browse files

xhmm discover stats file

parent 997c7f15
......@@ -2,13 +2,16 @@ package nl.lumc.sasc.biopet.extensions.xhmm
import java.io.File
import nl.lumc.sasc.biopet.core.summary.Summarizable
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Argument, Input, Output}
import scala.io.Source
/**
* Created by Sander Bollen on 23-11-16.
*/
class XhmmDiscover(val root: Configurable) extends Xhmm {
class XhmmDiscover(val root: Configurable) extends Xhmm with Summarizable {
@Input
var inputMatrix: File = _
......@@ -38,4 +41,24 @@ class XhmmDiscover(val root: Configurable) extends Xhmm {
required("-s", xhmmAnalysisName)
}
case class XcnvLine(sample: String, cnvType: String, location: String)
def summaryFiles: Map[String, File] = Map()
def summaryStats: Map[String, Any] = {
val lines = Source.fromFile(outputXcnv).
getLines().
filter(p => !p.startsWith("SAMPLE")).
map(x => x.split("\t")).
map(x => XcnvLine(x(0), x(1), x(2))).toList
val samples = lines.map(_.sample)
samples.map{x =>
val sampleLines = lines.filter(_.sample == x)
x -> Map(
"DEL" -> sampleLines.count(_.cnvType == "DEL"),
"DUP" -> sampleLines.count(_.cnvType == "DUP"))
}.toMap
}
}
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