Commit 1a7fd7db authored by Peter van 't Hof's avatar Peter van 't Hof

No overwrite of the total.json anymore

parent 7d0148d6
......@@ -165,7 +165,7 @@ case class Stats(generalStats: mutable.Map[String, mutable.Map[Any, Int]] = muta
sampleDistributions: List[String],
contig: Option[String]): Unit = {
outputDir.mkdirs()
this.writeToFile(new File(outputDir, "stats.json"),
this.writeToFile(new File(outputDir, s"${contig.getOrElse("total")}.json"),
samples,
genotypeFields,
infoFields,
......
......@@ -110,11 +110,11 @@ object VcfStats extends ToolCommand {
val completeStatsJson = regions
.flatMap(_.map(_.chr))
.foldLeft(ConfigUtils.fileToConfigMap(new File(cmdArgs.outputDir, "stats.json"))) {
.foldLeft(ConfigUtils.fileToConfigMap(new File(cmdArgs.outputDir, "total.json"))) {
case (map, contig) =>
val contigMap = ConfigUtils.fileToConfigMap(
new File(cmdArgs.outputDir,
"contigs" + File.separator + contig + File.separator + "stats.json"))
"contigs" + File.separator + contig + File.separator + s"$contig.json"))
ConfigUtils.mergeMaps(map, contigMap)
}
......
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