Commit b27bc919 authored by Peter van 't Hof's avatar Peter van 't Hof

Move config report

parent 5f904c36
......@@ -104,8 +104,10 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
case _ =>
}
val logDir = new File(outputDir, ".log" + File.separator + BiopetQCommandLine.timestamp)
if (outputDir.getParentFile.canWrite || (outputDir.exists && outputDir.canWrite))
globalConfig.writeReport(qSettings.runName, new File(outputDir, ".log/" + qSettings.runName))
globalConfig.writeReport(new File(logDir, "config"))
else Logging.addError("Parent of output dir: '" + outputDir.getParent + "' is not writeable, output directory cannot be created")
logger.info("Checking input files")
......@@ -126,7 +128,7 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
if (!skipWriteDependencies) WriteDependencies.writeDependencies(
functions,
new File(outputDir, ".log" + File.separator + BiopetQCommandLine.timestamp + File.separator + "graph"))
new File(logDir, "graph"))
Logging.checkErrors()
logger.info("Script complete without errors")
......
......@@ -189,7 +189,7 @@ class Config(protected var _map: Map[String, Any],
} else ConfigValue(requestedIndex, null, null, freeVar)
}
def writeReport(id: String, directory: File): Unit = {
def writeReport(directory: File): Unit = {
directory.mkdirs()
def convertIndexValuesToMap(input: List[(ConfigValueIndex, Any)], forceFreeVar: Option[Boolean] = None): Map[String, Any] = {
......@@ -205,7 +205,7 @@ class Config(protected var _map: Map[String, Any],
}
def writeMapToJsonFile(map: Map[String, Any], name: String): Unit = {
val file = new File(directory, id + "." + name + ".json")
val file = new File(directory, name + ".json")
val writer = new PrintWriter(file)
writer.write(ConfigUtils.mapToJson(map).spaces2)
writer.close()
......
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