forked from DataBiosphere/toil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance cwltoil to support SoftwareRequirements & BioContainers.
This enables the reproducibilty stack described in [this preprint](https://www.biorxiv.org/content/early/2017/10/11/200683) and [presented at BOSC 2017](http://jmchilton.github.io/writing/bosc2017slides/biocontainers.html) under Toil. Concretely this enables all the same options in cwltoil as added to cwltool in common-workflow-language/cwltool#214 including `` --beta-conda-dependencies``, ``--beta-dependency-resolvers-configuration``, and ``--beta-use-biocontainers``. The first two of these are documented in depth in cwltool's README (https://github.com/common-workflow-language/cwltool/#leveraging-softwarerequirements-beta). Here I will quickly review a couple of the available options against test examples available in cwltool's ``tests`` directory using this branch of Toil. ``` git clone https://github.com/common-workflow-language/cwltool.git cd cwltool ``` From here we can quickly demonstrate installation and resolution of CWL ``SoftwareRequirement`` hints using Conda using the tests/seqtk_seq.cwl tool. This tool doesn't define an explicit ``DockerRequirement`` but does define the following ``SoftwareRequirement`` in its ``hints`` as follows: ``` hints: SoftwareRequirement: packages: - package: seqtk version: - r93 ``` We can try this tool out with ``cwltoil`` and see that by default we probably don't have the binary seqtk on our ``PATH`` and so the tool fails using the following command: ``` cwltoil tests/seqtk_seq.cwl tests/seqtk_seq_job.json ``` This should result in a tool execution failure. We can then instruct ``cwltoil`` to install the required package from Bioconda into an isolated environment and use it as needed by passing it the ``--beta-conda-dependencies`` flag as follows: ``` cwltoil --beta-conda-dependencies tests/seqtk_seq.cwl tests/seqtk_seq_job.json ``` The tool should now be successful. The Conda support can be endless tweaked but the defaults are defaults that target the best practice Conda channels that work well for the Galaxy project. Additional ``SoftwareRequirement`` resolution options are available including targetting Software Modules, lmod, Homebrew, simple scripts called "Galaxy packages". All of these options can be specified and configured with a YAML file passed to cwltoil using the ``--beta-dependency-resolvers-configuration`` option instead of the simple shortcut ``--beta-conda-dependencies``. The cwltool documentation walks through a few examples of adapting infrastructure to tools and tools to package managers. Reference documentation is available in [galaxy-lib's documentation](http://galaxy-lib.readthedocs.io/en/latest/topics/dependency_resolution.html). In addition to options that allow configuring tool execution environments, containers themselves can be discovered and/or built from these software requirements. The [Biocontainers](https://github.com/BioContainers) project (previously Biodocker) contains a registry we use for this purpose. Every version of every Bioconda package has a corresponding best-practice (very lightweight, very small) Docker container on quay.io. There are over 3000 such containers currently. Continuing with the example above, the new `--beta-use-biocontainers` flag instructs ``cwltoil`` to fetch the corresponding Biocontainers container from quay.io automatically or build one to use locally (required for instance for tools with multiple software requirements - fat tools). ``` cwltoil --beta-use-biocontainers tests/seqtk_seq.cwl tests/seqtk_seq_job.json ``` These containers contain the same binaries that the package would use locally (outside of Docker). Therefore this technique allows cross platform reproducibility/remixability across cwltool, cwltoil, Galaxy, and CLI - both inside and outside of containers.
- Loading branch information
Showing
7 changed files
with
129 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
>Sequence 561 BP; 135 A; 106 C; 98 G; 222 T; 0 other; | ||
gttcgatgcc taaaatacct tcttttgtcc ctacacagac cacagttttc ctaatggctt | ||
tacaccgact agaaattctt gtgcaagcac taattgaaag cggttggcct agagtgttac | ||
cggtttgtat agctgagcgc gtctcttgcc ctgatcaaag gttcattttc tctactttgg | ||
aagacgttgt ggaagaatac aacaagtacg agtctctccc ccctggtttg ctgattactg | ||
gatacagttg taataccctt cgcaacaccg cgtaactatc tatatgaatt attttccctt | ||
tattatatgt agtaggttcg tctttaatct tcctttagca agtcttttac tgttttcgac | ||
ctcaatgttc atgttcttag gttgttttgg ataatatgcg gtcagtttaa tcttcgttgt | ||
ttcttcttaa aatatttatt catggtttaa tttttggttt gtacttgttc aggggccagt | ||
tcattattta ctctgtttgt atacagcagt tcttttattt ttagtatgat tttaatttaa | ||
aacaattcta atggtcaaaa a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@EAS54_6_R1_2_1_413_324 | ||
CCCTTCTTGTCTTCAGCGTTTCTCC | ||
+ | ||
;;3;;;;;;;;;;;;7;;;;;;;88 | ||
@EAS54_6_R1_2_1_540_792 | ||
TTGGCAGGCCAAGGCCGATGGATCA | ||
+ | ||
;;;;;;;;;;;7;;;;;-;;;3;83 | ||
@EAS54_6_R1_2_1_443_348 | ||
GTTGCTTCTGGCGTGGGTGGGGGGG | ||
+EAS54_6_R1_2_1_443_348 | ||
;;;;;;;;;;;9;7;;.7;393333 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cwlVersion: v1.0 | ||
class: CommandLineTool | ||
id: "seqtk_seq" | ||
doc: "Convert to FASTA (seqtk)" | ||
inputs: | ||
- id: input1 | ||
type: File | ||
inputBinding: | ||
position: 1 | ||
prefix: "-a" | ||
outputs: | ||
- id: output1 | ||
type: File | ||
outputBinding: | ||
glob: out | ||
baseCommand: ["seqtk", "seq"] | ||
arguments: [] | ||
stdout: out | ||
hints: | ||
SoftwareRequirement: | ||
packages: | ||
- package: seqtk | ||
version: | ||
- r93 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"input1": { | ||
"class": "File", | ||
"location": "2.fastq" | ||
} | ||
} |