From 30c804eb0867706f948dedeb9a0713e1b13cc71f Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 May 2024 20:39:03 +1000 Subject: [PATCH 1/2] Added exercise to push code and view it on cwl-viewer --- episodes/03-dependency_graphs.Rmd | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/episodes/03-dependency_graphs.Rmd b/episodes/03-dependency_graphs.Rmd index 161d58f..650531b 100644 --- a/episodes/03-dependency_graphs.Rmd +++ b/episodes/03-dependency_graphs.Rmd @@ -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`. + +:::::::::::::: exercise + +### 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! + + +:::::::::::::::: exercise + +#### 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. @@ -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: From 04d2e89af5cb6e50e951e1f1d7441ee803b6268d Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 May 2024 20:56:15 +1000 Subject: [PATCH 2/2] Use challenge headers (with chillies) over exercises --- episodes/03-dependency_graphs.Rmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/episodes/03-dependency_graphs.Rmd b/episodes/03-dependency_graphs.Rmd index 650531b..e95e81c 100644 --- a/episodes/03-dependency_graphs.Rmd +++ b/episodes/03-dependency_graphs.Rmd @@ -181,9 +181,9 @@ In this example the workflow is already made, so the graph can be generated usin GitLab or Git repository. To view the graph of the workflow enter the URL and click `Parse Workflow`. -:::::::::::::: exercise +:::::::::::::: challenge -### Push your workflow to GitHub +### Push your workflow to GitHub 🌶 Add your workflow to a git commit and then push that commit to github.com @@ -211,9 +211,9 @@ git push Now it's time to view your workflow! -:::::::::::::::: exercise +:::::::::::::::: challenge -#### View your workflow in the cwl viewer +#### View your workflow in the cwl viewer 🌶 Paste the workflow url into the form on [view.commonwl.org][cwl_viewer] @@ -241,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. ::::::::::::::::::::::::::::::::