Commit 1a7fd7db authored by pjvan_thof's avatar pjvan_thof

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