Skip to content

Instantly share code, notes, and snippets.

@samuell
Last active April 24, 2019 01:42
Show Gist options
  • Select an option

  • Save samuell/f3dfeb997a7078f06b9a98ee440f7f3d to your computer and use it in GitHub Desktop.

Select an option

Save samuell/f3dfeb997a7078f06b9a98ee440f7f3d to your computer and use it in GitHub Desktop.

Revisions

  1. samuell revised this gist Apr 24, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions command_to_parameters_example.go
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ 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}`)
  2. samuell revised this gist Apr 24, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions command_to_parameters_example.go
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@ import (
    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.
    targetExtractor := spc.NewCommandToParams(wf, "cmdtoparam", `awk -f"\t" '{ print $1 }' database | sort | uniq`)

    createDataset := wf.NewProc("create_dataset", `grep "{p:target}" ../database > {o:dataset}`)
  3. samuell revised this gist Apr 24, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion command_to_parameters_example.go
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ import (
    func main() {
    wf := sp.NewWorkflow("example_workflow", 4)

    targetExtractor := spc.NewCommandToParams(wf, "cmdtoparam", `awk '{ print $1 }' database | sort | uniq`)
    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")
  4. samuell revised this gist Apr 24, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion command_to_parameters_example.go
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ import (
    func main() {
    wf := sp.NewWorkflow("example_workflow", 4)

    targetExtractor := spc.NewCommandToParams(wf, "cmdtoparam", `awk '{ print $1 }' database_ | sort | uniq`)
    targetExtractor := spc.NewCommandToParams(wf, "cmdtoparam", `awk '{ print $1 }' database | sort | uniq`)

    createDataset := wf.NewProc("create_dataset", `grep "{p:target}" ../database > {o:dataset}`)
    createDataset.SetOut("dataset", "dataset_{p:target}.tsv")
  5. samuell renamed this gist Apr 24, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. samuell created this gist Apr 24, 2019.
    18 changes: 18 additions & 0 deletions example_workflow.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    package main

    import (
    sp "github.com/scipipe/scipipe"
    spc "github.com/scipipe/scipipe/components"
    )

    func main() {
    wf := sp.NewWorkflow("example_workflow", 4)

    targetExtractor := spc.NewCommandToParams(wf, "cmdtoparam", `awk '{ 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()
    }