Skip to content

Commit e05d12f

Browse files
authored
Merge branch 'main' into correct-broken-link
2 parents 3cb3c8a + 316ebdf commit e05d12f

20 files changed

+465
-50
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: GitHub Pages sphinx deployment
33
on:
44
push:
55
branches:
6-
- main
6+
- release
77
workflow_dispatch:
88

99
# NOTE: If you modify this file to install a package with pip or apt, please
@@ -17,7 +17,7 @@ jobs:
1717

1818
- name: Install apt packages
1919
run: |
20-
sudo apt-get install -y graphviz
20+
sudo apt-get install -y graphviz tree
2121
2222
- name: Set up Python
2323
uses: actions/setup-python@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ _site
99
.Rproj.user
1010
.Rhistory
1111
.RData
12-
1312
_build/
13+
build/
1414
*.egg-info/
1515

1616
src/_includes/cwl/**/output.txt
17+
venv/

.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ build:
99
nodejs: "16"
1010
apt_packages:
1111
- graphviz
12+
- tree
1213

1314
sphinx:
1415
configuration: src/conf.py

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ in `Makefile`).
102102
python -m venv venv
103103
source venv/bin/activate
104104
# Install the dependencies in your virtual environment
105-
(venv) pip install -e .[all]
105+
(venv) python -mpip install .[all]
106106
# Create the HTML to visualize locally
107107
(venv) make html
108108
(venv) firefox _build/index.html
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Capitalize each word passed. Will split the text by spaces.
3+
* For instance, given "hello world", it returns "Hello World".
4+
*
5+
* @param {String} message - The input message.
6+
* @return {String} the message with each word with its initial letter capitalized.
7+
*/
8+
function capitalizeWords (message) {
9+
if (message === undefined || message === null || typeof message !== 'string' || message.trim().length === 0) {
10+
return '';
11+
}
12+
return message
13+
.split(' ')
14+
.map(function (token) {
15+
return token.charAt(0).toUpperCase() + token.slice(1);
16+
})
17+
.join(' ');
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cwlVersion: v1.2
2+
class: CommandLineTool
3+
requirements:
4+
- class: InlineJavascriptRequirement
5+
expressionLib:
6+
- { $include: custom-functions.js }
7+
8+
baseCommand: echo
9+
10+
inputs:
11+
message:
12+
type: string
13+
14+
arguments: [$( capitalizeWords(inputs.message) )]
15+
16+
outputs: []
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
cwlVersion: v1.2
2+
class: CommandLineTool
3+
requirements:
4+
- class: InlineJavascriptRequirement
5+
expressionLib:
6+
- |
7+
/**
8+
* Capitalize each word passed. Will split the text by spaces.
9+
* For instance, given "hello world", it returns "Hello World".
10+
*
11+
* @param {String} message - The input message.
12+
* @return {String} the message with each word with its initial letter capitalized.
13+
*/
14+
function capitalizeWords (message) {
15+
if (message === undefined || message === null || typeof message !== 'string' || message.trim().length === 0) {
16+
return '';
17+
}
18+
return message
19+
.split(' ')
20+
.map(function (token) {
21+
return token.charAt(0).toUpperCase() + token.slice(1);
22+
})
23+
.join(' ');
24+
}
25+
26+
baseCommand: echo
27+
28+
inputs:
29+
message:
30+
type: string
31+
32+
arguments: [$( capitalizeWords(inputs.message) )]
33+
34+
outputs: []
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cwlVersion: v1.2
2+
class: CommandLineTool
3+
requirements:
4+
- class: InlineJavascriptRequirement
5+
expressionLib:
6+
- { $include: custom-functions.js }
7+
- |
8+
/**
9+
* A merely illustrative example function that uses a function
10+
* from the included custom-functions.js file to create a
11+
* Hello World message.
12+
*
13+
* @param {Object} message - CWL document input message
14+
*/
15+
var createHelloWorldMessage = function (message) {
16+
return capitalizeWords(message);
17+
};
18+
19+
baseCommand: echo
20+
21+
inputs:
22+
message:
23+
type: string
24+
25+
arguments: [$( createHelloWorldMessage(inputs.message) )]
26+
27+
outputs: []
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
cwlVersion: v1.2
2+
class: CommandLineTool
3+
4+
inputs:
5+
file_format:
6+
type:
7+
- 'null'
8+
- name: format_choices
9+
type: enum
10+
symbols:
11+
- auto
12+
- fasta
13+
- fastq
14+
- fasta.gz
15+
- fastq.gz
16+
inputBinding:
17+
position: 0
18+
prefix: '--format'
19+
outputs:
20+
text_output:
21+
type: string
22+
outputBinding:
23+
outputEval: $(inputs.file_format)
24+
25+
baseCommand: 'true'
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
cwlVersion: v1.2
2+
class: Workflow
3+
4+
inputs:
5+
text:
6+
type: string
7+
default: 'Hello World'
8+
outputs:
9+
reversed_message:
10+
type: string
11+
outputSource: step_b/reversed_message
12+
13+
steps:
14+
step_a:
15+
run:
16+
class: CommandLineTool
17+
stdout: stdout.txt
18+
inputs:
19+
text: string
20+
outputs:
21+
step_a_stdout:
22+
type: File
23+
outputBinding:
24+
glob: 'stdout.txt'
25+
baseCommand: echo
26+
arguments: [ '-n', '$(inputs.text)' ]
27+
in:
28+
text: text
29+
out: [step_a_stdout]
30+
step_b:
31+
run:
32+
class: CommandLineTool
33+
stdout: stdout.txt
34+
inputs:
35+
step_a_stdout: File
36+
outputs:
37+
reversed_message:
38+
type: string
39+
outputBinding:
40+
glob: stdout.txt
41+
loadContents: true
42+
outputEval: $(self[0].contents)
43+
baseCommand: rev
44+
arguments: [ $(inputs.step_a_stdout) ]
45+
in:
46+
step_a_stdout:
47+
source: step_a/step_a_stdout
48+
out: [reversed_message]

0 commit comments

Comments
 (0)