Commit b9173a70 authored by akaljuvee's avatar akaljuvee

one log line

parent 3d2cbc8a
......@@ -37,13 +37,15 @@ class VcfStatsForSv(val parent: Configurable) extends ToolCommandFunction with S
var outputFile: File = _
override def defaultCoreMemory = 1.0
override def defaultResidentFactor = 2.0
override def defaultVmemFactor = 3.0
override def cmdLine = super.cmdLine +
required("-i", inputFile) +
required("-o", outputFile) +
repeat("--histBinBoundaries", histogramBinBoundaries)
def summaryStats: Map[String, Any] = ConfigUtils.yamlToMap(outputFile)
def summaryStats: Map[String, Any] = ConfigUtils.fileToConfigMap(outputFile)
def summaryFiles: Map[String, File] = Map.empty
......
......@@ -38,8 +38,7 @@ object VcfStatsForSv extends ToolCommand {
val stats: Map[String, Any] = getVariantCounts(cmdArgs.inputFile, cmdArgs.histBinBoundaries)
ConfigUtils.mapToYamlFile(stats, cmdArgs.outputFile)
ConfigUtils.mapToJsonFile(stats, cmdArgs.outputFile)
}
/** Parses a vcf-file and counts sv-s by type and size. Sv-s are divided to different size classes, the parameter histogramBinBoundaries gives the boundaries between these classes. */
......
......@@ -168,6 +168,12 @@ object ConfigUtils extends Logging {
writer.close()
}
def mapToJsonFile(map: Map[String, Any], outputFile: File) = {
val writer = new PrintWriter(outputFile)
writer.println(anyToJson(map).toString())
writer.close()
}
/** Convert json to native scala map/values */
def jsonToMap(json: Json): Map[String, Any] = {
var output: Map[String, Any] = Map()
......
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