snakemake-github-action icon indicating copy to clipboard operation
snakemake-github-action copied to clipboard

Save png of DAG using this action

Open colinbrislawn opened this issue 5 years ago • 1 comments

I usually run this to make save DAGs

snakemake --dag --forceall --configfile config/example.yml | dot -Tpng > outdir/full-graph.png

So I tried this

    - name: Save full DAG
      uses: snakemake/[email protected]
      with:
        args: '--dag --forceall --configfile config/example.yml | dot -Tpng > outdir/full-graph.png'

but of course this was not escaped properly.

Is there a way to pipe the output DAG like I'm doing here? What is the GitHub Actions ™️ way of getting these graphs?

colinbrislawn avatar Dec 13 '19 21:12 colinbrislawn

Idea for a potential workaround: write a rule in your snakemake to generate the DAG, then use GitHub Actions to run the rule.

Snakefile:

rule write_dag:
    output:
        png='outdir/full-graph.png'
    shell:
        '''
        snakemake --dag --forceall --configfile config/example.yml | dot -Tpng > {output.png}
        '''  

In your GitHub Actions workflow:

    - name: Save full DAG
      uses: snakemake/[email protected]
      with:
        args: 'write_dag'

kelly-sovacool avatar Jan 10 '23 18:01 kelly-sovacool