Skip to content

Commit 016b923

Browse files
committed
More tutorial testing, tutorial updates.
1 parent e8a860c commit 016b923

File tree

12 files changed

+187
-27
lines changed

12 files changed

+187
-27
lines changed

docs/_writing_dependencies_containers_cwl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ to check if a tool contains only best-practice ``requirement`` tags. The ``lint`
5353
command can also be fed the ``--biocontainers`` flag to check if a
5454
BioContainers_ container has been registered that is compatible with that tool.
5555

56+
.. include:: _writing_containers_linter_explain.rst
57+
5658
The Conda exercises project template has an example tool (``exercise3``) that we
5759
can use to demonstrate ``--biocontainers``. If you are continuing from the Conda
5860
tutorial, simply move to ``../exercise3`` otherwise using ``planemo project_init``
@@ -79,8 +81,6 @@ to grab the exercise as show below.
7981
.. INFO: BioContainer best-practice container found [quay.io/biocontainers/seqtk:1.2--1].
8082
Failed linting
8183

82-
.. include:: _writing_containers_linter_explain.rst
83-
8484
::
8585

8686
$ planemo test --biocontainers seqtk_seq.cwl

docs/tests/tests_conda_cwl.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#!/bin/bash
22

3-
SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4-
PROJECT_DIRECTORY="${SCRIPTS_DIRECTORY}/../.."
5-
63
set -o xtrace
74

85
set -e
96

107
shopt -s expand_aliases # Needed for conda_env test
118

129
# Preconditions:
10+
# - seqtk not on PATH
1311
# - seqtk_example doesn't exist and in home directory
1412
# - conda_exercises doesn't exist in home directory.
1513
# - seqtk environment is absent
@@ -24,8 +22,7 @@ conda remove --force --yes --name '__seqtk@1.2' --all || true
2422

2523
echo "Setup completed seqtk example"
2624
# TODO: project_init once in master branch
27-
# planemo project_init --template=seqtk_complete_cwl seqtk_example
28-
cp -r $PROJECT_DIRECTORY/project_templates/seqtk_complete_cwl seqtk_example
25+
planemo project_init --template=seqtk_complete_cwl seqtk_example
2926
cd seqtk_example
3027

3128
echo "Check conda_requirements - should see them linting properly"
@@ -52,8 +49,7 @@ planemo test --no-container seqtk_seq.cwl
5249
cd
5350

5451
# TODO: project_init once in master branch
55-
# planemo project_init --template conda_exercises_cwl conda_exercises
56-
cp -r $PROJECT_DIRECTORY/project_templates/conda_exercises_cwl conda_exercises
52+
planemo project_init --template conda_exercises_cwl conda_exercises
5753
cd conda_exercises/exercise_1
5854

5955
ls

docs/tests/tests_docker_cwl.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,47 @@
11
#!/bin/bash
22

3-
SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4-
PROJECT_DIRECTORY="${SCRIPTS_DIRECTORY}/../.."
5-
63
set -o xtrace
74

85
set -e
96

107
# Preconditions
8+
# - seqtk not on PATH
119
# - Planemo installed
12-
# - seqtk_example directory doesn't exist in the home directory.
10+
# - conda_exercises directory doesn't exist in the home directory.
11+
# - conda_answers directory doesn't exist in the home directory.
1312
# - conda_testing directory doesn't exist in the home directory
1413
# - docker running and sudo-less access available via the docker command.
1514

1615
cd
1716
rm -rf conda_exercises
17+
rm -rf conda_answers_cwl
1818
rm -rf conda_testing
1919

20-
2120
echo "Setup completed seqtk example"
22-
# TODO: project_init once in master branch
23-
# planemo project_init --template=conda_exercies_cwl conda_exercies
24-
cp -r $PROJECT_DIRECTORY/project_templates/conda_exercies_cwl conda_exercies
21+
planemo project_init --template=conda_exercies_cwl conda_exercies
2522
cd conda_exercies
2623

24+
cd conda_exercises/exercise_3
25+
2726
echo "We should see biocontainer found for this tool, but not a Docker container"
2827
planemo lint --biocontainers seqtk_seq.cwl | true
2928

3029
echo "This should pass and we should see container was used."
31-
planemo test --biocontainers --engine cwltool seqtk_seq.cwl
30+
planemo test --biocontainers seqtk_seq.cwl
31+
32+
echo "This should fail without biocontainers"
33+
planemo test seqtk_seq.cwl
3234

3335
cd ..
3436

37+
echo "Run seqtk exercise answers"
38+
planemo project_init --template=conda_answers_cwl conda_answers
39+
cd conda_answers/exercise_3
40+
41+
planemo lint --biocontainers seqtk_seq.cwl
42+
planemo test seqtk_seq.cwl
43+
44+
3545
planemo project_init --template=conda_testing_cwl conda_testing
3646
cd conda_testing/
3747
echo "Should show quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:03dc1d2818d9de56938078b8b78b82d967c1f820-0 is built"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: 'v1.0'
3+
class: CommandLineTool
4+
id: "seqtk_seq"
5+
label: "Convert to FASTA (seqtk)"
6+
hints:
7+
DockerRequirement:
8+
dockerPull: quay.io/biocontainers/seqtk:1.2--1
9+
SoftwareRequirement:
10+
packages:
11+
- package: seqtk
12+
version:
13+
- "1.2"
14+
inputs:
15+
input1:
16+
type: File
17+
doc: |
18+
Input FASTA file.
19+
inputBinding:
20+
position: 1
21+
prefix: "-a"
22+
outputs:
23+
output1:
24+
type: File
25+
outputBinding:
26+
glob: out
27+
baseCommand:
28+
- "seqtk"
29+
- "seq"
30+
arguments: []
31+
stdout: out
32+
doc: |
33+
34+
Usage: seqtk seq [options] <in.fq>|<in.fa>
35+
36+
Options: -q INT mask bases with quality lower than INT [0]
37+
-X INT mask bases with quality higher than INT [255]
38+
-n CHAR masked bases converted to CHAR; 0 for lowercase [0]
39+
-l INT number of residues per line; 0 for 2^32-1 [0]
40+
-Q INT quality shift: ASCII-INT gives base quality [33]
41+
-s INT random seed (effective with -f) [11]
42+
-f FLOAT sample FLOAT fraction of sequences [1]
43+
-M FILE mask regions in BED or name list FILE [null]
44+
-L INT drop sequences with length shorter than INT [0]
45+
-c mask complement region (effective with -M)
46+
-r reverse complement
47+
-A force FASTA output (discard quality)
48+
-C drop comments at the header lines
49+
-N drop sequences containing ambiguous bases
50+
-1 output the 2n-1 reads only
51+
-2 output the 2n reads only
52+
-V shift quality by '(-Q) - 33'
53+
-U convert all bases to uppercases
54+
-S strip of white spaces in sequences
55+
56+
$namespaces:
57+
s: http://schema.org/
58+
$schemas:
59+
- http://schema.org/docs/schema_org_rdfa.html
60+
61+
s:mainEntity:
62+
class: s:SoftwareSourceCode
63+
s:name: seqtk
64+
s:about: 'Toolkit for processing sequences in FASTA/Q formats'
65+
s:url: https://github.com/lh3/seqtk
66+
s:codeRepository: https://github.com/lh3/seqtk
67+
68+
s:license:
69+
- https://opensource.org/licenses/MIT
70+
71+
s:targetProduct:
72+
class: s:SoftwareApplication
73+
s:softwareVersion: "1.2"
74+
s:applicationCategory: commandline tool
75+
s:programmingLanguage: C
76+
s:publication:
77+
- class: s:ScholarlyArticle
78+
id: http://dx.doi.org/10.1093/bioinformatics/bts635
79+
80+
s:author:
81+
- class: s:Person
82+
s:name: "Heng Li"
83+
s:sameAs:
84+
- id: https://orcid.org/0000-0003-4874-2874
85+
86+
s:downloadUrl: https://github.com/galaxyproject/planemo/blob/master/project_templates/seqtk_complete_cwl/seqtk_seq.cwl
87+
s:codeRepository: https://github.com/galaxyproject/planemo
88+
89+
s:author:
90+
class: s:Person
91+
s:name: John Chilton
92+
s:email: mailto:jmchilton@gmail.com
93+
s:sameAs:
94+
- id: https://orcid.org/0000-0002-6794-0756
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
input1:
3+
class: File
4+
path: test-data/2.fastq
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
- doc: test generated from example command
3+
job: seqtk_seq_job.json
4+
outputs:
5+
output1:
6+
path: test-data/2.fasta
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
>EAS54_6_R1_2_1_413_324
2+
CCCTTCTTGTCTTCAGCGTTTCTCC
3+
>EAS54_6_R1_2_1_540_792
4+
TTGGCAGGCCAAGGCCGATGGATCA
5+
>EAS54_6_R1_2_1_443_348
6+
GTTGCTTCTGGCGTGGGTGGGGGGG
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@EAS54_6_R1_2_1_413_324
2+
CCCTTCTTGTCTTCAGCGTTTCTCC
3+
+
4+
;;3;;;;;;;;;;;;7;;;;;;;88
5+
@EAS54_6_R1_2_1_540_792
6+
TTGGCAGGCCAAGGCCGATGGATCA
7+
+
8+
;;;;;;;;;;;7;;;;;-;;;3;83
9+
@EAS54_6_R1_2_1_443_348
10+
GTTGCTTCTGGCGTGGGTGGGGGGG
11+
+EAS54_6_R1_2_1_443_348
12+
;;;;;;;;;;;9;7;;.7;393333
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
input1:
3+
class: File
4+
path: test-data/2.fastq
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11

22
- doc: test generated from example command
3-
job:
4-
input1:
5-
class: File
6-
path: test-data/2.fastq
3+
job: seqtk_seq_job.json
74
outputs:
85
output1:
96
path: test-data/2.fasta

0 commit comments

Comments
 (0)