Created
August 14, 2017 11:51
-
-
Save danbills/d889dc5013cb321091e979bfe91a1d60 to your computer and use it in GitHub Desktop.
using ammonite and cwltool to preprocess CWL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wdl4s.cwl.other | |
import ammonite.ops._ | |
import ammonite.ops.ImplicitWd._ | |
import lenthall.validation.ErrorOr.ErrorOr | |
import wdl4s.cwl.{CwlCodecs, CwlFile} | |
object Salad extends App{ | |
//case class SaladOutput(outputAsJson: String, relativePath: Path) | |
/** | |
* | |
* @param in Needs to take a file to get relative file paths. | |
* @return | |
*/ | |
def salad(in: Path): String = { | |
//val relPath: RelPath = in relativeTo pwd | |
val toolresult = cwlTool(in.toString()) | |
toolresult.out.string | |
} | |
def cwlTool(filePath: String): CommandResult = %%('cwltool, "--print-pre", filePath.toString()) | |
def saladAndParse(in: Path): ErrorOr[(CwlFile, Map[String, CwlFile])] = { | |
val json = salad(in) | |
??? | |
val cwl = CwlCodecs.decodeSingleFileCwlAsJson(json) | |
??? | |
} | |
val x = 'cwl/'src/'test/'resources/"arguments.cwl" | |
val y = pwd/x | |
println(salad(y)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment