snakemake / snakemake-github-action

A Github action for running a Snakemake workflow
MIT License
51 stars 12 forks source link

Save png of DAG using this action #3

Open colinbrislawn opened 4 years ago

colinbrislawn commented 4 years ago

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/snakemake-github-action@v1.4.1
      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?

kelly-sovacool commented 1 year ago

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/snakemake-github-action@v1.4.1
      with:
        args: 'write_dag'