You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first method involves adding the folder containing your scripts to the `PATH` environment variable. This allows you to run the shell script without using `sh` or `bash` commands.
87
+
88
+
Start with adding a _shebang_ at the top of your file:
89
+
90
+
```{code-block}
91
+
#!/bin/bash
92
+
```
93
+
94
+
After that, make the script executable with the command `chmod +x scriptname.sh`
95
+
96
+
Finally, modify your `PATH` to add the directory where your script is located.
97
+
(It is good practice to use `$HOME/bin` for storing your own scripts).
98
+
99
+
```bash
100
+
export PATH=$PATH:/appropriate/directory
101
+
```
102
+
103
+
Now you can use `baseCommand: scriptname.sh` to run the script directly.
104
+
105
+
```cwl
106
+
#!/bin/bash
107
+
cwlVersion: v1.0
108
+
class: CommandLineTool
109
+
baseCommand: scriptname.sh
110
+
```
111
+
112
+
When you wish to share your work later, you can place your script in a software container in the Docker format.
113
+
114
+
The second method involves including an input of `type: File` in the script itself:
115
+
116
+
```cwl
117
+
class: CommandLineTool
118
+
119
+
inputs:
120
+
my_script:
121
+
type: File
122
+
inputBinding:
123
+
position: 0
124
+
125
+
126
+
# other inputs go here
127
+
128
+
baseCommand: sh
129
+
130
+
outputs: []
131
+
```
132
+
133
+
```{note}
134
+
In CWL, everything must be directly stated.
135
+
```
136
+
82
137
## Setting `self`-based input bindings for optional inputs
83
138
84
139
Currently, `cwltool` can't cope with missing optional inputs if their
@@ -108,8 +163,8 @@ outputs: []
108
163
109
164
## Model a "one-or-the-other" parameter
110
165
111
-
Below is an example of how
112
-
you can specify different strings to be added to a command line
166
+
Below is an example showing how
167
+
to specify different strings to be added to a command line,
113
168
based on the value given to a Boolean parameter.
114
169
115
170
```yaml
@@ -265,7 +320,7 @@ For command-line flags that are either **mutually exclusive** or **dependent**,
265
320
```
266
321
## Setting Mutually Exclusive Parameters
267
322
268
-
In order to properly set fields in a record input type, you need to pass a dictionary to the input to properly set the parameters. This is done by using inline javascript and returning the dictionary with the key of the field you want to set. The source field is set to indicate the input from the workflow to be used as the value.
323
+
To properly set fields in a record input type, you need to pass a dictionary to the input to properly set the parameters. This is done by using inline JavaScript and returning the dictionary with the key of the field you want to set. The source field is set to indicate the input from the workflow to be used as the value.
Copy file name to clipboardExpand all lines: src/introduction/prerequisites.md
+20-21Lines changed: 20 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
# Prerequisites
2
2
3
-
% This page supersedes the old setup.md. We used that page as reference while
3
+
% This page supersedes the old setup page: setup.md. We used that page as a reference while
4
4
% writing this documentation.
5
5
6
6
The software and configurations listed in this section are prerequisites for
7
7
following this user guide. The CWL standards are implemented by many different
8
8
workflow runners and platforms. This list of requirements focuses on the CWL reference runner,
9
-
`cwltool`. You can use another CWLcompatible runner or workflow systems but the results and
9
+
`cwltool`. You can use another CWL-compatible runner or workflow system, but the results and
10
10
interface may look different (though the exact workflow outputs should be identical).
11
11
12
12
```{admonition} CWL Implementations
13
13
14
-
There are many implementations of the CWL standards. Some are complete CWL runners,
15
-
others are plug-ins or extensions to workflow engines. We have a better
14
+
There are many implementations of the CWL standards. Some are complete CWL runners, while
15
+
others could be plug-ins or extensions to workflow engines. We have a better
16
16
explanation in the [Implementations](basic-concepts.md#implementations) section.
17
17
```
18
18
@@ -26,7 +26,7 @@ of the following options for your operating system:
26
26
- Windows
27
27
28
28
```{note}
29
-
If you are using Windows, you will have to install the Windows Subsystem for Linux 2.
29
+
If you are using Windows, you will have to install the [Windows Subsystem for Linux 2](https://learn.microsoft.com/en-us/windows/wsl/install) (WSL2).
30
30
Visit the `cwltool` [documentation](https://github.com/common-workflow-language/cwltool/blob/main/README.rst#ms-windows-users)
31
31
for details on installing WSL2.
32
32
Your operating system also needs internet access and a recent version of Python (3.6+).
@@ -59,7 +59,7 @@ $ (venv) pip install cwltool
59
59
```
60
60
61
61
```{note}
62
-
You can find the `cwl-runner` source code [here](https://github.com/common-workflow-language/cwltool/tree/main/cwlref-runner).
62
+
You can find the `cwl-runner` [source code](https://github.com/common-workflow-language/cwltool/tree/main/cwlref-runner) in the `cwltool` repository.
63
63
Visit the `cwltool` [documentation](https://github.com/common-workflow-language/cwltool#install)
64
64
for other ways to install `cwltool` with `apt` and `conda`.
65
65
```
@@ -71,10 +71,10 @@ Let's use a simple CWl tool description `true.cwl` with `cwltool`.
71
71
:name: true.cwl
72
72
```
73
73
74
-
The `cwltool` command has an option to validate CWL tool and workflow descriptionss. It will parse the
75
-
CWL document, look for syntax errors, and verify that the descriptions are compliant
76
-
with the CWL standards, without running it. To validate CWL workflows (or even a
77
-
standalone command line tool description like above) pass the `--validate` option
74
+
The `cwltool` command has an option to validate CWL tool and workflow descriptions. This option will parse the
75
+
CWL document, look for syntax errors, and verify that the workflow descriptions are compliant
76
+
with the CWL standards. However, these actions will be performed without running the document. To validate CWL workflows (or even a
77
+
standalone command line tool description like the above) pass the `--validate` option
78
78
to the `cwltool` command:
79
79
80
80
```{runcmd} cwltool --validate true.cwl
@@ -91,7 +91,7 @@ You can run the CWL tool description by omitting the `--validate` option:
91
91
92
92
### cwl-runner Python module
93
93
94
-
`cwl-runner` is an implementation-agnostic alias for CWL Runners.
94
+
`cwl-runner` is an implementation-agnostic alias for CWL Runners. This simply means that the `cwl-runner` alias command can be invoked independently, and is not reliant on a particular CWL runner.
95
95
Users can invoke `cwl-runner` instead of invoking a CWL runner like `cwltool`
96
96
directly. The `cwl-runner` alias command then chooses the correct CWL runner.
97
97
This is convenient for environments with multiple CWL runners.
@@ -106,7 +106,7 @@ an alias for `cwltool` under the name `cwl-runner`
106
106
$ pip install cwlref-runner
107
107
```
108
108
109
-
Now you can validate and run your workflow with `cwl-runner` executable,
109
+
Now you can validate and run your workflow with the `cwl-runner` executable,
110
110
which will invoke `cwltool`. You should have the same results and output
111
111
as in the previous section.
112
112
@@ -120,9 +120,9 @@ as in the previous section.
120
120
:caption: Running `true.cwl` with `cwl-runner`.
121
121
```
122
122
123
-
Another way to execute `cwl-runner` is invoking the file directly. For that,
124
-
the first thing you need to copy `true.cwl` workflow into a new file
125
-
`true_shebang.cwl` and include a special first line, a *shebang*:
123
+
Another way to execute `cwl-runner` is by invoking the file directly. For that,
124
+
the first thing you need to do is copy `true.cwl` workflow into a new file:
125
+
`true_shebang.cwl`, and include a special first line, a *shebang*:
0 commit comments