Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added exercise to push code and view it on cwl-viewer #29

Merged
merged 2 commits into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions episodes/03-dependency_graphs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,48 @@ In this example the workflow is already made, so the graph can be generated usin
[cwlviewer][cwl_viewer]. To use this tool, the workflow has to be put in a GitHub,
GitLab or Git repository. To view the graph of the workflow enter the URL and click `Parse Workflow`.


:::::::::::::: challenge

### Push your workflow to GitHub 🌶

Add your workflow to a git commit and then push that commit to github.com


::::::::::::::


:::::::::::::: solution

### Git add / commit / push

Your solution might look like this

```bash
git add rna_seq_workflow_2.cwl

git commit -m "Added my second RNASeq CWL Workflow"

git push
```

::::::::::::::


Now it's time to view your workflow!


:::::::::::::::: challenge

#### View your workflow in the cwl viewer 🌶

Paste the workflow url into the form on [view.commonwl.org][cwl_viewer]

Your workflow url will be something like `https://github.com/alexiswl/cwl-novice-tutorial/blob/main/rna_seq_workflow_2.cwl`.

::::::::::::::::


The cwlviewer displays the workflow as a graph, starting with the input. Then the different steps
are shown, each with their input(s) and output(s). The steps are linked to each other using arrows
accompanied by the input of the next step. The graph ends with the workflow outputs.
Expand All @@ -188,6 +230,8 @@ The graph of the RNA-seq workflow looks a follows:

![](fig/Ep3_graph_answer.png){alt="Ep3 graph answer" style='height: "400px"'}

### Generating graphs locally

It is also possible to generate the graph in the command line. `cwltool` has a function that makes a
graph. The `--print-dot` option will print a file suitable for Graphviz `dot` program. This is the
command to generate a Scalable Vector Graphic (SVG) file:
Expand All @@ -197,13 +241,13 @@ cwltool --print-dot rna_seq_workflow_2.cwl | dot -Tsvg > workflow_graph_2.svg
```

The resulting SVG file displays the same graph as the one in the cwlviewer. The SVG file can be
opened in any web browser and in [Inkscape][inkscape], for example.
opened in any web browser and in [Inkscape][inkscape], for example. Or opened with `code workflow_graph_2.svg` from the terminal.

:::::::::::::::::::::::::::::::: callout

### Windows Only: View images from the CLI with wslview

Windows users can run `wslview workflow_graph_2.svg` in their terminal to view the graph in the default web browser
Windows users can run `wslview workflow_graph_2.svg` in their terminal to view the graph in the default web browser.

::::::::::::::::::::::::::::::::

Expand Down
Loading