Skip to content

Instantly share code, notes, and snippets.

@samuell
Last active April 24, 2019 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuell/f3dfeb997a7078f06b9a98ee440f7f3d to your computer and use it in GitHub Desktop.
Save samuell/f3dfeb997a7078f06b9a98ee440f7f3d to your computer and use it in GitHub Desktop.
package main
import (
sp "github.com/scipipe/scipipe"
spc "github.com/scipipe/scipipe/components"
)
func main() {
wf := sp.NewWorkflow("example_workflow", 4)
// Note that this command does not run in a task-specific sub-folder, since it is not creating any output files directly.
// ... which means files should not prepended with '../'
targetExtractor := spc.NewCommandToParams(wf, "cmdtoparam", `awk -f"\t" '{ print $1 }' database | sort | uniq`)
createDataset := wf.NewProc("create_dataset", `grep "{p:target}" ../database > {o:dataset}`)
createDataset.SetOut("dataset", "dataset_{p:target}.tsv")
createDataset.InParam("target").From(targetExtractor.OutParam())
wf.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment