diff --git a/CHANGELOG.md b/CHANGELOG.md index 151b7a41..c89bb9b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# base unreleased +# biobox unreleased ## BREAKING CHANGES @@ -17,6 +17,8 @@ - `busco/busco_list_datasets`: Lists available busco datasets (PR #18). - `busco/busco_download_datasets`: Download busco datasets (PR #19). +* `cutadapt`: Remove adapter sequences from high-throughput sequencing reads (PR #7). + * `featurecounts`: Assign sequence reads to genomic features (PR #11). * `bgzip`: Add bgzip functionality to compress and decompress files (PR #13). @@ -29,7 +31,9 @@ * `multiqc`: Aggregate results from bioinformatics analyses across many samples into a single report (PR #42). -* `star/star_align_reads`: Align reads to a reference genome (PR #22). +* `star`: + - `star/star_align_reads`: Align reads to a reference genome (PR #22). + - `star/star_genome_generate`: Generate a genome index for STAR alignment (PR #58). * `gffread`: Validate, filter, convert and perform other operations on GFF files (PR #29). @@ -50,8 +54,9 @@ * `falco`: A C++ drop-in replacement of FastQC to assess the quality of sequence read data (PR #43). - -## MAJOR CHANGES +* `bedtools`: + - `bedtools_getfasta`: extract sequences from a FASTA file for each of the + intervals defined in a BED/GFF/VCF file (PR #59). ## MINOR CHANGES @@ -61,8 +66,16 @@ * Update to Viash 0.9.0-RC3 (PR #51). +* Update to Viash 0.9.0-RC6 (PR #63). + +* Switch to viash-hub/toolbox actions (PR #64). + ## DOCUMENTATION +* Update README (PR #64). + ## BUG FIXES -* Add escaping character before leading hashtag in the description field of the config file (PR #50). \ No newline at end of file +* Add escaping character before leading hashtag in the description field of the config file (PR #50). + +* Format URL in biobase/bcl_convert description (PR #55). \ No newline at end of file diff --git a/README.md b/README.md index ecf807ca..4b497dcd 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,24 @@ -# Base repository for reusable Viash components -This repository is a collection of reproducible and reusable Viash -components. +# 🌱📦 biobox + +[![ViashHub](https://img.shields.io/badge/ViashHub-biobox-7a4baa.png)](https://web.viash-hub.com/packages/biobox) +[![GitHub](https://img.shields.io/badge/GitHub-viash--hub%2Fbiobox-blue.png)](https://github.com/viash-hub/biobox) +[![GitHub +License](https://img.shields.io/github/license/viash-hub/biobox.png)](https://github.com/viash-hub/biobox/blob/main/LICENSE) +[![GitHub +Issues](https://img.shields.io/github/issues/viash-hub/biobox.png)](https://github.com/viash-hub/biobox/issues) +[![Viash +version](https://img.shields.io/badge/Viash-v0.9.0--RC6-blue)](https://viash.io) + +A collection of bioinformatics tools for working with sequence data. ## Objectives - **Reusability**: Facilitating the use of components across various projects and contexts. -- **Reproducibility**: Guaranteeing that bioinformatics analyses can be - reliably replicated. +- **Reproducibility**: Ensuring that components are reproducible and can + be easily shared. - **Best Practices**: Adhering to established standards in software development and bioinformatics. @@ -43,18 +52,21 @@ contribute a component to this repository. 12. Create test script 13. Create a `/var/software_versions.txt` file -See the [CONTRIBUTING](CONTRIBUTING.md) file for more details. +See the +[CONTRIBUTING](https://github.com/viash-hub/biobox/blob/main/CONTRIBUTING.md) +file for more details. ## Support and Community For support, questions, or to join our community: - **Issues**: Submit questions or issues via the [GitHub issue - tracker](https://github.com/viash-hub/base/issues). + tracker](https://github.com/viash-hub/biobox/issues). - **Discussions**: Join our discussions via [GitHub - Discussions](https://github.com/viash-hub/base/discussions). + Discussions](https://github.com/viash-hub/biobox/discussions). ## License This repository is licensed under an MIT license. See the -[LICENSE](LICENSE) file for details. +[LICENSE](https://github.com/viash-hub/biobox/blob/main/LICENSE) file +for details. diff --git a/README.qmd b/README.qmd index 656cdac7..7d36430b 100644 --- a/README.qmd +++ b/README.qmd @@ -1,14 +1,25 @@ --- -title: Base repository for reusable Viash components format: gfm --- +```{r setup, include=FALSE} +project <- yaml::read_yaml("_viash.yaml") +license <- paste0(project$links$repository, "/blob/main/LICENSE") +contributing <- paste0(project$links$repository, "/blob/main/CONTRIBUTING.md") +``` +# 🌱📦 `r project$name` -This repository is a collection of reproducible and reusable Viash components. +[![ViashHub](https://img.shields.io/badge/ViashHub-`r project$name`-7a4baa)](https://web.viash-hub.com/packages/`r project$name`) +[![GitHub](https://img.shields.io/badge/GitHub-viash--hub%2F`r project$name`-blue)](`r project$links$repository`) +[![GitHub License](https://img.shields.io/github/license/viash-hub/`r project$name`)](`r license`) +[![GitHub Issues](https://img.shields.io/github/issues/viash-hub/`r project$name`)](`r project$links$issue_tracker`) +[![Viash version](https://img.shields.io/badge/Viash-v`r gsub("-", "--", project$viash_version)`-blue)](https://viash.io) + +`r project$description` ## Objectives - **Reusability**: Facilitating the use of components across various projects and contexts. -- **Reproducibility**: Guaranteeing that bioinformatics analyses can be reliably replicated. +- **Reproducibility**: Ensuring that components are reproducible and can be easily shared. - **Best Practices**: Adhering to established standards in software development and bioinformatics. ## Contributing @@ -37,15 +48,15 @@ knitr::asis_output( ) ``` -See the [CONTRIBUTING](CONTRIBUTING.md) file for more details. +See the [CONTRIBUTING](`r contributing`) file for more details. ## Support and Community For support, questions, or to join our community: -- **Issues**: Submit questions or issues via the [GitHub issue tracker](https://github.com/viash-hub/base/issues). -- **Discussions**: Join our discussions via [GitHub Discussions](https://github.com/viash-hub/base/discussions). +- **Issues**: Submit questions or issues via the [GitHub issue tracker](`r project$links$issue_tracker`). +- **Discussions**: Join our discussions via [GitHub Discussions](`r project$links$repository`/discussions). ## License -This repository is licensed under an MIT license. See the [LICENSE](LICENSE) file for details. +This repository is licensed under an MIT license. See the [LICENSE](`r license`) file for details. diff --git a/_viash.yaml b/_viash.yaml index 5b6cf3f7..9b1bc565 100644 --- a/_viash.yaml +++ b/_viash.yaml @@ -1,13 +1,14 @@ name: biobox +version: v0.1.0 description: | A collection of bioinformatics tools for working with sequence data. license: MIT -keywords: [bioinformatics, sequence, alignment, variant calling, dna, rna] +keywords: [bioinformatics, modules, sequencing] links: issue_tracker: https://github.com/viash-hub/biobox/issues - repository: https://github.com/viash-hub/biobbox + repository: https://github.com/viash-hub/biobox -viash_version: 0.9.0-RC3 +viash_version: 0.9.0-RC6 config_mods: | .requirements.commands := ['ps'] diff --git a/nextflow.config b/nextflow.config index c8a15cd3..81cbb18c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -1,6 +1,6 @@ manifest { name = "biobox" - version = "v0.1" + version = "v0.1.0" defaultBranch = "main" nextflowVersion = "!>=20.12.1-edge" } diff --git a/src/bcl_convert/config.vsh.yaml b/src/bcl_convert/config.vsh.yaml index d0cedfa7..657fb1f0 100644 --- a/src/bcl_convert/config.vsh.yaml +++ b/src/bcl_convert/config.vsh.yaml @@ -2,8 +2,8 @@ name: bcl_convert description: | Convert bcl files to fastq files using bcl-convert. Information about upgrading from bcl2fastq via - https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html - and https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html + [Upgrading from bcl2fastq to BCL Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html) + and [BCL Convert Compatible Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html) argument_groups: - name: Input arguments arguments: diff --git a/src/bedtools/bedtools_getfasta/config.vsh.yaml b/src/bedtools/bedtools_getfasta/config.vsh.yaml new file mode 100644 index 00000000..f1f49a87 --- /dev/null +++ b/src/bedtools/bedtools_getfasta/config.vsh.yaml @@ -0,0 +1,103 @@ +name: bedtools_getfasta +namespace: bedtools +description: Extract sequences from a FASTA file for each of the intervals defined in a BED/GFF/VCF file. +keywords: [sequencing, fasta, BED, GFF, VCF] +links: + documentation: https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html + repository: https://github.com/arq5x/bedtools2 +references: + doi: 10.1093/bioinformatics/btq033 +license: GPL-2.0 +requirements: + commands: [bedtools] + +argument_groups: + - name: Input arguments + arguments: + - name: --input_fasta + type: file + description: | + FASTA file containing sequences for each interval specified in the input BED file. + The headers in the input FASTA file must exactly match the chromosome column in the BED file. + - name: "--input_bed" + type: file + description: | + BED file containing intervals to extract from the FASTA file. + BED files containing a single region require a newline character + at the end of the line, otherwise a blank output file is produced. + - name: --rna + type: boolean_true + description: | + The FASTA is RNA not DNA. Reverse complementation handled accordingly. + + - name: Run arguments + arguments: + - name: "--strandedness" + type: boolean_true + alternatives: ["-s"] + description: | + Force strandedness. If the feature occupies the antisense strand, the output sequence will + be reverse complemented. By default strandedness is not taken into account. + + - name: Output arguments + arguments: + - name: --output + alternatives: [-o] + required: true + type: file + direction: output + description: | + Output file where the output from the 'bedtools getfasta' commend will + be written to. + - name: --tab + type: boolean_true + description: | + Report extract sequences in a tab-delimited format instead of in FASTA format. + - name: --bed_out + type: boolean_true + description: | + Report extract sequences in a tab-delimited BED format instead of in FASTA format. + - name: "--name" + type: boolean_true + description: | + Set the FASTA header for each extracted sequence to be the "name" and coordinate columns from the BED feature. + - name: "--name_only" + type: boolean_true + description: | + Set the FASTA header for each extracted sequence to be the "name" columns from the BED feature. + - name: "--split" + type: boolean_true + description: | + When --input is in BED12 format, create a separate fasta entry for each block in a BED12 record, + blocks being described in the 11th and 12th column of the BED. + - name: "--full_header" + type: boolean_true + description: | + Use full fasta header. By default, only the word before the first space or tab is used. + +# Arguments not taken into account: +# +# -fo [Specify an output file name. By default, output goes to stdout. +# + +resources: + - type: bash_script + path: script.sh + +test_resources: + - type: bash_script + path: test.sh + +engines: + - type: docker + image: debian:stable-slim + setup: + - type: apt + packages: [bedtools, procps] + - type: docker + run: | + echo "bedtools: \"$(bedtools --version | sed -n 's/^bedtools //p')\"" > /var/software_versions.txt + +runners: + - type: executable + - type: nextflow diff --git a/src/bedtools/bedtools_getfasta/script.sh b/src/bedtools/bedtools_getfasta/script.sh new file mode 100644 index 00000000..8e88b318 --- /dev/null +++ b/src/bedtools/bedtools_getfasta/script.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -eo pipefail + +unset_if_false=( par_rna par_strandedness par_tab par_bed_out par_name par_name_only par_split par_full_header ) + +for par in ${unset_if_false[@]}; do + test_val="${!par}" + [[ "$test_val" == "false" ]] && unset $par +done + +bedtools getfasta \ + -fi "$par_input_fasta" \ + -bed "$par_input_bed" \ + ${par_rna:+-rna} \ + ${par_name:+-name} \ + ${par_name_only:+-nameOnly} \ + ${par_tab:+-tab} \ + ${par_bed_out:+-bedOut} \ + ${par_strandedness:+-s} \ + ${par_split:+-split} \ + ${par_full_header:+-fullHeader} > "$par_output" + diff --git a/src/bedtools/bedtools_getfasta/test.sh b/src/bedtools/bedtools_getfasta/test.sh new file mode 100644 index 00000000..a28e3a7e --- /dev/null +++ b/src/bedtools/bedtools_getfasta/test.sh @@ -0,0 +1,119 @@ +#!/usr/bin/env bash +set -eo pipefail + +TMPDIR=$(mktemp -d) +function clean_up { + [[ -d "$TMPDIR" ]] && rm -r "$TMPDIR" +} +trap clean_up EXIT + +# Create dummy test fasta file +cat > "$TMPDIR/test.fa" <chr1 +AAAAAAAACCCCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG +EOF + +TAB="$(printf '\t')" + +# Create dummy bed file +cat > "$TMPDIR/test.bed" < "$TMPDIR/expected.fasta" <chr1:5-10 +AAACC +EOF + +"$meta_executable" \ + --input_bed "$TMPDIR/test.bed" \ + --input_fasta "$TMPDIR/test.fa" \ + --output "$TMPDIR/output.fasta" + +cmp --silent "$TMPDIR/output.fasta" "$TMPDIR/expected.fasta" || { echo "files are different:"; exit 1; } + + +# Create expected bed file for --name +cat > "$TMPDIR/expected_with_name.fasta" <myseq::chr1:5-10 +AAACC +EOF + +"$meta_executable" \ + --input_bed "$TMPDIR/test.bed" \ + --input_fasta "$TMPDIR/test.fa" \ + --name \ + --output "$TMPDIR/output_with_name.fasta" + + +cmp --silent "$TMPDIR/output_with_name.fasta" "$TMPDIR/expected_with_name.fasta" || { echo "Files when using --name are different."; exit 1; } + +# Create expected bed file for --name_only +cat > "$TMPDIR/expected_with_name_only.fasta" <myseq +AAACC +EOF + +"$meta_executable" \ + --input_bed "$TMPDIR/test.bed" \ + --input_fasta "$TMPDIR/test.fa" \ + --name_only \ + --output "$TMPDIR/output_with_name_only.fasta" + +cmp --silent "$TMPDIR/output_with_name_only.fasta" "$TMPDIR/expected_with_name_only.fasta" || { echo "Files when using --name_only are different."; exit 1; } + + +# Create expected tab-delimited file for --tab +cat > "$TMPDIR/expected_tab.out" < "$TMPDIR/expected.bed" < "$TMPDIR/test_strandedness.bed" < "$TMPDIR/expected_strandedness.fasta" <forward(+) +CGCTA +>reverse(-) +TAGCG +EOF + +"$meta_executable" \ + --input_bed "$TMPDIR/test_strandedness.bed" \ + --input_fasta "$TMPDIR/test.fa" \ + -s \ + --name_only \ + --output "$TMPDIR/output_strandedness.fasta" + + +cmp --silent "$TMPDIR/expected_strandedness.fasta" "$TMPDIR/output_strandedness.fasta" || { echo "Files when using -s are different."; exit 1; } + diff --git a/src/bgzip/config.vsh.yaml b/src/bgzip/config.vsh.yaml deleted file mode 100644 index 26e31ae4..00000000 --- a/src/bgzip/config.vsh.yaml +++ /dev/null @@ -1,128 +0,0 @@ -name: bgzip -description: Block compression/decompression utility -links: - homepage: https://www.htslib.org/ - documentation: https://www.htslib.org/doc/bgzip.html - repository: https://github.com/samtools/htslib -references: - doi: 10.1093/gigascience/giab007 -license: MIT -requirements: - commands: [ bgzip ] -argument_groups: - - name: Inputs - arguments: - - name: --input - type: file - direction: input - description: file to be compressed or decompressed - required: true - - name: Outputs - arguments: - - name: --output - type: file - direction: output - description: compressed or decompressed output - required: true - - name: --index_name - alternatives: -I - type: file - direction: output - description: name of BGZF index file [file.gz.gzi] - - name: Arguments - arguments: - - name: --offset - alternatives: -b - type: integer - description: decompress at virtual file pointer (0-based uncompressed offset) - - name: --decompress - alternatives: -d - type: boolean_true - description: decompress the input file - - name: --rebgzip - alternatives: -g - type: boolean_true - description: use an index file to bgzip a file - - name: --index - alternatives: -i - type: boolean_true - description: compress and create BGZF index - - name: --compress_level - alternatives: -l - type: integer - description: compression level to use when compressing; 0 to 9, or -1 for default [-1] - min: -1 - max: 9 - - name: --reindex - alternatives: -r - type: boolean_true - description: (re)index the output file - - name: --size - alternatives: -s - type: integer - description: decompress INT bytes (uncompressed size) - min: 0 - - name: --test - alternatives: -t - type: boolean_true - description: test integrity of compressed file - - name: --binary - type: boolean_true - description: Don't align blocks with text lines -resources: - - type: bash_script - text: | - [[ "$par_decompress" == "false" ]] && unset par_decompress - [[ "$par_rebgzip" == "false" ]] && unset par_rebgzip - [[ "$par_index" == "false" ]] && unset par_index - [[ "$par_reindex" == "false" ]] && unset par_reindex - [[ "$par_test" == "false" ]] && unset par_test - [[ "$par_binary" == "false" ]] && unset par_binary - bgzip -c \ - ${meta_cpus:+--threads "${meta_cpus}"} \ - ${par_offset:+-b "${par_offset}"} \ - ${par_decompress:+-d} \ - ${par_rebgzip:+-g} \ - ${par_index:+-i} \ - ${par_index_name:+-I "${par_index_name}"} \ - ${par_compress_level:+-l "${par_compress_level}"} \ - ${par_reindex:+-r} \ - ${par_size:+-s "${par_size}"} \ - ${par_test:+-t} \ - ${par_binary:+--binary} \ - "$par_input" > "$par_output" -test_resources: - - type: bash_script - text: | - set -e - - "$meta_executable" --input "$meta_resources_dir/test_data/test.vcf" --output "test.vcf.gz" - - echo ">> Checking output of compressing" - [ ! -f "test.vcf.gz" ] && echo "Output file test.vcf.gz does not exist" && exit 1 - - "$meta_executable" --input "test.vcf.gz" --output "test.vcf" --decompress - - echo ">> Checking output of decompressing" - [ ! -f "test.vcf" ] && echo "Output file test.vcf does not exist" && exit 1 - - echo ">> Checking original and decompressed files are the same" - set +e - cmp --silent -- "$meta_resources_dir/test_data/test.vcf" "test.vcf" - [ $? -ne 0 ] && echo "files are different" && exit 1 - set -e - - echo "> Test successful" - - type: file - path: test_data - -engines: - - type: docker - image: quay.io/biocontainers/htslib:1.19--h81da01d_0 - setup: - - type: docker - run: | - bgzip -h | grep 'Version:' 2>&1 | sed 's/Version:\s\(.*\)/bgzip: "\1"/' > /var/software_versions.txt -runners: - - type: executable - - type: nextflow \ No newline at end of file diff --git a/src/bgzip/help.txt b/src/bgzip/help.txt deleted file mode 100644 index d4012efd..00000000 --- a/src/bgzip/help.txt +++ /dev/null @@ -1,22 +0,0 @@ -```bash -bgzip -h -``` - -Version: 1.19 -Usage: bgzip [OPTIONS] [FILE] ... -Options: - -b, --offset INT decompress at virtual file pointer (0-based uncompressed offset) - -c, --stdout write on standard output, keep original files unchanged - -d, --decompress decompress - -f, --force overwrite files without asking - -g, --rebgzip use an index file to bgzip a file - -h, --help give this help - -i, --index compress and create BGZF index - -I, --index-name FILE name of BGZF index file [file.gz.gzi] - -k, --keep don't delete input files during operation - -l, --compress-level INT Compression level to use when compressing; 0 to 9, or -1 for default [-1] - -r, --reindex (re)index compressed file - -s, --size INT decompress INT bytes (uncompressed size) - -t, --test test integrity of compressed file - --binary Don't align blocks with text lines - -@, --threads INT number of compression threads to use [1] diff --git a/src/bgzip/test_data/script.sh b/src/bgzip/test_data/script.sh deleted file mode 100644 index c9114473..00000000 --- a/src/bgzip/test_data/script.sh +++ /dev/null @@ -1,10 +0,0 @@ -# bgzip test data - -# Test data was obtained from https://github.com/snakemake/snakemake-wrappers/tree/master/bio/bgzip/test. - -if [ ! -d /tmp/snakemake-wrappers ]; then - git clone --depth 1 --single-branch --branch master https://github.com/snakemake/snakemake-wrappers /tmp/snakemake-wrappers -fi - -cp -r /tmp/snakemake-wrappers/bio/bgzip/test/* src/bgzip/test_data - diff --git a/src/bgzip/test_data/test.vcf b/src/bgzip/test_data/test.vcf deleted file mode 100644 index 11b5400e..00000000 --- a/src/bgzip/test_data/test.vcf +++ /dev/null @@ -1,23 +0,0 @@ -##fileformat=VCFv4.0 -##fileDate=20090805 -##source=https://www.internationalgenome.org/wiki/Analysis/vcf4.0/ -##reference=1000GenomesPilot-NCBI36 -##phasing=partial -##INFO= -##INFO= -##INFO= -##INFO= -##INFO= -##INFO= -##FILTER= -##FILTER= -##FORMAT= -##FORMAT= -##FORMAT= -##FORMAT= -#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003 -20 14370 rs6054257 G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51 1/1:43:5:.,. -20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50 0|1:3:5:65,3 0/0:41:3 -20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4 -20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60 0|0:48:4:51,51 0/0:61:2 -20 1234567 microsat1 GTCT G,GTACT 50 PASS NS=3;DP=9;AA=G GT:GQ:DP 0/1:35:4 0/2:17:2 1/1:40:3 diff --git a/src/cutadapt/config.vsh.yaml b/src/cutadapt/config.vsh.yaml new file mode 100644 index 00000000..a62f0aa9 --- /dev/null +++ b/src/cutadapt/config.vsh.yaml @@ -0,0 +1,463 @@ +name: cutadapt +description: | + Cutadapt removes adapter sequences from high-throughput sequencing reads. +keywords: [RNA-seq, scRNA-seq, high-throughput] +links: + homepage: https://cutadapt.readthedocs.io + documentation: https://cutadapt.readthedocs.io + repository: https://github.com/marcelm/cutadapt +references: + doi: 10.14806/ej.17.1.200 +license: MIT +argument_groups: + #################################################################### + - name: Specify Adapters for R1 + arguments: + - name: --adapter + alternatives: [-a] + type: string + multiple: true + description: | + Sequence of an adapter ligated to the 3' end (paired data: + of the first read). The adapter and subsequent bases are + trimmed. If a '$' character is appended ('anchoring'), the + adapter is only found if it is a suffix of the read. + required: false + - name: --front + alternatives: [-g] + type: string + multiple: true + description: | + Sequence of an adapter ligated to the 5' end (paired data: + of the first read). The adapter and any preceding bases + are trimmed. Partial matches at the 5' end are allowed. If + a '^' character is prepended ('anchoring'), the adapter is + only found if it is a prefix of the read. + required: false + - name: --anywhere + alternatives: [-b] + type: string + multiple: true + description: | + Sequence of an adapter that may be ligated to the 5' or 3' + end (paired data: of the first read). Both types of + matches as described under -a and -g are allowed. If the + first base of the read is part of the match, the behavior + is as with -g, otherwise as with -a. This option is mostly + for rescuing failed library preparations - do not use if + you know which end your adapter was ligated to! + required: false + + #################################################################### + - name: Specify Adapters using Fasta files for R1 + arguments: + - name: --adapter_fasta + type: file + multiple: true + description: | + Fasta file containing sequences of an adapter ligated to the 3' end (paired data: + of the first read). The adapter and subsequent bases are + trimmed. If a '$' character is appended ('anchoring'), the + adapter is only found if it is a suffix of the read. + required: false + - name: --front_fasta + type: file + description: | + Fasta file containing sequences of an adapter ligated to the 5' end (paired data: + of the first read). The adapter and any preceding bases + are trimmed. Partial matches at the 5' end are allowed. If + a '^' character is prepended ('anchoring'), the adapter is + only found if it is a prefix of the read. + required: false + - name: --anywhere_fasta + type: file + description: | + Fasta file containing sequences of an adapter that may be ligated to the 5' or 3' + end (paired data: of the first read). Both types of + matches as described under -a and -g are allowed. If the + first base of the read is part of the match, the behavior + is as with -g, otherwise as with -a. This option is mostly + for rescuing failed library preparations - do not use if + you know which end your adapter was ligated to! + required: false + + #################################################################### + - name: Specify Adapters for R2 + arguments: + - name: --adapter_r2 + alternatives: [-A] + type: string + multiple: true + description: | + Sequence of an adapter ligated to the 3' end (paired data: + of the first read). The adapter and subsequent bases are + trimmed. If a '$' character is appended ('anchoring'), the + adapter is only found if it is a suffix of the read. + required: false + - name: --front_r2 + alternatives: [-G] + type: string + multiple: true + description: | + Sequence of an adapter ligated to the 5' end (paired data: + of the first read). The adapter and any preceding bases + are trimmed. Partial matches at the 5' end are allowed. If + a '^' character is prepended ('anchoring'), the adapter is + only found if it is a prefix of the read. + required: false + - name: --anywhere_r2 + alternatives: [-B] + type: string + multiple: true + description: | + Sequence of an adapter that may be ligated to the 5' or 3' + end (paired data: of the first read). Both types of + matches as described under -a and -g are allowed. If the + first base of the read is part of the match, the behavior + is as with -g, otherwise as with -a. This option is mostly + for rescuing failed library preparations - do not use if + you know which end your adapter was ligated to! + required: false + + #################################################################### + - name: Specify Adapters using Fasta files for R2 + arguments: + - name: --adapter_r2_fasta + type: file + description: | + Fasta file containing sequences of an adapter ligated to the 3' end (paired data: + of the first read). The adapter and subsequent bases are + trimmed. If a '$' character is appended ('anchoring'), the + adapter is only found if it is a suffix of the read. + required: false + - name: --front_r2_fasta + type: file + description: | + Fasta file containing sequences of an adapter ligated to the 5' end (paired data: + of the first read). The adapter and any preceding bases + are trimmed. Partial matches at the 5' end are allowed. If + a '^' character is prepended ('anchoring'), the adapter is + only found if it is a prefix of the read. + required: false + - name: --anywhere_r2_fasta + type: file + description: | + Fasta file containing sequences of an adapter that may be ligated to the 5' or 3' + end (paired data: of the first read). Both types of + matches as described under -a and -g are allowed. If the + first base of the read is part of the match, the behavior + is as with -g, otherwise as with -a. This option is mostly + for rescuing failed library preparations - do not use if + you know which end your adapter was ligated to! + required: false + + #################################################################### + - name: Paired-end options + arguments: + - name: --pair_adapters + type: boolean_true + description: | + Treat adapters given with -a/-A etc. as pairs. Either both + or none are removed from each read pair. + - name: --pair_filter + type: string + choices: [any, both, first] + description: | + Which of the reads in a paired-end read have to match the + filtering criterion in order for the pair to be filtered. + - name: --interleaved + type: boolean_true + description: | + Read and/or write interleaved paired-end reads. + + #################################################################### + - name: Input parameters + arguments: + - name: --input + type: file + required: true + description: | + Input fastq file for single-end reads or R1 for paired-end reads. + - name: --input_r2 + type: file + required: false + description: | + Input fastq file for R2 in the case of paired-end reads. + - name: --error_rate + alternatives: [-E, --errors] + type: double + description: | + Maximum allowed error rate (if 0 <= E < 1), or absolute + number of errors for full-length adapter match (if E is an + integer >= 1). Error rate = no. of errors divided by + length of matching region. Default: 0.1 (10%). + example: 0.1 + - name: --no_indels + type: boolean_false + description: | + Allow only mismatches in alignments. + + - name: --times + type: integer + alternatives: [-n] + description: | + Remove up to COUNT adapters from each read. Default: 1. + example: 1 + - name: --overlap + alternatives: [-O] + type: integer + description: | + Require MINLENGTH overlap between read and adapter for an + adapter to be found. The default is 3. + example: 3 + - name: --match_read_wildcards + type: boolean_true + description: | + Interpret IUPAC wildcards in reads. + - name: --no_match_adapter_wildcards + type: boolean_false + description: | + Do not interpret IUPAC wildcards in adapters. + - name: --action + type: string + choices: + - trim + - retain + - mask + - lowercase + - none + description: | + What to do if a match was found. trim: trim adapter and + up- or downstream sequence; retain: trim, but retain + adapter; mask: replace with 'N' characters; lowercase: + convert to lowercase; none: leave unchanged. + The default is trim. + example: trim + - name: --revcomp + alternatives: [--rc] + type: boolean_true + description: | + Check both the read and its reverse complement for adapter + matches. If match is on reverse-complemented version, + output that one. + + #################################################################### + - name: Read modifications + arguments: + - name: --cut + alternatives: [-u] + type: integer + multiple: true + description: | + Remove LEN bases from each read (or R1 if paired; use --cut_r2 + option for R2). If LEN is positive, remove bases from the + beginning. If LEN is negative, remove bases from the end. + Can be used twice if LENs have different signs. Applied + *before* adapter trimming. + - name: --cut_r2 + type: integer + multiple: true + description: | + Remove LEN bases from each read (for R2). If LEN is positive, remove bases from the + beginning. If LEN is negative, remove bases from the end. + Can be used twice if LENs have different signs. Applied + *before* adapter trimming. + - name: --nextseq_trim + type: string + description: | + NextSeq-specific quality trimming (each read). Trims also + dark cycles appearing as high-quality G bases. + - name: --quality_cutoff + alternatives: [-q] + type: string + description: | + Trim low-quality bases from 5' and/or 3' ends of each read + before adapter removal. Applied to both reads if data is + paired. If one value is given, only the 3' end is trimmed. + If two comma-separated cutoffs are given, the 5' end is + trimmed with the first cutoff, the 3' end with the second. + - name: --quality_cutoff_r2 + alternatives: [-Q] + type: string + description: | + Quality-trimming cutoff for R2. Default: same as for R1 + - name: --quality_base + type: integer + description: | + Assume that quality values in FASTQ are encoded as + ascii(quality + N). This needs to be set to 64 for some + old Illumina FASTQ files. The default is 33. + example: 33 + - name: --poly_a + type: boolean_true + description: Trim poly-A tails + - name: --length + alternatives: [-l] + type: integer + description: | + Shorten reads to LENGTH. Positive values remove bases at + the end while negative ones remove bases at the beginning. + This and the following modifications are applied after + adapter trimming. + - name: --trim_n + type: boolean_true + description: Trim N's on ends of reads. + - name: --length_tag + type: string + description: | + Search for TAG followed by a decimal number in the + description field of the read. Replace the decimal number + with the correct length of the trimmed read. For example, + use --length-tag 'length=' to correct fields like + 'length=123'. + example: "length=" + - name: --strip_suffix + type: string + description: | + Remove this suffix from read names if present. Can be + given multiple times. + - name: --prefix + alternatives: [-x] + type: string + description: | + Add this prefix to read names. Use {name} to insert the + name of the matching adapter. + - name: --suffix + alternatives: [-y] + type: string + description: | + Add this suffix to read names; can also include {name} + - name: --rename + type: string + description: | + Rename reads using TEMPLATE containing variables such as + {id}, {adapter_name} etc. (see documentation) + - name: --zero_cap + alternatives: [-z] + type: boolean_true + description: Change negative quality values to zero. + + #################################################################### + - name: Filtering of processed reads + description: | + Filters are applied after above read modifications. Paired-end reads are + always discarded pairwise (see also --pair_filter). + arguments: + - name: --minimum_length + alternatives: [-m] + type: string + description: | + Discard reads shorter than LEN. Default is 0. + When trimming paired-end reads, the minimum lengths for R1 and R2 can be specified separately by separating them with a colon (:). + If the colon syntax is not used, the same minimum length applies to both reads, as discussed above. + Also, one of the values can be omitted to impose no restrictions. + For example, with -m 17:, the length of R1 must be at least 17, but the length of R2 is ignored. + example: "0" + - name: --maximum_length + alternatives: [-M] + type: string + description: | + Discard reads longer than LEN. Default: no limit. + For paired reads, see the remark for --minimum_length + - name: --max_n + type: string + description: | + Discard reads with more than COUNT 'N' bases. If COUNT is + a number between 0 and 1, it is interpreted as a fraction + of the read length. + - name: --max_expected_errors + alternatives: [--max_ee] + type: long + description: | + Discard reads whose expected number of errors (computed + from quality values) exceeds ERRORS. + - name: --max_average_error_rate + alternatives: [--max_aer] + type: long + description: | + as --max_expected_errors (see above), but divided by + length to account for reads of varying length. + - name: --discard_trimmed + alternatives: [--discard] + type: boolean_true + description: | + Discard reads that contain an adapter. Use also -O to + avoid discarding too many randomly matching reads. + - name: --discard_untrimmed + alternatives: [--trimmed_only] + type: boolean_true + description: | + Discard reads that do not contain an adapter. + - name: --discard_casava + type: boolean_true + description: | + Discard reads that did not pass CASAVA filtering (header + has :Y:). + + #################################################################### + - name: Output parameters + arguments: + - name: --report + type: string + choices: [full, minimal] + description: | + Which type of report to print: 'full' (default) or 'minimal'. + example: full + - name: --json + type: boolean_true + description: | + Write report in JSON format to this file. + - name: --output + type: file + description: | + Glob pattern for matching the expected output files. + Should include `$output_dir`. + example: "fastq/*_001.fast[a,q]" + direction: output + required: true + must_exist: true + multiple: true + - name: --fasta + type: boolean_true + description: | + Output FASTA to standard output even on FASTQ input. + - name: --info_file + type: boolean_true + description: | + Write information about each read and its adapter matches + into info.txt in the output directory. + See the documentation for the file format. + # - name: -Z + # - name: --rest_file + # - name: --wildcard-file + # - name: --too_short_output + # - name: --too_long_output + # - name: --untrimmed_output + # - name: --untrimmed_paired_output + # - name: too_short_paired_output + # - name: too_long_paired_output + - name: Debug + arguments: + - type: boolean_true + name: --debug + description: Print debug information +resources: + - type: bash_script + path: script.sh +test_resources: + - type: bash_script + path: test.sh + +engines: + - type: docker + image: python:3.12 + setup: + - type: python + pip: + - cutadapt + - type: docker + run: | + cutadapt --version | sed 's/\(.*\)/cutadapt: "\1"/' > /var/software_versions.txt +runners: + - type: executable + - type: nextflow diff --git a/src/cutadapt/help.txt b/src/cutadapt/help.txt new file mode 100644 index 00000000..2280c3e2 --- /dev/null +++ b/src/cutadapt/help.txt @@ -0,0 +1,218 @@ +cutadapt version 4.6 + +Copyright (C) 2010 Marcel Martin and contributors + +Cutadapt removes adapter sequences from high-throughput sequencing reads. + +Usage: + cutadapt -a ADAPTER [options] [-o output.fastq] input.fastq + +For paired-end reads: + cutadapt -a ADAPT1 -A ADAPT2 [options] -o out1.fastq -p out2.fastq in1.fastq in2.fastq + +Replace "ADAPTER" with the actual sequence of your 3' adapter. IUPAC wildcard +characters are supported. All reads from input.fastq will be written to +output.fastq with the adapter sequence removed. Adapter matching is +error-tolerant. Multiple adapter sequences can be given (use further -a +options), but only the best-matching adapter will be removed. + +Input may also be in FASTA format. Compressed input and output is supported and +auto-detected from the file name (.gz, .xz, .bz2). Use the file name '-' for +standard input/output. Without the -o option, output is sent to standard output. + +Citation: + +Marcel Martin. Cutadapt removes adapter sequences from high-throughput +sequencing reads. EMBnet.Journal, 17(1):10-12, May 2011. +http://dx.doi.org/10.14806/ej.17.1.200 + +Run "cutadapt --help" to see all command-line options. +See https://cutadapt.readthedocs.io/ for full documentation. + +Options: + -h, --help Show this help message and exit + --version Show version number and exit + --debug Print debug log. Use twice to also print DP matrices + -j CORES, --cores CORES + Number of CPU cores to use. Use 0 to auto-detect. Default: + 1 + +Finding adapters: + Parameters -a, -g, -b specify adapters to be removed from each read (or from + R1 if data is paired-end. If specified multiple times, only the best matching + adapter is trimmed (but see the --times option). Use notation 'file:FILE' to + read adapter sequences from a FASTA file. + + -a ADAPTER, --adapter ADAPTER + Sequence of an adapter ligated to the 3' end (paired data: + of the first read). The adapter and subsequent bases are + trimmed. If a '$' character is appended ('anchoring'), the + adapter is only found if it is a suffix of the read. + -g ADAPTER, --front ADAPTER + Sequence of an adapter ligated to the 5' end (paired data: + of the first read). The adapter and any preceding bases + are trimmed. Partial matches at the 5' end are allowed. If + a '^' character is prepended ('anchoring'), the adapter is + only found if it is a prefix of the read. + -b ADAPTER, --anywhere ADAPTER + Sequence of an adapter that may be ligated to the 5' or 3' + end (paired data: of the first read). Both types of + matches as described under -a and -g are allowed. If the + first base of the read is part of the match, the behavior + is as with -g, otherwise as with -a. This option is mostly + for rescuing failed library preparations - do not use if + you know which end your adapter was ligated to! + -e E, --error-rate E, --errors E + Maximum allowed error rate (if 0 <= E < 1), or absolute + number of errors for full-length adapter match (if E is an + integer >= 1). Error rate = no. of errors divided by + length of matching region. Default: 0.1 (10%) + --no-indels Allow only mismatches in alignments. Default: allow both + mismatches and indels + -n COUNT, --times COUNT + Remove up to COUNT adapters from each read. Default: 1 + -O MINLENGTH, --overlap MINLENGTH + Require MINLENGTH overlap between read and adapter for an + adapter to be found. Default: 3 + --match-read-wildcards + Interpret IUPAC wildcards in reads. Default: False + -N, --no-match-adapter-wildcards + Do not interpret IUPAC wildcards in adapters. + --action {trim,retain,mask,lowercase,none} + What to do if a match was found. trim: trim adapter and + up- or downstream sequence; retain: trim, but retain + adapter; mask: replace with 'N' characters; lowercase: + convert to lowercase; none: leave unchanged. Default: trim + --rc, --revcomp Check both the read and its reverse complement for adapter + matches. If match is on reverse-complemented version, + output that one. Default: check only read + +Additional read modifications: + -u LEN, --cut LEN Remove LEN bases from each read (or R1 if paired; use -U + option for R2). If LEN is positive, remove bases from the + beginning. If LEN is negative, remove bases from the end. + Can be used twice if LENs have different signs. Applied + *before* adapter trimming. + --nextseq-trim 3'CUTOFF + NextSeq-specific quality trimming (each read). Trims also + dark cycles appearing as high-quality G bases. + -q [5'CUTOFF,]3'CUTOFF, --quality-cutoff [5'CUTOFF,]3'CUTOFF + Trim low-quality bases from 5' and/or 3' ends of each read + before adapter removal. Applied to both reads if data is + paired. If one value is given, only the 3' end is trimmed. + If two comma-separated cutoffs are given, the 5' end is + trimmed with the first cutoff, the 3' end with the second. + --quality-base N Assume that quality values in FASTQ are encoded as + ascii(quality + N). This needs to be set to 64 for some + old Illumina FASTQ files. Default: 33 + --poly-a Trim poly-A tails + --length LENGTH, -l LENGTH + Shorten reads to LENGTH. Positive values remove bases at + the end while negative ones remove bases at the beginning. + This and the following modifications are applied after + adapter trimming. + --trim-n Trim N's on ends of reads. + --length-tag TAG Search for TAG followed by a decimal number in the + description field of the read. Replace the decimal number + with the correct length of the trimmed read. For example, + use --length-tag 'length=' to correct fields like + 'length=123'. + --strip-suffix STRIP_SUFFIX + Remove this suffix from read names if present. Can be + given multiple times. + -x PREFIX, --prefix PREFIX + Add this prefix to read names. Use {name} to insert the + name of the matching adapter. + -y SUFFIX, --suffix SUFFIX + Add this suffix to read names; can also include {name} + --rename TEMPLATE Rename reads using TEMPLATE containing variables such as + {id}, {adapter_name} etc. (see documentation) + --zero-cap, -z Change negative quality values to zero. + +Filtering of processed reads: + Filters are applied after above read modifications. Paired-end reads are + always discarded pairwise (see also --pair-filter). + + -m LEN[:LEN2], --minimum-length LEN[:LEN2] + Discard reads shorter than LEN. Default: 0 + -M LEN[:LEN2], --maximum-length LEN[:LEN2] + Discard reads longer than LEN. Default: no limit + --max-n COUNT Discard reads with more than COUNT 'N' bases. If COUNT is + a number between 0 and 1, it is interpreted as a fraction + of the read length. + --max-expected-errors ERRORS, --max-ee ERRORS + Discard reads whose expected number of errors (computed + from quality values) exceeds ERRORS. + --max-average-error-rate ERROR_RATE, --max-aer ERROR_RATE + as --max-expected-errors (see above), but divided by + length to account for reads of varying length. + --discard-trimmed, --discard + Discard reads that contain an adapter. Use also -O to + avoid discarding too many randomly matching reads. + --discard-untrimmed, --trimmed-only + Discard reads that do not contain an adapter. + --discard-casava Discard reads that did not pass CASAVA filtering (header + has :Y:). + +Output: + --quiet Print only error messages. + --report {full,minimal} + Which type of report to print: 'full' or 'minimal'. + Default: full + --json FILE Dump report in JSON format to FILE + -o FILE, --output FILE + Write trimmed reads to FILE. FASTQ or FASTA format is + chosen depending on input. Summary report is sent to + standard output. Use '{name}' for demultiplexing (see + docs). Default: write to standard output + --fasta Output FASTA to standard output even on FASTQ input. + -Z Use compression level 1 for gzipped output files (faster, + but uses more space) + --info-file FILE Write information about each read and its adapter matches + into FILE. See the documentation for the file format. + -r FILE, --rest-file FILE + When the adapter matches in the middle of a read, write + the rest (after the adapter) to FILE. + --wildcard-file FILE When the adapter has N wildcard bases, write adapter bases + matching wildcard positions to FILE. (Inaccurate with + indels.) + --too-short-output FILE + Write reads that are too short (according to length + specified by -m) to FILE. Default: discard reads + --too-long-output FILE + Write reads that are too long (according to length + specified by -M) to FILE. Default: discard reads + --untrimmed-output FILE + Write reads that do not contain any adapter to FILE. + Default: output to same file as trimmed reads + +Paired-end options: + The -A/-G/-B/-U/-Q options work like their lowercase counterparts, but are + applied to R2 (second read in pair) + + -A ADAPTER 3' adapter to be removed from R2 + -G ADAPTER 5' adapter to be removed from R2 + -B ADAPTER 5'/3 adapter to be removed from R2 + -U LENGTH Remove LENGTH bases from R2 + -Q [5'CUTOFF,]3'CUTOFF + Quality-trimming cutoff for R2. Default: same as for R1 + -p FILE, --paired-output FILE + Write R2 to FILE. + --pair-adapters Treat adapters given with -a/-A etc. as pairs. Either both + or none are removed from each read pair. + --pair-filter {any,both,first} + Which of the reads in a paired-end read have to match the + filtering criterion in order for the pair to be filtered. + Default: any + --interleaved Read and/or write interleaved paired-end reads. + --untrimmed-paired-output FILE + Write second read in a pair to this FILE when no adapter + was found. Use with --untrimmed-output. Default: output to + same file as trimmed reads + --too-short-paired-output FILE + Write second read in a pair to this file if pair is too + short. + --too-long-paired-output FILE + Write second read in a pair to this file if pair is too + long. + diff --git a/src/cutadapt/script.sh b/src/cutadapt/script.sh new file mode 100644 index 00000000..5e1f9e30 --- /dev/null +++ b/src/cutadapt/script.sh @@ -0,0 +1,237 @@ +#!/bin/bash + +## VIASH START +par_adapter='AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC;GGATCGGAAGAGCACACGTCTGAACTCCAGTCAC' +par_input='src/cutadapt/test_data/se/a.fastq' +par_report='full' +par_json='false' +par_fasta='false' +par_info_file='false' +par_debug='true' +## VIASH END + +function debug { + [[ "$par_debug" == "true" ]] && echo "DEBUG: $@" +} + +output_dir=$(dirname $par_output) +[[ ! -d $output_dir ]] && mkdir -p $output_dir + +# Init +########################################################### + +echo ">> Paired-end data or not?" + +mode="" +if [[ -z $par_input_r2 ]]; then + mode="se" + echo " Single end" + input="$par_input" +else + echo " Paired end" + mode="pe" + input="$par_input $par_input_r2" +fi + +# Adapter arguments +# - paired and single-end +# - string and fasta +########################################################### + +function add_flags { + local arg=$1 + local flag=$2 + local prefix=$3 + [[ -z $prefix ]] && prefix="" + + # This function should not be called if the input is empty + # but check for it just in case + if [[ -z $arg ]]; then + return + fi + + local output="" + IFS=';' read -r -a array <<< "$arg" + for a in "${array[@]}"; do + output="$output $flag $prefix$a" + done + echo $output +} + +debug ">> Parsing arguments dealing with adapters" +adapter_args=$(echo \ + ${par_adapter:+$(add_flags "$par_adapter" "--adapter")} \ + ${par_adapter_fasta:+$(add_flags "$par_adapter_fasta" "--adapter" "file:")} \ + ${par_front:+$(add_flags "$par_front" "--front")} \ + ${par_front_fasta:+$(add_flags "$par_front_fasta" "--front" "file:")} \ + ${par_anywhere:+$(add_flags "$par_anywhere" "--anywhere")} \ + ${par_anywhere_fasta:+$(add_flags "$par_anywhere_fasta" "--anywhere" "file:")} \ + ${par_adapter_r2:+$(add_flags "$par_adapter_r2" "-A")} \ + ${par_adapter_fasta_r2:+$(add_flags "$par_adapter_fasta_r2" "-A" "file:")} \ + ${par_front_r2:+$(add_flags "$par_front_r2" "-G")} \ + ${par_front_fasta_r2:+$(add_flags "$par_front_fasta_r2" "-G" "file:")} \ + ${par_anywhere_r2:+$(add_flags "$par_anywhere_r2" "-B")} \ + ${par_anywhere_fasta_r2:+$(add_flags "$par_anywhere_fasta_r2" "-B" "file:")} \ +) + +debug "Arguments to cutadapt:" +debug "$adapter_args" +debug + +# Paired-end options +########################################################### +echo ">> Parsing arguments for paired-end reads" +[[ "$par_pair_adapters" == "false" ]] && unset par_pair_adapters +[[ "$par_interleaved" == "false" ]] && unset par_interleaved + +paired_args=$(echo \ + ${par_pair_adapters:+--pair-adapters} \ + ${par_pair_filter:+--pair-filter "${par_pair_filter}"} \ + ${par_interleaved:+--interleaved} +) +debug "Arguments to cutadapt:" +debug $paired_args +debug + +# Input arguments +########################################################### +echo ">> Parsing input arguments" +[[ "$par_no_indels" == "true" ]] && unset par_no_indels +[[ "$par_match_read_wildcards" == "false" ]] && unset par_match_read_wildcards +[[ "$par_no_match_adapter_wildcards" == "true" ]] && unset par_no_match_adapter_wildcards +[[ "$par_revcomp" == "false" ]] && unset par_revcomp + +input_args=$(echo \ + ${par_error_rate:+--error-rate "${par_error_rate}"} \ + ${par_no_indels:+--no-indels} \ + ${par_times:+--times "${par_times}"} \ + ${par_overlap:+--overlap "${par_overlap}"} \ + ${par_match_read_wildcards:+--match-read-wildcards} \ + ${par_no_match_adapter_wildcards:+--no-match-adapter-wildcards} \ + ${par_action:+--action "${par_action}"} \ + ${par_revcomp:+--revcomp} \ +) +debug "Arguments to cutadapt:" +debug $input_args +debug + +# Read modifications +########################################################### +echo ">> Parsing read modification arguments" +[[ "$par_poly_a" == "false" ]] && unset par_poly_a +[[ "$par_trim_n" == "false" ]] && unset par_trim_n +[[ "$par_zero_cap" == "false" ]] && unset par_zero_cap + +mod_args=$(echo \ + ${par_cut:+--cut "${par_cut}"} \ + ${par_cut_r2:+--cut_r2 "${par_cut_r2}"} \ + ${par_nextseq_trim:+--nextseq-trim "${par_nextseq_trim}"} \ + ${par_quality_cutoff:+--quality-cutoff "${par_quality_cutoff}"} \ + ${par_quality_cutoff_r2:+--quality-cutoff_r2 "${par_quality_cutoff_r2}"} \ + ${par_quality_base:+--quality-base "${par_quality_base}"} \ + ${par_poly_a:+--poly-a} \ + ${par_length:+--length "${par_length}"} \ + ${par_trim_n:+--trim-n} \ + ${par_length_tag:+--length-tag "${par_length_tag}"} \ + ${par_strip_suffix:+--strip-suffix "${par_strip_suffix}"} \ + ${par_prefix:+--prefix "${par_prefix}"} \ + ${par_suffix:+--suffix "${par_suffix}"} \ + ${par_rename:+--rename "${par_rename}"} \ + ${par_zero_cap:+--zero-cap} \ +) +debug "Arguments to cutadapt:" +debug $mod_args +debug + +# Filtering of processed reads arguments +########################################################### +echo ">> Filtering of processed reads arguments" +[[ "$par_discard_trimmed" == "false" ]] && unset par_discard_trimmed +[[ "$par_discard_untrimmed" == "false" ]] && unset par_discard_untrimmed +[[ "$par_discard_casava" == "false" ]] && unset par_discard_casava + +# Parse and transform the minimum and maximum length arguments +[[ -z $par_minimum_length ]] + +filter_args=$(echo \ + ${par_minimum_length:+--minimum-length "${par_minimum_length}"} \ + ${par_maximum_length:+--maximum-length "${par_maximum_length}"} \ + ${par_max_n:+--max-n "${par_max_n}"} \ + ${par_max_expected_errors:+--max-expected-errors "${par_max_expected_errors}"} \ + ${par_max_average_error_rate:+--max-average-error-rate "${par_max_average_error_rate}"} \ + ${par_discard_trimmed:+--discard-trimmed} \ + ${par_discard_untrimmed:+--discard-untrimmed} \ + ${par_discard_casava:+--discard-casava} \ +) +debug "Arguments to cutadapt:" +debug $filter_args +debug + +# Optional output arguments +########################################################### +echo ">> Optional arguments" +[[ "$par_json" == "false" ]] && unset par_json +[[ "$par_fasta" == "false" ]] && unset par_fasta +[[ "$par_info_file" == "false" ]] && unset par_info_file + +optional_output_args=$(echo \ + ${par_report:+--report "${par_report}"} \ + ${par_json:+--json "report.json"} \ + ${par_fasta:+--fasta} \ + ${par_info_file:+--info-file "info.txt"} \ +) + +debug "Arguments to cutadapt:" +debug $optional_output_args +debug + +# Output arguments +# We write the output to a directory rather than +# individual files. +########################################################### + +if [[ -z $par_fasta ]]; then + ext="fastq" +else + ext="fasta" +fi + +if [ $mode = "se" ]; then + output_args=$(echo \ + --output "$output_dir/{name}_001.$ext" \ + ) +else + output_args=$(echo \ + --output "$output_dir/{name}_R1_001.$ext" \ + --paired-output "$output_dir/{name}_R2_001.$ext" \ + ) +fi + +debug "Arguments to cutadapt:" +debug $output_args +debug + +# Full CLI +# Set the --cores argument to 0 unless meta_cpus is set +########################################################### +echo ">> Running cutadapt" +par_cpus=0 +[[ ! -z $meta_cpus ]] && par_cpus=$meta_cpus + +cli=$(echo \ + $input \ + $adapter_args \ + $paired_args \ + $input_args \ + $mod_args \ + $filter_args \ + $optional_output_args \ + $output_args \ + --cores $par_cpus +) + +debug ">> Full CLI to be run:" +debug cutadapt $cli | sed -e 's/--/\r\n --/g' +debug + +cutadapt $cli diff --git a/src/cutadapt/test.sh b/src/cutadapt/test.sh new file mode 100644 index 00000000..eff997d7 --- /dev/null +++ b/src/cutadapt/test.sh @@ -0,0 +1,256 @@ +#!/bin/bash + +set -e + +############################################# +# helper functions +assert_file_exists() { + [ -f "$1" ] || (echo "File '$1' does not exist" && exit 1) +} +assert_file_doesnt_exist() { + [ ! -f "$1" ] || (echo "File '$1' exists but shouldn't" && exit 1) +} +assert_file_empty() { + [ ! -s "$1" ] || (echo "File '$1' is not empty but should be" && exit 1) +} +assert_file_not_empty() { + [ -s "$1" ] || (echo "File '$1' is empty but shouldn't be" && exit 1) +} +assert_file_contains() { + grep -q "$2" "$1" || (echo "File '$1' does not contain '$2'" && exit 1) +} +assert_file_not_contains() { + grep -q "$2" "$1" && (echo "File '$1' contains '$2' but shouldn't" && exit 1) +} + +############################################# +mkdir test_multiple_output +cd test_multiple_output + +echo "#############################################" +echo "> Run cutadapt with multiple outputs" + +cat > example.fa <<'EOF' +>read1 +MYSEQUENCEADAPTER +>read2 +MYSEQUENCEADAP +>read3 +MYSEQUENCEADAPTERSOMETHINGELSE +>read4 +MYSEQUENCEADABTER +>read5 +MYSEQUENCEADAPTR +>read6 +MYSEQUENCEADAPPTER +>read7 +ADAPTERMYSEQUENCE +>read8 +PTERMYSEQUENCE +>read9 +SOMETHINGADAPTERMYSEQUENCE +EOF + +"$meta_executable" \ + --report minimal \ + --output "out_test/*.fasta" \ + --adapter ADAPTER \ + --input example.fa \ + --fasta \ + --no_match_adapter_wildcards \ + --json + +echo ">> Checking output" +assert_file_exists "report.json" +assert_file_exists "out_test/1_001.fasta" +assert_file_exists "out_test/unknown_001.fasta" + +cd .. +echo + +############################################# +mkdir test_simple_single_end +cd test_simple_single_end + +echo "#############################################" +echo "> Run cutadapt on single-end data" + +cat > example.fa <<'EOF' +>read1 +MYSEQUENCEADAPTER +>read2 +MYSEQUENCEADAP +>read3 +MYSEQUENCEADAPTERSOMETHINGELSE +>read4 +MYSEQUENCEADABTER +>read5 +MYSEQUENCEADAPTR +>read6 +MYSEQUENCEADAPPTER +>read7 +ADAPTERMYSEQUENCE +>read8 +PTERMYSEQUENCE +>read9 +SOMETHINGADAPTERMYSEQUENCE +EOF + +"$meta_executable" \ + --report minimal \ + --output "out_test1/*.fasta" \ + --adapter ADAPTER \ + --input example.fa \ + --fasta \ + --no_match_adapter_wildcards \ + --json + +echo ">> Checking output" +assert_file_exists "report.json" +assert_file_exists "out_test1/1_001.fasta" +assert_file_exists "out_test1/unknown_001.fasta" + +echo ">> Check if output is empty" +assert_file_not_empty "report.json" +assert_file_not_empty "out_test1/1_001.fasta" +assert_file_not_empty "out_test1/unknown_001.fasta" + +echo ">> Check contents" +for i in 1 2 3 7 9; do + assert_file_contains "out_test1/1_001.fasta" ">read$i" +done +for i in 4 5 6 8; do + assert_file_contains "out_test1/unknown_001.fasta" ">read$i" +done + +cd .. +echo + +############################################# +mkdir test_multiple_single_end +cd test_multiple_single_end + +echo "#############################################" +echo "> Run with a combination of inputs" + +cat > example.fa <<'EOF' +>read1 +ACGTACGTACGTAAAAA +>read2 +ACGTACGTACGTCCCCC +>read3 +ACGTACGTACGTGGGGG +>read4 +ACGTACGTACGTTTTTT +EOF + +cat > adapters1.fasta <<'EOF' +>adapter1 +CCCCC +EOF + +cat > adapters2.fasta <<'EOF' +>adapter2 +GGGGG +EOF + +"$meta_executable" \ + --report minimal \ + --output "out_test2/*.fasta" \ + --adapter AAAAA \ + --adapter_fasta adapters1.fasta \ + --adapter_fasta adapters2.fasta \ + --input example.fa \ + --fasta \ + --json + +echo ">> Checking output" +assert_file_exists "report.json" +assert_file_exists "out_test2/1_001.fasta" +assert_file_exists "out_test2/adapter1_001.fasta" +assert_file_exists "out_test2/adapter2_001.fasta" +assert_file_exists "out_test2/unknown_001.fasta" + +echo ">> Check if output is empty" +assert_file_not_empty "report.json" +assert_file_not_empty "out_test2/1_001.fasta" +assert_file_not_empty "out_test2/adapter1_001.fasta" +assert_file_not_empty "out_test2/adapter2_001.fasta" +assert_file_not_empty "out_test2/unknown_001.fasta" + +echo ">> Check contents" +assert_file_contains "out_test2/1_001.fasta" ">read1" +assert_file_contains "out_test2/adapter1_001.fasta" ">read2" +assert_file_contains "out_test2/adapter2_001.fasta" ">read3" +assert_file_contains "out_test2/unknown_001.fasta" ">read4" + +cd .. +echo + +############################################# +mkdir test_simple_paired_end +cd test_simple_paired_end + +echo "#############################################" +echo "> Run cutadapt on paired-end data" + +cat > example_R1.fastq <<'EOF' +@read1 +ACGTACGTACGTAAAAA ++ +IIIIIIIIIIIIIIIII +@read2 +ACGTACGTACGTCCCCC ++ +IIIIIIIIIIIIIIIII +EOF + +cat > example_R2.fastq <<'EOF' +@read1 +ACGTACGTACGTGGGGG ++ +IIIIIIIIIIIIIIIII +@read2 +ACGTACGTACGTTTTTT ++ +IIIIIIIIIIIIIIIII +EOF + +"$meta_executable" \ + --report minimal \ + --output "out_test3/*.fastq" \ + --adapter AAAAA \ + --adapter_r2 GGGGG \ + --input example_R1.fastq \ + --input_r2 example_R2.fastq \ + --quality_cutoff 20 \ + --json \ + ---cpus 1 + +echo ">> Checking output" +assert_file_exists "report.json" +assert_file_exists "out_test3/1_R1_001.fastq" +assert_file_exists "out_test3/1_R2_001.fastq" +assert_file_exists "out_test3/unknown_R1_001.fastq" +assert_file_exists "out_test3/unknown_R2_001.fastq" + +echo ">> Check if output is empty" +assert_file_not_empty "report.json" +assert_file_not_empty "out_test3/1_R1_001.fastq" +assert_file_not_empty "out_test3/1_R2_001.fastq" +assert_file_not_empty "out_test3/unknown_R1_001.fastq" + +echo ">> Check contents" +assert_file_contains "out_test3/1_R1_001.fastq" "@read1" +assert_file_contains "out_test3/1_R2_001.fastq" "@read1" +assert_file_contains "out_test3/unknown_R1_001.fastq" "@read2" +assert_file_contains "out_test3/unknown_R2_001.fastq" "@read2" + +cd .. +echo + +############################################# + +echo "#############################################" +echo "> Test successful" + diff --git a/src/salmon/salmon_quant/config.vsh.yaml b/src/salmon/salmon_quant/config.vsh.yaml index 47d72665..b7e303f4 100644 --- a/src/salmon/salmon_quant/config.vsh.yaml +++ b/src/salmon/salmon_quant/config.vsh.yaml @@ -42,7 +42,7 @@ argument_groups: type: file description: | Salmon index. - required: true + required: false example: transcriptome_index - name: --unmated_reads alternatives: ["-r"] @@ -320,12 +320,15 @@ argument_groups: example: 0.00001 - name: --write_mappings alternatives: ["-z"] - type: file - direction: output + type: boolean_true description: | If this option is provided, then the selective-alignment results will be written out in SAM-compatible format. By default, output will be directed to stdout, but an alternative file name can be provided instead. + - name: --mapping_sam + type: file + description: Path to file that should output the selective-alignment results in SAM-compatible format. THis option must be provided while using --write_mappings required: false - example: mappings.sam + direction: output + example: mappings.sam - name: --write_qualities type: boolean_true description: | diff --git a/src/salmon/salmon_quant/script.sh b/src/salmon/salmon_quant/script.sh index ace79711..4c9f69d5 100644 --- a/src/salmon/salmon_quant/script.sh +++ b/src/salmon/salmon_quant/script.sh @@ -21,6 +21,7 @@ set -e [[ "$par_softclip_overhangs" == "false" ]] && unset par_softclip_overhangs [[ "$par_full_length_alignment" == "false" ]] && unset par_full_length_alignment [[ "$par_hard_filter" == "false" ]] && unset par_hard_filter +[[ "$par_write_mappings" == "false" ]] && unset par_write_mappings [[ "$par_write_qualities" == "false" ]] && unset par_write_qualities [[ "$par_alternative_init_mode" == "false" ]] && unset par_alternative_init_mode [[ "$par_skip_quant" == "false" ]] && unset par_skip_quant @@ -96,7 +97,7 @@ salmon quant \ ${par_full_length_alignment:+--fullLengthAlignment} \ ${par_hard_filter:+--hardFilter} \ ${par_min_aln_prob:+--minAlnProb "${par_min_aln_prob}"} \ - ${par_write_mappings:+-z "${par_write_mappings}"} \ + ${par_write_mappings:+--write_mappings="${par_mappings_sam}"} \ ${par_write_qualities:+--writeQualities} \ ${par_hit_filter_policy:+--hitFilterPolicy "${par_hit_filter_policy}"} \ ${par_alternative_init_mode:+--alternativeInitMode} \ diff --git a/src/star/star_genome_generate/config.vsh.yaml b/src/star/star_genome_generate/config.vsh.yaml new file mode 100644 index 00000000..3adaf7a2 --- /dev/null +++ b/src/star/star_genome_generate/config.vsh.yaml @@ -0,0 +1,139 @@ +name: star_genome_generate +namespace: star +description: | + Create index for STAR +keywords: [genome, index, align] +links: + repository: https://github.com/alexdobin/STAR + documentation: https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf +references: + doi: 10.1093/bioinformatics/bts635 +license: MIT +requirements: + commands: [ STAR ] + +argument_groups: +- name: "Input" + arguments: + - name: "--genomeFastaFiles" + type: file + description: | + Path(s) to the fasta files with the genome sequences, separated by spaces. These files should be plain text FASTA files, they *cannot* be zipped. + required: true + multiple: yes + multiple_sep: ; + - name: "--sjdbGTFfile" + type: file + description: Path to the GTF file with annotations + - name: --sjdbOverhang + type: integer + description: Length of the donor/acceptor sequence on each side of the junctions, ideally = (mate_length - 1) + example: 100 + - name: --sjdbGTFchrPrefix + type: string + description: Prefix for chromosome names in a GTF file (e.g. 'chr' for using ENSMEBL annotations with UCSC genomes) + - name: --sjdbGTFfeatureExon + type: string + description: Feature type in GTF file to be used as exons for building transcripts + example: exon + - name: --sjdbGTFtagExonParentTranscript + type: string + description: GTF attribute name for parent transcript ID (default "transcript_id" works for GTF files) + example: transcript_id + - name: --sjdbGTFtagExonParentGene + type: string + description: GTF attribute name for parent gene ID (default "gene_id" works for GTF files) + example: gene_id + - name: --sjdbGTFtagExonParentGeneName + type: string + description: GTF attribute name for parent gene name + example: gene_name + multiple: yes + multiple_sep: ; + - name: --sjdbGTFtagExonParentGeneType + type: string + description: GTF attribute name for parent gene type + example: + - gene_type + - gene_biotype + multiple: yes + multiple_sep: ; + - name: --limitGenomeGenerateRAM + type: long + description: Maximum available RAM (bytes) for genome generation + example: '31000000000' + - name: --genomeSAindexNbases + type: integer + description: Length (bases) of the SA pre-indexing string. Typically between 10 and 15. Longer strings will use much more memory, but allow faster searches. For small genomes, this parameter must be scaled down to min(14, log2(GenomeLength)/2 - 1). + example: 14 + - name: --genomeChrBinNbits + type: integer + description: Defined as log2(chrBin), where chrBin is the size of the bins for genome storage. Each chromosome will occupy an integer number of bins. For a genome with large number of contigs, it is recommended to scale this parameter as min(18, log2[max(GenomeLength/NumberOfReferences,ReadLength)]). + example: 18 + - name: --genomeSAsparseD + type: integer + min: 0 + example: 1 + description: Suffux array sparsity, i.e. distance between indices. Use bigger numbers to decrease needed RAM at the cost of mapping speed reduction. + - name: --genomeSuffixLengthMax + type: integer + description: Maximum length of the suffixes, has to be longer than read length. Use -1 for infinite length. + example: -1 + - name: --genomeTransformType + type: string + description: | + Type of genome transformation + None ... no transformation + Haploid ... replace reference alleles with alternative alleles from VCF file (e.g. consensus allele) + Diploid ... create two haplotypes for each chromosome listed in VCF file, for genotypes 1|2, assumes perfect phasing (e.g. personal genome) + example: None + - name: --genomeTransformVCF + type: file + description: path to VCF file for genome transformation + +- name: "Output" + arguments: + - name: "--index" + type: file + direction: output + description: STAR index directory. + default: STAR_index + required: true + +resources: + - type: bash_script + path: script.sh + +test_resources: + - type: bash_script + path: test.sh + +engines: +- type: docker + image: ubuntu:22.04 + setup: + # setup derived from https://github.com/alexdobin/STAR/blob/master/extras/docker/Dockerfile + - type: docker + env: + - STAR_VERSION 2.7.11b + - PACKAGES gcc g++ make wget zlib1g-dev unzip xxd + run: | + apt-get update && \ + apt-get install -y --no-install-recommends ${PACKAGES} && \ + cd /tmp && \ + wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip && \ + unzip ${STAR_VERSION}.zip && \ + cd STAR-${STAR_VERSION}/source && \ + make STARstatic CXXFLAGS_SIMD=-std=c++11 && \ + cp STAR /usr/local/bin && \ + cd / && \ + rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip && \ + apt-get --purge autoremove -y ${PACKAGES} && \ + apt-get clean + - type: docker + run: | + STAR --version | sed 's#\(.*\)#star: "\1"#' > /var/software_versions.txt + +runners: + - type: executable + - type: nextflow diff --git a/src/star/star_genome_generate/help.txt b/src/star/star_genome_generate/help.txt new file mode 100644 index 00000000..940f639d --- /dev/null +++ b/src/star/star_genome_generate/help.txt @@ -0,0 +1,927 @@ +Usage: STAR [options]... --genomeDir /path/to/genome/index/ --readFilesIn R1.fq R2.fq +Spliced Transcripts Alignment to a Reference (c) Alexander Dobin, 2009-2022 + +STAR version=2.7.11b +STAR compilation time,server,dir=2024-02-11T19:36:26+00:00 :/tmp/STAR-2.7.11b/source +For more details see: + + +### versions +versionGenome 2.7.4a + string: earliest genome index version compatible with this STAR release. Please do not change this value! + +### Parameter Files +parametersFiles - + string: name of a user-defined parameters file, "-": none. Can only be defined on the command line. + +### System +sysShell - + string: path to the shell binary, preferably bash, e.g. /bin/bash. + - ... the default shell is executed, typically /bin/sh. This was reported to fail on some Ubuntu systems - then you need to specify path to bash. + +### Run Parameters +runMode alignReads + string: type of the run. + alignReads ... map reads + genomeGenerate ... generate genome files + inputAlignmentsFromBAM ... input alignments from BAM. Presently only works with --outWigType and --bamRemoveDuplicates options. + liftOver ... lift-over of GTF files (--sjdbGTFfile) between genome assemblies using chain file(s) from --genomeChainFiles. + soloCellFiltering ... STARsolo cell filtering ("calling") without remapping, followed by the path to raw count directory and output (filtered) prefix + +runThreadN 1 + int: number of threads to run STAR + +runDirPerm User_RWX + string: permissions for the directories created at the run-time. + User_RWX ... user-read/write/execute + All_RWX ... all-read/write/execute (same as chmod 777) + +runRNGseed 777 + int: random number generator seed. + + +### Genome Parameters +genomeDir ./GenomeDir/ + string: path to the directory where genome files are stored (for --runMode alignReads) or will be generated (for --runMode generateGenome) + +genomeLoad NoSharedMemory + string: mode of shared memory usage for the genome files. Only used with --runMode alignReads. + LoadAndKeep ... load genome into shared and keep it in memory after run + LoadAndRemove ... load genome into shared but remove it after run + LoadAndExit ... load genome into shared memory and exit, keeping the genome in memory for future runs + Remove ... do not map anything, just remove loaded genome from memory + NoSharedMemory ... do not use shared memory, each job will have its own private copy of the genome + +genomeFastaFiles - + string(s): path(s) to the fasta files with the genome sequences, separated by spaces. These files should be plain text FASTA files, they *cannot* be zipped. + Required for the genome generation (--runMode genomeGenerate). Can also be used in the mapping (--runMode alignReads) to add extra (new) sequences to the genome (e.g. spike-ins). + +genomeChainFiles - + string: chain files for genomic liftover. Only used with --runMode liftOver . + +genomeFileSizes 0 + uint(s)>0: genome files exact sizes in bytes. Typically, this should not be defined by the user. + +genomeTransformOutput None + string(s): which output to transform back to original genome + SAM ... SAM/BAM alignments + SJ ... splice junctions (SJ.out.tab) + Quant ... quantifications (from --quantMode option) + None ... no transformation of the output + +genomeChrSetMitochondrial chrM M MT + string(s): names of the mitochondrial chromosomes. Presently only used for STARsolo statistics output/ + +### Genome Indexing Parameters - only used with --runMode genomeGenerate +genomeChrBinNbits 18 + int: =log2(chrBin), where chrBin is the size of the bins for genome storage: each chromosome will occupy an integer number of bins. For a genome with large number of contigs, it is recommended to scale this parameter as min(18, log2[max(GenomeLength/NumberOfReferences,ReadLength)]). + +genomeSAindexNbases 14 + int: length (bases) of the SA pre-indexing string. Typically between 10 and 15. Longer strings will use much more memory, but allow faster searches. For small genomes, the parameter --genomeSAindexNbases must be scaled down to min(14, log2(GenomeLength)/2 - 1). + +genomeSAsparseD 1 + int>0: suffux array sparsity, i.e. distance between indices: use bigger numbers to decrease needed RAM at the cost of mapping speed reduction + +genomeSuffixLengthMax -1 + int: maximum length of the suffixes, has to be longer than read length. -1 = infinite. + +genomeTransformType None + string: type of genome transformation + None ... no transformation + Haploid ... replace reference alleles with alternative alleles from VCF file (e.g. consensus allele) + Diploid ... create two haplotypes for each chromosome listed in VCF file, for genotypes 1|2, assumes perfect phasing (e.g. personal genome) + +genomeTransformVCF - + string: path to VCF file for genome transformation + + + +#####UnderDevelopment_begin : not supported - do not use +genomeType Full + string: type of genome to generate + Full ... full (normal) genome + Transcriptome ... genome consists of transcript sequences + SuperTransriptome ... genome consists of superTranscript sequences +#####UnderDevelopment_end + +# DEPRECATED: please use --genomeTransformVCF and --genomeTransformType options instead. +#genomeConsensusFile - +# string: VCF file with consensus SNPs (i.e. alternative allele is the major (AF>0.5) allele) +# DEPRECATED + + + +### Splice Junctions Database +sjdbFileChrStartEnd - + string(s): path to the files with genomic coordinates (chr start end strand) for the splice junction introns. Multiple files can be supplied and will be concatenated. + +sjdbGTFfile - + string: path to the GTF file with annotations + +sjdbGTFchrPrefix - + string: prefix for chromosome names in a GTF file (e.g. 'chr' for using ENSMEBL annotations with UCSC genomes) + +sjdbGTFfeatureExon exon + string: feature type in GTF file to be used as exons for building transcripts + +sjdbGTFtagExonParentTranscript transcript_id + string: GTF attribute name for parent transcript ID (default "transcript_id" works for GTF files) + +sjdbGTFtagExonParentGene gene_id + string: GTF attribute name for parent gene ID (default "gene_id" works for GTF files) + +sjdbGTFtagExonParentGeneName gene_name + string(s): GTF attribute name for parent gene name + +sjdbGTFtagExonParentGeneType gene_type gene_biotype + string(s): GTF attribute name for parent gene type + +sjdbOverhang 100 + int>0: length of the donor/acceptor sequence on each side of the junctions, ideally = (mate_length - 1) + +sjdbScore 2 + int: extra alignment score for alignments that cross database junctions + +sjdbInsertSave Basic + string: which files to save when sjdb junctions are inserted on the fly at the mapping step + Basic ... only small junction / transcript files + All ... all files including big Genome, SA and SAindex - this will create a complete genome directory + +### Variation parameters +varVCFfile - + string: path to the VCF file that contains variation data. The 10th column should contain the genotype information, e.g. 0/1 + +### Input Files +inputBAMfile - + string: path to BAM input file, to be used with --runMode inputAlignmentsFromBAM + +### Read Parameters +readFilesType Fastx + string: format of input read files + Fastx ... FASTA or FASTQ + SAM SE ... SAM or BAM single-end reads; for BAM use --readFilesCommand samtools view + SAM PE ... SAM or BAM paired-end reads; for BAM use --readFilesCommand samtools view + +readFilesSAMattrKeep All + string(s): for --readFilesType SAM SE/PE, which SAM tags to keep in the output BAM, e.g.: --readFilesSAMtagsKeep RG PL + All ... keep all tags + None ... do not keep any tags + +readFilesIn Read1 Read2 + string(s): paths to files that contain input read1 (and, if needed, read2) + +readFilesManifest - + string: path to the "manifest" file with the names of read files. The manifest file should contain 3 tab-separated columns: + paired-end reads: read1_file_name $tab$ read2_file_name $tab$ read_group_line. + single-end reads: read1_file_name $tab$ - $tab$ read_group_line. + Spaces, but not tabs are allowed in file names. + If read_group_line does not start with ID:, it can only contain one ID field, and ID: will be added to it. + If read_group_line starts with ID:, it can contain several fields separated by $tab$, and all fields will be be copied verbatim into SAM @RG header line. + +readFilesPrefix - + string: prefix for the read files names, i.e. it will be added in front of the strings in --readFilesIn + +readFilesCommand - + string(s): command line to execute for each of the input file. This command should generate FASTA or FASTQ text and send it to stdout + For example: zcat - to uncompress .gz files, bzcat - to uncompress .bz2 files, etc. + +readMapNumber -1 + int: number of reads to map from the beginning of the file + -1: map all reads + +readMatesLengthsIn NotEqual + string: Equal/NotEqual - lengths of names,sequences,qualities for both mates are the same / not the same. NotEqual is safe in all situations. + +readNameSeparator / + string(s): character(s) separating the part of the read names that will be trimmed in output (read name after space is always trimmed) + +readQualityScoreBase 33 + int>=0: number to be subtracted from the ASCII code to get Phred quality score + +### Read Clipping + +clipAdapterType Hamming + string: adapter clipping type + Hamming ... adapter clipping based on Hamming distance, with the number of mismatches controlled by --clip5pAdapterMMp + CellRanger4 ... 5p and 3p adapter clipping similar to CellRanger4. Utilizes Opal package by Martin Šošić: https://github.com/Martinsos/opal + None ... no adapter clipping, all other clip* parameters are disregarded + +clip3pNbases 0 + int(s): number(s) of bases to clip from 3p of each mate. If one value is given, it will be assumed the same for both mates. + +clip3pAdapterSeq - + string(s): adapter sequences to clip from 3p of each mate. If one value is given, it will be assumed the same for both mates. + polyA ... polyA sequence with the length equal to read length + +clip3pAdapterMMp 0.1 + double(s): max proportion of mismatches for 3p adapter clipping for each mate. If one value is given, it will be assumed the same for both mates. + +clip3pAfterAdapterNbases 0 + int(s): number of bases to clip from 3p of each mate after the adapter clipping. If one value is given, it will be assumed the same for both mates. + +clip5pNbases 0 + int(s): number(s) of bases to clip from 5p of each mate. If one value is given, it will be assumed the same for both mates. + +#####UnderDevelopment_begin : not supported - do not use +clip5pAdapterSeq - + string(s): adapter sequences to clip from 5p of each mate, separated by space. + +clip5pAdapterMMp 0.1 + double(s): max proportion of mismatches for 5p adapter clipping for each mate, separated by space + +clip5pAfterAdapterNbases 0 + int(s): number of bases to clip from 5p of each mate after the adapter clipping, separated by space. +#####UnderDevelopment_end + +### Limits +limitGenomeGenerateRAM 31000000000 + int>0: maximum available RAM (bytes) for genome generation + +limitIObufferSize 30000000 50000000 + int(s)>0: max available buffers size (bytes) for input/output, per thread + +limitOutSAMoneReadBytes 100000 + int>0: max size of the SAM record (bytes) for one read. Recommended value: >(2*(LengthMate1+LengthMate2+100)*outFilterMultimapNmax + +limitOutSJoneRead 1000 + int>0: max number of junctions for one read (including all multi-mappers) + +limitOutSJcollapsed 1000000 + int>0: max number of collapsed junctions + +limitBAMsortRAM 0 + int>=0: maximum available RAM (bytes) for sorting BAM. If =0, it will be set to the genome index size. 0 value can only be used with --genomeLoad NoSharedMemory option. + +limitSjdbInsertNsj 1000000 + int>=0: maximum number of junctions to be inserted to the genome on the fly at the mapping stage, including those from annotations and those detected in the 1st step of the 2-pass run + +limitNreadsSoft -1 + int: soft limit on the number of reads + +### Output: general +outFileNamePrefix ./ + string: output files name prefix (including full or relative path). Can only be defined on the command line. + +outTmpDir - + string: path to a directory that will be used as temporary by STAR. All contents of this directory will be removed! + - ... the temp directory will default to outFileNamePrefix_STARtmp + +outTmpKeep None + string: whether to keep the temporary files after STAR runs is finished + None ... remove all temporary files + All ... keep all files + +outStd Log + string: which output will be directed to stdout (standard out) + Log ... log messages + SAM ... alignments in SAM format (which normally are output to Aligned.out.sam file), normal standard output will go into Log.std.out + BAM_Unsorted ... alignments in BAM format, unsorted. Requires --outSAMtype BAM Unsorted + BAM_SortedByCoordinate ... alignments in BAM format, sorted by coordinate. Requires --outSAMtype BAM SortedByCoordinate + BAM_Quant ... alignments to transcriptome in BAM format, unsorted. Requires --quantMode TranscriptomeSAM + +outReadsUnmapped None + string: output of unmapped and partially mapped (i.e. mapped only one mate of a paired end read) reads in separate file(s). + None ... no output + Fastx ... output in separate fasta/fastq files, Unmapped.out.mate1/2 + +outQSconversionAdd 0 + int: add this number to the quality score (e.g. to convert from Illumina to Sanger, use -31) + +outMultimapperOrder Old_2.4 + string: order of multimapping alignments in the output files + Old_2.4 ... quasi-random order used before 2.5.0 + Random ... random order of alignments for each multi-mapper. Read mates (pairs) are always adjacent, all alignment for each read stay together. This option will become default in the future releases. + +### Output: SAM and BAM +outSAMtype SAM + strings: type of SAM/BAM output + 1st word: + BAM ... output BAM without sorting + SAM ... output SAM without sorting + None ... no SAM/BAM output + 2nd, 3rd: + Unsorted ... standard unsorted + SortedByCoordinate ... sorted by coordinate. This option will allocate extra memory for sorting which can be specified by --limitBAMsortRAM. + +outSAMmode Full + string: mode of SAM output + None ... no SAM output + Full ... full SAM output + NoQS ... full SAM but without quality scores + +outSAMstrandField None + string: Cufflinks-like strand field flag + None ... not used + intronMotif ... strand derived from the intron motif. This option changes the output alignments: reads with inconsistent and/or non-canonical introns are filtered out. + +outSAMattributes Standard + string(s): a string of desired SAM attributes, in the order desired for the output SAM. Tags can be listed in any combination/order. + ***Presets: + None ... no attributes + Standard ... NH HI AS nM + All ... NH HI AS nM NM MD jM jI MC ch + ***Alignment: + NH ... number of loci the reads maps to: =1 for unique mappers, >1 for multimappers. Standard SAM tag. + HI ... multiple alignment index, starts with --outSAMattrIHstart (=1 by default). Standard SAM tag. + AS ... local alignment score, +1/-1 for matches/mismateches, score* penalties for indels and gaps. For PE reads, total score for two mates. Stadnard SAM tag. + nM ... number of mismatches. For PE reads, sum over two mates. + NM ... edit distance to the reference (number of mismatched + inserted + deleted bases) for each mate. Standard SAM tag. + MD ... string encoding mismatched and deleted reference bases (see standard SAM specifications). Standard SAM tag. + jM ... intron motifs for all junctions (i.e. N in CIGAR): 0: non-canonical; 1: GT/AG, 2: CT/AC, 3: GC/AG, 4: CT/GC, 5: AT/AC, 6: GT/AT. If splice junctions database is used, and a junction is annotated, 20 is added to its motif value. + jI ... start and end of introns for all junctions (1-based). + XS ... alignment strand according to --outSAMstrandField. + MC ... mate's CIGAR string. Standard SAM tag. + ch ... marks all segment of all chimeric alingments for --chimOutType WithinBAM output. + cN ... number of bases clipped from the read ends: 5' and 3' + ***Variation: + vA ... variant allele + vG ... genomic coordinate of the variant overlapped by the read. + vW ... 1 - alignment passes WASP filtering; 2,3,4,5,6,7 - alignment does not pass WASP filtering. Requires --waspOutputMode SAMtag. + ha ... haplotype (1/2) when mapping to the diploid genome. Requires genome generated with --genomeTransformType Diploid . + ***STARsolo: + CR CY UR UY ... sequences and quality scores of cell barcodes and UMIs for the solo* demultiplexing. + GX GN ... gene ID and gene name for unique-gene reads. + gx gn ... gene IDs and gene names for unique- and multi-gene reads. + CB UB ... error-corrected cell barcodes and UMIs for solo* demultiplexing. Requires --outSAMtype BAM SortedByCoordinate. + sM ... assessment of CB and UMI. + sS ... sequence of the entire barcode (CB,UMI,adapter). + sQ ... quality of the entire barcode. + sF ... type of feature overlap and number of features for each alignment + ***Unsupported/undocumented: + rB ... alignment block read/genomic coordinates. + vR ... read coordinate of the variant. + +outSAMattrIHstart 1 + int>=0: start value for the IH attribute. 0 may be required by some downstream software, such as Cufflinks or StringTie. + +outSAMunmapped None + string(s): output of unmapped reads in the SAM format + 1st word: + None ... no output + Within ... output unmapped reads within the main SAM file (i.e. Aligned.out.sam) + 2nd word: + KeepPairs ... record unmapped mate for each alignment, and, in case of unsorted output, keep it adjacent to its mapped mate. Only affects multi-mapping reads. + +outSAMorder Paired + string: type of sorting for the SAM output + Paired: one mate after the other for all paired alignments + PairedKeepInputOrder: one mate after the other for all paired alignments, the order is kept the same as in the input FASTQ files + +outSAMprimaryFlag OneBestScore + string: which alignments are considered primary - all others will be marked with 0x100 bit in the FLAG + OneBestScore ... only one alignment with the best score is primary + AllBestScore ... all alignments with the best score are primary + +outSAMreadID Standard + string: read ID record type + Standard ... first word (until space) from the FASTx read ID line, removing /1,/2 from the end + Number ... read number (index) in the FASTx file + +outSAMmapqUnique 255 + int: 0 to 255: the MAPQ value for unique mappers + +outSAMflagOR 0 + int: 0 to 65535: sam FLAG will be bitwise OR'd with this value, i.e. FLAG=FLAG | outSAMflagOR. This is applied after all flags have been set by STAR, and after outSAMflagAND. Can be used to set specific bits that are not set otherwise. + +outSAMflagAND 65535 + int: 0 to 65535: sam FLAG will be bitwise AND'd with this value, i.e. FLAG=FLAG & outSAMflagOR. This is applied after all flags have been set by STAR, but before outSAMflagOR. Can be used to unset specific bits that are not set otherwise. + +outSAMattrRGline - + string(s): SAM/BAM read group line. The first word contains the read group identifier and must start with "ID:", e.g. --outSAMattrRGline ID:xxx CN:yy "DS:z z z". + xxx will be added as RG tag to each output alignment. Any spaces in the tag values have to be double quoted. + Comma separated RG lines correspons to different (comma separated) input files in --readFilesIn. Commas have to be surrounded by spaces, e.g. + --outSAMattrRGline ID:xxx , ID:zzz "DS:z z" , ID:yyy DS:yyyy + +outSAMheaderHD - + strings: @HD (header) line of the SAM header + +outSAMheaderPG - + strings: extra @PG (software) line of the SAM header (in addition to STAR) + +outSAMheaderCommentFile - + string: path to the file with @CO (comment) lines of the SAM header + +outSAMfilter None + string(s): filter the output into main SAM/BAM files + KeepOnlyAddedReferences ... only keep the reads for which all alignments are to the extra reference sequences added with --genomeFastaFiles at the mapping stage. + KeepAllAddedReferences ... keep all alignments to the extra reference sequences added with --genomeFastaFiles at the mapping stage. + + +outSAMmultNmax -1 + int: max number of multiple alignments for a read that will be output to the SAM/BAM files. Note that if this value is not equal to -1, the top scoring alignment will be output first + -1 ... all alignments (up to --outFilterMultimapNmax) will be output + +outSAMtlen 1 + int: calculation method for the TLEN field in the SAM/BAM files + 1 ... leftmost base of the (+)strand mate to rightmost base of the (-)mate. (+)sign for the (+)strand mate + 2 ... leftmost base of any mate to rightmost base of any mate. (+)sign for the mate with the leftmost base. This is different from 1 for overlapping mates with protruding ends + +outBAMcompression 1 + int: -1 to 10 BAM compression level, -1=default compression (6?), 0=no compression, 10=maximum compression + +outBAMsortingThreadN 0 + int: >=0: number of threads for BAM sorting. 0 will default to min(6,--runThreadN). + +outBAMsortingBinsN 50 + int: >0: number of genome bins for coordinate-sorting + +### BAM processing +bamRemoveDuplicatesType - + string: mark duplicates in the BAM file, for now only works with (i) sorted BAM fed with inputBAMfile, and (ii) for paired-end alignments only + - ... no duplicate removal/marking + UniqueIdentical ... mark all multimappers, and duplicate unique mappers. The coordinates, FLAG, CIGAR must be identical + UniqueIdenticalNotMulti ... mark duplicate unique mappers but not multimappers. + +bamRemoveDuplicatesMate2basesN 0 + int>0: number of bases from the 5' of mate 2 to use in collapsing (e.g. for RAMPAGE) + +### Output Wiggle +outWigType None + string(s): type of signal output, e.g. "bedGraph" OR "bedGraph read1_5p". Requires sorted BAM: --outSAMtype BAM SortedByCoordinate . + 1st word: + None ... no signal output + bedGraph ... bedGraph format + wiggle ... wiggle format + 2nd word: + read1_5p ... signal from only 5' of the 1st read, useful for CAGE/RAMPAGE etc + read2 ... signal from only 2nd read + +outWigStrand Stranded + string: strandedness of wiggle/bedGraph output + Stranded ... separate strands, str1 and str2 + Unstranded ... collapsed strands + +outWigReferencesPrefix - + string: prefix matching reference names to include in the output wiggle file, e.g. "chr", default "-" - include all references + +outWigNorm RPM + string: type of normalization for the signal + RPM ... reads per million of mapped reads + None ... no normalization, "raw" counts + +### Output Filtering +outFilterType Normal + string: type of filtering + Normal ... standard filtering using only current alignment + BySJout ... keep only those reads that contain junctions that passed filtering into SJ.out.tab + +outFilterMultimapScoreRange 1 + int: the score range below the maximum score for multimapping alignments + +outFilterMultimapNmax 10 + int: maximum number of loci the read is allowed to map to. Alignments (all of them) will be output only if the read maps to no more loci than this value. + Otherwise no alignments will be output, and the read will be counted as "mapped to too many loci" in the Log.final.out . + +outFilterMismatchNmax 10 + int: alignment will be output only if it has no more mismatches than this value. + +outFilterMismatchNoverLmax 0.3 + real: alignment will be output only if its ratio of mismatches to *mapped* length is less than or equal to this value. + +outFilterMismatchNoverReadLmax 1.0 + real: alignment will be output only if its ratio of mismatches to *read* length is less than or equal to this value. + + +outFilterScoreMin 0 + int: alignment will be output only if its score is higher than or equal to this value. + +outFilterScoreMinOverLread 0.66 + real: same as outFilterScoreMin, but normalized to read length (sum of mates' lengths for paired-end reads) + +outFilterMatchNmin 0 + int: alignment will be output only if the number of matched bases is higher than or equal to this value. + +outFilterMatchNminOverLread 0.66 + real: sam as outFilterMatchNmin, but normalized to the read length (sum of mates' lengths for paired-end reads). + +outFilterIntronMotifs None + string: filter alignment using their motifs + None ... no filtering + RemoveNoncanonical ... filter out alignments that contain non-canonical junctions + RemoveNoncanonicalUnannotated ... filter out alignments that contain non-canonical unannotated junctions when using annotated splice junctions database. The annotated non-canonical junctions will be kept. + +outFilterIntronStrands RemoveInconsistentStrands + string: filter alignments + RemoveInconsistentStrands ... remove alignments that have junctions with inconsistent strands + None ... no filtering + +### Output splice junctions (SJ.out.tab) +outSJtype Standard + string: type of splice junction output + Standard ... standard SJ.out.tab output + None ... no splice junction output + +### Output Filtering: Splice Junctions +outSJfilterReads All + string: which reads to consider for collapsed splice junctions output + All ... all reads, unique- and multi-mappers + Unique ... uniquely mapping reads only + +outSJfilterOverhangMin 30 12 12 12 + 4 integers: minimum overhang length for splice junctions on both sides for: (1) non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC motif, (4) AT/AC and GT/AT motif. -1 means no output for that motif + does not apply to annotated junctions + +outSJfilterCountUniqueMin 3 1 1 1 + 4 integers: minimum uniquely mapping read count per junction for: (1) non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC motif, (4) AT/AC and GT/AT motif. -1 means no output for that motif + Junctions are output if one of outSJfilterCountUniqueMin OR outSJfilterCountTotalMin conditions are satisfied + does not apply to annotated junctions + +outSJfilterCountTotalMin 3 1 1 1 + 4 integers: minimum total (multi-mapping+unique) read count per junction for: (1) non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC motif, (4) AT/AC and GT/AT motif. -1 means no output for that motif + Junctions are output if one of outSJfilterCountUniqueMin OR outSJfilterCountTotalMin conditions are satisfied + does not apply to annotated junctions + +outSJfilterDistToOtherSJmin 10 0 5 10 + 4 integers>=0: minimum allowed distance to other junctions' donor/acceptor + does not apply to annotated junctions + +outSJfilterIntronMaxVsReadN 50000 100000 200000 + N integers>=0: maximum gap allowed for junctions supported by 1,2,3,,,N reads + i.e. by default junctions supported by 1 read can have gaps <=50000b, by 2 reads: <=100000b, by 3 reads: <=200000. by >=4 reads any gap <=alignIntronMax + does not apply to annotated junctions + +### Scoring +scoreGap 0 + int: splice junction penalty (independent on intron motif) + +scoreGapNoncan -8 + int: non-canonical junction penalty (in addition to scoreGap) + +scoreGapGCAG -4 + int: GC/AG and CT/GC junction penalty (in addition to scoreGap) + +scoreGapATAC -8 + int: AT/AC and GT/AT junction penalty (in addition to scoreGap) + +scoreGenomicLengthLog2scale -0.25 + int: extra score logarithmically scaled with genomic length of the alignment: scoreGenomicLengthLog2scale*log2(genomicLength) + +scoreDelOpen -2 + int: deletion open penalty + +scoreDelBase -2 + int: deletion extension penalty per base (in addition to scoreDelOpen) + +scoreInsOpen -2 + int: insertion open penalty + +scoreInsBase -2 + int: insertion extension penalty per base (in addition to scoreInsOpen) + +scoreStitchSJshift 1 + int: maximum score reduction while searching for SJ boundaries in the stitching step + + +### Alignments and Seeding + +seedSearchStartLmax 50 + int>0: defines the search start point through the read - the read is split into pieces no longer than this value + +seedSearchStartLmaxOverLread 1.0 + real: seedSearchStartLmax normalized to read length (sum of mates' lengths for paired-end reads) + +seedSearchLmax 0 + int>=0: defines the maximum length of the seeds, if =0 seed length is not limited + +seedMultimapNmax 10000 + int>0: only pieces that map fewer than this value are utilized in the stitching procedure + +seedPerReadNmax 1000 + int>0: max number of seeds per read + +seedPerWindowNmax 50 + int>0: max number of seeds per window + +seedNoneLociPerWindow 10 + int>0: max number of one seed loci per window + +seedSplitMin 12 + int>0: min length of the seed sequences split by Ns or mate gap + +seedMapMin 5 + int>0: min length of seeds to be mapped + +alignIntronMin 21 + int: minimum intron size, genomic gap is considered intron if its length>=alignIntronMin, otherwise it is considered Deletion + +alignIntronMax 0 + int: maximum intron size, if 0, max intron size will be determined by (2^winBinNbits)*winAnchorDistNbins + +alignMatesGapMax 0 + int: maximum gap between two mates, if 0, max intron gap will be determined by (2^winBinNbits)*winAnchorDistNbins + +alignSJoverhangMin 5 + int>0: minimum overhang (i.e. block size) for spliced alignments + +alignSJstitchMismatchNmax 0 -1 0 0 + 4*int>=0: maximum number of mismatches for stitching of the splice junctions (-1: no limit). + (1) non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC motif, (4) AT/AC and GT/AT motif. + +alignSJDBoverhangMin 3 + int>0: minimum overhang (i.e. block size) for annotated (sjdb) spliced alignments + +alignSplicedMateMapLmin 0 + int>0: minimum mapped length for a read mate that is spliced + +alignSplicedMateMapLminOverLmate 0.66 + real>0: alignSplicedMateMapLmin normalized to mate length + +alignWindowsPerReadNmax 10000 + int>0: max number of windows per read + +alignTranscriptsPerWindowNmax 100 + int>0: max number of transcripts per window + +alignTranscriptsPerReadNmax 10000 + int>0: max number of different alignments per read to consider + +alignEndsType Local + string: type of read ends alignment + Local ... standard local alignment with soft-clipping allowed + EndToEnd ... force end-to-end read alignment, do not soft-clip + Extend5pOfRead1 ... fully extend only the 5p of the read1, all other ends: local alignment + Extend5pOfReads12 ... fully extend only the 5p of the both read1 and read2, all other ends: local alignment + +alignEndsProtrude 0 ConcordantPair + int, string: allow protrusion of alignment ends, i.e. start (end) of the +strand mate downstream of the start (end) of the -strand mate + 1st word: int: maximum number of protrusion bases allowed + 2nd word: string: + ConcordantPair ... report alignments with non-zero protrusion as concordant pairs + DiscordantPair ... report alignments with non-zero protrusion as discordant pairs + +alignSoftClipAtReferenceEnds Yes + string: allow the soft-clipping of the alignments past the end of the chromosomes + Yes ... allow + No ... prohibit, useful for compatibility with Cufflinks + +alignInsertionFlush None + string: how to flush ambiguous insertion positions + None ... insertions are not flushed + Right ... insertions are flushed to the right + +### Paired-End reads +peOverlapNbasesMin 0 + int>=0: minimum number of overlapping bases to trigger mates merging and realignment. Specify >0 value to switch on the "merginf of overlapping mates" algorithm. + +peOverlapMMp 0.01 + real, >=0 & <1: maximum proportion of mismatched bases in the overlap area + +### Windows, Anchors, Binning + +winAnchorMultimapNmax 50 + int>0: max number of loci anchors are allowed to map to + +winBinNbits 16 + int>0: =log2(winBin), where winBin is the size of the bin for the windows/clustering, each window will occupy an integer number of bins. + +winAnchorDistNbins 9 + int>0: max number of bins between two anchors that allows aggregation of anchors into one window + +winFlankNbins 4 + int>0: log2(winFlank), where win Flank is the size of the left and right flanking regions for each window + +winReadCoverageRelativeMin 0.5 + real>=0: minimum relative coverage of the read sequence by the seeds in a window, for STARlong algorithm only. + +winReadCoverageBasesMin 0 + int>0: minimum number of bases covered by the seeds in a window , for STARlong algorithm only. + +### Chimeric Alignments +chimOutType Junctions + string(s): type of chimeric output + Junctions ... Chimeric.out.junction + SeparateSAMold ... output old SAM into separate Chimeric.out.sam file + WithinBAM ... output into main aligned BAM files (Aligned.*.bam) + WithinBAM HardClip ... (default) hard-clipping in the CIGAR for supplemental chimeric alignments (default if no 2nd word is present) + WithinBAM SoftClip ... soft-clipping in the CIGAR for supplemental chimeric alignments + +chimSegmentMin 0 + int>=0: minimum length of chimeric segment length, if ==0, no chimeric output + +chimScoreMin 0 + int>=0: minimum total (summed) score of the chimeric segments + +chimScoreDropMax 20 + int>=0: max drop (difference) of chimeric score (the sum of scores of all chimeric segments) from the read length + +chimScoreSeparation 10 + int>=0: minimum difference (separation) between the best chimeric score and the next one + +chimScoreJunctionNonGTAG -1 + int: penalty for a non-GT/AG chimeric junction + +chimJunctionOverhangMin 20 + int>=0: minimum overhang for a chimeric junction + +chimSegmentReadGapMax 0 + int>=0: maximum gap in the read sequence between chimeric segments + +chimFilter banGenomicN + string(s): different filters for chimeric alignments + None ... no filtering + banGenomicN ... Ns are not allowed in the genome sequence around the chimeric junction + +chimMainSegmentMultNmax 10 + int>=1: maximum number of multi-alignments for the main chimeric segment. =1 will prohibit multimapping main segments. + +chimMultimapNmax 0 + int>=0: maximum number of chimeric multi-alignments + 0 ... use the old scheme for chimeric detection which only considered unique alignments + +chimMultimapScoreRange 1 + int>=0: the score range for multi-mapping chimeras below the best chimeric score. Only works with --chimMultimapNmax > 1 + +chimNonchimScoreDropMin 20 + int>=0: to trigger chimeric detection, the drop in the best non-chimeric alignment score with respect to the read length has to be greater than this value + +chimOutJunctionFormat 0 + int: formatting type for the Chimeric.out.junction file + 0 ... no comment lines/headers + 1 ... comment lines at the end of the file: command line and Nreads: total, unique/multi-mapping + +### Quantification of Annotations +quantMode - + string(s): types of quantification requested + - ... none + TranscriptomeSAM ... output SAM/BAM alignments to transcriptome into a separate file + GeneCounts ... count reads per gene + +quantTranscriptomeBAMcompression 1 + int: -2 to 10 transcriptome BAM compression level + -2 ... no BAM output + -1 ... default compression (6?) + 0 ... no compression + 10 ... maximum compression + +quantTranscriptomeSAMoutput BanSingleEnd_BanIndels_ExtendSoftclip + string: alignment filtering for TranscriptomeSAM output + BanSingleEnd_BanIndels_ExtendSoftclip ... prohibit indels and single-end alignments, extend softclips - compatible with RSEM + BanSingleEnd ... prohibit single-end alignments, allow indels and softclips + BanSingleEnd_ExtendSoftclip ... prohibit single-end alignments, extend softclips, allow indels + + +### 2-pass Mapping +twopassMode None + string: 2-pass mapping mode. + None ... 1-pass mapping + Basic ... basic 2-pass mapping, with all 1st pass junctions inserted into the genome indices on the fly + +twopass1readsN -1 + int: number of reads to process for the 1st step. Use very large number (or default -1) to map all reads in the first step. + + +### WASP parameters +waspOutputMode None + string: WASP allele-specific output type. This is re-implementation of the original WASP mappability filtering by Bryce van de Geijn, Graham McVicker, Yoav Gilad & Jonathan K Pritchard. Please cite the original WASP paper: Nature Methods 12, 1061–1063 (2015), https://www.nature.com/articles/nmeth.3582 . + SAMtag ... add WASP tags to the alignments that pass WASP filtering + +### STARsolo (single cell RNA-seq) parameters +soloType None + string(s): type of single-cell RNA-seq + CB_UMI_Simple ... (a.k.a. Droplet) one UMI and one Cell Barcode of fixed length in read2, e.g. Drop-seq and 10X Chromium. + CB_UMI_Complex ... multiple Cell Barcodes of varying length, one UMI of fixed length and one adapter sequence of fixed length are allowed in read2 only (e.g. inDrop, ddSeq). + CB_samTagOut ... output Cell Barcode as CR and/or CB SAm tag. No UMI counting. --readFilesIn cDNA_read1 [cDNA_read2 if paired-end] CellBarcode_read . Requires --outSAMtype BAM Unsorted [and/or SortedByCoordinate] + SmartSeq ... Smart-seq: each cell in a separate FASTQ (paired- or single-end), barcodes are corresponding read-groups, no UMI sequences, alignments deduplicated according to alignment start and end (after extending soft-clipped bases) + +soloCBtype Sequence + string: cell barcode type + Sequence: cell barcode is a sequence (standard option) + String: cell barcode is an arbitrary string + +soloCBwhitelist - + string(s): file(s) with whitelist(s) of cell barcodes. Only --soloType CB_UMI_Complex allows more than one whitelist file. + None ... no whitelist: all cell barcodes are allowed + +soloCBstart 1 + int>0: cell barcode start base + +soloCBlen 16 + int>0: cell barcode length + +soloUMIstart 17 + int>0: UMI start base + +soloUMIlen 10 + int>0: UMI length + +soloBarcodeReadLength 1 + int: length of the barcode read + 1 ... equal to sum of soloCBlen+soloUMIlen + 0 ... not defined, do not check + +soloBarcodeMate 0 + int: identifies which read mate contains the barcode (CB+UMI) sequence + 0 ... barcode sequence is on separate read, which should always be the last file in the --readFilesIn listed + 1 ... barcode sequence is a part of mate 1 + 2 ... barcode sequence is a part of mate 2 + +soloCBposition - + strings(s): position of Cell Barcode(s) on the barcode read. + Presently only works with --soloType CB_UMI_Complex, and barcodes are assumed to be on Read2. + Format for each barcode: startAnchor_startPosition_endAnchor_endPosition + start(end)Anchor defines the Anchor Base for the CB: 0: read start; 1: read end; 2: adapter start; 3: adapter end + start(end)Position is the 0-based position with of the CB start(end) with respect to the Anchor Base + String for different barcodes are separated by space. + Example: inDrop (Zilionis et al, Nat. Protocols, 2017): + --soloCBposition 0_0_2_-1 3_1_3_8 + +soloUMIposition - + string: position of the UMI on the barcode read, same as soloCBposition + Example: inDrop (Zilionis et al, Nat. Protocols, 2017): + --soloCBposition 3_9_3_14 + +soloAdapterSequence - + string: adapter sequence to anchor barcodes. Only one adapter sequence is allowed. + +soloAdapterMismatchesNmax 1 + int>0: maximum number of mismatches allowed in adapter sequence. + +soloCBmatchWLtype 1MM_multi + string: matching the Cell Barcodes to the WhiteList + Exact ... only exact matches allowed + 1MM ... only one match in whitelist with 1 mismatched base allowed. Allowed CBs have to have at least one read with exact match. + 1MM_multi ... multiple matches in whitelist with 1 mismatched base allowed, posterior probability calculation is used choose one of the matches. + Allowed CBs have to have at least one read with exact match. This option matches best with CellRanger 2.2.0 + 1MM_multi_pseudocounts ... same as 1MM_Multi, but pseudocounts of 1 are added to all whitelist barcodes. + 1MM_multi_Nbase_pseudocounts ... same as 1MM_multi_pseudocounts, multimatching to WL is allowed for CBs with N-bases. This option matches best with CellRanger >= 3.0.0 + EditDist_2 ... allow up to edit distance of 3 fpr each of the barcodes. May include one deletion + one insertion. Only works with --soloType CB_UMI_Complex. Matches to multiple passlist barcdoes are not allowed. Similar to ParseBio Split-seq pipeline. + +soloInputSAMattrBarcodeSeq - + string(s): when inputting reads from a SAM file (--readsFileType SAM SE/PE), these SAM attributes mark the barcode sequence (in proper order). + For instance, for 10X CellRanger or STARsolo BAMs, use --soloInputSAMattrBarcodeSeq CR UR . + This parameter is required when running STARsolo with input from SAM. + +soloInputSAMattrBarcodeQual - + string(s): when inputting reads from a SAM file (--readsFileType SAM SE/PE), these SAM attributes mark the barcode qualities (in proper order). + For instance, for 10X CellRanger or STARsolo BAMs, use --soloInputSAMattrBarcodeQual CY UY . + If this parameter is '-' (default), the quality 'H' will be assigned to all bases. + +soloStrand Forward + string: strandedness of the solo libraries: + Unstranded ... no strand information + Forward ... read strand same as the original RNA molecule + Reverse ... read strand opposite to the original RNA molecule + +soloFeatures Gene + string(s): genomic features for which the UMI counts per Cell Barcode are collected + Gene ... genes: reads match the gene transcript + SJ ... splice junctions: reported in SJ.out.tab + GeneFull ... full gene (pre-mRNA): count all reads overlapping genes' exons and introns + GeneFull_ExonOverIntron ... full gene (pre-mRNA): count all reads overlapping genes' exons and introns: prioritize 100% overlap with exons + GeneFull_Ex50pAS ... full gene (pre-RNA): count all reads overlapping genes' exons and introns: prioritize >50% overlap with exons. Do not count reads with 100% exonic overlap in the antisense direction. + +#####UnderDevelopment_begin : not supported - do not use + Transcript3p ... quantification of transcript for 3' protocols +#####UnderDevelopment_end + +soloMultiMappers Unique + string(s): counting method for reads mapping to multiple genes + Unique ... count only reads that map to unique genes + Uniform ... uniformly distribute multi-genic UMIs to all genes + Rescue ... distribute UMIs proportionally to unique+uniform counts (~ first iteration of EM) + PropUnique ... distribute UMIs proportionally to unique mappers, if present, and uniformly if not. + EM ... multi-gene UMIs are distributed using Expectation Maximization algorithm + +soloUMIdedup 1MM_All + string(s): type of UMI deduplication (collapsing) algorithm + 1MM_All ... all UMIs with 1 mismatch distance to each other are collapsed (i.e. counted once). + 1MM_Directional_UMItools ... follows the "directional" method from the UMI-tools by Smith, Heger and Sudbery (Genome Research 2017). + 1MM_Directional ... same as 1MM_Directional_UMItools, but with more stringent criteria for duplicate UMIs + Exact ... only exactly matching UMIs are collapsed. + NoDedup ... no deduplication of UMIs, count all reads. + 1MM_CR ... CellRanger2-4 algorithm for 1MM UMI collapsing. + +soloUMIfiltering - + string(s): type of UMI filtering (for reads uniquely mapping to genes) + - ... basic filtering: remove UMIs with N and homopolymers (similar to CellRanger 2.2.0). + MultiGeneUMI ... basic + remove lower-count UMIs that map to more than one gene. + MultiGeneUMI_All ... basic + remove all UMIs that map to more than one gene. + MultiGeneUMI_CR ... basic + remove lower-count UMIs that map to more than one gene, matching CellRanger > 3.0.0 . + Only works with --soloUMIdedup 1MM_CR + +soloOutFileNames Solo.out/ features.tsv barcodes.tsv matrix.mtx + string(s): file names for STARsolo output: + file_name_prefix gene_names barcode_sequences cell_feature_count_matrix + +soloCellFilter CellRanger2.2 3000 0.99 10 + string(s): cell filtering type and parameters + None ... do not output filtered cells + TopCells ... only report top cells by UMI count, followed by the exact number of cells + CellRanger2.2 ... simple filtering of CellRanger 2.2. + Can be followed by numbers: number of expected cells, robust maximum percentile for UMI count, maximum to minimum ratio for UMI count + The harcoded values are from CellRanger: nExpectedCells=3000; maxPercentile=0.99; maxMinRatio=10 + EmptyDrops_CR ... EmptyDrops filtering in CellRanger flavor. Please cite the original EmptyDrops paper: A.T.L Lun et al, Genome Biology, 20, 63 (2019): https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1662-y + Can be followed by 10 numeric parameters: nExpectedCells maxPercentile maxMinRatio indMin indMax umiMin umiMinFracMedian candMaxN FDR simN + The harcoded values are from CellRanger: 3000 0.99 10 45000 90000 500 0.01 20000 0.01 10000 + +soloOutFormatFeaturesGeneField3 "Gene Expression" + string(s): field 3 in the Gene features.tsv file. If "-", then no 3rd field is output. + +soloCellReadStats None + string: Output reads statistics for each CB + Standard ... standard output + +#####UnderDevelopment_begin : not supported - do not use +soloClusterCBfile - + string: file containing the cluster information for cell barcodes, two columns: CB cluster_index. Only used with --soloFeatures Transcript3p +#####UnderDevelopment_end diff --git a/src/star/star_genome_generate/script.sh b/src/star/star_genome_generate/script.sh new file mode 100644 index 00000000..cb3b906c --- /dev/null +++ b/src/star/star_genome_generate/script.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +## VIASH START +## VIASH END + +mkdir -p $par_index + +STAR \ + --runMode genomeGenerate \ + --genomeDir $par_index \ + --genomeFastaFiles $par_genomeFastaFiles \ + ${meta_cpus:+--runThreadN "${meta_cpus}"} \ + ${par_sjdbGTFfile:+--sjdbGTFfile "${par_sjdbGTFfile}"} \ + ${par_sjdbOverhang:+--sjdbOverhang "${par_sjdbOverhang}"} \ + ${par_genomeSAindexNbases:+--genomeSAindexNbases "${par_genomeSAindexNbases}"} \ + ${par_sjdbGTFchrPrefix:+--sjdbGTFchrPrefix "${par_sjdbGTFchrPrefix}"} \ + ${par_sjdbGTFfeatureExon:+--sjdbGTFfeatureExon "${par_sjdbGTFfeatureExon}"} \ + ${par_sjdbGTFtagExonParentTranscript:+--sjdbGTFtagExonParentTranscript "${par_sjdbGTFtagExonParentTranscript}"} \ + ${par_sjdbGTFtagExonParentGene:+--sjdbGTFtagExonParentGene "${par_sjdbGTFtagExonParentGene}"} \ + ${par_sjdbGTFtagExonParentGeneName:+--sjdbGTFtagExonParentGeneName "${par_sjdbGTFtagExonParentGeneName}"} \ + ${par_sjdbGTFtagExonParentGeneType:+--sjdbGTFtagExonParentGeneType "${sjdbGTFtagExonParentGeneType}"} \ + ${par_limitGenomeGenerateRAM:+--limitGenomeGenerateRAM "${par_limitGenomeGenerateRAM}"} \ + ${par_genomeChrBinNbits:+--genomeChrBinNbits "${par_genomeChrBinNbits}"} \ + ${par_genomeSAsparseD:+--genomeSAsparseD "${par_genomeSAsparseD}"} \ + ${par_genomeSuffixLengthMax:+--genomeSuffixLengthMax "${par_genomeSuffixLengthMax}"} \ + ${par_genomeTransformType:+--genomeTransformType "${par_genomeTransformType}"} \ + ${par_genomeTransformVCF:+--genomeTransformVCF "${par_genomeTransformVCF}"} \ diff --git a/src/star/star_genome_generate/test.sh b/src/star/star_genome_generate/test.sh new file mode 100644 index 00000000..fd0e4775 --- /dev/null +++ b/src/star/star_genome_generate/test.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e + +## VIASH START +## VIASH END + +######################################################################################### + +echo "> Prepare test data" + +cat > genome.fasta <<'EOF' +>chr1 +TGGCATGAGCCAACGAACGCTGCCTCATAAGCCTCACACATCCGCGCCTATGTTGTGACTCTCTGTGAGCGTTCGTGGG +GCTCGTCACCACTATGGTTGGCCGGTTAGTAGTGTGACTCCTGGTTTTCTGGAGCTTCTTTAAACCGTAGTCCAGTCAA +TGCGAATGGCACTTCACGACGGACTGTCCTTAGCTCAGGGGA +EOF + +cat > genes.gtf <<'EOF' +chr1 example_source gene 0 50 . + . gene_id "gene1"; transcript_id "transcript1"; +chr1 example_source exon 20 40 . + . gene_id "gene1"; transcript_id "transcript1"; +EOF + +######################################################################################### + +echo "> Generate index" +"$meta_executable" \ + ${meta_cpus:+---cpus $meta_cpus} \ + --index "star_index/" \ + --genomeFastaFiles "genome.fasta" \ + --sjdbGTFfile "genes.gtf" \ + --genomeSAindexNbases 2 + +files=("Genome" "Log.out" "SA" "SAindex" "chrLength.txt" "chrName.txt" "chrNameLength.txt" "chrStart.txt" "exonGeTrInfo.tab" "exonInfo.tab" "geneInfo.tab" "genomeParameters.txt" "sjdbInfo.txt" "sjdbList.fromGTF.out.tab" "sjdbList.out.tab" "transcriptInfo.tab") + +echo ">> Check if output exists" +[ ! -d "star_index" ] && echo "Directory 'star_index' does not exist!" && exit 1 +for file in "${files[@]}"; do + [ ! -f "star_index/$file" ] && echo "File '$file' does not exist in 'star_index'." && exit 1 +done + +echo ">> Check contents of output files" +grep -q "200" "star_index/chrLength.txt" || (echo "Chromosome length in file 'chrLength.txt' is incorrect! " && exit 1) +grep -q "chr1" "star_index/chrName.txt" || (echo "Chromosome name in file 'chrName.txt' is incorrect! " && exit 1) +grep -q "chr1 200" "star_index/chrNameLength.txt" || (echo "Chromosome name in file 'chrNameLength.txt' is incorrect! " && exit 1) + +echo ">>> Test finished successfully" +exit 0 diff --git a/target/executable/arriba/.config.vsh.yaml b/target/executable/arriba/.config.vsh.yaml index 7729eabf..a446b413 100644 --- a/target/executable/arriba/.config.vsh.yaml +++ b/target/executable/arriba/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "arriba" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -670,7 +670,7 @@ engines: id: "docker" image: "quay.io/biocontainers/arriba:2.4.0--h0033a41_2" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -688,11 +688,11 @@ build_info: output: "target/executable/arriba" executable: "target/executable/arriba/arriba" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -702,16 +702,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/arriba/arriba b/target/executable/arriba/arriba index b17f2128..9fb3a2fd 100755 --- a/target/executable/arriba/arriba +++ b/target/executable/arriba/arriba @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# arriba v0.1 +# arriba v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "arriba v0.1" + echo "arriba v0.1.0" echo "" echo "Detect gene fusions from RNA-Seq data" echo "" @@ -749,10 +749,10 @@ ENTRYPOINT [] RUN arriba -h | grep 'Version:' 2>&1 | sed 's/Version:\s\(.*\)/arriba: "\1"/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component arriba" -LABEL org.opencontainers.image.created="2024-06-24T08:44:05Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:37Z" LABEL org.opencontainers.image.source="https://github.com/suhrig/arriba" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -875,7 +875,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "arriba v0.1" + echo "arriba v0.1.0" exit ;; --bam) @@ -1589,7 +1589,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/arriba:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/arriba:v0.1.0' fi # print dockerfile diff --git a/target/executable/bcl_convert/.config.vsh.yaml b/target/executable/bcl_convert/.config.vsh.yaml index b97c2c0c..ae8993e3 100644 --- a/target/executable/bcl_convert/.config.vsh.yaml +++ b/target/executable/bcl_convert/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "bcl_convert" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Input arguments" arguments: @@ -270,8 +270,8 @@ resources: path: "script.sh" is_executable: true description: "Convert bcl files to fastq files using bcl-convert.\nInformation about\ - \ upgrading from bcl2fastq via\nhttps://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html\n\ - and https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html\n" + \ upgrading from bcl2fastq via\n[Upgrading from bcl2fastq to BCL Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html)\n\ + and [BCL Convert Compatible Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html)\n" test_resources: - type: "bash_script" path: "test.sh" @@ -283,7 +283,7 @@ requirements: - "ps" license: "MIT" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" runners: - type: "executable" id: "executable" @@ -354,7 +354,7 @@ engines: id: "docker" image: "debian:trixie-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "apt" @@ -386,11 +386,11 @@ build_info: output: "target/executable/bcl_convert" executable: "target/executable/bcl_convert/bcl_convert" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -400,16 +400,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/bcl_convert/bcl_convert b/target/executable/bcl_convert/bcl_convert index 695efaf3..60971eec 100755 --- a/target/executable/bcl_convert/bcl_convert +++ b/target/executable/bcl_convert/bcl_convert @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# bcl_convert v0.1 +# bcl_convert v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,13 +171,14 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "bcl_convert v0.1" + echo "bcl_convert v0.1.0" echo "" echo "Convert bcl files to fastq files using bcl-convert." echo "Information about upgrading from bcl2fastq via" - echo "https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html" - echo "and" - echo "https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html" + echo "[Upgrading from bcl2fastq to BCL" + echo "Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html)" + echo "and [BCL Convert Compatible" + echo "Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html)" echo "" echo "Input arguments:" echo " -i, --bcl_input_directory" @@ -592,10 +593,10 @@ rm /tmp/bcl-convert.rpm RUN echo "bcl-convert: \"$(bcl-convert -V 2>&1 >/dev/null | sed -n '/Version/ s/^bcl-convert\ Version //p')\"" > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component bcl_convert" -LABEL org.opencontainers.image.created="2024-06-24T08:43:59Z" -LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobbox" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.created="2024-06-24T09:12:31Z" +LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobox" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -718,7 +719,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "bcl_convert v0.1" + echo "bcl_convert v0.1.0" exit ;; --bcl_input_directory) @@ -1068,7 +1069,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/bcl_convert:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/bcl_convert:v0.1.0' fi # print dockerfile diff --git a/target/executable/bgzip/.config.vsh.yaml b/target/executable/bedtools/bedtools_getfasta/.config.vsh.yaml similarity index 51% rename from target/executable/bgzip/.config.vsh.yaml rename to target/executable/bedtools/bedtools_getfasta/.config.vsh.yaml index b2b404f4..ea811242 100644 --- a/target/executable/bgzip/.config.vsh.yaml +++ b/target/executable/bedtools/bedtools_getfasta/.config.vsh.yaml @@ -1,23 +1,57 @@ -name: "bgzip" -version: "v0.1" +name: "bedtools_getfasta" +namespace: "bedtools" +version: "v0.1.0" argument_groups: -- name: "Inputs" +- name: "Input arguments" arguments: - type: "file" - name: "--input" - description: "file to be compressed or decompressed" + name: "--input_fasta" + description: "FASTA file containing sequences for each interval specified in the\ + \ input BED file.\nThe headers in the input FASTA file must exactly match the\ + \ chromosome column in the BED file.\n" info: null must_exist: true create_parent: true - required: true + required: false direction: "input" multiple: false multiple_sep: ";" -- name: "Outputs" + - type: "file" + name: "--input_bed" + description: "BED file containing intervals to extract from the FASTA file.\n\ + BED files containing a single region require a newline character\nat the end\ + \ of the line, otherwise a blank output file is produced.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--rna" + description: "The FASTA is RNA not DNA. Reverse complementation handled accordingly.\n" + info: null + direction: "input" +- name: "Run arguments" + arguments: + - type: "boolean_true" + name: "--strandedness" + alternatives: + - "-s" + description: "Force strandedness. If the feature occupies the antisense strand,\ + \ the output sequence will\nbe reverse complemented. By default strandedness\ + \ is not taken into account.\n" + info: null + direction: "input" +- name: "Output arguments" arguments: - type: "file" name: "--output" - description: "compressed or decompressed output" + alternatives: + - "-o" + description: "Output file where the output from the 'bedtools getfasta' commend\ + \ will\nbe written to.\n" info: null must_exist: true create_parent: true @@ -25,149 +59,71 @@ argument_groups: direction: "output" multiple: false multiple_sep: ";" - - type: "file" - name: "--index_name" - alternatives: - - "-I" - description: "name of BGZF index file [file.gz.gzi]" - info: null - must_exist: true - create_parent: true - required: false - direction: "output" - multiple: false - multiple_sep: ";" -- name: "Arguments" - arguments: - - type: "integer" - name: "--offset" - alternatives: - - "-b" - description: "decompress at virtual file pointer (0-based uncompressed offset)" - info: null - required: false - direction: "input" - multiple: false - multiple_sep: ";" - type: "boolean_true" - name: "--decompress" - alternatives: - - "-d" - description: "decompress the input file" + name: "--tab" + description: "Report extract sequences in a tab-delimited format instead of in\ + \ FASTA format.\n" info: null direction: "input" - type: "boolean_true" - name: "--rebgzip" - alternatives: - - "-g" - description: "use an index file to bgzip a file" + name: "--bed_out" + description: "Report extract sequences in a tab-delimited BED format instead of\ + \ in FASTA format.\n" info: null direction: "input" - type: "boolean_true" - name: "--index" - alternatives: - - "-i" - description: "compress and create BGZF index" - info: null - direction: "input" - - type: "integer" - name: "--compress_level" - alternatives: - - "-l" - description: "compression level to use when compressing; 0 to 9, or -1 for default\ - \ [-1]" - info: null - required: false - min: -1 - max: 9 - direction: "input" - multiple: false - multiple_sep: ";" - - type: "boolean_true" - name: "--reindex" - alternatives: - - "-r" - description: "(re)index the output file" - info: null - direction: "input" - - type: "integer" - name: "--size" - alternatives: - - "-s" - description: "decompress INT bytes (uncompressed size)" - info: null - required: false - min: 0 - direction: "input" - multiple: false - multiple_sep: ";" - - type: "boolean_true" - name: "--test" - alternatives: - - "-t" - description: "test integrity of compressed file" + name: "--name" + description: "Set the FASTA header for each extracted sequence to be the \"name\"\ + \ and coordinate columns from the BED feature.\n" info: null direction: "input" - type: "boolean_true" - name: "--binary" - description: "Don't align blocks with text lines" + name: "--name_only" + description: "Set the FASTA header for each extracted sequence to be the \"name\"\ + \ columns from the BED feature.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--split" + description: "When --input is in BED12 format, create a separate fasta entry for\ + \ each block in a BED12 record,\nblocks being described in the 11th and 12th\ + \ column of the BED.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--full_header" + description: "Use full fasta header. By default, only the word before the first\ + \ space or tab is used.\n" info: null direction: "input" resources: - type: "bash_script" - text: | - [[ "$par_decompress" == "false" ]] && unset par_decompress - [[ "$par_rebgzip" == "false" ]] && unset par_rebgzip - [[ "$par_index" == "false" ]] && unset par_index - [[ "$par_reindex" == "false" ]] && unset par_reindex - [[ "$par_test" == "false" ]] && unset par_test - [[ "$par_binary" == "false" ]] && unset par_binary - bgzip -c \ - ${meta_cpus:+--threads "${meta_cpus}"} \ - ${par_offset:+-b "${par_offset}"} \ - ${par_decompress:+-d} \ - ${par_rebgzip:+-g} \ - ${par_index:+-i} \ - ${par_index_name:+-I "${par_index_name}"} \ - ${par_compress_level:+-l "${par_compress_level}"} \ - ${par_reindex:+-r} \ - ${par_size:+-s "${par_size}"} \ - ${par_test:+-t} \ - ${par_binary:+--binary} \ - "$par_input" > "$par_output" - - - dest: "./script.sh" + path: "script.sh" is_executable: true -description: "Block compression/decompression utility" +description: "Extract sequences from a FASTA file for each of the intervals defined\ + \ in a BED/GFF/VCF file." test_resources: - type: "bash_script" - text: "set -e\n\n\"$meta_executable\" --input \"$meta_resources_dir/test_data/test.vcf\"\ - \ --output \"test.vcf.gz\"\n\necho \">> Checking output of compressing\"\n[ !\ - \ -f \"test.vcf.gz\" ] && echo \"Output file test.vcf.gz does not exist\" && exit\ - \ 1\n\n\"$meta_executable\" --input \"test.vcf.gz\" --output \"test.vcf\" --decompress\n\ - \necho \">> Checking output of decompressing\"\n[ ! -f \"test.vcf\" ] && echo\ - \ \"Output file test.vcf does not exist\" && exit 1\n\necho \">> Checking original\ - \ and decompressed files are the same\"\nset +e\ncmp --silent -- \"$meta_resources_dir/test_data/test.vcf\"\ - \ \"test.vcf\"\n[ $? -ne 0 ] && echo \"files are different\" && exit 1\nset -e\n\ - \necho \"> Test successful\"\n" - dest: "./script.sh" + path: "test.sh" is_executable: true -- type: "file" - path: "test_data" info: null status: "enabled" requirements: commands: - "ps" -license: "MIT" +keywords: +- "sequencing" +- "fasta" +- "BED" +- "GFF" +- "VCF" +license: "GPL-2.0" references: doi: - - "10.1093/gigascience/giab007" + - "10.1093/bioinformatics/btq033" links: - repository: "https://github.com/samtools/htslib" - homepage: "https://www.htslib.org/" - documentation: "https://www.htslib.org/doc/bgzip.html" + repository: "https://github.com/arq5x/bedtools2" + documentation: "https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html" runners: - type: "executable" id: "executable" @@ -236,31 +192,36 @@ runners: engines: - type: "docker" id: "docker" - image: "quay.io/biocontainers/htslib:1.19--h81da01d_0" + image: "debian:stable-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: + - type: "apt" + packages: + - "bedtools" + - "procps" + interactive: false - type: "docker" run: - - "bgzip -h | grep 'Version:' 2>&1 | sed 's/Version:\\s\\(.*\\)/bgzip: \"\\1\"\ - /' > /var/software_versions.txt\n" + - "echo \"bedtools: \\\"$(bedtools --version | sed -n 's/^bedtools //p')\\\"\"\ + \ > /var/software_versions.txt\n" entrypoint: [] cmd: null - type: "native" id: "native" build_info: - config: "src/bgzip/config.vsh.yaml" + config: "src/bedtools/bedtools_getfasta/config.vsh.yaml" runner: "executable" engine: "docker|native" - output: "target/executable/bgzip" - executable: "target/executable/bgzip/bgzip" + output: "target/executable/bedtools/bedtools_getfasta" + executable: "target/executable/bedtools/bedtools_getfasta/bedtools_getfasta" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -270,16 +231,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/bgzip/bgzip b/target/executable/bedtools/bedtools_getfasta/bedtools_getfasta similarity index 70% rename from target/executable/bgzip/bgzip rename to target/executable/bedtools/bedtools_getfasta/bedtools_getfasta index 9dc42d75..3e9fdf39 100755 --- a/target/executable/bgzip/bgzip +++ b/target/executable/bedtools/bedtools_getfasta/bedtools_getfasta @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# bgzip v0.1 +# bedtools_getfasta v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -162,8 +162,8 @@ VIASH_META_RESOURCES_DIR=`ViashSourceDir ${BASH_SOURCE[0]}` VIASH_TARGET_DIR=`ViashFindTargetDir $VIASH_META_RESOURCES_DIR` # define meta fields -VIASH_META_NAME="bgzip" -VIASH_META_FUNCTIONALITY_NAME="bgzip" +VIASH_META_NAME="bedtools_getfasta" +VIASH_META_FUNCTIONALITY_NAME="bedtools_getfasta" VIASH_META_EXECUTABLE="$VIASH_META_RESOURCES_DIR/$VIASH_META_NAME" VIASH_META_CONFIG="$VIASH_META_RESOURCES_DIR/.config.vsh.yaml" VIASH_META_TEMP_DIR="$VIASH_TEMP" @@ -171,64 +171,73 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "bgzip v0.1" + echo "bedtools_getfasta v0.1.0" echo "" - echo "Block compression/decompression utility" + echo "Extract sequences from a FASTA file for each of the intervals defined in a" + echo "BED/GFF/VCF file." echo "" - echo "Inputs:" - echo " --input" - echo " type: file, required parameter, file must exist" - echo " file to be compressed or decompressed" + echo "Input arguments:" + echo " --input_fasta" + echo " type: file, file must exist" + echo " FASTA file containing sequences for each interval specified in the input" + echo " BED file." + echo " The headers in the input FASTA file must exactly match the chromosome" + echo " column in the BED file." echo "" - echo "Outputs:" - echo " --output" + echo " --input_bed" + echo " type: file, file must exist" + echo " BED file containing intervals to extract from the FASTA file." + echo " BED files containing a single region require a newline character" + echo " at the end of the line, otherwise a blank output file is produced." + echo "" + echo " --rna" + echo " type: boolean_true" + echo " The FASTA is RNA not DNA. Reverse complementation handled accordingly." + echo "" + echo "Run arguments:" + echo " -s, --strandedness" + echo " type: boolean_true" + echo " Force strandedness. If the feature occupies the antisense strand, the" + echo " output sequence will" + echo " be reverse complemented. By default strandedness is not taken into" + echo " account." + echo "" + echo "Output arguments:" + echo " -o, --output" echo " type: file, required parameter, output, file must exist" - echo " compressed or decompressed output" + echo " Output file where the output from the 'bedtools getfasta' commend will" + echo " be written to." echo "" - echo " -I, --index_name" - echo " type: file, output, file must exist" - echo " name of BGZF index file [file.gz.gzi]" - echo "" - echo "Arguments:" - echo " -b, --offset" - echo " type: integer" - echo " decompress at virtual file pointer (0-based uncompressed offset)" - echo "" - echo " -d, --decompress" + echo " --tab" echo " type: boolean_true" - echo " decompress the input file" + echo " Report extract sequences in a tab-delimited format instead of in FASTA" + echo " format." echo "" - echo " -g, --rebgzip" + echo " --bed_out" echo " type: boolean_true" - echo " use an index file to bgzip a file" + echo " Report extract sequences in a tab-delimited BED format instead of in" + echo " FASTA format." echo "" - echo " -i, --index" + echo " --name" echo " type: boolean_true" - echo " compress and create BGZF index" + echo " Set the FASTA header for each extracted sequence to be the \"name\" and" + echo " coordinate columns from the BED feature." echo "" - echo " -l, --compress_level" - echo " type: integer" - echo " min: -1" - echo " max: 9" - echo " compression level to use when compressing; 0 to 9, or -1 for default" - echo " [-1]" - echo "" - echo " -r, --reindex" + echo " --name_only" echo " type: boolean_true" - echo " (re)index the output file" + echo " Set the FASTA header for each extracted sequence to be the \"name\"" + echo " columns from the BED feature." echo "" - echo " -s, --size" - echo " type: integer" - echo " min: 0" - echo " decompress INT bytes (uncompressed size)" - echo "" - echo " -t, --test" + echo " --split" echo " type: boolean_true" - echo " test integrity of compressed file" + echo " When --input is in BED12 format, create a separate fasta entry for each" + echo " block in a BED12 record," + echo " blocks being described in the 11th and 12th column of the BED." echo "" - echo " --binary" + echo " --full_header" echo " type: boolean_true" - echo " Don't align blocks with text lines" + echo " Use full fasta header. By default, only the word before the first space" + echo " or tab is used." } # initialise variables @@ -503,15 +512,19 @@ function ViashDockerfile { if [[ "$engine_id" == "docker" ]]; then cat << 'VIASHDOCKER' -FROM quay.io/biocontainers/htslib:1.19--h81da01d_0 +FROM debian:stable-slim ENTRYPOINT [] -RUN bgzip -h | grep 'Version:' 2>&1 | sed 's/Version:\s\(.*\)/bgzip: "\1"/' > /var/software_versions.txt +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y bedtools procps && \ + rm -rf /var/lib/apt/lists/* -LABEL org.opencontainers.image.description="Companion container for running component bgzip" -LABEL org.opencontainers.image.created="2024-06-24T08:43:58Z" -LABEL org.opencontainers.image.source="https://github.com/samtools/htslib" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +RUN echo "bedtools: \"$(bedtools --version | sed -n 's/^bedtools //p')\"" > /var/software_versions.txt + +LABEL org.opencontainers.image.description="Companion container for running component bedtools bedtools_getfasta" +LABEL org.opencontainers.image.created="2024-06-24T09:12:39Z" +LABEL org.opencontainers.image.source="https://github.com/arq5x/bedtools2" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -634,18 +647,44 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "bgzip v0.1" + echo "bedtools_getfasta v0.1.0" exit ;; - --input) - [ -n "$VIASH_PAR_INPUT" ] && ViashError Bad arguments for option \'--input\': \'$VIASH_PAR_INPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INPUT="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to --input. Use "--help" to get more information on the parameters. && exit 1 + --input_fasta) + [ -n "$VIASH_PAR_INPUT_FASTA" ] && ViashError Bad arguments for option \'--input_fasta\': \'$VIASH_PAR_INPUT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_FASTA="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_fasta. Use "--help" to get more information on the parameters. && exit 1 shift 2 ;; - --input=*) - [ -n "$VIASH_PAR_INPUT" ] && ViashError Bad arguments for option \'--input=*\': \'$VIASH_PAR_INPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INPUT=$(ViashRemoveFlags "$1") + --input_fasta=*) + [ -n "$VIASH_PAR_INPUT_FASTA" ] && ViashError Bad arguments for option \'--input_fasta=*\': \'$VIASH_PAR_INPUT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_FASTA=$(ViashRemoveFlags "$1") + shift 1 + ;; + --input_bed) + [ -n "$VIASH_PAR_INPUT_BED" ] && ViashError Bad arguments for option \'--input_bed\': \'$VIASH_PAR_INPUT_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_BED="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_bed. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --input_bed=*) + [ -n "$VIASH_PAR_INPUT_BED" ] && ViashError Bad arguments for option \'--input_bed=*\': \'$VIASH_PAR_INPUT_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_BED=$(ViashRemoveFlags "$1") + shift 1 + ;; + --rna) + [ -n "$VIASH_PAR_RNA" ] && ViashError Bad arguments for option \'--rna\': \'$VIASH_PAR_RNA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_RNA=true + shift 1 + ;; + --strandedness) + [ -n "$VIASH_PAR_STRANDEDNESS" ] && ViashError Bad arguments for option \'--strandedness\': \'$VIASH_PAR_STRANDEDNESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_STRANDEDNESS=true + shift 1 + ;; + -s) + [ -n "$VIASH_PAR_STRANDEDNESS" ] && ViashError Bad arguments for option \'-s\': \'$VIASH_PAR_STRANDEDNESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_STRANDEDNESS=true shift 1 ;; --output) @@ -659,127 +698,40 @@ while [[ $# -gt 0 ]]; do VIASH_PAR_OUTPUT=$(ViashRemoveFlags "$1") shift 1 ;; - --index_name) - [ -n "$VIASH_PAR_INDEX_NAME" ] && ViashError Bad arguments for option \'--index_name\': \'$VIASH_PAR_INDEX_NAME\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INDEX_NAME="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to --index_name. Use "--help" to get more information on the parameters. && exit 1 + -o) + [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'-o\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OUTPUT="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -o. Use "--help" to get more information on the parameters. && exit 1 shift 2 ;; - --index_name=*) - [ -n "$VIASH_PAR_INDEX_NAME" ] && ViashError Bad arguments for option \'--index_name=*\': \'$VIASH_PAR_INDEX_NAME\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INDEX_NAME=$(ViashRemoveFlags "$1") + --tab) + [ -n "$VIASH_PAR_TAB" ] && ViashError Bad arguments for option \'--tab\': \'$VIASH_PAR_TAB\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_TAB=true shift 1 ;; - -I) - [ -n "$VIASH_PAR_INDEX_NAME" ] && ViashError Bad arguments for option \'-I\': \'$VIASH_PAR_INDEX_NAME\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INDEX_NAME="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to -I. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --offset) - [ -n "$VIASH_PAR_OFFSET" ] && ViashError Bad arguments for option \'--offset\': \'$VIASH_PAR_OFFSET\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_OFFSET="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to --offset. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --offset=*) - [ -n "$VIASH_PAR_OFFSET" ] && ViashError Bad arguments for option \'--offset=*\': \'$VIASH_PAR_OFFSET\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_OFFSET=$(ViashRemoveFlags "$1") + --bed_out) + [ -n "$VIASH_PAR_BED_OUT" ] && ViashError Bad arguments for option \'--bed_out\': \'$VIASH_PAR_BED_OUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_BED_OUT=true shift 1 ;; - -b) - [ -n "$VIASH_PAR_OFFSET" ] && ViashError Bad arguments for option \'-b\': \'$VIASH_PAR_OFFSET\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_OFFSET="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to -b. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --decompress) - [ -n "$VIASH_PAR_DECOMPRESS" ] && ViashError Bad arguments for option \'--decompress\': \'$VIASH_PAR_DECOMPRESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_DECOMPRESS=true + --name) + [ -n "$VIASH_PAR_NAME" ] && ViashError Bad arguments for option \'--name\': \'$VIASH_PAR_NAME\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_NAME=true shift 1 ;; - -d) - [ -n "$VIASH_PAR_DECOMPRESS" ] && ViashError Bad arguments for option \'-d\': \'$VIASH_PAR_DECOMPRESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_DECOMPRESS=true + --name_only) + [ -n "$VIASH_PAR_NAME_ONLY" ] && ViashError Bad arguments for option \'--name_only\': \'$VIASH_PAR_NAME_ONLY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_NAME_ONLY=true shift 1 ;; - --rebgzip) - [ -n "$VIASH_PAR_REBGZIP" ] && ViashError Bad arguments for option \'--rebgzip\': \'$VIASH_PAR_REBGZIP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_REBGZIP=true + --split) + [ -n "$VIASH_PAR_SPLIT" ] && ViashError Bad arguments for option \'--split\': \'$VIASH_PAR_SPLIT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SPLIT=true shift 1 ;; - -g) - [ -n "$VIASH_PAR_REBGZIP" ] && ViashError Bad arguments for option \'-g\': \'$VIASH_PAR_REBGZIP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_REBGZIP=true - shift 1 - ;; - --index) - [ -n "$VIASH_PAR_INDEX" ] && ViashError Bad arguments for option \'--index\': \'$VIASH_PAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INDEX=true - shift 1 - ;; - -i) - [ -n "$VIASH_PAR_INDEX" ] && ViashError Bad arguments for option \'-i\': \'$VIASH_PAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_INDEX=true - shift 1 - ;; - --compress_level) - [ -n "$VIASH_PAR_COMPRESS_LEVEL" ] && ViashError Bad arguments for option \'--compress_level\': \'$VIASH_PAR_COMPRESS_LEVEL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_COMPRESS_LEVEL="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to --compress_level. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --compress_level=*) - [ -n "$VIASH_PAR_COMPRESS_LEVEL" ] && ViashError Bad arguments for option \'--compress_level=*\': \'$VIASH_PAR_COMPRESS_LEVEL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_COMPRESS_LEVEL=$(ViashRemoveFlags "$1") - shift 1 - ;; - -l) - [ -n "$VIASH_PAR_COMPRESS_LEVEL" ] && ViashError Bad arguments for option \'-l\': \'$VIASH_PAR_COMPRESS_LEVEL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_COMPRESS_LEVEL="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to -l. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --reindex) - [ -n "$VIASH_PAR_REINDEX" ] && ViashError Bad arguments for option \'--reindex\': \'$VIASH_PAR_REINDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_REINDEX=true - shift 1 - ;; - -r) - [ -n "$VIASH_PAR_REINDEX" ] && ViashError Bad arguments for option \'-r\': \'$VIASH_PAR_REINDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_REINDEX=true - shift 1 - ;; - --size) - [ -n "$VIASH_PAR_SIZE" ] && ViashError Bad arguments for option \'--size\': \'$VIASH_PAR_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_SIZE="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to --size. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --size=*) - [ -n "$VIASH_PAR_SIZE" ] && ViashError Bad arguments for option \'--size=*\': \'$VIASH_PAR_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_SIZE=$(ViashRemoveFlags "$1") - shift 1 - ;; - -s) - [ -n "$VIASH_PAR_SIZE" ] && ViashError Bad arguments for option \'-s\': \'$VIASH_PAR_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_SIZE="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to -s. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --test) - [ -n "$VIASH_PAR_TEST" ] && ViashError Bad arguments for option \'--test\': \'$VIASH_PAR_TEST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_TEST=true - shift 1 - ;; - -t) - [ -n "$VIASH_PAR_TEST" ] && ViashError Bad arguments for option \'-t\': \'$VIASH_PAR_TEST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_TEST=true - shift 1 - ;; - --binary) - [ -n "$VIASH_PAR_BINARY" ] && ViashError Bad arguments for option \'--binary\': \'$VIASH_PAR_BINARY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_BINARY=true + --full_header) + [ -n "$VIASH_PAR_FULL_HEADER" ] && ViashError Bad arguments for option \'--full_header\': \'$VIASH_PAR_FULL_HEADER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_FULL_HEADER=true shift 1 ;; ---engine) @@ -858,7 +810,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/bgzip:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/bedtools/bedtools_getfasta:v0.1.0' fi # print dockerfile @@ -938,10 +890,6 @@ fi # check whether required parameters exist -if [ -z ${VIASH_PAR_INPUT+x} ]; then - ViashError '--input' is a required argument. Use "--help" to get more information on the parameters. - exit 1 -fi if [ -z ${VIASH_PAR_OUTPUT+x} ]; then ViashError '--output' is a required argument. Use "--help" to get more information on the parameters. exit 1 @@ -972,95 +920,87 @@ if [ -z ${VIASH_META_TEMP_DIR+x} ]; then fi # filling in defaults -if [ -z ${VIASH_PAR_DECOMPRESS+x} ]; then - VIASH_PAR_DECOMPRESS="false" +if [ -z ${VIASH_PAR_RNA+x} ]; then + VIASH_PAR_RNA="false" fi -if [ -z ${VIASH_PAR_REBGZIP+x} ]; then - VIASH_PAR_REBGZIP="false" +if [ -z ${VIASH_PAR_STRANDEDNESS+x} ]; then + VIASH_PAR_STRANDEDNESS="false" fi -if [ -z ${VIASH_PAR_INDEX+x} ]; then - VIASH_PAR_INDEX="false" +if [ -z ${VIASH_PAR_TAB+x} ]; then + VIASH_PAR_TAB="false" fi -if [ -z ${VIASH_PAR_REINDEX+x} ]; then - VIASH_PAR_REINDEX="false" +if [ -z ${VIASH_PAR_BED_OUT+x} ]; then + VIASH_PAR_BED_OUT="false" fi -if [ -z ${VIASH_PAR_TEST+x} ]; then - VIASH_PAR_TEST="false" +if [ -z ${VIASH_PAR_NAME+x} ]; then + VIASH_PAR_NAME="false" fi -if [ -z ${VIASH_PAR_BINARY+x} ]; then - VIASH_PAR_BINARY="false" +if [ -z ${VIASH_PAR_NAME_ONLY+x} ]; then + VIASH_PAR_NAME_ONLY="false" +fi +if [ -z ${VIASH_PAR_SPLIT+x} ]; then + VIASH_PAR_SPLIT="false" +fi +if [ -z ${VIASH_PAR_FULL_HEADER+x} ]; then + VIASH_PAR_FULL_HEADER="false" fi # check whether required files exist -if [ ! -z "$VIASH_PAR_INPUT" ] && [ ! -e "$VIASH_PAR_INPUT" ]; then - ViashError "Input file '$VIASH_PAR_INPUT' does not exist." +if [ ! -z "$VIASH_PAR_INPUT_FASTA" ] && [ ! -e "$VIASH_PAR_INPUT_FASTA" ]; then + ViashError "Input file '$VIASH_PAR_INPUT_FASTA' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_INPUT_BED" ] && [ ! -e "$VIASH_PAR_INPUT_BED" ]; then + ViashError "Input file '$VIASH_PAR_INPUT_BED' does not exist." exit 1 fi # check whether parameters values are of the right type -if [[ -n "$VIASH_PAR_OFFSET" ]]; then - if ! [[ "$VIASH_PAR_OFFSET" =~ ^[-+]?[0-9]+$ ]]; then - ViashError '--offset' has to be an integer. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_RNA" ]]; then + if ! [[ "$VIASH_PAR_RNA" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--rna' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_DECOMPRESS" ]]; then - if ! [[ "$VIASH_PAR_DECOMPRESS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--decompress' has to be a boolean_true. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_STRANDEDNESS" ]]; then + if ! [[ "$VIASH_PAR_STRANDEDNESS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--strandedness' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_REBGZIP" ]]; then - if ! [[ "$VIASH_PAR_REBGZIP" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--rebgzip' has to be a boolean_true. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_TAB" ]]; then + if ! [[ "$VIASH_PAR_TAB" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--tab' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_INDEX" ]]; then - if ! [[ "$VIASH_PAR_INDEX" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--index' has to be a boolean_true. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_BED_OUT" ]]; then + if ! [[ "$VIASH_PAR_BED_OUT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--bed_out' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_COMPRESS_LEVEL" ]]; then - if ! [[ "$VIASH_PAR_COMPRESS_LEVEL" =~ ^[-+]?[0-9]+$ ]]; then - ViashError '--compress_level' has to be an integer. Use "--help" to get more information on the parameters. - exit 1 - fi - if [[ $VIASH_PAR_COMPRESS_LEVEL -lt -1 ]]; then - ViashError '--compress_level' has be more than or equal to -1. Use "--help" to get more information on the parameters. - exit 1 - fi - if [[ $VIASH_PAR_COMPRESS_LEVEL -gt 9 ]]; then - ViashError '--compress_level' has be less than or equal to 9. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_NAME" ]]; then + if ! [[ "$VIASH_PAR_NAME" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--name' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_REINDEX" ]]; then - if ! [[ "$VIASH_PAR_REINDEX" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--reindex' has to be a boolean_true. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_NAME_ONLY" ]]; then + if ! [[ "$VIASH_PAR_NAME_ONLY" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--name_only' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_SIZE" ]]; then - if ! [[ "$VIASH_PAR_SIZE" =~ ^[-+]?[0-9]+$ ]]; then - ViashError '--size' has to be an integer. Use "--help" to get more information on the parameters. - exit 1 - fi - if [[ $VIASH_PAR_SIZE -lt 0 ]]; then - ViashError '--size' has be more than or equal to 0. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_SPLIT" ]]; then + if ! [[ "$VIASH_PAR_SPLIT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--split' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi -if [[ -n "$VIASH_PAR_TEST" ]]; then - if ! [[ "$VIASH_PAR_TEST" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--test' has to be a boolean_true. Use "--help" to get more information on the parameters. - exit 1 - fi -fi -if [[ -n "$VIASH_PAR_BINARY" ]]; then - if ! [[ "$VIASH_PAR_BINARY" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--binary' has to be a boolean_true. Use "--help" to get more information on the parameters. +if [[ -n "$VIASH_PAR_FULL_HEADER" ]]; then + if ! [[ "$VIASH_PAR_FULL_HEADER" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--full_header' has to be a boolean_true. Use "--help" to get more information on the parameters. exit 1 fi fi @@ -1141,9 +1081,6 @@ fi if [ ! -z "$VIASH_PAR_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT")" ]; then mkdir -p "$(dirname "$VIASH_PAR_OUTPUT")" fi -if [ ! -z "$VIASH_PAR_INDEX_NAME" ] && [ ! -d "$(dirname "$VIASH_PAR_INDEX_NAME")" ]; then - mkdir -p "$(dirname "$VIASH_PAR_INDEX_NAME")" -fi if [ "$VIASH_ENGINE_ID" == "native" ] ; then if [ "$VIASH_MODE" == "run" ]; then @@ -1157,20 +1094,19 @@ fi if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # detect volumes from file arguments VIASH_CHOWN_VARS=() -if [ ! -z "$VIASH_PAR_INPUT" ]; then - VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT")" ) - VIASH_PAR_INPUT=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT") +if [ ! -z "$VIASH_PAR_INPUT_FASTA" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT_FASTA")" ) + VIASH_PAR_INPUT_FASTA=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT_FASTA") +fi +if [ ! -z "$VIASH_PAR_INPUT_BED" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT_BED")" ) + VIASH_PAR_INPUT_BED=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT_BED") fi if [ ! -z "$VIASH_PAR_OUTPUT" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_OUTPUT")" ) VIASH_PAR_OUTPUT=$(ViashDockerAutodetectMount "$VIASH_PAR_OUTPUT") VIASH_CHOWN_VARS+=( "$VIASH_PAR_OUTPUT" ) fi -if [ ! -z "$VIASH_PAR_INDEX_NAME" ]; then - VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INDEX_NAME")" ) - VIASH_PAR_INDEX_NAME=$(ViashDockerAutodetectMount "$VIASH_PAR_INDEX_NAME") - VIASH_CHOWN_VARS+=( "$VIASH_PAR_INDEX_NAME" ) -fi if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_RESOURCES_DIR")" ) VIASH_META_RESOURCES_DIR=$(ViashDockerAutodetectMount "$VIASH_META_RESOURCES_DIR") @@ -1227,7 +1163,7 @@ fi ViashDebug "Running command: $(echo $VIASH_CMD)" cat << VIASHEOF | eval $VIASH_CMD set -e -tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-bgzip-XXXXXX").sh +tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-bedtools_getfasta-XXXXXX").sh function clean_up { rm "\$tempscript" } @@ -1240,18 +1176,17 @@ trap interrupt INT SIGINT cat > "\$tempscript" << 'VIASHMAIN' ## VIASH START # The following code has been auto-generated by Viash. -$( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_FASTA+x} ]; then echo "${VIASH_PAR_INPUT_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_input_fasta='&'#" ; else echo "# par_input_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_BED+x} ]; then echo "${VIASH_PAR_INPUT_BED}" | sed "s#'#'\"'\"'#g;s#.*#par_input_bed='&'#" ; else echo "# par_input_bed="; fi ) +$( if [ ! -z ${VIASH_PAR_RNA+x} ]; then echo "${VIASH_PAR_RNA}" | sed "s#'#'\"'\"'#g;s#.*#par_rna='&'#" ; else echo "# par_rna="; fi ) +$( if [ ! -z ${VIASH_PAR_STRANDEDNESS+x} ]; then echo "${VIASH_PAR_STRANDEDNESS}" | sed "s#'#'\"'\"'#g;s#.*#par_strandedness='&'#" ; else echo "# par_strandedness="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "${VIASH_PAR_OUTPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_output='&'#" ; else echo "# par_output="; fi ) -$( if [ ! -z ${VIASH_PAR_INDEX_NAME+x} ]; then echo "${VIASH_PAR_INDEX_NAME}" | sed "s#'#'\"'\"'#g;s#.*#par_index_name='&'#" ; else echo "# par_index_name="; fi ) -$( if [ ! -z ${VIASH_PAR_OFFSET+x} ]; then echo "${VIASH_PAR_OFFSET}" | sed "s#'#'\"'\"'#g;s#.*#par_offset='&'#" ; else echo "# par_offset="; fi ) -$( if [ ! -z ${VIASH_PAR_DECOMPRESS+x} ]; then echo "${VIASH_PAR_DECOMPRESS}" | sed "s#'#'\"'\"'#g;s#.*#par_decompress='&'#" ; else echo "# par_decompress="; fi ) -$( if [ ! -z ${VIASH_PAR_REBGZIP+x} ]; then echo "${VIASH_PAR_REBGZIP}" | sed "s#'#'\"'\"'#g;s#.*#par_rebgzip='&'#" ; else echo "# par_rebgzip="; fi ) -$( if [ ! -z ${VIASH_PAR_INDEX+x} ]; then echo "${VIASH_PAR_INDEX}" | sed "s#'#'\"'\"'#g;s#.*#par_index='&'#" ; else echo "# par_index="; fi ) -$( if [ ! -z ${VIASH_PAR_COMPRESS_LEVEL+x} ]; then echo "${VIASH_PAR_COMPRESS_LEVEL}" | sed "s#'#'\"'\"'#g;s#.*#par_compress_level='&'#" ; else echo "# par_compress_level="; fi ) -$( if [ ! -z ${VIASH_PAR_REINDEX+x} ]; then echo "${VIASH_PAR_REINDEX}" | sed "s#'#'\"'\"'#g;s#.*#par_reindex='&'#" ; else echo "# par_reindex="; fi ) -$( if [ ! -z ${VIASH_PAR_SIZE+x} ]; then echo "${VIASH_PAR_SIZE}" | sed "s#'#'\"'\"'#g;s#.*#par_size='&'#" ; else echo "# par_size="; fi ) -$( if [ ! -z ${VIASH_PAR_TEST+x} ]; then echo "${VIASH_PAR_TEST}" | sed "s#'#'\"'\"'#g;s#.*#par_test='&'#" ; else echo "# par_test="; fi ) -$( if [ ! -z ${VIASH_PAR_BINARY+x} ]; then echo "${VIASH_PAR_BINARY}" | sed "s#'#'\"'\"'#g;s#.*#par_binary='&'#" ; else echo "# par_binary="; fi ) +$( if [ ! -z ${VIASH_PAR_TAB+x} ]; then echo "${VIASH_PAR_TAB}" | sed "s#'#'\"'\"'#g;s#.*#par_tab='&'#" ; else echo "# par_tab="; fi ) +$( if [ ! -z ${VIASH_PAR_BED_OUT+x} ]; then echo "${VIASH_PAR_BED_OUT}" | sed "s#'#'\"'\"'#g;s#.*#par_bed_out='&'#" ; else echo "# par_bed_out="; fi ) +$( if [ ! -z ${VIASH_PAR_NAME+x} ]; then echo "${VIASH_PAR_NAME}" | sed "s#'#'\"'\"'#g;s#.*#par_name='&'#" ; else echo "# par_name="; fi ) +$( if [ ! -z ${VIASH_PAR_NAME_ONLY+x} ]; then echo "${VIASH_PAR_NAME_ONLY}" | sed "s#'#'\"'\"'#g;s#.*#par_name_only='&'#" ; else echo "# par_name_only="; fi ) +$( if [ ! -z ${VIASH_PAR_SPLIT+x} ]; then echo "${VIASH_PAR_SPLIT}" | sed "s#'#'\"'\"'#g;s#.*#par_split='&'#" ; else echo "# par_split="; fi ) +$( if [ ! -z ${VIASH_PAR_FULL_HEADER+x} ]; then echo "${VIASH_PAR_FULL_HEADER}" | sed "s#'#'\"'\"'#g;s#.*#par_full_header='&'#" ; else echo "# par_full_header="; fi ) $( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) $( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) $( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\"'\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) @@ -1272,25 +1207,27 @@ $( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}" $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi ) ## VIASH END -[[ "\$par_decompress" == "false" ]] && unset par_decompress -[[ "\$par_rebgzip" == "false" ]] && unset par_rebgzip -[[ "\$par_index" == "false" ]] && unset par_index -[[ "\$par_reindex" == "false" ]] && unset par_reindex -[[ "\$par_test" == "false" ]] && unset par_test -[[ "\$par_binary" == "false" ]] && unset par_binary -bgzip -c \\ - \${meta_cpus:+--threads "\${meta_cpus}"} \\ - \${par_offset:+-b "\${par_offset}"} \\ - \${par_decompress:+-d} \\ - \${par_rebgzip:+-g} \\ - \${par_index:+-i} \\ - \${par_index_name:+-I "\${par_index_name}"} \\ - \${par_compress_level:+-l "\${par_compress_level}"} \\ - \${par_reindex:+-r} \\ - \${par_size:+-s "\${par_size}"} \\ - \${par_test:+-t} \\ - \${par_binary:+--binary} \\ - "\$par_input" > "\$par_output" +#!/usr/bin/env bash +set -eo pipefail + +unset_if_false=( par_rna par_strandedness par_tab par_bed_out par_name par_name_only par_split par_full_header ) + +for par in \${unset_if_false[@]}; do + test_val="\${!par}" + [[ "\$test_val" == "false" ]] && unset \$par +done + +bedtools getfasta \\ + -fi "\$par_input_fasta" \\ + -bed "\$par_input_bed" \\ + \${par_rna:+-rna} \\ + \${par_name:+-name} \\ + \${par_name_only:+-nameOnly} \\ + \${par_tab:+-tab} \\ + \${par_bed_out:+-bedOut} \\ + \${par_strandedness:+-s} \\ + \${par_split:+-split} \\ + \${par_full_header:+-fullHeader} > "\$par_output" VIASHMAIN bash "\$tempscript" & wait "\$!" @@ -1301,15 +1238,15 @@ VIASHEOF if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # strip viash automount from file paths - if [ ! -z "$VIASH_PAR_INPUT" ]; then - VIASH_PAR_INPUT=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT") + if [ ! -z "$VIASH_PAR_INPUT_FASTA" ]; then + VIASH_PAR_INPUT_FASTA=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT_FASTA") + fi + if [ ! -z "$VIASH_PAR_INPUT_BED" ]; then + VIASH_PAR_INPUT_BED=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT_BED") fi if [ ! -z "$VIASH_PAR_OUTPUT" ]; then VIASH_PAR_OUTPUT=$(ViashDockerStripAutomount "$VIASH_PAR_OUTPUT") fi - if [ ! -z "$VIASH_PAR_INDEX_NAME" ]; then - VIASH_PAR_INDEX_NAME=$(ViashDockerStripAutomount "$VIASH_PAR_INDEX_NAME") - fi if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then VIASH_META_RESOURCES_DIR=$(ViashDockerStripAutomount "$VIASH_META_RESOURCES_DIR") fi @@ -1330,10 +1267,6 @@ if [ ! -z "$VIASH_PAR_OUTPUT" ] && [ ! -e "$VIASH_PAR_OUTPUT" ]; then ViashError "Output file '$VIASH_PAR_OUTPUT' does not exist." exit 1 fi -if [ ! -z "$VIASH_PAR_INDEX_NAME" ] && [ ! -e "$VIASH_PAR_INDEX_NAME" ]; then - ViashError "Output file '$VIASH_PAR_INDEX_NAME' does not exist." - exit 1 -fi exit 0 diff --git a/target/executable/busco/busco_download_datasets/.config.vsh.yaml b/target/executable/busco/busco_download_datasets/.config.vsh.yaml index e497e68b..66ba30f7 100644 --- a/target/executable/busco/busco_download_datasets/.config.vsh.yaml +++ b/target/executable/busco/busco_download_datasets/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "busco_download_datasets" namespace: "busco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -127,7 +127,7 @@ engines: id: "docker" image: "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -144,11 +144,11 @@ build_info: output: "target/executable/busco/busco_download_datasets" executable: "target/executable/busco/busco_download_datasets/busco_download_datasets" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -158,16 +158,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/busco/busco_download_datasets/busco_download_datasets b/target/executable/busco/busco_download_datasets/busco_download_datasets index 9d1444d1..5e1e242a 100755 --- a/target/executable/busco/busco_download_datasets/busco_download_datasets +++ b/target/executable/busco/busco_download_datasets/busco_download_datasets @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# busco_download_datasets v0.1 +# busco_download_datasets v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "busco_download_datasets v0.1" + echo "busco_download_datasets v0.1.0" echo "" echo "Downloads available busco datasets" echo "" @@ -470,10 +470,10 @@ ENTRYPOINT [] RUN busco --version | sed 's/BUSCO\s\(.*\)/busco: "\1"/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component busco busco_download_datasets" -LABEL org.opencontainers.image.created="2024-06-24T08:44:06Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:39Z" LABEL org.opencontainers.image.source="https://gitlab.com/ezlab/busco" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -596,7 +596,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "busco_download_datasets v0.1" + echo "busco_download_datasets v0.1.0" exit ;; --download) @@ -697,7 +697,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/busco/busco_download_datasets:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/busco/busco_download_datasets:v0.1.0' fi # print dockerfile diff --git a/target/executable/busco/busco_list_datasets/.config.vsh.yaml b/target/executable/busco/busco_list_datasets/.config.vsh.yaml index 942afd1f..d1880dd4 100644 --- a/target/executable/busco/busco_list_datasets/.config.vsh.yaml +++ b/target/executable/busco/busco_list_datasets/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "busco_list_datasets" namespace: "busco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Outputs" arguments: @@ -114,7 +114,7 @@ engines: id: "docker" image: "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -131,11 +131,11 @@ build_info: output: "target/executable/busco/busco_list_datasets" executable: "target/executable/busco/busco_list_datasets/busco_list_datasets" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -145,16 +145,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/busco/busco_list_datasets/busco_list_datasets b/target/executable/busco/busco_list_datasets/busco_list_datasets index bb19a674..7a249098 100755 --- a/target/executable/busco/busco_list_datasets/busco_list_datasets +++ b/target/executable/busco/busco_list_datasets/busco_list_datasets @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# busco_list_datasets v0.1 +# busco_list_datasets v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "busco_list_datasets v0.1" + echo "busco_list_datasets v0.1.0" echo "" echo "Lists the available busco datasets" echo "" @@ -460,10 +460,10 @@ ENTRYPOINT [] RUN busco --version | sed 's/BUSCO\s\(.*\)/busco: "\1"/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component busco busco_list_datasets" -LABEL org.opencontainers.image.created="2024-06-24T08:44:05Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:38Z" LABEL org.opencontainers.image.source="https://gitlab.com/ezlab/busco" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -586,7 +586,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "busco_list_datasets v0.1" + echo "busco_list_datasets v0.1.0" exit ;; --output) @@ -682,7 +682,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/busco/busco_list_datasets:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/busco/busco_list_datasets:v0.1.0' fi # print dockerfile diff --git a/target/executable/busco/busco_run/.config.vsh.yaml b/target/executable/busco/busco_run/.config.vsh.yaml index 934b5710..2e45cdb4 100644 --- a/target/executable/busco/busco_run/.config.vsh.yaml +++ b/target/executable/busco/busco_run/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "busco_run" namespace: "busco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -387,7 +387,7 @@ engines: id: "docker" image: "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -404,11 +404,11 @@ build_info: output: "target/executable/busco/busco_run" executable: "target/executable/busco/busco_run/busco_run" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -418,16 +418,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/busco/busco_run/busco_run b/target/executable/busco/busco_run/busco_run index 564981df..d880dfae 100755 --- a/target/executable/busco/busco_run/busco_run +++ b/target/executable/busco/busco_run/busco_run @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# busco_run v0.1 +# busco_run v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "busco_run v0.1" + echo "busco_run v0.1.0" echo "" echo "Assessment of genome assembly and annotation completeness with single copy" echo "orthologs" @@ -623,10 +623,10 @@ ENTRYPOINT [] RUN busco --version | sed 's/BUSCO\s\(.*\)/busco: "\1"/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component busco busco_run" -LABEL org.opencontainers.image.created="2024-06-24T08:44:05Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:38Z" LABEL org.opencontainers.image.source="https://gitlab.com/ezlab/busco" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -749,7 +749,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "busco_run v0.1" + echo "busco_run v0.1.0" exit ;; --input) @@ -1087,7 +1087,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/busco/busco_run:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/busco/busco_run:v0.1.0' fi # print dockerfile diff --git a/target/executable/cutadapt/.config.vsh.yaml b/target/executable/cutadapt/.config.vsh.yaml new file mode 100644 index 00000000..3463f15a --- /dev/null +++ b/target/executable/cutadapt/.config.vsh.yaml @@ -0,0 +1,733 @@ +name: "cutadapt" +version: "v0.1.0" +argument_groups: +- name: "Specify Adapters for R1" + arguments: + - type: "string" + name: "--adapter" + alternatives: + - "-a" + description: "Sequence of an adapter ligated to the 3' end (paired data:\nof the\ + \ first read). The adapter and subsequent bases are\ntrimmed. If a '$' character\ + \ is appended ('anchoring'), the\nadapter is only found if it is a suffix of\ + \ the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--front" + alternatives: + - "-g" + description: "Sequence of an adapter ligated to the 5' end (paired data:\nof the\ + \ first read). The adapter and any preceding bases\nare trimmed. Partial matches\ + \ at the 5' end are allowed. If\na '^' character is prepended ('anchoring'),\ + \ the adapter is\nonly found if it is a prefix of the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--anywhere" + alternatives: + - "-b" + description: "Sequence of an adapter that may be ligated to the 5' or 3'\nend\ + \ (paired data: of the first read). Both types of\nmatches as described under\ + \ -a and -g are allowed. If the\nfirst base of the read is part of the match,\ + \ the behavior\nis as with -g, otherwise as with -a. This option is mostly\n\ + for rescuing failed library preparations - do not use if\nyou know which end\ + \ your adapter was ligated to!\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" +- name: "Specify Adapters using Fasta files for R1" + arguments: + - type: "file" + name: "--adapter_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 3'\ + \ end (paired data:\nof the first read). The adapter and subsequent bases are\n\ + trimmed. If a '$' character is appended ('anchoring'), the\nadapter is only\ + \ found if it is a suffix of the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "file" + name: "--front_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 5'\ + \ end (paired data:\nof the first read). The adapter and any preceding bases\n\ + are trimmed. Partial matches at the 5' end are allowed. If\na '^' character\ + \ is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of\ + \ the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--anywhere_fasta" + description: "Fasta file containing sequences of an adapter that may be ligated\ + \ to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches\ + \ as described under -a and -g are allowed. If the\nfirst base of the read is\ + \ part of the match, the behavior\nis as with -g, otherwise as with -a. This\ + \ option is mostly\nfor rescuing failed library preparations - do not use if\n\ + you know which end your adapter was ligated to!\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" +- name: "Specify Adapters for R2" + arguments: + - type: "string" + name: "--adapter_r2" + alternatives: + - "-A" + description: "Sequence of an adapter ligated to the 3' end (paired data:\nof the\ + \ first read). The adapter and subsequent bases are\ntrimmed. If a '$' character\ + \ is appended ('anchoring'), the\nadapter is only found if it is a suffix of\ + \ the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--front_r2" + alternatives: + - "-G" + description: "Sequence of an adapter ligated to the 5' end (paired data:\nof the\ + \ first read). The adapter and any preceding bases\nare trimmed. Partial matches\ + \ at the 5' end are allowed. If\na '^' character is prepended ('anchoring'),\ + \ the adapter is\nonly found if it is a prefix of the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--anywhere_r2" + alternatives: + - "-B" + description: "Sequence of an adapter that may be ligated to the 5' or 3'\nend\ + \ (paired data: of the first read). Both types of\nmatches as described under\ + \ -a and -g are allowed. If the\nfirst base of the read is part of the match,\ + \ the behavior\nis as with -g, otherwise as with -a. This option is mostly\n\ + for rescuing failed library preparations - do not use if\nyou know which end\ + \ your adapter was ligated to!\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" +- name: "Specify Adapters using Fasta files for R2" + arguments: + - type: "file" + name: "--adapter_r2_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 3'\ + \ end (paired data:\nof the first read). The adapter and subsequent bases are\n\ + trimmed. If a '$' character is appended ('anchoring'), the\nadapter is only\ + \ found if it is a suffix of the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--front_r2_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 5'\ + \ end (paired data:\nof the first read). The adapter and any preceding bases\n\ + are trimmed. Partial matches at the 5' end are allowed. If\na '^' character\ + \ is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of\ + \ the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--anywhere_r2_fasta" + description: "Fasta file containing sequences of an adapter that may be ligated\ + \ to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches\ + \ as described under -a and -g are allowed. If the\nfirst base of the read is\ + \ part of the match, the behavior\nis as with -g, otherwise as with -a. This\ + \ option is mostly\nfor rescuing failed library preparations - do not use if\n\ + you know which end your adapter was ligated to!\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" +- name: "Paired-end options" + arguments: + - type: "boolean_true" + name: "--pair_adapters" + description: "Treat adapters given with -a/-A etc. as pairs. Either both\nor none\ + \ are removed from each read pair.\n" + info: null + direction: "input" + - type: "string" + name: "--pair_filter" + description: "Which of the reads in a paired-end read have to match the\nfiltering\ + \ criterion in order for the pair to be filtered.\n" + info: null + required: false + choices: + - "any" + - "both" + - "first" + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--interleaved" + description: "Read and/or write interleaved paired-end reads.\n" + info: null + direction: "input" +- name: "Input parameters" + arguments: + - type: "file" + name: "--input" + description: "Input fastq file for single-end reads or R1 for paired-end reads.\n" + info: null + must_exist: true + create_parent: true + required: true + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--input_r2" + description: "Input fastq file for R2 in the case of paired-end reads.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "double" + name: "--error_rate" + alternatives: + - "-E" + - "--errors" + description: "Maximum allowed error rate (if 0 <= E < 1), or absolute\nnumber\ + \ of errors for full-length adapter match (if E is an\ninteger >= 1). Error\ + \ rate = no. of errors divided by\nlength of matching region. Default: 0.1 (10%).\n" + info: null + example: + - 0.1 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_false" + name: "--no_indels" + description: "Allow only mismatches in alignments.\n" + info: null + direction: "input" + - type: "integer" + name: "--times" + alternatives: + - "-n" + description: "Remove up to COUNT adapters from each read. Default: 1.\n" + info: null + example: + - 1 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--overlap" + alternatives: + - "-O" + description: "Require MINLENGTH overlap between read and adapter for an\nadapter\ + \ to be found. The default is 3.\n" + info: null + example: + - 3 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--match_read_wildcards" + description: "Interpret IUPAC wildcards in reads.\n" + info: null + direction: "input" + - type: "boolean_false" + name: "--no_match_adapter_wildcards" + description: "Do not interpret IUPAC wildcards in adapters.\n" + info: null + direction: "input" + - type: "string" + name: "--action" + description: "What to do if a match was found. trim: trim adapter and\nup- or\ + \ downstream sequence; retain: trim, but retain\nadapter; mask: replace with\ + \ 'N' characters; lowercase:\nconvert to lowercase; none: leave unchanged.\n\ + The default is trim.\n" + info: null + example: + - "trim" + required: false + choices: + - "trim" + - "retain" + - "mask" + - "lowercase" + - "none" + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--revcomp" + alternatives: + - "--rc" + description: "Check both the read and its reverse complement for adapter\nmatches.\ + \ If match is on reverse-complemented version,\noutput that one.\n" + info: null + direction: "input" +- name: "Read modifications" + arguments: + - type: "integer" + name: "--cut" + alternatives: + - "-u" + description: "Remove LEN bases from each read (or R1 if paired; use --cut_r2\n\ + option for R2). If LEN is positive, remove bases from the\nbeginning. If LEN\ + \ is negative, remove bases from the end.\nCan be used twice if LENs have different\ + \ signs. Applied\n*before* adapter trimming.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "integer" + name: "--cut_r2" + description: "Remove LEN bases from each read (for R2). If LEN is positive, remove\ + \ bases from the\nbeginning. If LEN is negative, remove bases from the end.\n\ + Can be used twice if LENs have different signs. Applied\n*before* adapter trimming.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--nextseq_trim" + description: "NextSeq-specific quality trimming (each read). Trims also\ndark\ + \ cycles appearing as high-quality G bases.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--quality_cutoff" + alternatives: + - "-q" + description: "Trim low-quality bases from 5' and/or 3' ends of each read\nbefore\ + \ adapter removal. Applied to both reads if data is\npaired. If one value is\ + \ given, only the 3' end is trimmed.\nIf two comma-separated cutoffs are given,\ + \ the 5' end is\ntrimmed with the first cutoff, the 3' end with the second.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--quality_cutoff_r2" + alternatives: + - "-Q" + description: "Quality-trimming cutoff for R2. Default: same as for R1\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--quality_base" + description: "Assume that quality values in FASTQ are encoded as\nascii(quality\ + \ + N). This needs to be set to 64 for some\nold Illumina FASTQ files. The default\ + \ is 33.\n" + info: null + example: + - 33 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--poly_a" + description: "Trim poly-A tails" + info: null + direction: "input" + - type: "integer" + name: "--length" + alternatives: + - "-l" + description: "Shorten reads to LENGTH. Positive values remove bases at\nthe end\ + \ while negative ones remove bases at the beginning.\nThis and the following\ + \ modifications are applied after\nadapter trimming.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--trim_n" + description: "Trim N's on ends of reads." + info: null + direction: "input" + - type: "string" + name: "--length_tag" + description: "Search for TAG followed by a decimal number in the\ndescription\ + \ field of the read. Replace the decimal number\nwith the correct length of\ + \ the trimmed read. For example,\nuse --length-tag 'length=' to correct fields\ + \ like\n'length=123'.\n" + info: null + example: + - "length=" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--strip_suffix" + description: "Remove this suffix from read names if present. Can be\ngiven multiple\ + \ times.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--prefix" + alternatives: + - "-x" + description: "Add this prefix to read names. Use {name} to insert the\nname of\ + \ the matching adapter.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--suffix" + alternatives: + - "-y" + description: "Add this suffix to read names; can also include {name}\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--rename" + description: "Rename reads using TEMPLATE containing variables such as\n{id},\ + \ {adapter_name} etc. (see documentation)\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--zero_cap" + alternatives: + - "-z" + description: "Change negative quality values to zero." + info: null + direction: "input" +- name: "Filtering of processed reads" + description: "Filters are applied after above read modifications. Paired-end reads\ + \ are\nalways discarded pairwise (see also --pair_filter).\n" + arguments: + - type: "string" + name: "--minimum_length" + alternatives: + - "-m" + description: "Discard reads shorter than LEN. Default is 0.\nWhen trimming paired-end\ + \ reads, the minimum lengths for R1 and R2 can be specified separately by separating\ + \ them with a colon (:).\nIf the colon syntax is not used, the same minimum\ + \ length applies to both reads, as discussed above.\nAlso, one of the values\ + \ can be omitted to impose no restrictions.\nFor example, with -m 17:, the length\ + \ of R1 must be at least 17, but the length of R2 is ignored.\n" + info: null + example: + - "0" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--maximum_length" + alternatives: + - "-M" + description: "Discard reads longer than LEN. Default: no limit.\nFor paired reads,\ + \ see the remark for --minimum_length\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--max_n" + description: "Discard reads with more than COUNT 'N' bases. If COUNT is\na number\ + \ between 0 and 1, it is interpreted as a fraction\nof the read length.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "long" + name: "--max_expected_errors" + alternatives: + - "--max_ee" + description: "Discard reads whose expected number of errors (computed\nfrom quality\ + \ values) exceeds ERRORS.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "long" + name: "--max_average_error_rate" + alternatives: + - "--max_aer" + description: "as --max_expected_errors (see above), but divided by\nlength to\ + \ account for reads of varying length.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--discard_trimmed" + alternatives: + - "--discard" + description: "Discard reads that contain an adapter. Use also -O to\navoid discarding\ + \ too many randomly matching reads.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--discard_untrimmed" + alternatives: + - "--trimmed_only" + description: "Discard reads that do not contain an adapter.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--discard_casava" + description: "Discard reads that did not pass CASAVA filtering (header\nhas :Y:).\n" + info: null + direction: "input" +- name: "Output parameters" + arguments: + - type: "string" + name: "--report" + description: "Which type of report to print: 'full' (default) or 'minimal'.\n" + info: null + example: + - "full" + required: false + choices: + - "full" + - "minimal" + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--json" + description: "Write report in JSON format to this file.\n" + info: null + direction: "input" + - type: "file" + name: "--output" + description: "Glob pattern for matching the expected output files.\nShould include\ + \ `$output_dir`.\n" + info: null + example: + - "fastq/*_001.fast[a,q]" + must_exist: true + create_parent: true + required: true + direction: "output" + multiple: true + multiple_sep: ";" + - type: "boolean_true" + name: "--fasta" + description: "Output FASTA to standard output even on FASTQ input.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--info_file" + description: "Write information about each read and its adapter matches\ninto\ + \ info.txt in the output directory.\nSee the documentation for the file format.\n" + info: null + direction: "input" +- name: "Debug" + arguments: + - type: "boolean_true" + name: "--debug" + description: "Print debug information" + info: null + direction: "input" +resources: +- type: "bash_script" + path: "script.sh" + is_executable: true +description: "Cutadapt removes adapter sequences from high-throughput sequencing reads.\n" +test_resources: +- type: "bash_script" + path: "test.sh" + is_executable: true +info: null +status: "enabled" +requirements: + commands: + - "ps" +keywords: +- "RNA-seq" +- "scRNA-seq" +- "high-throughput" +license: "MIT" +references: + doi: + - "10.14806/ej.17.1.200" +links: + repository: "https://github.com/marcelm/cutadapt" + homepage: "https://cutadapt.readthedocs.io" + documentation: "https://cutadapt.readthedocs.io" +runners: +- type: "executable" + id: "executable" + docker_setup_strategy: "ifneedbepullelsecachedbuild" +- type: "nextflow" + id: "nextflow" + directives: + tag: "$id" + auto: + simplifyInput: true + simplifyOutput: false + transcript: false + publish: false + config: + labels: + mem1gb: "memory = 1000000000.B" + mem2gb: "memory = 2000000000.B" + mem5gb: "memory = 5000000000.B" + mem10gb: "memory = 10000000000.B" + mem20gb: "memory = 20000000000.B" + mem50gb: "memory = 50000000000.B" + mem100gb: "memory = 100000000000.B" + mem200gb: "memory = 200000000000.B" + mem500gb: "memory = 500000000000.B" + mem1tb: "memory = 1000000000000.B" + mem2tb: "memory = 2000000000000.B" + mem5tb: "memory = 5000000000000.B" + mem10tb: "memory = 10000000000000.B" + mem20tb: "memory = 20000000000000.B" + mem50tb: "memory = 50000000000000.B" + mem100tb: "memory = 100000000000000.B" + mem200tb: "memory = 200000000000000.B" + mem500tb: "memory = 500000000000000.B" + mem1gib: "memory = 1073741824.B" + mem2gib: "memory = 2147483648.B" + mem4gib: "memory = 4294967296.B" + mem8gib: "memory = 8589934592.B" + mem16gib: "memory = 17179869184.B" + mem32gib: "memory = 34359738368.B" + mem64gib: "memory = 68719476736.B" + mem128gib: "memory = 137438953472.B" + mem256gib: "memory = 274877906944.B" + mem512gib: "memory = 549755813888.B" + mem1tib: "memory = 1099511627776.B" + mem2tib: "memory = 2199023255552.B" + mem4tib: "memory = 4398046511104.B" + mem8tib: "memory = 8796093022208.B" + mem16tib: "memory = 17592186044416.B" + mem32tib: "memory = 35184372088832.B" + mem64tib: "memory = 70368744177664.B" + mem128tib: "memory = 140737488355328.B" + mem256tib: "memory = 281474976710656.B" + mem512tib: "memory = 562949953421312.B" + cpu1: "cpus = 1" + cpu2: "cpus = 2" + cpu5: "cpus = 5" + cpu10: "cpus = 10" + cpu20: "cpus = 20" + cpu50: "cpus = 50" + cpu100: "cpus = 100" + cpu200: "cpus = 200" + cpu500: "cpus = 500" + cpu1000: "cpus = 1000" + debug: false + container: "docker" +engines: +- type: "docker" + id: "docker" + image: "python:3.12" + target_registry: "images.viash-hub.com" + target_tag: "v0.1.0" + namespace_separator: "/" + setup: + - type: "python" + user: false + pip: + - "cutadapt" + upgrade: true + - type: "docker" + run: + - "cutadapt --version | sed 's/\\(.*\\)/cutadapt: \"\\1\"/' > /var/software_versions.txt\n" + entrypoint: [] + cmd: null +- type: "native" + id: "native" +build_info: + config: "src/cutadapt/config.vsh.yaml" + runner: "executable" + engine: "docker|native" + output: "target/executable/cutadapt" + executable: "target/executable/cutadapt/cutadapt" + viash_version: "0.9.0-RC6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" + git_remote: "https://github.com/viash-hub/biobox" +package_config: + name: "biobox" + version: "v0.1.0" + description: "A collection of bioinformatics tools for working with sequence data.\n" + info: null + viash_version: "0.9.0-RC6" + source: "src" + target: "target" + config_mods: + - ".requirements.commands := ['ps']\n" + - ".engines += { type: \"native\" }" + - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" + keywords: + - "bioinformatics" + - "modules" + - "sequencing" + license: "MIT" + organization: "vsh" + links: + repository: "https://github.com/viash-hub/biobox" + issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/cutadapt/cutadapt b/target/executable/cutadapt/cutadapt new file mode 100755 index 00000000..bb136868 --- /dev/null +++ b/target/executable/cutadapt/cutadapt @@ -0,0 +1,2725 @@ +#!/usr/bin/env bash + +# cutadapt v0.1.0 +# +# This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a +# derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from +# Data Intuitive. +# +# The component may contain files which fall under a different license. The +# authors of this component should specify the license in the header of such +# files, or include a separate license file detailing the licenses of all included +# files. + +set -e + +if [ -z "$VIASH_TEMP" ]; then + VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$VIASH_TEMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMP} + VIASH_TEMP=${VIASH_TEMP:-$TMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$TMP} + VIASH_TEMP=${VIASH_TEMP:-$TEMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$TEMP} + VIASH_TEMP=${VIASH_TEMP:-/tmp} +fi + +# define helper functions +# ViashQuote: put quotes around non flag values +# $1 : unquoted string +# return : possibly quoted string +# examples: +# ViashQuote --foo # returns --foo +# ViashQuote bar # returns 'bar' +# Viashquote --foo=bar # returns --foo='bar' +function ViashQuote { + if [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+=.+$ ]]; then + echo "$1" | sed "s#=\(.*\)#='\1'#" + elif [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+$ ]]; then + echo "$1" + else + echo "'$1'" + fi +} +# ViashRemoveFlags: Remove leading flag +# $1 : string with a possible leading flag +# return : string without possible leading flag +# examples: +# ViashRemoveFlags --foo=bar # returns bar +function ViashRemoveFlags { + echo "$1" | sed 's/^--*[a-zA-Z0-9_\-]*=//' +} +# ViashSourceDir: return the path of a bash file, following symlinks +# usage : ViashSourceDir ${BASH_SOURCE[0]} +# $1 : Should always be set to ${BASH_SOURCE[0]} +# returns : The absolute path of the bash file +function ViashSourceDir { + SOURCE="$1" + while [ -h "$SOURCE" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" + done + cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd +} +# ViashFindTargetDir: return the path of the '.build.yaml' file, following symlinks +# usage : ViashFindTargetDir 'ScriptPath' +# $1 : The location from where to start the upward search +# returns : The absolute path of the '.build.yaml' file +function ViashFindTargetDir { + SOURCE="$1" + while [[ "$SOURCE" != "" && ! -e "$SOURCE/.build.yaml" ]]; do + SOURCE=${SOURCE%/*} + done + echo $SOURCE +} +# see https://en.wikipedia.org/wiki/Syslog#Severity_level +VIASH_LOGCODE_EMERGENCY=0 +VIASH_LOGCODE_ALERT=1 +VIASH_LOGCODE_CRITICAL=2 +VIASH_LOGCODE_ERROR=3 +VIASH_LOGCODE_WARNING=4 +VIASH_LOGCODE_NOTICE=5 +VIASH_LOGCODE_INFO=6 +VIASH_LOGCODE_DEBUG=7 +VIASH_VERBOSITY=$VIASH_LOGCODE_NOTICE + +# ViashLog: Log events depending on the verbosity level +# usage: ViashLog 1 alert Oh no something went wrong! +# $1: required verbosity level +# $2: display tag +# $3+: messages to display +# stdout: Your input, prepended by '[$2] '. +function ViashLog { + local required_level="$1" + local display_tag="$2" + shift 2 + if [ $VIASH_VERBOSITY -ge $required_level ]; then + >&2 echo "[$display_tag]" "$@" + fi +} + +# ViashEmergency: log events when the system is unstable +# usage: ViashEmergency Oh no something went wrong. +# stdout: Your input, prepended by '[emergency] '. +function ViashEmergency { + ViashLog $VIASH_LOGCODE_EMERGENCY emergency "$@" +} + +# ViashAlert: log events when actions must be taken immediately (e.g. corrupted system database) +# usage: ViashAlert Oh no something went wrong. +# stdout: Your input, prepended by '[alert] '. +function ViashAlert { + ViashLog $VIASH_LOGCODE_ALERT alert "$@" +} + +# ViashCritical: log events when a critical condition occurs +# usage: ViashCritical Oh no something went wrong. +# stdout: Your input, prepended by '[critical] '. +function ViashCritical { + ViashLog $VIASH_LOGCODE_CRITICAL critical "$@" +} + +# ViashError: log events when an error condition occurs +# usage: ViashError Oh no something went wrong. +# stdout: Your input, prepended by '[error] '. +function ViashError { + ViashLog $VIASH_LOGCODE_ERROR error "$@" +} + +# ViashWarning: log potentially abnormal events +# usage: ViashWarning Something may have gone wrong. +# stdout: Your input, prepended by '[warning] '. +function ViashWarning { + ViashLog $VIASH_LOGCODE_WARNING warning "$@" +} + +# ViashNotice: log significant but normal events +# usage: ViashNotice This just happened. +# stdout: Your input, prepended by '[notice] '. +function ViashNotice { + ViashLog $VIASH_LOGCODE_NOTICE notice "$@" +} + +# ViashInfo: log normal events +# usage: ViashInfo This just happened. +# stdout: Your input, prepended by '[info] '. +function ViashInfo { + ViashLog $VIASH_LOGCODE_INFO info "$@" +} + +# ViashDebug: log all events, for debugging purposes +# usage: ViashDebug This just happened. +# stdout: Your input, prepended by '[debug] '. +function ViashDebug { + ViashLog $VIASH_LOGCODE_DEBUG debug "$@" +} + +# find source folder of this component +VIASH_META_RESOURCES_DIR=`ViashSourceDir ${BASH_SOURCE[0]}` + +# find the root of the built components & dependencies +VIASH_TARGET_DIR=`ViashFindTargetDir $VIASH_META_RESOURCES_DIR` + +# define meta fields +VIASH_META_NAME="cutadapt" +VIASH_META_FUNCTIONALITY_NAME="cutadapt" +VIASH_META_EXECUTABLE="$VIASH_META_RESOURCES_DIR/$VIASH_META_NAME" +VIASH_META_CONFIG="$VIASH_META_RESOURCES_DIR/.config.vsh.yaml" +VIASH_META_TEMP_DIR="$VIASH_TEMP" + + +# ViashHelp: Display helpful explanation about this executable +function ViashHelp { + echo "cutadapt v0.1.0" + echo "" + echo "Cutadapt removes adapter sequences from high-throughput sequencing reads." + echo "" + echo "Specify Adapters for R1:" + echo " -a, --adapter" + echo " type: string, multiple values allowed" + echo " Sequence of an adapter ligated to the 3' end (paired data:" + echo " of the first read). The adapter and subsequent bases are" + echo " trimmed. If a '\$' character is appended ('anchoring'), the" + echo " adapter is only found if it is a suffix of the read." + echo "" + echo " -g, --front" + echo " type: string, multiple values allowed" + echo " Sequence of an adapter ligated to the 5' end (paired data:" + echo " of the first read). The adapter and any preceding bases" + echo " are trimmed. Partial matches at the 5' end are allowed. If" + echo " a '^' character is prepended ('anchoring'), the adapter is" + echo " only found if it is a prefix of the read." + echo "" + echo " -b, --anywhere" + echo " type: string, multiple values allowed" + echo " Sequence of an adapter that may be ligated to the 5' or 3'" + echo " end (paired data: of the first read). Both types of" + echo " matches as described under -a and -g are allowed. If the" + echo " first base of the read is part of the match, the behavior" + echo " is as with -g, otherwise as with -a. This option is mostly" + echo " for rescuing failed library preparations - do not use if" + echo " you know which end your adapter was ligated to!" + echo "" + echo "Specify Adapters using Fasta files for R1:" + echo " --adapter_fasta" + echo " type: file, multiple values allowed, file must exist" + echo " Fasta file containing sequences of an adapter ligated to the 3' end" + echo " (paired data:" + echo " of the first read). The adapter and subsequent bases are" + echo " trimmed. If a '\$' character is appended ('anchoring'), the" + echo " adapter is only found if it is a suffix of the read." + echo "" + echo " --front_fasta" + echo " type: file, file must exist" + echo " Fasta file containing sequences of an adapter ligated to the 5' end" + echo " (paired data:" + echo " of the first read). The adapter and any preceding bases" + echo " are trimmed. Partial matches at the 5' end are allowed. If" + echo " a '^' character is prepended ('anchoring'), the adapter is" + echo " only found if it is a prefix of the read." + echo "" + echo " --anywhere_fasta" + echo " type: file, file must exist" + echo " Fasta file containing sequences of an adapter that may be ligated to the" + echo " 5' or 3'" + echo " end (paired data: of the first read). Both types of" + echo " matches as described under -a and -g are allowed. If the" + echo " first base of the read is part of the match, the behavior" + echo " is as with -g, otherwise as with -a. This option is mostly" + echo " for rescuing failed library preparations - do not use if" + echo " you know which end your adapter was ligated to!" + echo "" + echo "Specify Adapters for R2:" + echo " -A, --adapter_r2" + echo " type: string, multiple values allowed" + echo " Sequence of an adapter ligated to the 3' end (paired data:" + echo " of the first read). The adapter and subsequent bases are" + echo " trimmed. If a '\$' character is appended ('anchoring'), the" + echo " adapter is only found if it is a suffix of the read." + echo "" + echo " -G, --front_r2" + echo " type: string, multiple values allowed" + echo " Sequence of an adapter ligated to the 5' end (paired data:" + echo " of the first read). The adapter and any preceding bases" + echo " are trimmed. Partial matches at the 5' end are allowed. If" + echo " a '^' character is prepended ('anchoring'), the adapter is" + echo " only found if it is a prefix of the read." + echo "" + echo " -B, --anywhere_r2" + echo " type: string, multiple values allowed" + echo " Sequence of an adapter that may be ligated to the 5' or 3'" + echo " end (paired data: of the first read). Both types of" + echo " matches as described under -a and -g are allowed. If the" + echo " first base of the read is part of the match, the behavior" + echo " is as with -g, otherwise as with -a. This option is mostly" + echo " for rescuing failed library preparations - do not use if" + echo " you know which end your adapter was ligated to!" + echo "" + echo "Specify Adapters using Fasta files for R2:" + echo " --adapter_r2_fasta" + echo " type: file, file must exist" + echo " Fasta file containing sequences of an adapter ligated to the 3' end" + echo " (paired data:" + echo " of the first read). The adapter and subsequent bases are" + echo " trimmed. If a '\$' character is appended ('anchoring'), the" + echo " adapter is only found if it is a suffix of the read." + echo "" + echo " --front_r2_fasta" + echo " type: file, file must exist" + echo " Fasta file containing sequences of an adapter ligated to the 5' end" + echo " (paired data:" + echo " of the first read). The adapter and any preceding bases" + echo " are trimmed. Partial matches at the 5' end are allowed. If" + echo " a '^' character is prepended ('anchoring'), the adapter is" + echo " only found if it is a prefix of the read." + echo "" + echo " --anywhere_r2_fasta" + echo " type: file, file must exist" + echo " Fasta file containing sequences of an adapter that may be ligated to the" + echo " 5' or 3'" + echo " end (paired data: of the first read). Both types of" + echo " matches as described under -a and -g are allowed. If the" + echo " first base of the read is part of the match, the behavior" + echo " is as with -g, otherwise as with -a. This option is mostly" + echo " for rescuing failed library preparations - do not use if" + echo " you know which end your adapter was ligated to!" + echo "" + echo "Paired-end options:" + echo " --pair_adapters" + echo " type: boolean_true" + echo " Treat adapters given with -a/-A etc. as pairs. Either both" + echo " or none are removed from each read pair." + echo "" + echo " --pair_filter" + echo " type: string" + echo " choices: [ any, both, first ]" + echo " Which of the reads in a paired-end read have to match the" + echo " filtering criterion in order for the pair to be filtered." + echo "" + echo " --interleaved" + echo " type: boolean_true" + echo " Read and/or write interleaved paired-end reads." + echo "" + echo "Input parameters:" + echo " --input" + echo " type: file, required parameter, file must exist" + echo " Input fastq file for single-end reads or R1 for paired-end reads." + echo "" + echo " --input_r2" + echo " type: file, file must exist" + echo " Input fastq file for R2 in the case of paired-end reads." + echo "" + echo " -E, --errors, --error_rate" + echo " type: double" + echo " example: 0.1" + echo " Maximum allowed error rate (if 0 <= E < 1), or absolute" + echo " number of errors for full-length adapter match (if E is an" + echo " integer >= 1). Error rate = no. of errors divided by" + echo " length of matching region. Default: 0.1 (10%)." + echo "" + echo " --no_indels" + echo " type: boolean_false" + echo " Allow only mismatches in alignments." + echo "" + echo " -n, --times" + echo " type: integer" + echo " example: 1" + echo " Remove up to COUNT adapters from each read. Default: 1." + echo "" + echo " -O, --overlap" + echo " type: integer" + echo " example: 3" + echo " Require MINLENGTH overlap between read and adapter for an" + echo " adapter to be found. The default is 3." + echo "" + echo " --match_read_wildcards" + echo " type: boolean_true" + echo " Interpret IUPAC wildcards in reads." + echo "" + echo " --no_match_adapter_wildcards" + echo " type: boolean_false" + echo " Do not interpret IUPAC wildcards in adapters." + echo "" + echo " --action" + echo " type: string" + echo " example: trim" + echo " choices: [ trim, retain, mask, lowercase, none ]" + echo " What to do if a match was found. trim: trim adapter and" + echo " up- or downstream sequence; retain: trim, but retain" + echo " adapter; mask: replace with 'N' characters; lowercase:" + echo " convert to lowercase; none: leave unchanged." + echo " The default is trim." + echo "" + echo " --rc, --revcomp" + echo " type: boolean_true" + echo " Check both the read and its reverse complement for adapter" + echo " matches. If match is on reverse-complemented version," + echo " output that one." + echo "" + echo "Read modifications:" + echo " -u, --cut" + echo " type: integer, multiple values allowed" + echo " Remove LEN bases from each read (or R1 if paired; use --cut_r2" + echo " option for R2). If LEN is positive, remove bases from the" + echo " beginning. If LEN is negative, remove bases from the end." + echo " Can be used twice if LENs have different signs. Applied" + echo " *before* adapter trimming." + echo "" + echo " --cut_r2" + echo " type: integer, multiple values allowed" + echo " Remove LEN bases from each read (for R2). If LEN is positive, remove" + echo " bases from the" + echo " beginning. If LEN is negative, remove bases from the end." + echo " Can be used twice if LENs have different signs. Applied" + echo " *before* adapter trimming." + echo "" + echo " --nextseq_trim" + echo " type: string" + echo " NextSeq-specific quality trimming (each read). Trims also" + echo " dark cycles appearing as high-quality G bases." + echo "" + echo " -q, --quality_cutoff" + echo " type: string" + echo " Trim low-quality bases from 5' and/or 3' ends of each read" + echo " before adapter removal. Applied to both reads if data is" + echo " paired. If one value is given, only the 3' end is trimmed." + echo " If two comma-separated cutoffs are given, the 5' end is" + echo " trimmed with the first cutoff, the 3' end with the second." + echo "" + echo " -Q, --quality_cutoff_r2" + echo " type: string" + echo " Quality-trimming cutoff for R2. Default: same as for R1" + echo "" + echo " --quality_base" + echo " type: integer" + echo " example: 33" + echo " Assume that quality values in FASTQ are encoded as" + echo " ascii(quality + N). This needs to be set to 64 for some" + echo " old Illumina FASTQ files. The default is 33." + echo "" + echo " --poly_a" + echo " type: boolean_true" + echo " Trim poly-A tails" + echo "" + echo " -l, --length" + echo " type: integer" + echo " Shorten reads to LENGTH. Positive values remove bases at" + echo " the end while negative ones remove bases at the beginning." + echo " This and the following modifications are applied after" + echo " adapter trimming." + echo "" + echo " --trim_n" + echo " type: boolean_true" + echo " Trim N's on ends of reads." + echo "" + echo " --length_tag" + echo " type: string" + echo " example: length=" + echo " Search for TAG followed by a decimal number in the" + echo " description field of the read. Replace the decimal number" + echo " with the correct length of the trimmed read. For example," + echo " use --length-tag 'length=' to correct fields like" + echo " 'length=123'." + echo "" + echo " --strip_suffix" + echo " type: string" + echo " Remove this suffix from read names if present. Can be" + echo " given multiple times." + echo "" + echo " -x, --prefix" + echo " type: string" + echo " Add this prefix to read names. Use {name} to insert the" + echo " name of the matching adapter." + echo "" + echo " -y, --suffix" + echo " type: string" + echo " Add this suffix to read names; can also include {name}" + echo "" + echo " --rename" + echo " type: string" + echo " Rename reads using TEMPLATE containing variables such as" + echo " {id}, {adapter_name} etc. (see documentation)" + echo "" + echo " -z, --zero_cap" + echo " type: boolean_true" + echo " Change negative quality values to zero." + echo "" + echo "Filtering of processed reads:" + echo " Filters are applied after above read modifications. Paired-end reads are" + echo " always discarded pairwise (see also --pair_filter)." + echo "" + echo " -m, --minimum_length" + echo " type: string" + echo " example: 0" + echo " Discard reads shorter than LEN. Default is 0." + echo " When trimming paired-end reads, the minimum lengths for R1 and R2 can be" + echo " specified separately by separating them with a colon (:)." + echo " If the colon syntax is not used, the same minimum length applies to both" + echo " reads, as discussed above." + echo " Also, one of the values can be omitted to impose no restrictions." + echo " For example, with -m 17:, the length of R1 must be at least 17, but the" + echo " length of R2 is ignored." + echo "" + echo " -M, --maximum_length" + echo " type: string" + echo " Discard reads longer than LEN. Default: no limit." + echo " For paired reads, see the remark for --minimum_length" + echo "" + echo " --max_n" + echo " type: string" + echo " Discard reads with more than COUNT 'N' bases. If COUNT is" + echo " a number between 0 and 1, it is interpreted as a fraction" + echo " of the read length." + echo "" + echo " --max_ee, --max_expected_errors" + echo " type: long" + echo " Discard reads whose expected number of errors (computed" + echo " from quality values) exceeds ERRORS." + echo "" + echo " --max_aer, --max_average_error_rate" + echo " type: long" + echo " as --max_expected_errors (see above), but divided by" + echo " length to account for reads of varying length." + echo "" + echo " --discard, --discard_trimmed" + echo " type: boolean_true" + echo " Discard reads that contain an adapter. Use also -O to" + echo " avoid discarding too many randomly matching reads." + echo "" + echo " --trimmed_only, --discard_untrimmed" + echo " type: boolean_true" + echo " Discard reads that do not contain an adapter." + echo "" + echo " --discard_casava" + echo " type: boolean_true" + echo " Discard reads that did not pass CASAVA filtering (header" + echo " has :Y:)." + echo "" + echo "Output parameters:" + echo " --report" + echo " type: string" + echo " example: full" + echo " choices: [ full, minimal ]" + echo " Which type of report to print: 'full' (default) or 'minimal'." + echo "" + echo " --json" + echo " type: boolean_true" + echo " Write report in JSON format to this file." + echo "" + echo " --output" + echo " type: file, required parameter, multiple values allowed, output, file" + echo "must exist" + echo " example: fastq/*_001.fast[a,q]" + echo " Glob pattern for matching the expected output files." + echo " Should include \`\$output_dir\`." + echo "" + echo " --fasta" + echo " type: boolean_true" + echo " Output FASTA to standard output even on FASTQ input." + echo "" + echo " --info_file" + echo " type: boolean_true" + echo " Write information about each read and its adapter matches" + echo " into info.txt in the output directory." + echo " See the documentation for the file format." + echo "" + echo "Debug:" + echo " --debug" + echo " type: boolean_true" + echo " Print debug information" +} + +# initialise variables +VIASH_MODE='run' +VIASH_ENGINE_ID='docker' + +######## Helper functions for setting up Docker images for viash ######## +# expects: ViashDockerBuild + +# ViashDockerInstallationCheck: check whether Docker is installed correctly +# +# examples: +# ViashDockerInstallationCheck +function ViashDockerInstallationCheck { + ViashDebug "Checking whether Docker is installed" + if [ ! command -v docker &> /dev/null ]; then + ViashCritical "Docker doesn't seem to be installed. See 'https://docs.docker.com/get-docker/' for instructions." + exit 1 + fi + + ViashDebug "Checking whether the Docker daemon is running" + save=$-; set +e + docker_version=$(docker version --format '{{.Client.APIVersion}}' 2> /dev/null) + out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashCritical "Docker daemon does not seem to be running. Try one of the following:" + ViashCritical "- Try running 'dockerd' in the command line" + ViashCritical "- See https://docs.docker.com/config/daemon/" + exit 1 + fi +} + +# ViashDockerRemoteTagCheck: check whether a Docker image is available +# on a remote. Assumes `docker login` has been performed, if relevant. +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# ViashDockerRemoteTagCheck python:latest +# echo $? # returns '0' +# ViashDockerRemoteTagCheck sdaizudceahifu +# echo $? # returns '1' +function ViashDockerRemoteTagCheck { + docker manifest inspect $1 > /dev/null 2> /dev/null +} + +# ViashDockerLocalTagCheck: check whether a Docker image is available locally +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# docker pull python:latest +# ViashDockerLocalTagCheck python:latest +# echo $? # returns '0' +# ViashDockerLocalTagCheck sdaizudceahifu +# echo $? # returns '1' +function ViashDockerLocalTagCheck { + [ -n "$(docker images -q $1)" ] +} + +# ViashDockerPull: pull a Docker image +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# ViashDockerPull python:latest +# echo $? # returns '0' +# ViashDockerPull sdaizudceahifu +# echo $? # returns '1' +function ViashDockerPull { + ViashNotice "Checking if Docker image is available at '$1'" + if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then + docker pull $1 && return 0 || return 1 + else + save=$-; set +e + docker pull $1 2> /dev/null > /dev/null + out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashWarning "Could not pull from '$1'. Docker image doesn't exist or is not accessible." + fi + return $out + fi +} + +# ViashDockerPush: push a Docker image +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# ViashDockerPush python:latest +# echo $? # returns '0' +# ViashDockerPush sdaizudceahifu +# echo $? # returns '1' +function ViashDockerPush { + ViashNotice "Pushing image to '$1'" + save=$-; set +e + if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then + docker push $1 + out=$? + else + docker push $1 2> /dev/null > /dev/null + out=$? + fi + [[ $save =~ e ]] && set -e + if [ $out -eq 0 ]; then + ViashNotice "Container '$1' push succeeded." + else + ViashError "Container '$1' push errored. You might not be logged in or have the necessary permissions." + fi + return $out +} + +# ViashDockerPullElseBuild: pull a Docker image, else build it +# +# $1 : image identifier with format `[registry/]image[:tag]` +# ViashDockerBuild : a Bash function which builds a docker image, takes image identifier as argument. +# examples: +# ViashDockerPullElseBuild mynewcomponent +function ViashDockerPullElseBuild { + save=$-; set +e + ViashDockerPull $1 + out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashDockerBuild $@ + fi +} + +# ViashDockerSetup: create a Docker image, according to specified docker setup strategy +# +# $1 : image identifier with format `[registry/]image[:tag]` +# $2 : docker setup strategy, see DockerSetupStrategy.scala +# examples: +# ViashDockerSetup mynewcomponent alwaysbuild +function ViashDockerSetup { + local image_id="$1" + local setup_strategy="$2" + if [ "$setup_strategy" == "alwaysbuild" -o "$setup_strategy" == "build" -o "$setup_strategy" == "b" ]; then + ViashDockerBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "alwayspull" -o "$setup_strategy" == "pull" -o "$setup_strategy" == "p" ]; then + ViashDockerPull $image_id + elif [ "$setup_strategy" == "alwayspullelsebuild" -o "$setup_strategy" == "pullelsebuild" ]; then + ViashDockerPullElseBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "alwayspullelsecachedbuild" -o "$setup_strategy" == "pullelsecachedbuild" ]; then + ViashDockerPullElseBuild $image_id $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "alwayscachedbuild" -o "$setup_strategy" == "cachedbuild" -o "$setup_strategy" == "cb" ]; then + ViashDockerBuild $image_id $(ViashDockerBuildArgs "$engine_id") + elif [[ "$setup_strategy" =~ ^ifneedbe ]]; then + local save=$-; set +e + ViashDockerLocalTagCheck $image_id + local outCheck=$? + [[ $save =~ e ]] && set -e + if [ $outCheck -eq 0 ]; then + ViashInfo "Image $image_id already exists" + elif [ "$setup_strategy" == "ifneedbebuild" ]; then + ViashDockerBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "ifneedbecachedbuild" ]; then + ViashDockerBuild $image_id $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "ifneedbepull" ]; then + ViashDockerPull $image_id + elif [ "$setup_strategy" == "ifneedbepullelsebuild" ]; then + ViashDockerPullElseBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "ifneedbepullelsecachedbuild" ]; then + ViashDockerPullElseBuild $image_id $(ViashDockerBuildArgs "$engine_id") + else + ViashError "Unrecognised Docker strategy: $setup_strategy" + exit 1 + fi + elif [ "$setup_strategy" == "push" -o "$setup_strategy" == "forcepush" -o "$setup_strategy" == "alwayspush" ]; then + ViashDockerPush "$image_id" + elif [ "$setup_strategy" == "pushifnotpresent" -o "$setup_strategy" == "gentlepush" -o "$setup_strategy" == "maybepush" ]; then + local save=$-; set +e + ViashDockerRemoteTagCheck $image_id + local outCheck=$? + [[ $save =~ e ]] && set -e + if [ $outCheck -eq 0 ]; then + ViashNotice "Container '$image_id' exists, doing nothing." + else + ViashNotice "Container '$image_id' does not yet exist." + ViashDockerPush "$image_id" + fi + elif [ "$setup_strategy" == "donothing" -o "$setup_strategy" == "meh" ]; then + ViashNotice "Skipping setup." + else + ViashError "Unrecognised Docker strategy: $setup_strategy" + exit 1 + fi +} + +# ViashDockerCheckCommands: Check whether a docker container has the required commands +# +# $1 : image identifier with format `[registry/]image[:tag]` +# $@ : commands to verify being present +# examples: +# ViashDockerCheckCommands bash:4.0 bash ps foo +function ViashDockerCheckCommands { + local image_id="$1" + shift 1 + local commands="$@" + local save=$-; set +e + local missing # mark 'missing' as local in advance, otherwise the exit code of the command will be missing and always be '0' + missing=$(docker run --rm --entrypoint=sh "$image_id" -c "for command in $commands; do command -v \$command >/dev/null 2>&1; if [ \$? -ne 0 ]; then echo \$command; exit 1; fi; done") + local outCheck=$? + [[ $save =~ e ]] && set -e + if [ $outCheck -ne 0 ]; then + ViashError "Docker container '$image_id' does not contain command '$missing'." + exit 1 + fi +} + +# ViashDockerBuild: build a docker image +# $1 : image identifier with format `[registry/]image[:tag]` +# $... : additional arguments to pass to docker build +# $VIASH_META_TEMP_DIR : temporary directory to store dockerfile & optional resources in +# $VIASH_META_NAME : name of the component +# $VIASH_META_RESOURCES_DIR : directory containing the resources +# $VIASH_VERBOSITY : verbosity level +# exit code $? : whether or not the image was built successfully +function ViashDockerBuild { + local image_id="$1" + shift 1 + + # create temporary directory to store dockerfile & optional resources in + local tmpdir=$(mktemp -d "$VIASH_META_TEMP_DIR/dockerbuild-$VIASH_META_NAME-XXXXXX") + local dockerfile="$tmpdir/Dockerfile" + function clean_up { + rm -rf "$tmpdir" + } + trap clean_up EXIT + + # store dockerfile and resources + ViashDockerfile "$VIASH_ENGINE_ID" > "$dockerfile" + + # generate the build command + local docker_build_cmd="docker build -t '$image_id' $@ '$VIASH_META_RESOURCES_DIR' -f '$dockerfile'" + + # build the container + ViashNotice "Building container '$image_id' with Dockerfile" + ViashInfo "$docker_build_cmd" + local save=$-; set +e + if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then + eval $docker_build_cmd + else + eval $docker_build_cmd &> "$tmpdir/docker_build.log" + fi + + # check exit code + local out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashError "Error occurred while building container '$image_id'" + if [ $VIASH_VERBOSITY -lt $VIASH_LOGCODE_INFO ]; then + ViashError "Transcript: --------------------------------" + cat "$tmpdir/docker_build.log" + ViashError "End of transcript --------------------------" + fi + exit 1 + fi +} + +######## End of helper functions for setting up Docker images for viash ######## + +# ViashDockerFile: print the dockerfile to stdout +# $1 : engine identifier +# return : dockerfile required to run this component +# examples: +# ViashDockerFile +function ViashDockerfile { + local engine_id="$1" + + if [[ "$engine_id" == "docker" ]]; then + cat << 'VIASHDOCKER' +FROM python:3.12 +ENTRYPOINT [] +RUN pip install --upgrade pip && \ + pip install --upgrade --no-cache-dir "cutadapt" + +RUN cutadapt --version | sed 's/\(.*\)/cutadapt: "\1"/' > /var/software_versions.txt + +LABEL org.opencontainers.image.description="Companion container for running component cutadapt" +LABEL org.opencontainers.image.created="2024-06-24T09:12:31Z" +LABEL org.opencontainers.image.source="https://github.com/marcelm/cutadapt" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" + +VIASHDOCKER + fi +} + +# ViashDockerBuildArgs: return the arguments to pass to docker build +# $1 : engine identifier +# return : arguments to pass to docker build +function ViashDockerBuildArgs { + local engine_id="$1" + + if [[ "$engine_id" == "docker" ]]; then + echo "" + fi +} + +# ViashAbsolutePath: generate absolute path from relative path +# borrowed from https://stackoverflow.com/a/21951256 +# $1 : relative filename +# return : absolute path +# examples: +# ViashAbsolutePath some_file.txt # returns /path/to/some_file.txt +# ViashAbsolutePath /foo/bar/.. # returns /foo +function ViashAbsolutePath { + local thePath + if [[ ! "$1" =~ ^/ ]]; then + thePath="$PWD/$1" + else + thePath="$1" + fi + echo "$thePath" | ( + IFS=/ + read -a parr + declare -a outp + for i in "${parr[@]}"; do + case "$i" in + ''|.) continue ;; + ..) + len=${#outp[@]} + if ((len==0)); then + continue + else + unset outp[$((len-1))] + fi + ;; + *) + len=${#outp[@]} + outp[$len]="$i" + ;; + esac + done + echo /"${outp[*]}" + ) +} +# ViashDockerAutodetectMount: auto configuring docker mounts from parameters +# $1 : The parameter value +# returns : New parameter +# $VIASH_DIRECTORY_MOUNTS : Added another parameter to be passed to docker +# examples: +# ViashDockerAutodetectMount /path/to/bar # returns '/viash_automount/path/to/bar' +# ViashDockerAutodetectMountArg /path/to/bar # returns '--volume="/path/to:/viash_automount/path/to"' +function ViashDockerAutodetectMount { + abs_path=$(ViashAbsolutePath "$1") + if [ -d "$abs_path" ]; then + mount_source="$abs_path" + base_name="" + else + mount_source=`dirname "$abs_path"` + base_name=`basename "$abs_path"` + fi + mount_target="/viash_automount$mount_source" + if [ -z "$base_name" ]; then + echo "$mount_target" + else + echo "$mount_target/$base_name" + fi +} +function ViashDockerAutodetectMountArg { + abs_path=$(ViashAbsolutePath "$1") + if [ -d "$abs_path" ]; then + mount_source="$abs_path" + base_name="" + else + mount_source=`dirname "$abs_path"` + base_name=`basename "$abs_path"` + fi + mount_target="/viash_automount$mount_source" + ViashDebug "ViashDockerAutodetectMountArg $1 -> $mount_source -> $mount_target" + echo "--volume=\"$mount_source:$mount_target\"" +} +function ViashDockerStripAutomount { + abs_path=$(ViashAbsolutePath "$1") + echo "${abs_path#/viash_automount}" +} +# initialise variables +VIASH_DIRECTORY_MOUNTS=() + +# initialise docker variables +VIASH_DOCKER_RUN_ARGS=(-i --rm) + +# initialise array +VIASH_POSITIONAL_ARGS='' + +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + ViashHelp + exit + ;; + ---v|---verbose) + let "VIASH_VERBOSITY=VIASH_VERBOSITY+1" + shift 1 + ;; + ---verbosity) + VIASH_VERBOSITY="$2" + shift 2 + ;; + ---verbosity=*) + VIASH_VERBOSITY="$(ViashRemoveFlags "$1")" + shift 1 + ;; + --version) + echo "cutadapt v0.1.0" + exit + ;; + --adapter) + if [ -z "$VIASH_PAR_ADAPTER" ]; then + VIASH_PAR_ADAPTER="$2" + else + VIASH_PAR_ADAPTER="$VIASH_PAR_ADAPTER;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --adapter. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --adapter=*) + if [ -z "$VIASH_PAR_ADAPTER" ]; then + VIASH_PAR_ADAPTER=$(ViashRemoveFlags "$1") + else + VIASH_PAR_ADAPTER="$VIASH_PAR_ADAPTER;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -a) + if [ -z "$VIASH_PAR_ADAPTER" ]; then + VIASH_PAR_ADAPTER="$2" + else + VIASH_PAR_ADAPTER="$VIASH_PAR_ADAPTER;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -a. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --front) + if [ -z "$VIASH_PAR_FRONT" ]; then + VIASH_PAR_FRONT="$2" + else + VIASH_PAR_FRONT="$VIASH_PAR_FRONT;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --front. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --front=*) + if [ -z "$VIASH_PAR_FRONT" ]; then + VIASH_PAR_FRONT=$(ViashRemoveFlags "$1") + else + VIASH_PAR_FRONT="$VIASH_PAR_FRONT;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -g) + if [ -z "$VIASH_PAR_FRONT" ]; then + VIASH_PAR_FRONT="$2" + else + VIASH_PAR_FRONT="$VIASH_PAR_FRONT;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -g. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --anywhere) + if [ -z "$VIASH_PAR_ANYWHERE" ]; then + VIASH_PAR_ANYWHERE="$2" + else + VIASH_PAR_ANYWHERE="$VIASH_PAR_ANYWHERE;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --anywhere. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --anywhere=*) + if [ -z "$VIASH_PAR_ANYWHERE" ]; then + VIASH_PAR_ANYWHERE=$(ViashRemoveFlags "$1") + else + VIASH_PAR_ANYWHERE="$VIASH_PAR_ANYWHERE;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -b) + if [ -z "$VIASH_PAR_ANYWHERE" ]; then + VIASH_PAR_ANYWHERE="$2" + else + VIASH_PAR_ANYWHERE="$VIASH_PAR_ANYWHERE;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -b. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --adapter_fasta) + if [ -z "$VIASH_PAR_ADAPTER_FASTA" ]; then + VIASH_PAR_ADAPTER_FASTA="$2" + else + VIASH_PAR_ADAPTER_FASTA="$VIASH_PAR_ADAPTER_FASTA;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --adapter_fasta. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --adapter_fasta=*) + if [ -z "$VIASH_PAR_ADAPTER_FASTA" ]; then + VIASH_PAR_ADAPTER_FASTA=$(ViashRemoveFlags "$1") + else + VIASH_PAR_ADAPTER_FASTA="$VIASH_PAR_ADAPTER_FASTA;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + --front_fasta) + [ -n "$VIASH_PAR_FRONT_FASTA" ] && ViashError Bad arguments for option \'--front_fasta\': \'$VIASH_PAR_FRONT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_FRONT_FASTA="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --front_fasta. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --front_fasta=*) + [ -n "$VIASH_PAR_FRONT_FASTA" ] && ViashError Bad arguments for option \'--front_fasta=*\': \'$VIASH_PAR_FRONT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_FRONT_FASTA=$(ViashRemoveFlags "$1") + shift 1 + ;; + --anywhere_fasta) + [ -n "$VIASH_PAR_ANYWHERE_FASTA" ] && ViashError Bad arguments for option \'--anywhere_fasta\': \'$VIASH_PAR_ANYWHERE_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ANYWHERE_FASTA="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --anywhere_fasta. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --anywhere_fasta=*) + [ -n "$VIASH_PAR_ANYWHERE_FASTA" ] && ViashError Bad arguments for option \'--anywhere_fasta=*\': \'$VIASH_PAR_ANYWHERE_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ANYWHERE_FASTA=$(ViashRemoveFlags "$1") + shift 1 + ;; + --adapter_r2) + if [ -z "$VIASH_PAR_ADAPTER_R2" ]; then + VIASH_PAR_ADAPTER_R2="$2" + else + VIASH_PAR_ADAPTER_R2="$VIASH_PAR_ADAPTER_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --adapter_r2. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --adapter_r2=*) + if [ -z "$VIASH_PAR_ADAPTER_R2" ]; then + VIASH_PAR_ADAPTER_R2=$(ViashRemoveFlags "$1") + else + VIASH_PAR_ADAPTER_R2="$VIASH_PAR_ADAPTER_R2;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -A) + if [ -z "$VIASH_PAR_ADAPTER_R2" ]; then + VIASH_PAR_ADAPTER_R2="$2" + else + VIASH_PAR_ADAPTER_R2="$VIASH_PAR_ADAPTER_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -A. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --front_r2) + if [ -z "$VIASH_PAR_FRONT_R2" ]; then + VIASH_PAR_FRONT_R2="$2" + else + VIASH_PAR_FRONT_R2="$VIASH_PAR_FRONT_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --front_r2. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --front_r2=*) + if [ -z "$VIASH_PAR_FRONT_R2" ]; then + VIASH_PAR_FRONT_R2=$(ViashRemoveFlags "$1") + else + VIASH_PAR_FRONT_R2="$VIASH_PAR_FRONT_R2;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -G) + if [ -z "$VIASH_PAR_FRONT_R2" ]; then + VIASH_PAR_FRONT_R2="$2" + else + VIASH_PAR_FRONT_R2="$VIASH_PAR_FRONT_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -G. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --anywhere_r2) + if [ -z "$VIASH_PAR_ANYWHERE_R2" ]; then + VIASH_PAR_ANYWHERE_R2="$2" + else + VIASH_PAR_ANYWHERE_R2="$VIASH_PAR_ANYWHERE_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --anywhere_r2. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --anywhere_r2=*) + if [ -z "$VIASH_PAR_ANYWHERE_R2" ]; then + VIASH_PAR_ANYWHERE_R2=$(ViashRemoveFlags "$1") + else + VIASH_PAR_ANYWHERE_R2="$VIASH_PAR_ANYWHERE_R2;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -B) + if [ -z "$VIASH_PAR_ANYWHERE_R2" ]; then + VIASH_PAR_ANYWHERE_R2="$2" + else + VIASH_PAR_ANYWHERE_R2="$VIASH_PAR_ANYWHERE_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -B. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --adapter_r2_fasta) + [ -n "$VIASH_PAR_ADAPTER_R2_FASTA" ] && ViashError Bad arguments for option \'--adapter_r2_fasta\': \'$VIASH_PAR_ADAPTER_R2_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ADAPTER_R2_FASTA="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --adapter_r2_fasta. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --adapter_r2_fasta=*) + [ -n "$VIASH_PAR_ADAPTER_R2_FASTA" ] && ViashError Bad arguments for option \'--adapter_r2_fasta=*\': \'$VIASH_PAR_ADAPTER_R2_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ADAPTER_R2_FASTA=$(ViashRemoveFlags "$1") + shift 1 + ;; + --front_r2_fasta) + [ -n "$VIASH_PAR_FRONT_R2_FASTA" ] && ViashError Bad arguments for option \'--front_r2_fasta\': \'$VIASH_PAR_FRONT_R2_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_FRONT_R2_FASTA="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --front_r2_fasta. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --front_r2_fasta=*) + [ -n "$VIASH_PAR_FRONT_R2_FASTA" ] && ViashError Bad arguments for option \'--front_r2_fasta=*\': \'$VIASH_PAR_FRONT_R2_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_FRONT_R2_FASTA=$(ViashRemoveFlags "$1") + shift 1 + ;; + --anywhere_r2_fasta) + [ -n "$VIASH_PAR_ANYWHERE_R2_FASTA" ] && ViashError Bad arguments for option \'--anywhere_r2_fasta\': \'$VIASH_PAR_ANYWHERE_R2_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ANYWHERE_R2_FASTA="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --anywhere_r2_fasta. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --anywhere_r2_fasta=*) + [ -n "$VIASH_PAR_ANYWHERE_R2_FASTA" ] && ViashError Bad arguments for option \'--anywhere_r2_fasta=*\': \'$VIASH_PAR_ANYWHERE_R2_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ANYWHERE_R2_FASTA=$(ViashRemoveFlags "$1") + shift 1 + ;; + --pair_adapters) + [ -n "$VIASH_PAR_PAIR_ADAPTERS" ] && ViashError Bad arguments for option \'--pair_adapters\': \'$VIASH_PAR_PAIR_ADAPTERS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_PAIR_ADAPTERS=true + shift 1 + ;; + --pair_filter) + [ -n "$VIASH_PAR_PAIR_FILTER" ] && ViashError Bad arguments for option \'--pair_filter\': \'$VIASH_PAR_PAIR_FILTER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_PAIR_FILTER="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --pair_filter. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --pair_filter=*) + [ -n "$VIASH_PAR_PAIR_FILTER" ] && ViashError Bad arguments for option \'--pair_filter=*\': \'$VIASH_PAR_PAIR_FILTER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_PAIR_FILTER=$(ViashRemoveFlags "$1") + shift 1 + ;; + --interleaved) + [ -n "$VIASH_PAR_INTERLEAVED" ] && ViashError Bad arguments for option \'--interleaved\': \'$VIASH_PAR_INTERLEAVED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INTERLEAVED=true + shift 1 + ;; + --input) + [ -n "$VIASH_PAR_INPUT" ] && ViashError Bad arguments for option \'--input\': \'$VIASH_PAR_INPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --input. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --input=*) + [ -n "$VIASH_PAR_INPUT" ] && ViashError Bad arguments for option \'--input=*\': \'$VIASH_PAR_INPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT=$(ViashRemoveFlags "$1") + shift 1 + ;; + --input_r2) + [ -n "$VIASH_PAR_INPUT_R2" ] && ViashError Bad arguments for option \'--input_r2\': \'$VIASH_PAR_INPUT_R2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_R2="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_r2. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --input_r2=*) + [ -n "$VIASH_PAR_INPUT_R2" ] && ViashError Bad arguments for option \'--input_r2=*\': \'$VIASH_PAR_INPUT_R2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_R2=$(ViashRemoveFlags "$1") + shift 1 + ;; + --error_rate) + [ -n "$VIASH_PAR_ERROR_RATE" ] && ViashError Bad arguments for option \'--error_rate\': \'$VIASH_PAR_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ERROR_RATE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --error_rate. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --error_rate=*) + [ -n "$VIASH_PAR_ERROR_RATE" ] && ViashError Bad arguments for option \'--error_rate=*\': \'$VIASH_PAR_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ERROR_RATE=$(ViashRemoveFlags "$1") + shift 1 + ;; + -E) + [ -n "$VIASH_PAR_ERROR_RATE" ] && ViashError Bad arguments for option \'-E\': \'$VIASH_PAR_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ERROR_RATE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -E. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --errors) + [ -n "$VIASH_PAR_ERROR_RATE" ] && ViashError Bad arguments for option \'--errors\': \'$VIASH_PAR_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ERROR_RATE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --errors. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --no_indels) + [ -n "$VIASH_PAR_NO_INDELS" ] && ViashError Bad arguments for option \'--no_indels\': \'$VIASH_PAR_NO_INDELS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_NO_INDELS=false + shift 1 + ;; + --times) + [ -n "$VIASH_PAR_TIMES" ] && ViashError Bad arguments for option \'--times\': \'$VIASH_PAR_TIMES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_TIMES="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --times. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --times=*) + [ -n "$VIASH_PAR_TIMES" ] && ViashError Bad arguments for option \'--times=*\': \'$VIASH_PAR_TIMES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_TIMES=$(ViashRemoveFlags "$1") + shift 1 + ;; + -n) + [ -n "$VIASH_PAR_TIMES" ] && ViashError Bad arguments for option \'-n\': \'$VIASH_PAR_TIMES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_TIMES="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -n. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --overlap) + [ -n "$VIASH_PAR_OVERLAP" ] && ViashError Bad arguments for option \'--overlap\': \'$VIASH_PAR_OVERLAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OVERLAP="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --overlap. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --overlap=*) + [ -n "$VIASH_PAR_OVERLAP" ] && ViashError Bad arguments for option \'--overlap=*\': \'$VIASH_PAR_OVERLAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OVERLAP=$(ViashRemoveFlags "$1") + shift 1 + ;; + -O) + [ -n "$VIASH_PAR_OVERLAP" ] && ViashError Bad arguments for option \'-O\': \'$VIASH_PAR_OVERLAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OVERLAP="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -O. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --match_read_wildcards) + [ -n "$VIASH_PAR_MATCH_READ_WILDCARDS" ] && ViashError Bad arguments for option \'--match_read_wildcards\': \'$VIASH_PAR_MATCH_READ_WILDCARDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MATCH_READ_WILDCARDS=true + shift 1 + ;; + --no_match_adapter_wildcards) + [ -n "$VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS" ] && ViashError Bad arguments for option \'--no_match_adapter_wildcards\': \'$VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS=false + shift 1 + ;; + --action) + [ -n "$VIASH_PAR_ACTION" ] && ViashError Bad arguments for option \'--action\': \'$VIASH_PAR_ACTION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ACTION="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --action. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --action=*) + [ -n "$VIASH_PAR_ACTION" ] && ViashError Bad arguments for option \'--action=*\': \'$VIASH_PAR_ACTION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ACTION=$(ViashRemoveFlags "$1") + shift 1 + ;; + --revcomp) + [ -n "$VIASH_PAR_REVCOMP" ] && ViashError Bad arguments for option \'--revcomp\': \'$VIASH_PAR_REVCOMP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_REVCOMP=true + shift 1 + ;; + --rc) + [ -n "$VIASH_PAR_REVCOMP" ] && ViashError Bad arguments for option \'--rc\': \'$VIASH_PAR_REVCOMP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_REVCOMP=true + shift 1 + ;; + --cut) + if [ -z "$VIASH_PAR_CUT" ]; then + VIASH_PAR_CUT="$2" + else + VIASH_PAR_CUT="$VIASH_PAR_CUT;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --cut. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --cut=*) + if [ -z "$VIASH_PAR_CUT" ]; then + VIASH_PAR_CUT=$(ViashRemoveFlags "$1") + else + VIASH_PAR_CUT="$VIASH_PAR_CUT;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + -u) + if [ -z "$VIASH_PAR_CUT" ]; then + VIASH_PAR_CUT="$2" + else + VIASH_PAR_CUT="$VIASH_PAR_CUT;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to -u. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --cut_r2) + if [ -z "$VIASH_PAR_CUT_R2" ]; then + VIASH_PAR_CUT_R2="$2" + else + VIASH_PAR_CUT_R2="$VIASH_PAR_CUT_R2;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --cut_r2. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --cut_r2=*) + if [ -z "$VIASH_PAR_CUT_R2" ]; then + VIASH_PAR_CUT_R2=$(ViashRemoveFlags "$1") + else + VIASH_PAR_CUT_R2="$VIASH_PAR_CUT_R2;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + --nextseq_trim) + [ -n "$VIASH_PAR_NEXTSEQ_TRIM" ] && ViashError Bad arguments for option \'--nextseq_trim\': \'$VIASH_PAR_NEXTSEQ_TRIM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_NEXTSEQ_TRIM="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --nextseq_trim. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --nextseq_trim=*) + [ -n "$VIASH_PAR_NEXTSEQ_TRIM" ] && ViashError Bad arguments for option \'--nextseq_trim=*\': \'$VIASH_PAR_NEXTSEQ_TRIM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_NEXTSEQ_TRIM=$(ViashRemoveFlags "$1") + shift 1 + ;; + --quality_cutoff) + [ -n "$VIASH_PAR_QUALITY_CUTOFF" ] && ViashError Bad arguments for option \'--quality_cutoff\': \'$VIASH_PAR_QUALITY_CUTOFF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_CUTOFF="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --quality_cutoff. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --quality_cutoff=*) + [ -n "$VIASH_PAR_QUALITY_CUTOFF" ] && ViashError Bad arguments for option \'--quality_cutoff=*\': \'$VIASH_PAR_QUALITY_CUTOFF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_CUTOFF=$(ViashRemoveFlags "$1") + shift 1 + ;; + -q) + [ -n "$VIASH_PAR_QUALITY_CUTOFF" ] && ViashError Bad arguments for option \'-q\': \'$VIASH_PAR_QUALITY_CUTOFF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_CUTOFF="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -q. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --quality_cutoff_r2) + [ -n "$VIASH_PAR_QUALITY_CUTOFF_R2" ] && ViashError Bad arguments for option \'--quality_cutoff_r2\': \'$VIASH_PAR_QUALITY_CUTOFF_R2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_CUTOFF_R2="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --quality_cutoff_r2. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --quality_cutoff_r2=*) + [ -n "$VIASH_PAR_QUALITY_CUTOFF_R2" ] && ViashError Bad arguments for option \'--quality_cutoff_r2=*\': \'$VIASH_PAR_QUALITY_CUTOFF_R2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_CUTOFF_R2=$(ViashRemoveFlags "$1") + shift 1 + ;; + -Q) + [ -n "$VIASH_PAR_QUALITY_CUTOFF_R2" ] && ViashError Bad arguments for option \'-Q\': \'$VIASH_PAR_QUALITY_CUTOFF_R2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_CUTOFF_R2="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -Q. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --quality_base) + [ -n "$VIASH_PAR_QUALITY_BASE" ] && ViashError Bad arguments for option \'--quality_base\': \'$VIASH_PAR_QUALITY_BASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_BASE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --quality_base. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --quality_base=*) + [ -n "$VIASH_PAR_QUALITY_BASE" ] && ViashError Bad arguments for option \'--quality_base=*\': \'$VIASH_PAR_QUALITY_BASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_QUALITY_BASE=$(ViashRemoveFlags "$1") + shift 1 + ;; + --poly_a) + [ -n "$VIASH_PAR_POLY_A" ] && ViashError Bad arguments for option \'--poly_a\': \'$VIASH_PAR_POLY_A\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_POLY_A=true + shift 1 + ;; + --length) + [ -n "$VIASH_PAR_LENGTH" ] && ViashError Bad arguments for option \'--length\': \'$VIASH_PAR_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LENGTH="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --length. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --length=*) + [ -n "$VIASH_PAR_LENGTH" ] && ViashError Bad arguments for option \'--length=*\': \'$VIASH_PAR_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LENGTH=$(ViashRemoveFlags "$1") + shift 1 + ;; + -l) + [ -n "$VIASH_PAR_LENGTH" ] && ViashError Bad arguments for option \'-l\': \'$VIASH_PAR_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LENGTH="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -l. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --trim_n) + [ -n "$VIASH_PAR_TRIM_N" ] && ViashError Bad arguments for option \'--trim_n\': \'$VIASH_PAR_TRIM_N\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_TRIM_N=true + shift 1 + ;; + --length_tag) + [ -n "$VIASH_PAR_LENGTH_TAG" ] && ViashError Bad arguments for option \'--length_tag\': \'$VIASH_PAR_LENGTH_TAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LENGTH_TAG="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --length_tag. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --length_tag=*) + [ -n "$VIASH_PAR_LENGTH_TAG" ] && ViashError Bad arguments for option \'--length_tag=*\': \'$VIASH_PAR_LENGTH_TAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LENGTH_TAG=$(ViashRemoveFlags "$1") + shift 1 + ;; + --strip_suffix) + [ -n "$VIASH_PAR_STRIP_SUFFIX" ] && ViashError Bad arguments for option \'--strip_suffix\': \'$VIASH_PAR_STRIP_SUFFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_STRIP_SUFFIX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --strip_suffix. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --strip_suffix=*) + [ -n "$VIASH_PAR_STRIP_SUFFIX" ] && ViashError Bad arguments for option \'--strip_suffix=*\': \'$VIASH_PAR_STRIP_SUFFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_STRIP_SUFFIX=$(ViashRemoveFlags "$1") + shift 1 + ;; + --prefix) + [ -n "$VIASH_PAR_PREFIX" ] && ViashError Bad arguments for option \'--prefix\': \'$VIASH_PAR_PREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_PREFIX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --prefix. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --prefix=*) + [ -n "$VIASH_PAR_PREFIX" ] && ViashError Bad arguments for option \'--prefix=*\': \'$VIASH_PAR_PREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_PREFIX=$(ViashRemoveFlags "$1") + shift 1 + ;; + -x) + [ -n "$VIASH_PAR_PREFIX" ] && ViashError Bad arguments for option \'-x\': \'$VIASH_PAR_PREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_PREFIX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -x. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --suffix) + [ -n "$VIASH_PAR_SUFFIX" ] && ViashError Bad arguments for option \'--suffix\': \'$VIASH_PAR_SUFFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SUFFIX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --suffix. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --suffix=*) + [ -n "$VIASH_PAR_SUFFIX" ] && ViashError Bad arguments for option \'--suffix=*\': \'$VIASH_PAR_SUFFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SUFFIX=$(ViashRemoveFlags "$1") + shift 1 + ;; + -y) + [ -n "$VIASH_PAR_SUFFIX" ] && ViashError Bad arguments for option \'-y\': \'$VIASH_PAR_SUFFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SUFFIX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -y. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --rename) + [ -n "$VIASH_PAR_RENAME" ] && ViashError Bad arguments for option \'--rename\': \'$VIASH_PAR_RENAME\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_RENAME="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --rename. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --rename=*) + [ -n "$VIASH_PAR_RENAME" ] && ViashError Bad arguments for option \'--rename=*\': \'$VIASH_PAR_RENAME\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_RENAME=$(ViashRemoveFlags "$1") + shift 1 + ;; + --zero_cap) + [ -n "$VIASH_PAR_ZERO_CAP" ] && ViashError Bad arguments for option \'--zero_cap\': \'$VIASH_PAR_ZERO_CAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ZERO_CAP=true + shift 1 + ;; + -z) + [ -n "$VIASH_PAR_ZERO_CAP" ] && ViashError Bad arguments for option \'-z\': \'$VIASH_PAR_ZERO_CAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_ZERO_CAP=true + shift 1 + ;; + --minimum_length) + [ -n "$VIASH_PAR_MINIMUM_LENGTH" ] && ViashError Bad arguments for option \'--minimum_length\': \'$VIASH_PAR_MINIMUM_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MINIMUM_LENGTH="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --minimum_length. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --minimum_length=*) + [ -n "$VIASH_PAR_MINIMUM_LENGTH" ] && ViashError Bad arguments for option \'--minimum_length=*\': \'$VIASH_PAR_MINIMUM_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MINIMUM_LENGTH=$(ViashRemoveFlags "$1") + shift 1 + ;; + -m) + [ -n "$VIASH_PAR_MINIMUM_LENGTH" ] && ViashError Bad arguments for option \'-m\': \'$VIASH_PAR_MINIMUM_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MINIMUM_LENGTH="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -m. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --maximum_length) + [ -n "$VIASH_PAR_MAXIMUM_LENGTH" ] && ViashError Bad arguments for option \'--maximum_length\': \'$VIASH_PAR_MAXIMUM_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAXIMUM_LENGTH="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --maximum_length. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --maximum_length=*) + [ -n "$VIASH_PAR_MAXIMUM_LENGTH" ] && ViashError Bad arguments for option \'--maximum_length=*\': \'$VIASH_PAR_MAXIMUM_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAXIMUM_LENGTH=$(ViashRemoveFlags "$1") + shift 1 + ;; + -M) + [ -n "$VIASH_PAR_MAXIMUM_LENGTH" ] && ViashError Bad arguments for option \'-M\': \'$VIASH_PAR_MAXIMUM_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAXIMUM_LENGTH="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to -M. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --max_n) + [ -n "$VIASH_PAR_MAX_N" ] && ViashError Bad arguments for option \'--max_n\': \'$VIASH_PAR_MAX_N\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_N="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --max_n. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --max_n=*) + [ -n "$VIASH_PAR_MAX_N" ] && ViashError Bad arguments for option \'--max_n=*\': \'$VIASH_PAR_MAX_N\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_N=$(ViashRemoveFlags "$1") + shift 1 + ;; + --max_expected_errors) + [ -n "$VIASH_PAR_MAX_EXPECTED_ERRORS" ] && ViashError Bad arguments for option \'--max_expected_errors\': \'$VIASH_PAR_MAX_EXPECTED_ERRORS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_EXPECTED_ERRORS="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --max_expected_errors. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --max_expected_errors=*) + [ -n "$VIASH_PAR_MAX_EXPECTED_ERRORS" ] && ViashError Bad arguments for option \'--max_expected_errors=*\': \'$VIASH_PAR_MAX_EXPECTED_ERRORS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_EXPECTED_ERRORS=$(ViashRemoveFlags "$1") + shift 1 + ;; + --max_ee) + [ -n "$VIASH_PAR_MAX_EXPECTED_ERRORS" ] && ViashError Bad arguments for option \'--max_ee\': \'$VIASH_PAR_MAX_EXPECTED_ERRORS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_EXPECTED_ERRORS="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --max_ee. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --max_average_error_rate) + [ -n "$VIASH_PAR_MAX_AVERAGE_ERROR_RATE" ] && ViashError Bad arguments for option \'--max_average_error_rate\': \'$VIASH_PAR_MAX_AVERAGE_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_AVERAGE_ERROR_RATE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --max_average_error_rate. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --max_average_error_rate=*) + [ -n "$VIASH_PAR_MAX_AVERAGE_ERROR_RATE" ] && ViashError Bad arguments for option \'--max_average_error_rate=*\': \'$VIASH_PAR_MAX_AVERAGE_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_AVERAGE_ERROR_RATE=$(ViashRemoveFlags "$1") + shift 1 + ;; + --max_aer) + [ -n "$VIASH_PAR_MAX_AVERAGE_ERROR_RATE" ] && ViashError Bad arguments for option \'--max_aer\': \'$VIASH_PAR_MAX_AVERAGE_ERROR_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAX_AVERAGE_ERROR_RATE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --max_aer. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --discard_trimmed) + [ -n "$VIASH_PAR_DISCARD_TRIMMED" ] && ViashError Bad arguments for option \'--discard_trimmed\': \'$VIASH_PAR_DISCARD_TRIMMED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_DISCARD_TRIMMED=true + shift 1 + ;; + --discard) + [ -n "$VIASH_PAR_DISCARD_TRIMMED" ] && ViashError Bad arguments for option \'--discard\': \'$VIASH_PAR_DISCARD_TRIMMED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_DISCARD_TRIMMED=true + shift 1 + ;; + --discard_untrimmed) + [ -n "$VIASH_PAR_DISCARD_UNTRIMMED" ] && ViashError Bad arguments for option \'--discard_untrimmed\': \'$VIASH_PAR_DISCARD_UNTRIMMED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_DISCARD_UNTRIMMED=true + shift 1 + ;; + --trimmed_only) + [ -n "$VIASH_PAR_DISCARD_UNTRIMMED" ] && ViashError Bad arguments for option \'--trimmed_only\': \'$VIASH_PAR_DISCARD_UNTRIMMED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_DISCARD_UNTRIMMED=true + shift 1 + ;; + --discard_casava) + [ -n "$VIASH_PAR_DISCARD_CASAVA" ] && ViashError Bad arguments for option \'--discard_casava\': \'$VIASH_PAR_DISCARD_CASAVA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_DISCARD_CASAVA=true + shift 1 + ;; + --report) + [ -n "$VIASH_PAR_REPORT" ] && ViashError Bad arguments for option \'--report\': \'$VIASH_PAR_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_REPORT="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --report. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --report=*) + [ -n "$VIASH_PAR_REPORT" ] && ViashError Bad arguments for option \'--report=*\': \'$VIASH_PAR_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_REPORT=$(ViashRemoveFlags "$1") + shift 1 + ;; + --json) + [ -n "$VIASH_PAR_JSON" ] && ViashError Bad arguments for option \'--json\': \'$VIASH_PAR_JSON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_JSON=true + shift 1 + ;; + --output) + [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'--output\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OUTPUT="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --output. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --output=*) + [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'--output=*\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OUTPUT=$(ViashRemoveFlags "$1") + shift 1 + ;; + --fasta) + [ -n "$VIASH_PAR_FASTA" ] && ViashError Bad arguments for option \'--fasta\': \'$VIASH_PAR_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_FASTA=true + shift 1 + ;; + --info_file) + [ -n "$VIASH_PAR_INFO_FILE" ] && ViashError Bad arguments for option \'--info_file\': \'$VIASH_PAR_INFO_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INFO_FILE=true + shift 1 + ;; + --debug) + [ -n "$VIASH_PAR_DEBUG" ] && ViashError Bad arguments for option \'--debug\': \'$VIASH_PAR_DEBUG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_DEBUG=true + shift 1 + ;; + ---engine) + VIASH_ENGINE_ID="$2" + shift 2 + ;; + ---engine=*) + VIASH_ENGINE_ID="$(ViashRemoveFlags "$1")" + shift 1 + ;; + ---setup) + VIASH_MODE='setup' + VIASH_SETUP_STRATEGY="$2" + shift 2 + ;; + ---setup=*) + VIASH_MODE='setup' + VIASH_SETUP_STRATEGY="$(ViashRemoveFlags "$1")" + shift 1 + ;; + ---dockerfile) + VIASH_MODE='dockerfile' + shift 1 + ;; + ---debug) + VIASH_MODE='debug' + shift 1 + ;; + ---cpus) + [ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_CPUS="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to ---cpus. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + ---cpus=*) + [ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus=*\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_CPUS=$(ViashRemoveFlags "$1") + shift 1 + ;; + ---memory) + [ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_MEMORY="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to ---memory. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + ---memory=*) + [ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory=*\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_MEMORY=$(ViashRemoveFlags "$1") + shift 1 + ;; + *) # positional arg or unknown option + # since the positional args will be eval'd, can we always quote, instead of using ViashQuote + VIASH_POSITIONAL_ARGS="$VIASH_POSITIONAL_ARGS '$1'" + [[ $1 == -* ]] && ViashWarning $1 looks like a parameter but is not a defined parameter and will instead be treated as a positional argument. Use "--help" to get more information on the parameters. + shift # past argument + ;; + esac +done + +# parse positional parameters +eval set -- $VIASH_POSITIONAL_ARGS + + +if [ "$VIASH_ENGINE_ID" == "native" ] ; then + VIASH_ENGINE_TYPE='native' +elif [ "$VIASH_ENGINE_ID" == "docker" ] ; then + VIASH_ENGINE_TYPE='docker' +else + ViashError "Engine '$VIASH_ENGINE_ID' is not recognized. Options are: docker, native." + exit 1 +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # check if docker is installed properly + ViashDockerInstallationCheck + + # determine docker image id + if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/cutadapt:v0.1.0' + fi + + # print dockerfile + if [ "$VIASH_MODE" == "dockerfile" ]; then + ViashDockerfile "$VIASH_ENGINE_ID" + exit 0 + + # enter docker container + elif [[ "$VIASH_MODE" == "debug" ]]; then + VIASH_CMD="docker run --entrypoint=bash ${VIASH_DOCKER_RUN_ARGS[@]} -v '$(pwd)':/pwd --workdir /pwd -t $VIASH_DOCKER_IMAGE_ID" + ViashNotice "+ $VIASH_CMD" + eval $VIASH_CMD + exit + + # build docker image + elif [ "$VIASH_MODE" == "setup" ]; then + ViashDockerSetup "$VIASH_DOCKER_IMAGE_ID" "$VIASH_SETUP_STRATEGY" + ViashDockerCheckCommands "$VIASH_DOCKER_IMAGE_ID" 'ps' 'bash' + exit 0 + fi + + # check if docker image exists + ViashDockerSetup "$VIASH_DOCKER_IMAGE_ID" ifneedbepullelsecachedbuild + ViashDockerCheckCommands "$VIASH_DOCKER_IMAGE_ID" 'ps' 'bash' +fi + +# setting computational defaults + +# helper function for parsing memory strings +function ViashMemoryAsBytes { + local memory=`echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]'` + local memory_regex='^([0-9]+)([kmgtp]i?b?|b)$' + if [[ $memory =~ $memory_regex ]]; then + local number=${memory/[^0-9]*/} + local symbol=${memory/*[0-9]/} + + case $symbol in + b) memory_b=$number ;; + kb|k) memory_b=$(( $number * 1000 )) ;; + mb|m) memory_b=$(( $number * 1000 * 1000 )) ;; + gb|g) memory_b=$(( $number * 1000 * 1000 * 1000 )) ;; + tb|t) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 )) ;; + pb|p) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 * 1000 )) ;; + kib|ki) memory_b=$(( $number * 1024 )) ;; + mib|mi) memory_b=$(( $number * 1024 * 1024 )) ;; + gib|gi) memory_b=$(( $number * 1024 * 1024 * 1024 )) ;; + tib|ti) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 )) ;; + pib|pi) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 * 1024 )) ;; + esac + echo "$memory_b" + fi +} +# compute memory in different units +if [ ! -z ${VIASH_META_MEMORY+x} ]; then + VIASH_META_MEMORY_B=`ViashMemoryAsBytes $VIASH_META_MEMORY` + # do not define other variables if memory_b is an empty string + if [ ! -z "$VIASH_META_MEMORY_B" ]; then + VIASH_META_MEMORY_KB=$(( ($VIASH_META_MEMORY_B+999) / 1000 )) + VIASH_META_MEMORY_MB=$(( ($VIASH_META_MEMORY_KB+999) / 1000 )) + VIASH_META_MEMORY_GB=$(( ($VIASH_META_MEMORY_MB+999) / 1000 )) + VIASH_META_MEMORY_TB=$(( ($VIASH_META_MEMORY_GB+999) / 1000 )) + VIASH_META_MEMORY_PB=$(( ($VIASH_META_MEMORY_TB+999) / 1000 )) + VIASH_META_MEMORY_KIB=$(( ($VIASH_META_MEMORY_B+1023) / 1024 )) + VIASH_META_MEMORY_MIB=$(( ($VIASH_META_MEMORY_KIB+1023) / 1024 )) + VIASH_META_MEMORY_GIB=$(( ($VIASH_META_MEMORY_MIB+1023) / 1024 )) + VIASH_META_MEMORY_TIB=$(( ($VIASH_META_MEMORY_GIB+1023) / 1024 )) + VIASH_META_MEMORY_PIB=$(( ($VIASH_META_MEMORY_TIB+1023) / 1024 )) + else + # unset memory if string is empty + unset $VIASH_META_MEMORY_B + fi +fi +# unset nproc if string is empty +if [ -z "$VIASH_META_CPUS" ]; then + unset $VIASH_META_CPUS +fi + + +# check whether required parameters exist +if [ -z ${VIASH_PAR_INPUT+x} ]; then + ViashError '--input' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_PAR_OUTPUT+x} ]; then + ViashError '--output' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_NAME+x} ]; then + ViashError 'name' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then + ViashError 'functionality_name' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_RESOURCES_DIR+x} ]; then + ViashError 'resources_dir' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_EXECUTABLE+x} ]; then + ViashError 'executable' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_CONFIG+x} ]; then + ViashError 'config' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_TEMP_DIR+x} ]; then + ViashError 'temp_dir' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi + +# filling in defaults +if [ -z ${VIASH_PAR_PAIR_ADAPTERS+x} ]; then + VIASH_PAR_PAIR_ADAPTERS="false" +fi +if [ -z ${VIASH_PAR_INTERLEAVED+x} ]; then + VIASH_PAR_INTERLEAVED="false" +fi +if [ -z ${VIASH_PAR_NO_INDELS+x} ]; then + VIASH_PAR_NO_INDELS="true" +fi +if [ -z ${VIASH_PAR_MATCH_READ_WILDCARDS+x} ]; then + VIASH_PAR_MATCH_READ_WILDCARDS="false" +fi +if [ -z ${VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS+x} ]; then + VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS="true" +fi +if [ -z ${VIASH_PAR_REVCOMP+x} ]; then + VIASH_PAR_REVCOMP="false" +fi +if [ -z ${VIASH_PAR_POLY_A+x} ]; then + VIASH_PAR_POLY_A="false" +fi +if [ -z ${VIASH_PAR_TRIM_N+x} ]; then + VIASH_PAR_TRIM_N="false" +fi +if [ -z ${VIASH_PAR_ZERO_CAP+x} ]; then + VIASH_PAR_ZERO_CAP="false" +fi +if [ -z ${VIASH_PAR_DISCARD_TRIMMED+x} ]; then + VIASH_PAR_DISCARD_TRIMMED="false" +fi +if [ -z ${VIASH_PAR_DISCARD_UNTRIMMED+x} ]; then + VIASH_PAR_DISCARD_UNTRIMMED="false" +fi +if [ -z ${VIASH_PAR_DISCARD_CASAVA+x} ]; then + VIASH_PAR_DISCARD_CASAVA="false" +fi +if [ -z ${VIASH_PAR_JSON+x} ]; then + VIASH_PAR_JSON="false" +fi +if [ -z ${VIASH_PAR_FASTA+x} ]; then + VIASH_PAR_FASTA="false" +fi +if [ -z ${VIASH_PAR_INFO_FILE+x} ]; then + VIASH_PAR_INFO_FILE="false" +fi +if [ -z ${VIASH_PAR_DEBUG+x} ]; then + VIASH_PAR_DEBUG="false" +fi + +# check whether required files exist +if [ ! -z "$VIASH_PAR_ADAPTER_FASTA" ]; then + IFS=';' + set -f + for file in $VIASH_PAR_ADAPTER_FASTA; do + unset IFS + if [ ! -e "$file" ]; then + ViashError "Input file '$file' does not exist." + exit 1 + fi + done + set +f +fi +if [ ! -z "$VIASH_PAR_FRONT_FASTA" ] && [ ! -e "$VIASH_PAR_FRONT_FASTA" ]; then + ViashError "Input file '$VIASH_PAR_FRONT_FASTA' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_ANYWHERE_FASTA" ] && [ ! -e "$VIASH_PAR_ANYWHERE_FASTA" ]; then + ViashError "Input file '$VIASH_PAR_ANYWHERE_FASTA' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_ADAPTER_R2_FASTA" ] && [ ! -e "$VIASH_PAR_ADAPTER_R2_FASTA" ]; then + ViashError "Input file '$VIASH_PAR_ADAPTER_R2_FASTA' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_FRONT_R2_FASTA" ] && [ ! -e "$VIASH_PAR_FRONT_R2_FASTA" ]; then + ViashError "Input file '$VIASH_PAR_FRONT_R2_FASTA' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_ANYWHERE_R2_FASTA" ] && [ ! -e "$VIASH_PAR_ANYWHERE_R2_FASTA" ]; then + ViashError "Input file '$VIASH_PAR_ANYWHERE_R2_FASTA' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_INPUT" ] && [ ! -e "$VIASH_PAR_INPUT" ]; then + ViashError "Input file '$VIASH_PAR_INPUT' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_INPUT_R2" ] && [ ! -e "$VIASH_PAR_INPUT_R2" ]; then + ViashError "Input file '$VIASH_PAR_INPUT_R2' does not exist." + exit 1 +fi + +# check whether parameters values are of the right type +if [[ -n "$VIASH_PAR_PAIR_ADAPTERS" ]]; then + if ! [[ "$VIASH_PAR_PAIR_ADAPTERS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--pair_adapters' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_INTERLEAVED" ]]; then + if ! [[ "$VIASH_PAR_INTERLEAVED" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--interleaved' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_ERROR_RATE" ]]; then + if ! [[ "$VIASH_PAR_ERROR_RATE" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then + ViashError '--error_rate' has to be a double. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_NO_INDELS" ]]; then + if ! [[ "$VIASH_PAR_NO_INDELS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--no_indels' has to be a boolean_false. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_TIMES" ]]; then + if ! [[ "$VIASH_PAR_TIMES" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--times' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_OVERLAP" ]]; then + if ! [[ "$VIASH_PAR_OVERLAP" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--overlap' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_MATCH_READ_WILDCARDS" ]]; then + if ! [[ "$VIASH_PAR_MATCH_READ_WILDCARDS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--match_read_wildcards' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS" ]]; then + if ! [[ "$VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--no_match_adapter_wildcards' has to be a boolean_false. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_REVCOMP" ]]; then + if ! [[ "$VIASH_PAR_REVCOMP" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--revcomp' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [ -n "$VIASH_PAR_CUT" ]; then + IFS=';' + set -f + for val in $VIASH_PAR_CUT; do + if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--cut' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi + done + set +f + unset IFS +fi + +if [ -n "$VIASH_PAR_CUT_R2" ]; then + IFS=';' + set -f + for val in $VIASH_PAR_CUT_R2; do + if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--cut_r2' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi + done + set +f + unset IFS +fi + +if [[ -n "$VIASH_PAR_QUALITY_BASE" ]]; then + if ! [[ "$VIASH_PAR_QUALITY_BASE" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--quality_base' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_POLY_A" ]]; then + if ! [[ "$VIASH_PAR_POLY_A" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--poly_a' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_LENGTH" ]]; then + if ! [[ "$VIASH_PAR_LENGTH" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--length' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_TRIM_N" ]]; then + if ! [[ "$VIASH_PAR_TRIM_N" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--trim_n' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_ZERO_CAP" ]]; then + if ! [[ "$VIASH_PAR_ZERO_CAP" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--zero_cap' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_MAX_EXPECTED_ERRORS" ]]; then + if ! [[ "$VIASH_PAR_MAX_EXPECTED_ERRORS" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--max_expected_errors' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_MAX_AVERAGE_ERROR_RATE" ]]; then + if ! [[ "$VIASH_PAR_MAX_AVERAGE_ERROR_RATE" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--max_average_error_rate' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_DISCARD_TRIMMED" ]]; then + if ! [[ "$VIASH_PAR_DISCARD_TRIMMED" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--discard_trimmed' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_DISCARD_UNTRIMMED" ]]; then + if ! [[ "$VIASH_PAR_DISCARD_UNTRIMMED" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--discard_untrimmed' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_DISCARD_CASAVA" ]]; then + if ! [[ "$VIASH_PAR_DISCARD_CASAVA" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--discard_casava' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_JSON" ]]; then + if ! [[ "$VIASH_PAR_JSON" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--json' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_OUTPUT" ]]; then + if ! [[ "$VIASH_PAR_OUTPUT" =~ \* ]]; then + ViashError '--output' has to be a path containing a wildcard, e.g. 'output_*.txt'. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_FASTA" ]]; then + if ! [[ "$VIASH_PAR_FASTA" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--fasta' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_INFO_FILE" ]]; then + if ! [[ "$VIASH_PAR_INFO_FILE" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--info_file' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_DEBUG" ]]; then + if ! [[ "$VIASH_PAR_DEBUG" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--debug' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_CPUS" ]]; then + if ! [[ "$VIASH_META_CPUS" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'cpus' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_B" ]]; then + if ! [[ "$VIASH_META_MEMORY_B" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_b' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_KB" ]]; then + if ! [[ "$VIASH_META_MEMORY_KB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_kb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_MB" ]]; then + if ! [[ "$VIASH_META_MEMORY_MB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_mb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_GB" ]]; then + if ! [[ "$VIASH_META_MEMORY_GB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_gb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_TB" ]]; then + if ! [[ "$VIASH_META_MEMORY_TB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_tb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_PB" ]]; then + if ! [[ "$VIASH_META_MEMORY_PB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_pb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_KIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_KIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_kib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_MIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_MIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_mib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_GIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_GIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_gib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_TIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_TIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_tib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_PIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_PIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_pib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi + +# check whether value is belongs to a set of choices +if [ ! -z "$VIASH_PAR_PAIR_FILTER" ]; then + VIASH_PAR_PAIR_FILTER_CHOICES=("any;both;first") + IFS=';' + set -f + if ! [[ ";${VIASH_PAR_PAIR_FILTER_CHOICES[*]};" =~ ";$VIASH_PAR_PAIR_FILTER;" ]]; then + ViashError '--pair_filter' specified value of \'$VIASH_PAR_PAIR_FILTER\' is not in the list of allowed values. Use "--help" to get more information on the parameters. + exit 1 + fi + set +f + unset IFS +fi + +if [ ! -z "$VIASH_PAR_ACTION" ]; then + VIASH_PAR_ACTION_CHOICES=("trim;retain;mask;lowercase;none") + IFS=';' + set -f + if ! [[ ";${VIASH_PAR_ACTION_CHOICES[*]};" =~ ";$VIASH_PAR_ACTION;" ]]; then + ViashError '--action' specified value of \'$VIASH_PAR_ACTION\' is not in the list of allowed values. Use "--help" to get more information on the parameters. + exit 1 + fi + set +f + unset IFS +fi + +if [ ! -z "$VIASH_PAR_REPORT" ]; then + VIASH_PAR_REPORT_CHOICES=("full;minimal") + IFS=';' + set -f + if ! [[ ";${VIASH_PAR_REPORT_CHOICES[*]};" =~ ";$VIASH_PAR_REPORT;" ]]; then + ViashError '--report' specified value of \'$VIASH_PAR_REPORT\' is not in the list of allowed values. Use "--help" to get more information on the parameters. + exit 1 + fi + set +f + unset IFS +fi + +# create parent directories of output files, if so desired +if [ ! -z "$VIASH_PAR_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT")" ]; then + mkdir -p "$(dirname "$VIASH_PAR_OUTPUT")" +fi + +if [ "$VIASH_ENGINE_ID" == "native" ] ; then + if [ "$VIASH_MODE" == "run" ]; then + VIASH_CMD="bash" + else + ViashError "Engine '$VIASH_ENGINE_ID' does not support mode '$VIASH_MODE'." + exit 1 + fi +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # detect volumes from file arguments + VIASH_CHOWN_VARS=() +if [ ! -z "$VIASH_PAR_ADAPTER_FASTA" ]; then + VIASH_TEST_ADAPTER_FASTA=() + IFS=';' + for var in $VIASH_PAR_ADAPTER_FASTA; do + unset IFS + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$var")" ) + var=$(ViashDockerAutodetectMount "$var") + VIASH_TEST_ADAPTER_FASTA+=( "$var" ) + done + VIASH_PAR_ADAPTER_FASTA=$(IFS=';' ; echo "${VIASH_TEST_ADAPTER_FASTA[*]}") +fi +if [ ! -z "$VIASH_PAR_FRONT_FASTA" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_FRONT_FASTA")" ) + VIASH_PAR_FRONT_FASTA=$(ViashDockerAutodetectMount "$VIASH_PAR_FRONT_FASTA") +fi +if [ ! -z "$VIASH_PAR_ANYWHERE_FASTA" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_ANYWHERE_FASTA")" ) + VIASH_PAR_ANYWHERE_FASTA=$(ViashDockerAutodetectMount "$VIASH_PAR_ANYWHERE_FASTA") +fi +if [ ! -z "$VIASH_PAR_ADAPTER_R2_FASTA" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_ADAPTER_R2_FASTA")" ) + VIASH_PAR_ADAPTER_R2_FASTA=$(ViashDockerAutodetectMount "$VIASH_PAR_ADAPTER_R2_FASTA") +fi +if [ ! -z "$VIASH_PAR_FRONT_R2_FASTA" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_FRONT_R2_FASTA")" ) + VIASH_PAR_FRONT_R2_FASTA=$(ViashDockerAutodetectMount "$VIASH_PAR_FRONT_R2_FASTA") +fi +if [ ! -z "$VIASH_PAR_ANYWHERE_R2_FASTA" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_ANYWHERE_R2_FASTA")" ) + VIASH_PAR_ANYWHERE_R2_FASTA=$(ViashDockerAutodetectMount "$VIASH_PAR_ANYWHERE_R2_FASTA") +fi +if [ ! -z "$VIASH_PAR_INPUT" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT")" ) + VIASH_PAR_INPUT=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT") +fi +if [ ! -z "$VIASH_PAR_INPUT_R2" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT_R2")" ) + VIASH_PAR_INPUT_R2=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT_R2") +fi +if [ ! -z "$VIASH_PAR_OUTPUT" ]; then + VIASH_TEST_OUTPUT=() + IFS=';' + for var in $VIASH_PAR_OUTPUT; do + unset IFS + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$var")" ) + var=$(ViashDockerAutodetectMount "$var") + VIASH_TEST_OUTPUT+=( "$var" ) + VIASH_CHOWN_VARS+=( "$var" ) + done + VIASH_PAR_OUTPUT=$(IFS=';' ; echo "${VIASH_TEST_OUTPUT[*]}") +fi +if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_RESOURCES_DIR")" ) + VIASH_META_RESOURCES_DIR=$(ViashDockerAutodetectMount "$VIASH_META_RESOURCES_DIR") +fi +if [ ! -z "$VIASH_META_EXECUTABLE" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_EXECUTABLE")" ) + VIASH_META_EXECUTABLE=$(ViashDockerAutodetectMount "$VIASH_META_EXECUTABLE") +fi +if [ ! -z "$VIASH_META_CONFIG" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_CONFIG")" ) + VIASH_META_CONFIG=$(ViashDockerAutodetectMount "$VIASH_META_CONFIG") +fi +if [ ! -z "$VIASH_META_TEMP_DIR" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_TEMP_DIR")" ) + VIASH_META_TEMP_DIR=$(ViashDockerAutodetectMount "$VIASH_META_TEMP_DIR") +fi + + # get unique mounts + VIASH_UNIQUE_MOUNTS=($(for val in "${VIASH_DIRECTORY_MOUNTS[@]}"; do echo "$val"; done | sort -u)) +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # change file ownership + function ViashPerformChown { + if (( ${#VIASH_CHOWN_VARS[@]} )); then + set +e + VIASH_CMD="docker run --entrypoint=bash --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_DOCKER_IMAGE_ID -c 'chown $(id -u):$(id -g) --silent --recursive ${VIASH_CHOWN_VARS[@]}'" + ViashDebug "+ $VIASH_CMD" + eval $VIASH_CMD + set -e + fi + } + trap ViashPerformChown EXIT +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # helper function for filling in extra docker args + if [ ! -z "$VIASH_META_MEMORY_B" ]; then + VIASH_DOCKER_RUN_ARGS+=("--memory=${VIASH_META_MEMORY_B}") + fi + if [ ! -z "$VIASH_META_CPUS" ]; then + VIASH_DOCKER_RUN_ARGS+=("--cpus=${VIASH_META_CPUS}") + fi +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + VIASH_CMD="docker run --entrypoint=bash ${VIASH_DOCKER_RUN_ARGS[@]} ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_DOCKER_IMAGE_ID" +fi + + +# set dependency paths + + +ViashDebug "Running command: $(echo $VIASH_CMD)" +cat << VIASHEOF | eval $VIASH_CMD +set -e +tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-cutadapt-XXXXXX").sh +function clean_up { + rm "\$tempscript" +} +function interrupt { + echo -e "\nCTRL-C Pressed..." + exit 1 +} +trap clean_up EXIT +trap interrupt INT SIGINT +cat > "\$tempscript" << 'VIASHMAIN' +#!/bin/bash + +## VIASH START +# The following code has been auto-generated by Viash. +$( if [ ! -z ${VIASH_PAR_ADAPTER+x} ]; then echo "${VIASH_PAR_ADAPTER}" | sed "s#'#'\"'\"'#g;s#.*#par_adapter='&'#" ; else echo "# par_adapter="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT+x} ]; then echo "${VIASH_PAR_FRONT}" | sed "s#'#'\"'\"'#g;s#.*#par_front='&'#" ; else echo "# par_front="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE+x} ]; then echo "${VIASH_PAR_ANYWHERE}" | sed "s#'#'\"'\"'#g;s#.*#par_anywhere='&'#" ; else echo "# par_anywhere="; fi ) +$( if [ ! -z ${VIASH_PAR_ADAPTER_FASTA+x} ]; then echo "${VIASH_PAR_ADAPTER_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_adapter_fasta='&'#" ; else echo "# par_adapter_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT_FASTA+x} ]; then echo "${VIASH_PAR_FRONT_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_front_fasta='&'#" ; else echo "# par_front_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE_FASTA+x} ]; then echo "${VIASH_PAR_ANYWHERE_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_anywhere_fasta='&'#" ; else echo "# par_anywhere_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_ADAPTER_R2+x} ]; then echo "${VIASH_PAR_ADAPTER_R2}" | sed "s#'#'\"'\"'#g;s#.*#par_adapter_r2='&'#" ; else echo "# par_adapter_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT_R2+x} ]; then echo "${VIASH_PAR_FRONT_R2}" | sed "s#'#'\"'\"'#g;s#.*#par_front_r2='&'#" ; else echo "# par_front_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE_R2+x} ]; then echo "${VIASH_PAR_ANYWHERE_R2}" | sed "s#'#'\"'\"'#g;s#.*#par_anywhere_r2='&'#" ; else echo "# par_anywhere_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_ADAPTER_R2_FASTA+x} ]; then echo "${VIASH_PAR_ADAPTER_R2_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_adapter_r2_fasta='&'#" ; else echo "# par_adapter_r2_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT_R2_FASTA+x} ]; then echo "${VIASH_PAR_FRONT_R2_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_front_r2_fasta='&'#" ; else echo "# par_front_r2_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE_R2_FASTA+x} ]; then echo "${VIASH_PAR_ANYWHERE_R2_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_anywhere_r2_fasta='&'#" ; else echo "# par_anywhere_r2_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_PAIR_ADAPTERS+x} ]; then echo "${VIASH_PAR_PAIR_ADAPTERS}" | sed "s#'#'\"'\"'#g;s#.*#par_pair_adapters='&'#" ; else echo "# par_pair_adapters="; fi ) +$( if [ ! -z ${VIASH_PAR_PAIR_FILTER+x} ]; then echo "${VIASH_PAR_PAIR_FILTER}" | sed "s#'#'\"'\"'#g;s#.*#par_pair_filter='&'#" ; else echo "# par_pair_filter="; fi ) +$( if [ ! -z ${VIASH_PAR_INTERLEAVED+x} ]; then echo "${VIASH_PAR_INTERLEAVED}" | sed "s#'#'\"'\"'#g;s#.*#par_interleaved='&'#" ; else echo "# par_interleaved="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_R2+x} ]; then echo "${VIASH_PAR_INPUT_R2}" | sed "s#'#'\"'\"'#g;s#.*#par_input_r2='&'#" ; else echo "# par_input_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_ERROR_RATE+x} ]; then echo "${VIASH_PAR_ERROR_RATE}" | sed "s#'#'\"'\"'#g;s#.*#par_error_rate='&'#" ; else echo "# par_error_rate="; fi ) +$( if [ ! -z ${VIASH_PAR_NO_INDELS+x} ]; then echo "${VIASH_PAR_NO_INDELS}" | sed "s#'#'\"'\"'#g;s#.*#par_no_indels='&'#" ; else echo "# par_no_indels="; fi ) +$( if [ ! -z ${VIASH_PAR_TIMES+x} ]; then echo "${VIASH_PAR_TIMES}" | sed "s#'#'\"'\"'#g;s#.*#par_times='&'#" ; else echo "# par_times="; fi ) +$( if [ ! -z ${VIASH_PAR_OVERLAP+x} ]; then echo "${VIASH_PAR_OVERLAP}" | sed "s#'#'\"'\"'#g;s#.*#par_overlap='&'#" ; else echo "# par_overlap="; fi ) +$( if [ ! -z ${VIASH_PAR_MATCH_READ_WILDCARDS+x} ]; then echo "${VIASH_PAR_MATCH_READ_WILDCARDS}" | sed "s#'#'\"'\"'#g;s#.*#par_match_read_wildcards='&'#" ; else echo "# par_match_read_wildcards="; fi ) +$( if [ ! -z ${VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS+x} ]; then echo "${VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS}" | sed "s#'#'\"'\"'#g;s#.*#par_no_match_adapter_wildcards='&'#" ; else echo "# par_no_match_adapter_wildcards="; fi ) +$( if [ ! -z ${VIASH_PAR_ACTION+x} ]; then echo "${VIASH_PAR_ACTION}" | sed "s#'#'\"'\"'#g;s#.*#par_action='&'#" ; else echo "# par_action="; fi ) +$( if [ ! -z ${VIASH_PAR_REVCOMP+x} ]; then echo "${VIASH_PAR_REVCOMP}" | sed "s#'#'\"'\"'#g;s#.*#par_revcomp='&'#" ; else echo "# par_revcomp="; fi ) +$( if [ ! -z ${VIASH_PAR_CUT+x} ]; then echo "${VIASH_PAR_CUT}" | sed "s#'#'\"'\"'#g;s#.*#par_cut='&'#" ; else echo "# par_cut="; fi ) +$( if [ ! -z ${VIASH_PAR_CUT_R2+x} ]; then echo "${VIASH_PAR_CUT_R2}" | sed "s#'#'\"'\"'#g;s#.*#par_cut_r2='&'#" ; else echo "# par_cut_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_NEXTSEQ_TRIM+x} ]; then echo "${VIASH_PAR_NEXTSEQ_TRIM}" | sed "s#'#'\"'\"'#g;s#.*#par_nextseq_trim='&'#" ; else echo "# par_nextseq_trim="; fi ) +$( if [ ! -z ${VIASH_PAR_QUALITY_CUTOFF+x} ]; then echo "${VIASH_PAR_QUALITY_CUTOFF}" | sed "s#'#'\"'\"'#g;s#.*#par_quality_cutoff='&'#" ; else echo "# par_quality_cutoff="; fi ) +$( if [ ! -z ${VIASH_PAR_QUALITY_CUTOFF_R2+x} ]; then echo "${VIASH_PAR_QUALITY_CUTOFF_R2}" | sed "s#'#'\"'\"'#g;s#.*#par_quality_cutoff_r2='&'#" ; else echo "# par_quality_cutoff_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_QUALITY_BASE+x} ]; then echo "${VIASH_PAR_QUALITY_BASE}" | sed "s#'#'\"'\"'#g;s#.*#par_quality_base='&'#" ; else echo "# par_quality_base="; fi ) +$( if [ ! -z ${VIASH_PAR_POLY_A+x} ]; then echo "${VIASH_PAR_POLY_A}" | sed "s#'#'\"'\"'#g;s#.*#par_poly_a='&'#" ; else echo "# par_poly_a="; fi ) +$( if [ ! -z ${VIASH_PAR_LENGTH+x} ]; then echo "${VIASH_PAR_LENGTH}" | sed "s#'#'\"'\"'#g;s#.*#par_length='&'#" ; else echo "# par_length="; fi ) +$( if [ ! -z ${VIASH_PAR_TRIM_N+x} ]; then echo "${VIASH_PAR_TRIM_N}" | sed "s#'#'\"'\"'#g;s#.*#par_trim_n='&'#" ; else echo "# par_trim_n="; fi ) +$( if [ ! -z ${VIASH_PAR_LENGTH_TAG+x} ]; then echo "${VIASH_PAR_LENGTH_TAG}" | sed "s#'#'\"'\"'#g;s#.*#par_length_tag='&'#" ; else echo "# par_length_tag="; fi ) +$( if [ ! -z ${VIASH_PAR_STRIP_SUFFIX+x} ]; then echo "${VIASH_PAR_STRIP_SUFFIX}" | sed "s#'#'\"'\"'#g;s#.*#par_strip_suffix='&'#" ; else echo "# par_strip_suffix="; fi ) +$( if [ ! -z ${VIASH_PAR_PREFIX+x} ]; then echo "${VIASH_PAR_PREFIX}" | sed "s#'#'\"'\"'#g;s#.*#par_prefix='&'#" ; else echo "# par_prefix="; fi ) +$( if [ ! -z ${VIASH_PAR_SUFFIX+x} ]; then echo "${VIASH_PAR_SUFFIX}" | sed "s#'#'\"'\"'#g;s#.*#par_suffix='&'#" ; else echo "# par_suffix="; fi ) +$( if [ ! -z ${VIASH_PAR_RENAME+x} ]; then echo "${VIASH_PAR_RENAME}" | sed "s#'#'\"'\"'#g;s#.*#par_rename='&'#" ; else echo "# par_rename="; fi ) +$( if [ ! -z ${VIASH_PAR_ZERO_CAP+x} ]; then echo "${VIASH_PAR_ZERO_CAP}" | sed "s#'#'\"'\"'#g;s#.*#par_zero_cap='&'#" ; else echo "# par_zero_cap="; fi ) +$( if [ ! -z ${VIASH_PAR_MINIMUM_LENGTH+x} ]; then echo "${VIASH_PAR_MINIMUM_LENGTH}" | sed "s#'#'\"'\"'#g;s#.*#par_minimum_length='&'#" ; else echo "# par_minimum_length="; fi ) +$( if [ ! -z ${VIASH_PAR_MAXIMUM_LENGTH+x} ]; then echo "${VIASH_PAR_MAXIMUM_LENGTH}" | sed "s#'#'\"'\"'#g;s#.*#par_maximum_length='&'#" ; else echo "# par_maximum_length="; fi ) +$( if [ ! -z ${VIASH_PAR_MAX_N+x} ]; then echo "${VIASH_PAR_MAX_N}" | sed "s#'#'\"'\"'#g;s#.*#par_max_n='&'#" ; else echo "# par_max_n="; fi ) +$( if [ ! -z ${VIASH_PAR_MAX_EXPECTED_ERRORS+x} ]; then echo "${VIASH_PAR_MAX_EXPECTED_ERRORS}" | sed "s#'#'\"'\"'#g;s#.*#par_max_expected_errors='&'#" ; else echo "# par_max_expected_errors="; fi ) +$( if [ ! -z ${VIASH_PAR_MAX_AVERAGE_ERROR_RATE+x} ]; then echo "${VIASH_PAR_MAX_AVERAGE_ERROR_RATE}" | sed "s#'#'\"'\"'#g;s#.*#par_max_average_error_rate='&'#" ; else echo "# par_max_average_error_rate="; fi ) +$( if [ ! -z ${VIASH_PAR_DISCARD_TRIMMED+x} ]; then echo "${VIASH_PAR_DISCARD_TRIMMED}" | sed "s#'#'\"'\"'#g;s#.*#par_discard_trimmed='&'#" ; else echo "# par_discard_trimmed="; fi ) +$( if [ ! -z ${VIASH_PAR_DISCARD_UNTRIMMED+x} ]; then echo "${VIASH_PAR_DISCARD_UNTRIMMED}" | sed "s#'#'\"'\"'#g;s#.*#par_discard_untrimmed='&'#" ; else echo "# par_discard_untrimmed="; fi ) +$( if [ ! -z ${VIASH_PAR_DISCARD_CASAVA+x} ]; then echo "${VIASH_PAR_DISCARD_CASAVA}" | sed "s#'#'\"'\"'#g;s#.*#par_discard_casava='&'#" ; else echo "# par_discard_casava="; fi ) +$( if [ ! -z ${VIASH_PAR_REPORT+x} ]; then echo "${VIASH_PAR_REPORT}" | sed "s#'#'\"'\"'#g;s#.*#par_report='&'#" ; else echo "# par_report="; fi ) +$( if [ ! -z ${VIASH_PAR_JSON+x} ]; then echo "${VIASH_PAR_JSON}" | sed "s#'#'\"'\"'#g;s#.*#par_json='&'#" ; else echo "# par_json="; fi ) +$( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "${VIASH_PAR_OUTPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_output='&'#" ; else echo "# par_output="; fi ) +$( if [ ! -z ${VIASH_PAR_FASTA+x} ]; then echo "${VIASH_PAR_FASTA}" | sed "s#'#'\"'\"'#g;s#.*#par_fasta='&'#" ; else echo "# par_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_INFO_FILE+x} ]; then echo "${VIASH_PAR_INFO_FILE}" | sed "s#'#'\"'\"'#g;s#.*#par_info_file='&'#" ; else echo "# par_info_file="; fi ) +$( if [ ! -z ${VIASH_PAR_DEBUG+x} ]; then echo "${VIASH_PAR_DEBUG}" | sed "s#'#'\"'\"'#g;s#.*#par_debug='&'#" ; else echo "# par_debug="; fi ) +$( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) +$( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) +$( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\"'\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) +$( if [ ! -z ${VIASH_META_EXECUTABLE+x} ]; then echo "${VIASH_META_EXECUTABLE}" | sed "s#'#'\"'\"'#g;s#.*#meta_executable='&'#" ; else echo "# meta_executable="; fi ) +$( if [ ! -z ${VIASH_META_CONFIG+x} ]; then echo "${VIASH_META_CONFIG}" | sed "s#'#'\"'\"'#g;s#.*#meta_config='&'#" ; else echo "# meta_config="; fi ) +$( if [ ! -z ${VIASH_META_TEMP_DIR+x} ]; then echo "${VIASH_META_TEMP_DIR}" | sed "s#'#'\"'\"'#g;s#.*#meta_temp_dir='&'#" ; else echo "# meta_temp_dir="; fi ) +$( if [ ! -z ${VIASH_META_CPUS+x} ]; then echo "${VIASH_META_CPUS}" | sed "s#'#'\"'\"'#g;s#.*#meta_cpus='&'#" ; else echo "# meta_cpus="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_B+x} ]; then echo "${VIASH_META_MEMORY_B}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_b='&'#" ; else echo "# meta_memory_b="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KB+x} ]; then echo "${VIASH_META_MEMORY_KB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_kb='&'#" ; else echo "# meta_memory_kb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MB+x} ]; then echo "${VIASH_META_MEMORY_MB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_mb='&'#" ; else echo "# meta_memory_mb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GB+x} ]; then echo "${VIASH_META_MEMORY_GB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_gb='&'#" ; else echo "# meta_memory_gb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TB+x} ]; then echo "${VIASH_META_MEMORY_TB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_tb='&'#" ; else echo "# meta_memory_tb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PB+x} ]; then echo "${VIASH_META_MEMORY_PB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_pb='&'#" ; else echo "# meta_memory_pb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KIB+x} ]; then echo "${VIASH_META_MEMORY_KIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_kib='&'#" ; else echo "# meta_memory_kib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MIB+x} ]; then echo "${VIASH_META_MEMORY_MIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_mib='&'#" ; else echo "# meta_memory_mib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GIB+x} ]; then echo "${VIASH_META_MEMORY_GIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_gib='&'#" ; else echo "# meta_memory_gib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_tib='&'#" ; else echo "# meta_memory_tib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi ) + +## VIASH END + +function debug { + [[ "\$par_debug" == "true" ]] && echo "DEBUG: \$@" +} + +output_dir=\$(dirname \$par_output) +[[ ! -d \$output_dir ]] && mkdir -p \$output_dir + +# Init +########################################################### + +echo ">> Paired-end data or not?" + +mode="" +if [[ -z \$par_input_r2 ]]; then + mode="se" + echo " Single end" + input="\$par_input" +else + echo " Paired end" + mode="pe" + input="\$par_input \$par_input_r2" +fi + +# Adapter arguments +# - paired and single-end +# - string and fasta +########################################################### + +function add_flags { + local arg=\$1 + local flag=\$2 + local prefix=\$3 + [[ -z \$prefix ]] && prefix="" + + # This function should not be called if the input is empty + # but check for it just in case + if [[ -z \$arg ]]; then + return + fi + + local output="" + IFS=';' read -r -a array <<< "\$arg" + for a in "\${array[@]}"; do + output="\$output \$flag \$prefix\$a" + done + echo \$output +} + +debug ">> Parsing arguments dealing with adapters" +adapter_args=\$(echo \\ + \${par_adapter:+\$(add_flags "\$par_adapter" "--adapter")} \\ + \${par_adapter_fasta:+\$(add_flags "\$par_adapter_fasta" "--adapter" "file:")} \\ + \${par_front:+\$(add_flags "\$par_front" "--front")} \\ + \${par_front_fasta:+\$(add_flags "\$par_front_fasta" "--front" "file:")} \\ + \${par_anywhere:+\$(add_flags "\$par_anywhere" "--anywhere")} \\ + \${par_anywhere_fasta:+\$(add_flags "\$par_anywhere_fasta" "--anywhere" "file:")} \\ + \${par_adapter_r2:+\$(add_flags "\$par_adapter_r2" "-A")} \\ + \${par_adapter_fasta_r2:+\$(add_flags "\$par_adapter_fasta_r2" "-A" "file:")} \\ + \${par_front_r2:+\$(add_flags "\$par_front_r2" "-G")} \\ + \${par_front_fasta_r2:+\$(add_flags "\$par_front_fasta_r2" "-G" "file:")} \\ + \${par_anywhere_r2:+\$(add_flags "\$par_anywhere_r2" "-B")} \\ + \${par_anywhere_fasta_r2:+\$(add_flags "\$par_anywhere_fasta_r2" "-B" "file:")} \\ +) + +debug "Arguments to cutadapt:" +debug "\$adapter_args" +debug + +# Paired-end options +########################################################### +echo ">> Parsing arguments for paired-end reads" +[[ "\$par_pair_adapters" == "false" ]] && unset par_pair_adapters +[[ "\$par_interleaved" == "false" ]] && unset par_interleaved + +paired_args=\$(echo \\ + \${par_pair_adapters:+--pair-adapters} \\ + \${par_pair_filter:+--pair-filter "\${par_pair_filter}"} \\ + \${par_interleaved:+--interleaved} +) +debug "Arguments to cutadapt:" +debug \$paired_args +debug + +# Input arguments +########################################################### +echo ">> Parsing input arguments" +[[ "\$par_no_indels" == "true" ]] && unset par_no_indels +[[ "\$par_match_read_wildcards" == "false" ]] && unset par_match_read_wildcards +[[ "\$par_no_match_adapter_wildcards" == "true" ]] && unset par_no_match_adapter_wildcards +[[ "\$par_revcomp" == "false" ]] && unset par_revcomp + +input_args=\$(echo \\ + \${par_error_rate:+--error-rate "\${par_error_rate}"} \\ + \${par_no_indels:+--no-indels} \\ + \${par_times:+--times "\${par_times}"} \\ + \${par_overlap:+--overlap "\${par_overlap}"} \\ + \${par_match_read_wildcards:+--match-read-wildcards} \\ + \${par_no_match_adapter_wildcards:+--no-match-adapter-wildcards} \\ + \${par_action:+--action "\${par_action}"} \\ + \${par_revcomp:+--revcomp} \\ +) +debug "Arguments to cutadapt:" +debug \$input_args +debug + +# Read modifications +########################################################### +echo ">> Parsing read modification arguments" +[[ "\$par_poly_a" == "false" ]] && unset par_poly_a +[[ "\$par_trim_n" == "false" ]] && unset par_trim_n +[[ "\$par_zero_cap" == "false" ]] && unset par_zero_cap + +mod_args=\$(echo \\ + \${par_cut:+--cut "\${par_cut}"} \\ + \${par_cut_r2:+--cut_r2 "\${par_cut_r2}"} \\ + \${par_nextseq_trim:+--nextseq-trim "\${par_nextseq_trim}"} \\ + \${par_quality_cutoff:+--quality-cutoff "\${par_quality_cutoff}"} \\ + \${par_quality_cutoff_r2:+--quality-cutoff_r2 "\${par_quality_cutoff_r2}"} \\ + \${par_quality_base:+--quality-base "\${par_quality_base}"} \\ + \${par_poly_a:+--poly-a} \\ + \${par_length:+--length "\${par_length}"} \\ + \${par_trim_n:+--trim-n} \\ + \${par_length_tag:+--length-tag "\${par_length_tag}"} \\ + \${par_strip_suffix:+--strip-suffix "\${par_strip_suffix}"} \\ + \${par_prefix:+--prefix "\${par_prefix}"} \\ + \${par_suffix:+--suffix "\${par_suffix}"} \\ + \${par_rename:+--rename "\${par_rename}"} \\ + \${par_zero_cap:+--zero-cap} \\ +) +debug "Arguments to cutadapt:" +debug \$mod_args +debug + +# Filtering of processed reads arguments +########################################################### +echo ">> Filtering of processed reads arguments" +[[ "\$par_discard_trimmed" == "false" ]] && unset par_discard_trimmed +[[ "\$par_discard_untrimmed" == "false" ]] && unset par_discard_untrimmed +[[ "\$par_discard_casava" == "false" ]] && unset par_discard_casava + +# Parse and transform the minimum and maximum length arguments +[[ -z \$par_minimum_length ]] + +filter_args=\$(echo \\ + \${par_minimum_length:+--minimum-length "\${par_minimum_length}"} \\ + \${par_maximum_length:+--maximum-length "\${par_maximum_length}"} \\ + \${par_max_n:+--max-n "\${par_max_n}"} \\ + \${par_max_expected_errors:+--max-expected-errors "\${par_max_expected_errors}"} \\ + \${par_max_average_error_rate:+--max-average-error-rate "\${par_max_average_error_rate}"} \\ + \${par_discard_trimmed:+--discard-trimmed} \\ + \${par_discard_untrimmed:+--discard-untrimmed} \\ + \${par_discard_casava:+--discard-casava} \\ +) +debug "Arguments to cutadapt:" +debug \$filter_args +debug + +# Optional output arguments +########################################################### +echo ">> Optional arguments" +[[ "\$par_json" == "false" ]] && unset par_json +[[ "\$par_fasta" == "false" ]] && unset par_fasta +[[ "\$par_info_file" == "false" ]] && unset par_info_file + +optional_output_args=\$(echo \\ + \${par_report:+--report "\${par_report}"} \\ + \${par_json:+--json "report.json"} \\ + \${par_fasta:+--fasta} \\ + \${par_info_file:+--info-file "info.txt"} \\ +) + +debug "Arguments to cutadapt:" +debug \$optional_output_args +debug + +# Output arguments +# We write the output to a directory rather than +# individual files. +########################################################### + +if [[ -z \$par_fasta ]]; then + ext="fastq" +else + ext="fasta" +fi + +if [ \$mode = "se" ]; then + output_args=\$(echo \\ + --output "\$output_dir/{name}_001.\$ext" \\ + ) +else + output_args=\$(echo \\ + --output "\$output_dir/{name}_R1_001.\$ext" \\ + --paired-output "\$output_dir/{name}_R2_001.\$ext" \\ + ) +fi + +debug "Arguments to cutadapt:" +debug \$output_args +debug + +# Full CLI +# Set the --cores argument to 0 unless meta_cpus is set +########################################################### +echo ">> Running cutadapt" +par_cpus=0 +[[ ! -z \$meta_cpus ]] && par_cpus=\$meta_cpus + +cli=\$(echo \\ + \$input \\ + \$adapter_args \\ + \$paired_args \\ + \$input_args \\ + \$mod_args \\ + \$filter_args \\ + \$optional_output_args \\ + \$output_args \\ + --cores \$par_cpus +) + +debug ">> Full CLI to be run:" +debug cutadapt \$cli | sed -e 's/--/\\r\\n --/g' +debug + +cutadapt \$cli +VIASHMAIN +bash "\$tempscript" & +wait "\$!" + +VIASHEOF + + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # strip viash automount from file paths + + if [ ! -z "$VIASH_PAR_ADAPTER_FASTA" ]; then + unset VIASH_TEST_ADAPTER_FASTA + IFS=';' + for var in $VIASH_PAR_ADAPTER_FASTA; do + unset IFS + if [ -z "$VIASH_TEST_ADAPTER_FASTA" ]; then + VIASH_TEST_ADAPTER_FASTA="$(ViashDockerStripAutomount "$var")" + else + VIASH_TEST_ADAPTER_FASTA="$VIASH_TEST_ADAPTER_FASTA;""$(ViashDockerStripAutomount "$var")" + fi + done + VIASH_PAR_ADAPTER_FASTA="$VIASH_TEST_ADAPTER_FASTA" + fi + if [ ! -z "$VIASH_PAR_FRONT_FASTA" ]; then + VIASH_PAR_FRONT_FASTA=$(ViashDockerStripAutomount "$VIASH_PAR_FRONT_FASTA") + fi + if [ ! -z "$VIASH_PAR_ANYWHERE_FASTA" ]; then + VIASH_PAR_ANYWHERE_FASTA=$(ViashDockerStripAutomount "$VIASH_PAR_ANYWHERE_FASTA") + fi + if [ ! -z "$VIASH_PAR_ADAPTER_R2_FASTA" ]; then + VIASH_PAR_ADAPTER_R2_FASTA=$(ViashDockerStripAutomount "$VIASH_PAR_ADAPTER_R2_FASTA") + fi + if [ ! -z "$VIASH_PAR_FRONT_R2_FASTA" ]; then + VIASH_PAR_FRONT_R2_FASTA=$(ViashDockerStripAutomount "$VIASH_PAR_FRONT_R2_FASTA") + fi + if [ ! -z "$VIASH_PAR_ANYWHERE_R2_FASTA" ]; then + VIASH_PAR_ANYWHERE_R2_FASTA=$(ViashDockerStripAutomount "$VIASH_PAR_ANYWHERE_R2_FASTA") + fi + if [ ! -z "$VIASH_PAR_INPUT" ]; then + VIASH_PAR_INPUT=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT") + fi + if [ ! -z "$VIASH_PAR_INPUT_R2" ]; then + VIASH_PAR_INPUT_R2=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT_R2") + fi + if [ ! -z "$VIASH_PAR_OUTPUT" ]; then + VIASH_PAR_OUTPUT=$(ViashDockerStripAutomount "$VIASH_PAR_OUTPUT") + fi + if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then + VIASH_META_RESOURCES_DIR=$(ViashDockerStripAutomount "$VIASH_META_RESOURCES_DIR") + fi + if [ ! -z "$VIASH_META_EXECUTABLE" ]; then + VIASH_META_EXECUTABLE=$(ViashDockerStripAutomount "$VIASH_META_EXECUTABLE") + fi + if [ ! -z "$VIASH_META_CONFIG" ]; then + VIASH_META_CONFIG=$(ViashDockerStripAutomount "$VIASH_META_CONFIG") + fi + if [ ! -z "$VIASH_META_TEMP_DIR" ]; then + VIASH_META_TEMP_DIR=$(ViashDockerStripAutomount "$VIASH_META_TEMP_DIR") + fi +fi + + +# check whether required files exist +if [ ! -z "$VIASH_PAR_OUTPUT" ] && ! compgen -G "$VIASH_PAR_OUTPUT" > /dev/null; then + ViashError "Output file '$VIASH_PAR_OUTPUT' does not exist." + exit 1 +fi + + +exit 0 diff --git a/target/executable/falco/.config.vsh.yaml b/target/executable/falco/.config.vsh.yaml index 2e8a92f7..eaadbedd 100644 --- a/target/executable/falco/.config.vsh.yaml +++ b/target/executable/falco/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "falco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Input arguments" arguments: @@ -274,7 +274,7 @@ engines: id: "docker" image: "debian:trixie-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "apt" @@ -304,11 +304,11 @@ build_info: output: "target/executable/falco" executable: "target/executable/falco/falco" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -318,16 +318,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/falco/falco b/target/executable/falco/falco index 055d60b1..8e907f3f 100755 --- a/target/executable/falco/falco +++ b/target/executable/falco/falco @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# falco v0.1 +# falco v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "falco v0.1" + echo "falco v0.1.0" echo "" echo "A C++ drop-in replacement of FastQC to assess the quality of sequence read data" echo "" @@ -584,10 +584,10 @@ make install RUN echo "falco: \"$(falco -v | sed -n 's/^falco //p')\"" > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component falco" -LABEL org.opencontainers.image.created="2024-06-24T08:44:08Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:42Z" LABEL org.opencontainers.image.source="https://github.com/smithlabcode/falco" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -710,7 +710,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "falco v0.1" + echo "falco v0.1.0" exit ;; --input) @@ -966,7 +966,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/falco:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/falco:v0.1.0' fi # print dockerfile diff --git a/target/executable/fastp/.config.vsh.yaml b/target/executable/fastp/.config.vsh.yaml index 291992c6..0a3f0c7a 100644 --- a/target/executable/fastp/.config.vsh.yaml +++ b/target/executable/fastp/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "fastp" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" description: "`fastp` supports both single-end (SE) and paired-end (PE) input.\n\ @@ -1048,7 +1048,7 @@ engines: id: "docker" image: "quay.io/biocontainers/fastp:0.23.4--hadf994f_2" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -1065,11 +1065,11 @@ build_info: output: "target/executable/fastp" executable: "target/executable/fastp/fastp" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -1079,16 +1079,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/fastp/fastp b/target/executable/fastp/fastp index 4f158c93..9df88ad4 100755 --- a/target/executable/fastp/fastp +++ b/target/executable/fastp/fastp @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# fastp v0.1 +# fastp v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "fastp v0.1" + echo "fastp v0.1.0" echo "" echo "An ultra-fast all-in-one FASTQ preprocessor" echo "(QC/adapters/trimming/filtering/splitting/merging...)." @@ -1023,10 +1023,10 @@ ENTRYPOINT [] RUN fastp --version 2>&1 | sed 's# #: "#;s#$#"#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component fastp" -LABEL org.opencontainers.image.created="2024-06-24T08:44:06Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:39Z" LABEL org.opencontainers.image.source="https://github.com/OpenGene/fastp" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -1149,7 +1149,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "fastp v0.1" + echo "fastp v0.1.0" exit ;; --in1) @@ -2153,7 +2153,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/fastp:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/fastp:v0.1.0' fi # print dockerfile diff --git a/target/executable/featurecounts/.config.vsh.yaml b/target/executable/featurecounts/.config.vsh.yaml index 9775025a..6ec33f27 100644 --- a/target/executable/featurecounts/.config.vsh.yaml +++ b/target/executable/featurecounts/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "featurecounts" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -613,7 +613,7 @@ engines: id: "docker" image: "quay.io/biocontainers/subread:2.0.6--he4a0461_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -631,11 +631,11 @@ build_info: output: "target/executable/featurecounts" executable: "target/executable/featurecounts/featurecounts" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -645,16 +645,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/featurecounts/featurecounts b/target/executable/featurecounts/featurecounts index e19100c4..a6abde91 100755 --- a/target/executable/featurecounts/featurecounts +++ b/target/executable/featurecounts/featurecounts @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# featurecounts v0.1 +# featurecounts v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "featurecounts v0.1" + echo "featurecounts v0.1.0" echo "" echo "featureCounts is a read summarization program for counting reads generated from" echo "either RNA or genomic DNA sequencing experiments by implementing highly" @@ -749,10 +749,10 @@ ENTRYPOINT [] RUN featureCounts -v 2>&1 | sed 's/featureCounts v\([0-9.]*\)/featureCounts: \1/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component featurecounts" -LABEL org.opencontainers.image.created="2024-06-24T08:43:59Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:30Z" LABEL org.opencontainers.image.source="https://github.com/ShiLab-Bioinformatics/subread" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -875,7 +875,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "featurecounts v0.1" + echo "featurecounts v0.1.0" exit ;; --annotation) @@ -1467,7 +1467,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/featurecounts:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/featurecounts:v0.1.0' fi # print dockerfile diff --git a/target/executable/gffread/.config.vsh.yaml b/target/executable/gffread/.config.vsh.yaml index 4c102242..887eca09 100644 --- a/target/executable/gffread/.config.vsh.yaml +++ b/target/executable/gffread/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "gffread" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -654,7 +654,7 @@ engines: id: "docker" image: "quay.io/biocontainers/gffread:0.12.7--hdcf5f25_3" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -671,11 +671,11 @@ build_info: output: "target/executable/gffread" executable: "target/executable/gffread/gffread" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -685,16 +685,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/gffread/gffread b/target/executable/gffread/gffread index 50a3cd9a..0bce676e 100755 --- a/target/executable/gffread/gffread +++ b/target/executable/gffread/gffread @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# gffread v0.1 +# gffread v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "gffread v0.1" + echo "gffread v0.1.0" echo "" echo "Validate, filter, convert and perform various other operations on GFF files." echo "" @@ -802,10 +802,10 @@ ENTRYPOINT [] RUN echo "gffread: \"$(gffread --version 2>&1)\"" > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component gffread" -LABEL org.opencontainers.image.created="2024-06-24T08:44:03Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:36Z" LABEL org.opencontainers.image.source="https://github.com/gpertea/gffread" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -928,7 +928,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "gffread v0.1" + echo "gffread v0.1.0" exit ;; --input) @@ -1655,7 +1655,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/gffread:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/gffread:v0.1.0' fi # print dockerfile diff --git a/target/executable/lofreq/lofreq_call/.config.vsh.yaml b/target/executable/lofreq/lofreq_call/.config.vsh.yaml index 2cd4bcf1..49cc90f1 100644 --- a/target/executable/lofreq/lofreq_call/.config.vsh.yaml +++ b/target/executable/lofreq/lofreq_call/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "lofreq_call" namespace: "lofreq" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -398,7 +398,7 @@ references: doi: - "10.1093/nar/gks918" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" homepage: "https://csb5.github.io/lofreq/" documentation: "https://csb5.github.io/lofreq/commands/" runners: @@ -471,7 +471,7 @@ engines: id: "docker" image: "quay.io/biocontainers/lofreq:2.1.5--py38h794fc9e_10" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -489,11 +489,11 @@ build_info: output: "target/executable/lofreq/lofreq_call" executable: "target/executable/lofreq/lofreq_call/lofreq_call" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -503,16 +503,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/lofreq/lofreq_call/lofreq_call b/target/executable/lofreq/lofreq_call/lofreq_call index 6a897fa7..d8990758 100755 --- a/target/executable/lofreq/lofreq_call/lofreq_call +++ b/target/executable/lofreq/lofreq_call/lofreq_call @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# lofreq_call v0.1 +# lofreq_call v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "lofreq_call v0.1" + echo "lofreq_call v0.1.0" echo "" echo "Call variants from a BAM file." echo "" @@ -651,10 +651,10 @@ RUN version=$(lofreq version | grep 'version' | sed 's/version: //') && \ echo "lofreq: $version" > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component lofreq lofreq_call" -LABEL org.opencontainers.image.created="2024-06-24T08:44:07Z" -LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobbox" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.created="2024-06-24T09:12:42Z" +LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobox" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -777,7 +777,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "lofreq_call v0.1" + echo "lofreq_call v0.1.0" exit ;; --input) @@ -1289,7 +1289,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/lofreq/lofreq_call:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/lofreq/lofreq_call:v0.1.0' fi # print dockerfile diff --git a/target/executable/lofreq/lofreq_indelqual/.config.vsh.yaml b/target/executable/lofreq/lofreq_indelqual/.config.vsh.yaml index b430b550..e36939d2 100644 --- a/target/executable/lofreq/lofreq_indelqual/.config.vsh.yaml +++ b/target/executable/lofreq/lofreq_indelqual/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "lofreq_indelqual" namespace: "lofreq" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -106,7 +106,7 @@ references: doi: - "10.1093/nar/gks918" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" homepage: "https://csb5.github.io/lofreq/" documentation: "https://csb5.github.io/lofreq/commands/" runners: @@ -179,7 +179,7 @@ engines: id: "docker" image: "quay.io/biocontainers/lofreq:2.1.5--py38h794fc9e_10" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -197,11 +197,11 @@ build_info: output: "target/executable/lofreq/lofreq_indelqual" executable: "target/executable/lofreq/lofreq_indelqual/lofreq_indelqual" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -211,16 +211,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/lofreq/lofreq_indelqual/lofreq_indelqual b/target/executable/lofreq/lofreq_indelqual/lofreq_indelqual index 4d2dddc2..d70db798 100755 --- a/target/executable/lofreq/lofreq_indelqual/lofreq_indelqual +++ b/target/executable/lofreq/lofreq_indelqual/lofreq_indelqual @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# lofreq_indelqual v0.1 +# lofreq_indelqual v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "lofreq_indelqual v0.1" + echo "lofreq_indelqual v0.1.0" echo "" echo "Insert indel qualities into BAM file (required for indel predictions)." echo "" @@ -496,10 +496,10 @@ RUN version=$(lofreq version | grep 'version' | sed 's/version: //') && \ echo "lofreq: $version" > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component lofreq lofreq_indelqual" -LABEL org.opencontainers.image.created="2024-06-24T08:44:07Z" -LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobbox" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.created="2024-06-24T09:12:42Z" +LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobox" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -622,7 +622,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "lofreq_indelqual v0.1" + echo "lofreq_indelqual v0.1.0" exit ;; --input) @@ -773,7 +773,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/lofreq/lofreq_indelqual:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/lofreq/lofreq_indelqual:v0.1.0' fi # print dockerfile diff --git a/target/executable/multiqc/.config.vsh.yaml b/target/executable/multiqc/.config.vsh.yaml index c7d37a12..ab71a88f 100644 --- a/target/executable/multiqc/.config.vsh.yaml +++ b/target/executable/multiqc/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "multiqc" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Input" arguments: @@ -344,7 +344,7 @@ requirements: - "ps" license: "MIT" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" runners: - type: "executable" id: "executable" @@ -415,7 +415,7 @@ engines: id: "docker" image: "quay.io/biocontainers/multiqc:1.21--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -438,11 +438,11 @@ build_info: output: "target/executable/multiqc" executable: "target/executable/multiqc/multiqc" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -452,16 +452,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/multiqc/multiqc b/target/executable/multiqc/multiqc index 2b22d728..65122ddc 100755 --- a/target/executable/multiqc/multiqc +++ b/target/executable/multiqc/multiqc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# multiqc v0.1 +# multiqc v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "multiqc v0.1" + echo "multiqc v0.1.0" echo "" echo "MultiQC aggregates results from bioinformatics analyses across many samples into" echo "a single report." @@ -632,10 +632,10 @@ ENTRYPOINT [] RUN multiqc --version | sed 's/multiqc, version\s\(.*\)/multiqc: "\1"/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component multiqc" -LABEL org.opencontainers.image.created="2024-06-24T08:44:00Z" -LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobbox" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.created="2024-06-24T09:12:32Z" +LABEL org.opencontainers.image.source="https://github.com/viash-hub/biobox" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -758,7 +758,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "multiqc v0.1" + echo "multiqc v0.1.0" exit ;; --input) @@ -1155,7 +1155,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/multiqc:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/multiqc:v0.1.0' fi # print dockerfile diff --git a/target/executable/pear/.config.vsh.yaml b/target/executable/pear/.config.vsh.yaml index 4d13b4c5..edfd55ee 100644 --- a/target/executable/pear/.config.vsh.yaml +++ b/target/executable/pear/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "pear" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -362,7 +362,7 @@ engines: id: "docker" image: "quay.io/biocontainers/pear:0.9.6--h9d449c0_10" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -380,11 +380,11 @@ build_info: output: "target/executable/pear" executable: "target/executable/pear/pear" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -394,16 +394,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/pear/pear b/target/executable/pear/pear index e30eb113..91098427 100755 --- a/target/executable/pear/pear +++ b/target/executable/pear/pear @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# pear v0.1 +# pear v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "pear v0.1" + echo "pear v0.1.0" echo "" echo "PEAR is an ultrafast, memory-efficient and highly accurate pair-end read merger." echo "It is fully parallelized and can run with as low as just a few kilobytes of" @@ -592,10 +592,10 @@ RUN version=$(pear -h | grep 'PEAR v' | sed 's/PEAR v//' | sed 's/ .*//') && \ echo "pear: $version" > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component pear" -LABEL org.opencontainers.image.created="2024-06-24T08:44:03Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:35Z" LABEL org.opencontainers.image.source="https://github.com/tseemann/PEAR" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -718,7 +718,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "pear v0.1" + echo "pear v0.1.0" exit ;; --forward_fastq) @@ -1082,7 +1082,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/pear:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/pear:v0.1.0' fi # print dockerfile diff --git a/target/executable/salmon/salmon_index/.config.vsh.yaml b/target/executable/salmon/salmon_index/.config.vsh.yaml index 5f9e67e4..a032177d 100644 --- a/target/executable/salmon/salmon_index/.config.vsh.yaml +++ b/target/executable/salmon/salmon_index/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "salmon_index" namespace: "salmon" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -246,7 +246,7 @@ engines: id: "docker" image: "quay.io/biocontainers/salmon:1.10.2--hecfa306_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -263,11 +263,11 @@ build_info: output: "target/executable/salmon/salmon_index" executable: "target/executable/salmon/salmon_index/salmon_index" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -277,16 +277,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/salmon/salmon_index/salmon_index b/target/executable/salmon/salmon_index/salmon_index index 18b29401..56292de5 100755 --- a/target/executable/salmon/salmon_index/salmon_index +++ b/target/executable/salmon/salmon_index/salmon_index @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# salmon_index v0.1 +# salmon_index v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "salmon_index v0.1" + echo "salmon_index v0.1.0" echo "" echo "Salmon is a tool for wicked-fast transcript quantification from RNA-seq data. It" echo "can either make use of pre-computed alignments (in the form of a SAM/BAM file)" @@ -541,10 +541,10 @@ ENTRYPOINT [] RUN salmon index -v 2>&1 | sed 's/salmon \([0-9.]*\)/salmon: \1/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component salmon salmon_index" -LABEL org.opencontainers.image.created="2024-06-24T08:44:04Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:37Z" LABEL org.opencontainers.image.source="https://github.com/COMBINE-lab/salmon" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -667,7 +667,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "salmon_index v0.1" + echo "salmon_index v0.1.0" exit ;; --genome) @@ -889,7 +889,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/salmon/salmon_index:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/salmon/salmon_index:v0.1.0' fi # print dockerfile diff --git a/target/executable/salmon/salmon_quant/.config.vsh.yaml b/target/executable/salmon/salmon_quant/.config.vsh.yaml index 64587b66..e8d7c144 100644 --- a/target/executable/salmon/salmon_quant/.config.vsh.yaml +++ b/target/executable/salmon/salmon_quant/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "salmon_quant" namespace: "salmon" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Common input options" arguments: @@ -54,7 +54,7 @@ argument_groups: - "transcriptome_index" must_exist: true create_parent: true - required: true + required: false direction: "input" multiple: false multiple_sep: ";" @@ -561,7 +561,7 @@ argument_groups: direction: "input" multiple: false multiple_sep: ";" - - type: "file" + - type: "boolean_true" name: "--write_mappings" alternatives: - "-z" @@ -569,6 +569,12 @@ argument_groups: \ will be written out in SAM-compatible format. By default, output will be directed\ \ to stdout, but an alternative file name can be provided instead.\n" info: null + direction: "input" + - type: "file" + name: "--mapping_sam" + description: "Path to file that should output the selective-alignment results\ + \ in SAM-compatible format. THis option must be provided while using --write_mappings" + info: null example: - "mappings.sam" must_exist: true @@ -1136,7 +1142,7 @@ engines: id: "docker" image: "quay.io/biocontainers/salmon:1.10.2--hecfa306_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -1153,11 +1159,11 @@ build_info: output: "target/executable/salmon/salmon_quant" executable: "target/executable/salmon/salmon_quant/salmon_quant" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -1167,16 +1173,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/salmon/salmon_quant/salmon_quant b/target/executable/salmon/salmon_quant/salmon_quant index 9a72bf53..bc47f934 100755 --- a/target/executable/salmon/salmon_quant/salmon_quant +++ b/target/executable/salmon/salmon_quant/salmon_quant @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# salmon_quant v0.1 +# salmon_quant v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "salmon_quant v0.1" + echo "salmon_quant v0.1.0" echo "" echo "Salmon is a tool for wicked-fast transcript quantification from RNA-seq data. It" echo "can either make use of pre-computed alignments (in the form of a SAM/BAM file)" @@ -203,7 +203,7 @@ function ViashHelp { echo "" echo "Mapping input options:" echo " -i, --index" - echo " type: file, required parameter, file must exist" + echo " type: file, file must exist" echo " example: transcriptome_index" echo " Salmon index." echo "" @@ -555,13 +555,19 @@ function ViashHelp { echo " transcriptome for quantification to proceed." echo "" echo " -z, --write_mappings" - echo " type: file, output, file must exist" - echo " example: mappings.sam" + echo " type: boolean_true" echo " If this option is provided, then the selective-alignment results will be" echo " written out in SAM-compatible format. By default, output will be" echo " directed to stdout, but an alternative file name can be provided" echo " instead." echo "" + echo " --mapping_sam" + echo " type: file, output, file must exist" + echo " example: mappings.sam" + echo " Path to file that should output the selective-alignment results in" + echo " SAM-compatible format. THis option must be provided while using" + echo " --write_mappings" + echo "" echo " --write_qualities" echo " type: boolean_true" echo " This flag only has meaning if mappings are being written (with" @@ -1157,10 +1163,10 @@ ENTRYPOINT [] RUN salmon index -v 2>&1 | sed 's/salmon \([0-9.]*\)/salmon: \1/' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component salmon salmon_quant" -LABEL org.opencontainers.image.created="2024-06-24T08:44:04Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:36Z" LABEL org.opencontainers.image.source="https://github.com/COMBINE-lab/salmon" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -1283,7 +1289,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "salmon_quant v0.1" + echo "salmon_quant v0.1.0" exit ;; --lib_type) @@ -1761,21 +1767,25 @@ while [[ $# -gt 0 ]]; do ;; --write_mappings) [ -n "$VIASH_PAR_WRITE_MAPPINGS" ] && ViashError Bad arguments for option \'--write_mappings\': \'$VIASH_PAR_WRITE_MAPPINGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_WRITE_MAPPINGS="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to --write_mappings. Use "--help" to get more information on the parameters. && exit 1 - shift 2 - ;; - --write_mappings=*) - [ -n "$VIASH_PAR_WRITE_MAPPINGS" ] && ViashError Bad arguments for option \'--write_mappings=*\': \'$VIASH_PAR_WRITE_MAPPINGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_WRITE_MAPPINGS=$(ViashRemoveFlags "$1") + VIASH_PAR_WRITE_MAPPINGS=true shift 1 ;; -z) [ -n "$VIASH_PAR_WRITE_MAPPINGS" ] && ViashError Bad arguments for option \'-z\': \'$VIASH_PAR_WRITE_MAPPINGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_WRITE_MAPPINGS="$2" - [ $# -lt 2 ] && ViashError Not enough arguments passed to -z. Use "--help" to get more information on the parameters. && exit 1 + VIASH_PAR_WRITE_MAPPINGS=true + shift 1 + ;; + --mapping_sam) + [ -n "$VIASH_PAR_MAPPING_SAM" ] && ViashError Bad arguments for option \'--mapping_sam\': \'$VIASH_PAR_MAPPING_SAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAPPING_SAM="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --mapping_sam. Use "--help" to get more information on the parameters. && exit 1 shift 2 ;; + --mapping_sam=*) + [ -n "$VIASH_PAR_MAPPING_SAM" ] && ViashError Bad arguments for option \'--mapping_sam=*\': \'$VIASH_PAR_MAPPING_SAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_MAPPING_SAM=$(ViashRemoveFlags "$1") + shift 1 + ;; --write_qualities) [ -n "$VIASH_PAR_WRITE_QUALITIES" ] && ViashError Bad arguments for option \'--write_qualities\': \'$VIASH_PAR_WRITE_QUALITIES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 VIASH_PAR_WRITE_QUALITIES=true @@ -2234,7 +2244,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/salmon/salmon_quant:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/salmon/salmon_quant:v0.1.0' fi # print dockerfile @@ -2314,10 +2324,6 @@ fi # check whether required parameters exist -if [ -z ${VIASH_PAR_INDEX+x} ]; then - ViashError '--index' is a required argument. Use "--help" to get more information on the parameters. - exit 1 -fi if [ -z ${VIASH_PAR_OUTPUT+x} ]; then ViashError '--output' is a required argument. Use "--help" to get more information on the parameters. exit 1 @@ -2403,6 +2409,9 @@ fi if [ -z ${VIASH_PAR_HARD_FILTER+x} ]; then VIASH_PAR_HARD_FILTER="false" fi +if [ -z ${VIASH_PAR_WRITE_MAPPINGS+x} ]; then + VIASH_PAR_WRITE_MAPPINGS="false" +fi if [ -z ${VIASH_PAR_WRITE_QUALITIES+x} ]; then VIASH_PAR_WRITE_QUALITIES="false" fi @@ -2918,6 +2927,12 @@ if [[ -n "$VIASH_PAR_MIN_ALN_PROB" ]]; then exit 1 fi fi +if [[ -n "$VIASH_PAR_WRITE_MAPPINGS" ]]; then + if ! [[ "$VIASH_PAR_WRITE_MAPPINGS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then + ViashError '--write_mappings' has to be a boolean_true. Use "--help" to get more information on the parameters. + exit 1 + fi +fi if [[ -n "$VIASH_PAR_WRITE_QUALITIES" ]]; then if ! [[ "$VIASH_PAR_WRITE_QUALITIES" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then ViashError '--write_qualities' has to be a boolean_true. Use "--help" to get more information on the parameters. @@ -3313,8 +3328,8 @@ fi if [ ! -z "$VIASH_PAR_QUANT_RESULTS" ] && [ ! -d "$(dirname "$VIASH_PAR_QUANT_RESULTS")" ]; then mkdir -p "$(dirname "$VIASH_PAR_QUANT_RESULTS")" fi -if [ ! -z "$VIASH_PAR_WRITE_MAPPINGS" ] && [ ! -d "$(dirname "$VIASH_PAR_WRITE_MAPPINGS")" ]; then - mkdir -p "$(dirname "$VIASH_PAR_WRITE_MAPPINGS")" +if [ ! -z "$VIASH_PAR_MAPPING_SAM" ] && [ ! -d "$(dirname "$VIASH_PAR_MAPPING_SAM")" ]; then + mkdir -p "$(dirname "$VIASH_PAR_MAPPING_SAM")" fi if [ ! -z "$VIASH_PAR_AUX_DIR" ] && [ ! -d "$(dirname "$VIASH_PAR_AUX_DIR")" ]; then mkdir -p "$(dirname "$VIASH_PAR_AUX_DIR")" @@ -3406,10 +3421,10 @@ if [ ! -z "$VIASH_PAR_AUX_TARGET_FILE" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_AUX_TARGET_FILE")" ) VIASH_PAR_AUX_TARGET_FILE=$(ViashDockerAutodetectMount "$VIASH_PAR_AUX_TARGET_FILE") fi -if [ ! -z "$VIASH_PAR_WRITE_MAPPINGS" ]; then - VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_WRITE_MAPPINGS")" ) - VIASH_PAR_WRITE_MAPPINGS=$(ViashDockerAutodetectMount "$VIASH_PAR_WRITE_MAPPINGS") - VIASH_CHOWN_VARS+=( "$VIASH_PAR_WRITE_MAPPINGS" ) +if [ ! -z "$VIASH_PAR_MAPPING_SAM" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_MAPPING_SAM")" ) + VIASH_PAR_MAPPING_SAM=$(ViashDockerAutodetectMount "$VIASH_PAR_MAPPING_SAM") + VIASH_CHOWN_VARS+=( "$VIASH_PAR_MAPPING_SAM" ) fi if [ ! -z "$VIASH_PAR_AUX_DIR" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_AUX_DIR")" ) @@ -3533,6 +3548,7 @@ $( if [ ! -z ${VIASH_PAR_FULL_LENGTH_ALIGNMENT+x} ]; then echo "${VIASH_PAR_FULL $( if [ ! -z ${VIASH_PAR_HARD_FILTER+x} ]; then echo "${VIASH_PAR_HARD_FILTER}" | sed "s#'#'\"'\"'#g;s#.*#par_hard_filter='&'#" ; else echo "# par_hard_filter="; fi ) $( if [ ! -z ${VIASH_PAR_MIN_ALN_PROB+x} ]; then echo "${VIASH_PAR_MIN_ALN_PROB}" | sed "s#'#'\"'\"'#g;s#.*#par_min_aln_prob='&'#" ; else echo "# par_min_aln_prob="; fi ) $( if [ ! -z ${VIASH_PAR_WRITE_MAPPINGS+x} ]; then echo "${VIASH_PAR_WRITE_MAPPINGS}" | sed "s#'#'\"'\"'#g;s#.*#par_write_mappings='&'#" ; else echo "# par_write_mappings="; fi ) +$( if [ ! -z ${VIASH_PAR_MAPPING_SAM+x} ]; then echo "${VIASH_PAR_MAPPING_SAM}" | sed "s#'#'\"'\"'#g;s#.*#par_mapping_sam='&'#" ; else echo "# par_mapping_sam="; fi ) $( if [ ! -z ${VIASH_PAR_WRITE_QUALITIES+x} ]; then echo "${VIASH_PAR_WRITE_QUALITIES}" | sed "s#'#'\"'\"'#g;s#.*#par_write_qualities='&'#" ; else echo "# par_write_qualities="; fi ) $( if [ ! -z ${VIASH_PAR_HIT_FILTER_POLICY+x} ]; then echo "${VIASH_PAR_HIT_FILTER_POLICY}" | sed "s#'#'\"'\"'#g;s#.*#par_hit_filter_policy='&'#" ; else echo "# par_hit_filter_policy="; fi ) $( if [ ! -z ${VIASH_PAR_ALTERNATIVE_INIT_MODE+x} ]; then echo "${VIASH_PAR_ALTERNATIVE_INIT_MODE}" | sed "s#'#'\"'\"'#g;s#.*#par_alternative_init_mode='&'#" ; else echo "# par_alternative_init_mode="; fi ) @@ -3616,6 +3632,7 @@ $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" [[ "\$par_softclip_overhangs" == "false" ]] && unset par_softclip_overhangs [[ "\$par_full_length_alignment" == "false" ]] && unset par_full_length_alignment [[ "\$par_hard_filter" == "false" ]] && unset par_hard_filter +[[ "\$par_write_mappings" == "false" ]] && unset par_write_mappings [[ "\$par_write_qualities" == "false" ]] && unset par_write_qualities [[ "\$par_alternative_init_mode" == "false" ]] && unset par_alternative_init_mode [[ "\$par_skip_quant" == "false" ]] && unset par_skip_quant @@ -3691,7 +3708,7 @@ salmon quant \\ \${par_full_length_alignment:+--fullLengthAlignment} \\ \${par_hard_filter:+--hardFilter} \\ \${par_min_aln_prob:+--minAlnProb "\${par_min_aln_prob}"} \\ - \${par_write_mappings:+-z "\${par_write_mappings}"} \\ + \${par_write_mappings:+--write_mappings="\${par_mappings_sam}"} \\ \${par_write_qualities:+--writeQualities} \\ \${par_hit_filter_policy:+--hitFilterPolicy "\${par_hit_filter_policy}"} \\ \${par_alternative_init_mode:+--alternativeInitMode} \\ @@ -3827,8 +3844,8 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then if [ ! -z "$VIASH_PAR_AUX_TARGET_FILE" ]; then VIASH_PAR_AUX_TARGET_FILE=$(ViashDockerStripAutomount "$VIASH_PAR_AUX_TARGET_FILE") fi - if [ ! -z "$VIASH_PAR_WRITE_MAPPINGS" ]; then - VIASH_PAR_WRITE_MAPPINGS=$(ViashDockerStripAutomount "$VIASH_PAR_WRITE_MAPPINGS") + if [ ! -z "$VIASH_PAR_MAPPING_SAM" ]; then + VIASH_PAR_MAPPING_SAM=$(ViashDockerStripAutomount "$VIASH_PAR_MAPPING_SAM") fi if [ ! -z "$VIASH_PAR_AUX_DIR" ]; then VIASH_PAR_AUX_DIR=$(ViashDockerStripAutomount "$VIASH_PAR_AUX_DIR") @@ -3857,8 +3874,8 @@ if [ ! -z "$VIASH_PAR_QUANT_RESULTS" ] && [ ! -e "$VIASH_PAR_QUANT_RESULTS" ]; t ViashError "Output file '$VIASH_PAR_QUANT_RESULTS' does not exist." exit 1 fi -if [ ! -z "$VIASH_PAR_WRITE_MAPPINGS" ] && [ ! -e "$VIASH_PAR_WRITE_MAPPINGS" ]; then - ViashError "Output file '$VIASH_PAR_WRITE_MAPPINGS' does not exist." +if [ ! -z "$VIASH_PAR_MAPPING_SAM" ] && [ ! -e "$VIASH_PAR_MAPPING_SAM" ]; then + ViashError "Output file '$VIASH_PAR_MAPPING_SAM' does not exist." exit 1 fi if [ ! -z "$VIASH_PAR_AUX_DIR" ] && [ ! -e "$VIASH_PAR_AUX_DIR" ]; then diff --git a/target/executable/samtools/samtools_collate/.config.vsh.yaml b/target/executable/samtools/samtools_collate/.config.vsh.yaml index 8e21552f..f6fc3c42 100644 --- a/target/executable/samtools/samtools_collate/.config.vsh.yaml +++ b/target/executable/samtools/samtools_collate/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_collate" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -232,7 +232,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -250,11 +250,11 @@ build_info: output: "target/executable/samtools/samtools_collate" executable: "target/executable/samtools/samtools_collate/samtools_collate" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -264,16 +264,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_collate/samtools_collate b/target/executable/samtools/samtools_collate/samtools_collate index 083c0b8a..b85f2d24 100755 --- a/target/executable/samtools/samtools_collate/samtools_collate +++ b/target/executable/samtools/samtools_collate/samtools_collate @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_collate v0.1 +# samtools_collate v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_collate v0.1" + echo "samtools_collate v0.1.0" echo "" echo "Shuffles and groups reads in SAM/BAM/CRAM files together by their names." echo "" @@ -514,10 +514,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_collate" -LABEL org.opencontainers.image.created="2024-06-24T08:44:02Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:35Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -640,7 +640,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_collate v0.1" + echo "samtools_collate v0.1.0" exit ;; --input) @@ -884,7 +884,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_collate:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_collate:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_faidx/.config.vsh.yaml b/target/executable/samtools/samtools_faidx/.config.vsh.yaml index b3927cd0..044eceb8 100644 --- a/target/executable/samtools/samtools_faidx/.config.vsh.yaml +++ b/target/executable/samtools/samtools_faidx/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_faidx" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -211,7 +211,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -229,11 +229,11 @@ build_info: output: "target/executable/samtools/samtools_faidx" executable: "target/executable/samtools/samtools_faidx/samtools_faidx" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -243,16 +243,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_faidx/samtools_faidx b/target/executable/samtools/samtools_faidx/samtools_faidx index 5ff2f902..fbab70cb 100755 --- a/target/executable/samtools/samtools_faidx/samtools_faidx +++ b/target/executable/samtools/samtools_faidx/samtools_faidx @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_faidx v0.1 +# samtools_faidx v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_faidx v0.1" + echo "samtools_faidx v0.1.0" echo "" echo "Indexes FASTA files to enable random access to fasta and fastq files." echo "" @@ -507,10 +507,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_faidx" -LABEL org.opencontainers.image.created="2024-06-24T08:44:00Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:32Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -633,7 +633,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_faidx v0.1" + echo "samtools_faidx v0.1.0" exit ;; --input) @@ -827,7 +827,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_faidx:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_faidx:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_fastq/.config.vsh.yaml b/target/executable/samtools/samtools_fastq/.config.vsh.yaml index 71cc903e..627f6508 100644 --- a/target/executable/samtools/samtools_fastq/.config.vsh.yaml +++ b/target/executable/samtools/samtools_fastq/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_fastq" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -399,7 +399,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -417,11 +417,11 @@ build_info: output: "target/executable/samtools/samtools_fastq" executable: "target/executable/samtools/samtools_fastq/samtools_fastq" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -431,16 +431,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_fastq/samtools_fastq b/target/executable/samtools/samtools_fastq/samtools_fastq index 3295fa84..7ff48c4d 100755 --- a/target/executable/samtools/samtools_fastq/samtools_fastq +++ b/target/executable/samtools/samtools_fastq/samtools_fastq @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_fastq v0.1 +# samtools_fastq v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_fastq v0.1" + echo "samtools_fastq v0.1.0" echo "" echo "Converts a SAM, BAM or CRAM to FASTQ format." echo "" @@ -620,10 +620,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_fastq" -LABEL org.opencontainers.image.created="2024-06-24T08:44:03Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:35Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -746,7 +746,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_fastq v0.1" + echo "samtools_fastq v0.1.0" exit ;; --input) @@ -1185,7 +1185,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_fastq:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_fastq:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_flagstat/.config.vsh.yaml b/target/executable/samtools/samtools_flagstat/.config.vsh.yaml index 3fd102cd..8ac45640 100644 --- a/target/executable/samtools/samtools_flagstat/.config.vsh.yaml +++ b/target/executable/samtools/samtools_flagstat/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_flagstat" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -141,7 +141,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -159,11 +159,11 @@ build_info: output: "target/executable/samtools/samtools_flagstat" executable: "target/executable/samtools/samtools_flagstat/samtools_flagstat" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -173,16 +173,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_flagstat/samtools_flagstat b/target/executable/samtools/samtools_flagstat/samtools_flagstat index 76d495b2..948fda43 100755 --- a/target/executable/samtools/samtools_flagstat/samtools_flagstat +++ b/target/executable/samtools/samtools_flagstat/samtools_flagstat @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_flagstat v0.1 +# samtools_flagstat v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_flagstat v0.1" + echo "samtools_flagstat v0.1.0" echo "" echo "Counts the number of alignments in SAM/BAM/CRAM files for each FLAG type." echo "" @@ -469,10 +469,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_flagstat" -LABEL org.opencontainers.image.created="2024-06-24T08:44:02Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:34Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -595,7 +595,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_flagstat v0.1" + echo "samtools_flagstat v0.1.0" exit ;; --bam) @@ -707,7 +707,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_flagstat:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_flagstat:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_idxstats/.config.vsh.yaml b/target/executable/samtools/samtools_idxstats/.config.vsh.yaml index dc356e4f..dd8da758 100644 --- a/target/executable/samtools/samtools_idxstats/.config.vsh.yaml +++ b/target/executable/samtools/samtools_idxstats/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_idxstats" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -151,7 +151,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -169,11 +169,11 @@ build_info: output: "target/executable/samtools/samtools_idxstats" executable: "target/executable/samtools/samtools_idxstats/samtools_idxstats" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -183,16 +183,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_idxstats/samtools_idxstats b/target/executable/samtools/samtools_idxstats/samtools_idxstats index e322ae2b..018038d4 100755 --- a/target/executable/samtools/samtools_idxstats/samtools_idxstats +++ b/target/executable/samtools/samtools_idxstats/samtools_idxstats @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_idxstats v0.1 +# samtools_idxstats v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_idxstats v0.1" + echo "samtools_idxstats v0.1.0" echo "" echo "Reports alignment summary statistics for a BAM file." echo "" @@ -473,10 +473,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_idxstats" -LABEL org.opencontainers.image.created="2024-06-24T08:44:01Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:33Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -599,7 +599,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_idxstats v0.1" + echo "samtools_idxstats v0.1.0" exit ;; --bam) @@ -722,7 +722,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_idxstats:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_idxstats:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_index/.config.vsh.yaml b/target/executable/samtools/samtools_index/.config.vsh.yaml index 86758de2..bb861856 100644 --- a/target/executable/samtools/samtools_index/.config.vsh.yaml +++ b/target/executable/samtools/samtools_index/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_index" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -157,7 +157,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -175,11 +175,11 @@ build_info: output: "target/executable/samtools/samtools_index" executable: "target/executable/samtools/samtools_index/samtools_index" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -189,16 +189,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_index/samtools_index b/target/executable/samtools/samtools_index/samtools_index index c798578d..3439aec2 100755 --- a/target/executable/samtools/samtools_index/samtools_index +++ b/target/executable/samtools/samtools_index/samtools_index @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_index v0.1 +# samtools_index v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_index v0.1" + echo "samtools_index v0.1.0" echo "" echo "Index SAM/BAM/CRAM files." echo "" @@ -480,10 +480,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_index" -LABEL org.opencontainers.image.created="2024-06-24T08:44:02Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:34Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -606,7 +606,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_index v0.1" + echo "samtools_index v0.1.0" exit ;; --input) @@ -750,7 +750,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_index:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_index:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_sort/.config.vsh.yaml b/target/executable/samtools/samtools_sort/.config.vsh.yaml index 3f1359b1..c0868434 100644 --- a/target/executable/samtools/samtools_sort/.config.vsh.yaml +++ b/target/executable/samtools/samtools_sort/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_sort" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -300,7 +300,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -318,11 +318,11 @@ build_info: output: "target/executable/samtools/samtools_sort" executable: "target/executable/samtools/samtools_sort/samtools_sort" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -332,16 +332,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_sort/samtools_sort b/target/executable/samtools/samtools_sort/samtools_sort index 20447fbd..6993c44b 100755 --- a/target/executable/samtools/samtools_sort/samtools_sort +++ b/target/executable/samtools/samtools_sort/samtools_sort @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_sort v0.1 +# samtools_sort v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_sort v0.1" + echo "samtools_sort v0.1.0" echo "" echo "Sort SAM/BAM/CRAM file." echo "" @@ -551,10 +551,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_sort" -LABEL org.opencontainers.image.created="2024-06-24T08:44:01Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:33Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -677,7 +677,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_sort v0.1" + echo "samtools_sort v0.1.0" exit ;; --input) @@ -1005,7 +1005,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_sort:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_sort:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_stats/.config.vsh.yaml b/target/executable/samtools/samtools_stats/.config.vsh.yaml index e9200738..f018fdfc 100644 --- a/target/executable/samtools/samtools_stats/.config.vsh.yaml +++ b/target/executable/samtools/samtools_stats/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_stats" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -362,7 +362,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -380,11 +380,11 @@ build_info: output: "target/executable/samtools/samtools_stats" executable: "target/executable/samtools/samtools_stats/samtools_stats" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -394,16 +394,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_stats/samtools_stats b/target/executable/samtools/samtools_stats/samtools_stats index 7cc4152f..6c849270 100755 --- a/target/executable/samtools/samtools_stats/samtools_stats +++ b/target/executable/samtools/samtools_stats/samtools_stats @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_stats v0.1 +# samtools_stats v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_stats v0.1" + echo "samtools_stats v0.1.0" echo "" echo "Reports alignment summary statistics for a BAM file." echo "" @@ -568,10 +568,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_stats" -LABEL org.opencontainers.image.created="2024-06-24T08:44:01Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:34Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -694,7 +694,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_stats v0.1" + echo "samtools_stats v0.1.0" exit ;; --input) @@ -1126,7 +1126,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_stats:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_stats:v0.1.0' fi # print dockerfile diff --git a/target/executable/samtools/samtools_view/.config.vsh.yaml b/target/executable/samtools/samtools_view/.config.vsh.yaml index 2bc9aacd..52ba9c06 100644 --- a/target/executable/samtools/samtools_view/.config.vsh.yaml +++ b/target/executable/samtools/samtools_view/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_view" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -633,7 +633,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -651,11 +651,11 @@ build_info: output: "target/executable/samtools/samtools_view" executable: "target/executable/samtools/samtools_view/samtools_view" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -665,16 +665,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/samtools/samtools_view/samtools_view b/target/executable/samtools/samtools_view/samtools_view index d6a01e56..fb6f529a 100755 --- a/target/executable/samtools/samtools_view/samtools_view +++ b/target/executable/samtools/samtools_view/samtools_view @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# samtools_view v0.1 +# samtools_view v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "samtools_view v0.1" + echo "samtools_view v0.1.0" echo "" echo "Views and converts SAM/BAM/CRAM files." echo "" @@ -820,10 +820,10 @@ RUN samtools --version 2>&1 | grep -E '^(samtools|Using htslib)' | \ sed 's#Using ##;s# \([0-9\.]*\)$#: \1#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component samtools samtools_view" -LABEL org.opencontainers.image.created="2024-06-24T08:44:00Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:32Z" LABEL org.opencontainers.image.source="https://github.com/samtools/samtools" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -946,7 +946,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "samtools_view v0.1" + echo "samtools_view v0.1.0" exit ;; --input) @@ -1606,7 +1606,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_view:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/samtools/samtools_view:v0.1.0' fi # print dockerfile diff --git a/target/executable/star/star_align_reads/.config.vsh.yaml b/target/executable/star/star_align_reads/.config.vsh.yaml index 43bb0802..c336d65c 100644 --- a/target/executable/star/star_align_reads/.config.vsh.yaml +++ b/target/executable/star/star_align_reads/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "star_align_reads" namespace: "star" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Run Parameters" arguments: @@ -2061,7 +2061,7 @@ engines: id: "docker" image: "python:3.12-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "apt" @@ -2095,11 +2095,11 @@ build_info: output: "target/executable/star/star_align_reads" executable: "target/executable/star/star_align_reads/star_align_reads" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -2109,16 +2109,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/star/star_align_reads/star_align_reads b/target/executable/star/star_align_reads/star_align_reads index 684318b6..b10a08ba 100755 --- a/target/executable/star/star_align_reads/star_align_reads +++ b/target/executable/star/star_align_reads/star_align_reads @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# star_align_reads v0.1 +# star_align_reads v0.1.0 # # This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a # derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -171,7 +171,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP" # ViashHelp: Display helpful explanation about this executable function ViashHelp { - echo "star_align_reads v0.1" + echo "star_align_reads v0.1.0" echo "" echo "Aligns reads to a reference genome using STAR." echo "" @@ -1658,10 +1658,10 @@ RUN apt-get update && \ RUN STAR --version | sed 's#\(.*\)#star: "\1"#' > /var/software_versions.txt LABEL org.opencontainers.image.description="Companion container for running component star star_align_reads" -LABEL org.opencontainers.image.created="2024-06-24T08:44:06Z" +LABEL org.opencontainers.image.created="2024-06-24T09:12:40Z" LABEL org.opencontainers.image.source="https://github.com/alexdobin/STAR" -LABEL org.opencontainers.image.revision="d97e3156feb1839752aa080bfbe8a2153489dfd6" -LABEL org.opencontainers.image.version="v0.1" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" VIASHDOCKER fi @@ -1784,7 +1784,7 @@ while [[ $# -gt 0 ]]; do shift 1 ;; --version) - echo "star_align_reads v0.1" + echo "star_align_reads v0.1.0" exit ;; --runRNGseed) @@ -3897,7 +3897,7 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then # determine docker image id if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then - VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/star/star_align_reads:v0.1' + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/star/star_align_reads:v0.1.0' fi # print dockerfile diff --git a/target/executable/star/star_genome_generate/.config.vsh.yaml b/target/executable/star/star_genome_generate/.config.vsh.yaml new file mode 100644 index 00000000..0cd5f4f3 --- /dev/null +++ b/target/executable/star/star_genome_generate/.config.vsh.yaml @@ -0,0 +1,345 @@ +name: "star_genome_generate" +namespace: "star" +version: "v0.1.0" +argument_groups: +- name: "Input" + arguments: + - type: "file" + name: "--genomeFastaFiles" + description: "Path(s) to the fasta files with the genome sequences, separated\ + \ by spaces. These files should be plain text FASTA files, they *cannot* be\ + \ zipped.\n" + info: null + must_exist: true + create_parent: true + required: true + direction: "input" + multiple: true + multiple_sep: ";" + - type: "file" + name: "--sjdbGTFfile" + description: "Path to the GTF file with annotations" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--sjdbOverhang" + description: "Length of the donor/acceptor sequence on each side of the junctions,\ + \ ideally = (mate_length - 1)" + info: null + example: + - 100 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFchrPrefix" + description: "Prefix for chromosome names in a GTF file (e.g. 'chr' for using\ + \ ENSMEBL annotations with UCSC genomes)" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFfeatureExon" + description: "Feature type in GTF file to be used as exons for building transcripts" + info: null + example: + - "exon" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentTranscript" + description: "GTF attribute name for parent transcript ID (default \"transcript_id\"\ + \ works for GTF files)" + info: null + example: + - "transcript_id" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentGene" + description: "GTF attribute name for parent gene ID (default \"gene_id\" works\ + \ for GTF files)" + info: null + example: + - "gene_id" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentGeneName" + description: "GTF attribute name for parent gene name" + info: null + example: + - "gene_name" + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentGeneType" + description: "GTF attribute name for parent gene type" + info: null + example: + - "gene_type" + - "gene_biotype" + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "long" + name: "--limitGenomeGenerateRAM" + description: "Maximum available RAM (bytes) for genome generation" + info: null + example: + - 31000000000 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeSAindexNbases" + description: "Length (bases) of the SA pre-indexing string. Typically between\ + \ 10 and 15. Longer strings will use much more memory, but allow faster searches.\ + \ For small genomes, this parameter must be scaled down to min(14, log2(GenomeLength)/2\ + \ - 1)." + info: null + example: + - 14 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeChrBinNbits" + description: "Defined as log2(chrBin), where chrBin is the size of the bins for\ + \ genome storage. Each chromosome will occupy an integer number of bins. For\ + \ a genome with large number of contigs, it is recommended to scale this parameter\ + \ as min(18, log2[max(GenomeLength/NumberOfReferences,ReadLength)])." + info: null + example: + - 18 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeSAsparseD" + description: "Suffux array sparsity, i.e. distance between indices. Use bigger\ + \ numbers to decrease needed RAM at the cost of mapping speed reduction." + info: null + example: + - 1 + required: false + min: 0 + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeSuffixLengthMax" + description: "Maximum length of the suffixes, has to be longer than read length.\ + \ Use -1 for infinite length." + info: null + example: + - -1 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--genomeTransformType" + description: "Type of genome transformation\n None ... no transformation\n\ + \ Haploid ... replace reference alleles with alternative alleles from VCF\ + \ file (e.g. consensus allele)\n Diploid ... create two haplotypes for each\ + \ chromosome listed in VCF file, for genotypes 1|2, assumes perfect phasing\ + \ (e.g. personal genome)\n" + info: null + example: + - "None" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--genomeTransformVCF" + description: "path to VCF file for genome transformation" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" +- name: "Output" + arguments: + - type: "file" + name: "--index" + description: "STAR index directory." + info: null + default: + - "STAR_index" + must_exist: true + create_parent: true + required: true + direction: "output" + multiple: false + multiple_sep: ";" +resources: +- type: "bash_script" + path: "script.sh" + is_executable: true +description: "Create index for STAR\n" +test_resources: +- type: "bash_script" + path: "test.sh" + is_executable: true +info: null +status: "enabled" +requirements: + commands: + - "ps" +keywords: +- "genome" +- "index" +- "align" +license: "MIT" +references: + doi: + - "10.1093/bioinformatics/bts635" +links: + repository: "https://github.com/alexdobin/STAR" + documentation: "https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf" +runners: +- type: "executable" + id: "executable" + docker_setup_strategy: "ifneedbepullelsecachedbuild" +- type: "nextflow" + id: "nextflow" + directives: + tag: "$id" + auto: + simplifyInput: true + simplifyOutput: false + transcript: false + publish: false + config: + labels: + mem1gb: "memory = 1000000000.B" + mem2gb: "memory = 2000000000.B" + mem5gb: "memory = 5000000000.B" + mem10gb: "memory = 10000000000.B" + mem20gb: "memory = 20000000000.B" + mem50gb: "memory = 50000000000.B" + mem100gb: "memory = 100000000000.B" + mem200gb: "memory = 200000000000.B" + mem500gb: "memory = 500000000000.B" + mem1tb: "memory = 1000000000000.B" + mem2tb: "memory = 2000000000000.B" + mem5tb: "memory = 5000000000000.B" + mem10tb: "memory = 10000000000000.B" + mem20tb: "memory = 20000000000000.B" + mem50tb: "memory = 50000000000000.B" + mem100tb: "memory = 100000000000000.B" + mem200tb: "memory = 200000000000000.B" + mem500tb: "memory = 500000000000000.B" + mem1gib: "memory = 1073741824.B" + mem2gib: "memory = 2147483648.B" + mem4gib: "memory = 4294967296.B" + mem8gib: "memory = 8589934592.B" + mem16gib: "memory = 17179869184.B" + mem32gib: "memory = 34359738368.B" + mem64gib: "memory = 68719476736.B" + mem128gib: "memory = 137438953472.B" + mem256gib: "memory = 274877906944.B" + mem512gib: "memory = 549755813888.B" + mem1tib: "memory = 1099511627776.B" + mem2tib: "memory = 2199023255552.B" + mem4tib: "memory = 4398046511104.B" + mem8tib: "memory = 8796093022208.B" + mem16tib: "memory = 17592186044416.B" + mem32tib: "memory = 35184372088832.B" + mem64tib: "memory = 70368744177664.B" + mem128tib: "memory = 140737488355328.B" + mem256tib: "memory = 281474976710656.B" + mem512tib: "memory = 562949953421312.B" + cpu1: "cpus = 1" + cpu2: "cpus = 2" + cpu5: "cpus = 5" + cpu10: "cpus = 10" + cpu20: "cpus = 20" + cpu50: "cpus = 50" + cpu100: "cpus = 100" + cpu200: "cpus = 200" + cpu500: "cpus = 500" + cpu1000: "cpus = 1000" + debug: false + container: "docker" +engines: +- type: "docker" + id: "docker" + image: "ubuntu:22.04" + target_registry: "images.viash-hub.com" + target_tag: "v0.1.0" + namespace_separator: "/" + setup: + - type: "docker" + run: + - "apt-get update && \\\n apt-get install -y --no-install-recommends ${PACKAGES}\ + \ && \\\n cd /tmp && \\\n wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip\ + \ && \\\n unzip ${STAR_VERSION}.zip && \\\n cd STAR-${STAR_VERSION}/source\ + \ && \\\n make STARstatic CXXFLAGS_SIMD=-std=c++11 && \\\n cp STAR /usr/local/bin\ + \ && \\\n cd / && \\\n rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip\ + \ && \\\n apt-get --purge autoremove -y ${PACKAGES} && \\\n apt-get clean\n" + env: + - "STAR_VERSION 2.7.11b" + - "PACKAGES gcc g++ make wget zlib1g-dev unzip xxd" + - type: "docker" + run: + - "STAR --version | sed 's#\\(.*\\)#star: \"\\1\"#' > /var/software_versions.txt\n" + entrypoint: [] + cmd: null +- type: "native" + id: "native" +build_info: + config: "src/star/star_genome_generate/config.vsh.yaml" + runner: "executable" + engine: "docker|native" + output: "target/executable/star/star_genome_generate" + executable: "target/executable/star/star_genome_generate/star_genome_generate" + viash_version: "0.9.0-RC6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" + git_remote: "https://github.com/viash-hub/biobox" +package_config: + name: "biobox" + version: "v0.1.0" + description: "A collection of bioinformatics tools for working with sequence data.\n" + info: null + viash_version: "0.9.0-RC6" + source: "src" + target: "target" + config_mods: + - ".requirements.commands := ['ps']\n" + - ".engines += { type: \"native\" }" + - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" + keywords: + - "bioinformatics" + - "modules" + - "sequencing" + license: "MIT" + organization: "vsh" + links: + repository: "https://github.com/viash-hub/biobox" + issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/executable/star/star_genome_generate/star_genome_generate b/target/executable/star/star_genome_generate/star_genome_generate new file mode 100755 index 00000000..aa0deee1 --- /dev/null +++ b/target/executable/star/star_genome_generate/star_genome_generate @@ -0,0 +1,1462 @@ +#!/usr/bin/env bash + +# star_genome_generate v0.1.0 +# +# This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a +# derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from +# Data Intuitive. +# +# The component may contain files which fall under a different license. The +# authors of this component should specify the license in the header of such +# files, or include a separate license file detailing the licenses of all included +# files. + +set -e + +if [ -z "$VIASH_TEMP" ]; then + VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$VIASH_TEMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMP} + VIASH_TEMP=${VIASH_TEMP:-$TMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$TMP} + VIASH_TEMP=${VIASH_TEMP:-$TEMPDIR} + VIASH_TEMP=${VIASH_TEMP:-$TEMP} + VIASH_TEMP=${VIASH_TEMP:-/tmp} +fi + +# define helper functions +# ViashQuote: put quotes around non flag values +# $1 : unquoted string +# return : possibly quoted string +# examples: +# ViashQuote --foo # returns --foo +# ViashQuote bar # returns 'bar' +# Viashquote --foo=bar # returns --foo='bar' +function ViashQuote { + if [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+=.+$ ]]; then + echo "$1" | sed "s#=\(.*\)#='\1'#" + elif [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+$ ]]; then + echo "$1" + else + echo "'$1'" + fi +} +# ViashRemoveFlags: Remove leading flag +# $1 : string with a possible leading flag +# return : string without possible leading flag +# examples: +# ViashRemoveFlags --foo=bar # returns bar +function ViashRemoveFlags { + echo "$1" | sed 's/^--*[a-zA-Z0-9_\-]*=//' +} +# ViashSourceDir: return the path of a bash file, following symlinks +# usage : ViashSourceDir ${BASH_SOURCE[0]} +# $1 : Should always be set to ${BASH_SOURCE[0]} +# returns : The absolute path of the bash file +function ViashSourceDir { + SOURCE="$1" + while [ -h "$SOURCE" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" + done + cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd +} +# ViashFindTargetDir: return the path of the '.build.yaml' file, following symlinks +# usage : ViashFindTargetDir 'ScriptPath' +# $1 : The location from where to start the upward search +# returns : The absolute path of the '.build.yaml' file +function ViashFindTargetDir { + SOURCE="$1" + while [[ "$SOURCE" != "" && ! -e "$SOURCE/.build.yaml" ]]; do + SOURCE=${SOURCE%/*} + done + echo $SOURCE +} +# see https://en.wikipedia.org/wiki/Syslog#Severity_level +VIASH_LOGCODE_EMERGENCY=0 +VIASH_LOGCODE_ALERT=1 +VIASH_LOGCODE_CRITICAL=2 +VIASH_LOGCODE_ERROR=3 +VIASH_LOGCODE_WARNING=4 +VIASH_LOGCODE_NOTICE=5 +VIASH_LOGCODE_INFO=6 +VIASH_LOGCODE_DEBUG=7 +VIASH_VERBOSITY=$VIASH_LOGCODE_NOTICE + +# ViashLog: Log events depending on the verbosity level +# usage: ViashLog 1 alert Oh no something went wrong! +# $1: required verbosity level +# $2: display tag +# $3+: messages to display +# stdout: Your input, prepended by '[$2] '. +function ViashLog { + local required_level="$1" + local display_tag="$2" + shift 2 + if [ $VIASH_VERBOSITY -ge $required_level ]; then + >&2 echo "[$display_tag]" "$@" + fi +} + +# ViashEmergency: log events when the system is unstable +# usage: ViashEmergency Oh no something went wrong. +# stdout: Your input, prepended by '[emergency] '. +function ViashEmergency { + ViashLog $VIASH_LOGCODE_EMERGENCY emergency "$@" +} + +# ViashAlert: log events when actions must be taken immediately (e.g. corrupted system database) +# usage: ViashAlert Oh no something went wrong. +# stdout: Your input, prepended by '[alert] '. +function ViashAlert { + ViashLog $VIASH_LOGCODE_ALERT alert "$@" +} + +# ViashCritical: log events when a critical condition occurs +# usage: ViashCritical Oh no something went wrong. +# stdout: Your input, prepended by '[critical] '. +function ViashCritical { + ViashLog $VIASH_LOGCODE_CRITICAL critical "$@" +} + +# ViashError: log events when an error condition occurs +# usage: ViashError Oh no something went wrong. +# stdout: Your input, prepended by '[error] '. +function ViashError { + ViashLog $VIASH_LOGCODE_ERROR error "$@" +} + +# ViashWarning: log potentially abnormal events +# usage: ViashWarning Something may have gone wrong. +# stdout: Your input, prepended by '[warning] '. +function ViashWarning { + ViashLog $VIASH_LOGCODE_WARNING warning "$@" +} + +# ViashNotice: log significant but normal events +# usage: ViashNotice This just happened. +# stdout: Your input, prepended by '[notice] '. +function ViashNotice { + ViashLog $VIASH_LOGCODE_NOTICE notice "$@" +} + +# ViashInfo: log normal events +# usage: ViashInfo This just happened. +# stdout: Your input, prepended by '[info] '. +function ViashInfo { + ViashLog $VIASH_LOGCODE_INFO info "$@" +} + +# ViashDebug: log all events, for debugging purposes +# usage: ViashDebug This just happened. +# stdout: Your input, prepended by '[debug] '. +function ViashDebug { + ViashLog $VIASH_LOGCODE_DEBUG debug "$@" +} + +# find source folder of this component +VIASH_META_RESOURCES_DIR=`ViashSourceDir ${BASH_SOURCE[0]}` + +# find the root of the built components & dependencies +VIASH_TARGET_DIR=`ViashFindTargetDir $VIASH_META_RESOURCES_DIR` + +# define meta fields +VIASH_META_NAME="star_genome_generate" +VIASH_META_FUNCTIONALITY_NAME="star_genome_generate" +VIASH_META_EXECUTABLE="$VIASH_META_RESOURCES_DIR/$VIASH_META_NAME" +VIASH_META_CONFIG="$VIASH_META_RESOURCES_DIR/.config.vsh.yaml" +VIASH_META_TEMP_DIR="$VIASH_TEMP" + + +# ViashHelp: Display helpful explanation about this executable +function ViashHelp { + echo "star_genome_generate v0.1.0" + echo "" + echo "Create index for STAR" + echo "" + echo "Input:" + echo " --genomeFastaFiles" + echo " type: file, required parameter, multiple values allowed, file must exist" + echo " Path(s) to the fasta files with the genome sequences, separated by" + echo " spaces. These files should be plain text FASTA files, they *cannot* be" + echo " zipped." + echo "" + echo " --sjdbGTFfile" + echo " type: file, file must exist" + echo " Path to the GTF file with annotations" + echo "" + echo " --sjdbOverhang" + echo " type: integer" + echo " example: 100" + echo " Length of the donor/acceptor sequence on each side of the junctions," + echo " ideally = (mate_length - 1)" + echo "" + echo " --sjdbGTFchrPrefix" + echo " type: string" + echo " Prefix for chromosome names in a GTF file (e.g. 'chr' for using ENSMEBL" + echo " annotations with UCSC genomes)" + echo "" + echo " --sjdbGTFfeatureExon" + echo " type: string" + echo " example: exon" + echo " Feature type in GTF file to be used as exons for building transcripts" + echo "" + echo " --sjdbGTFtagExonParentTranscript" + echo " type: string" + echo " example: transcript_id" + echo " GTF attribute name for parent transcript ID (default \"transcript_id\"" + echo " works for GTF files)" + echo "" + echo " --sjdbGTFtagExonParentGene" + echo " type: string" + echo " example: gene_id" + echo " GTF attribute name for parent gene ID (default \"gene_id\" works for GTF" + echo " files)" + echo "" + echo " --sjdbGTFtagExonParentGeneName" + echo " type: string, multiple values allowed" + echo " example: gene_name" + echo " GTF attribute name for parent gene name" + echo "" + echo " --sjdbGTFtagExonParentGeneType" + echo " type: string, multiple values allowed" + echo " example: gene_type;gene_biotype" + echo " GTF attribute name for parent gene type" + echo "" + echo " --limitGenomeGenerateRAM" + echo " type: long" + echo " example: 31000000000" + echo " Maximum available RAM (bytes) for genome generation" + echo "" + echo " --genomeSAindexNbases" + echo " type: integer" + echo " example: 14" + echo " Length (bases) of the SA pre-indexing string. Typically between 10 and" + echo " 15. Longer strings will use much more memory, but allow faster searches." + echo " For small genomes, this parameter must be scaled down to min(14," + echo " log2(GenomeLength)/2 - 1)." + echo "" + echo " --genomeChrBinNbits" + echo " type: integer" + echo " example: 18" + echo " Defined as log2(chrBin), where chrBin is the size of the bins for genome" + echo " storage. Each chromosome will occupy an integer number of bins. For a" + echo " genome with large number of contigs, it is recommended to scale this" + echo " parameter as min(18," + echo " log2[max(GenomeLength/NumberOfReferences,ReadLength)])." + echo "" + echo " --genomeSAsparseD" + echo " type: integer" + echo " example: 1" + echo " min: 0" + echo " Suffux array sparsity, i.e. distance between indices. Use bigger numbers" + echo " to decrease needed RAM at the cost of mapping speed reduction." + echo "" + echo " --genomeSuffixLengthMax" + echo " type: integer" + echo " example: -1" + echo " Maximum length of the suffixes, has to be longer than read length. Use" + echo " -1 for infinite length." + echo "" + echo " --genomeTransformType" + echo " type: string" + echo " example: None" + echo " Type of genome transformation" + echo " None ... no transformation" + echo " Haploid ... replace reference alleles with alternative alleles from" + echo " VCF file (e.g. consensus allele)" + echo " Diploid ... create two haplotypes for each chromosome listed in VCF" + echo " file, for genotypes 1|2, assumes perfect phasing (e.g. personal genome)" + echo "" + echo " --genomeTransformVCF" + echo " type: file, file must exist" + echo " path to VCF file for genome transformation" + echo "" + echo "Output:" + echo " --index" + echo " type: file, required parameter, output, file must exist" + echo " default: STAR_index" + echo " STAR index directory." +} + +# initialise variables +VIASH_MODE='run' +VIASH_ENGINE_ID='docker' + +######## Helper functions for setting up Docker images for viash ######## +# expects: ViashDockerBuild + +# ViashDockerInstallationCheck: check whether Docker is installed correctly +# +# examples: +# ViashDockerInstallationCheck +function ViashDockerInstallationCheck { + ViashDebug "Checking whether Docker is installed" + if [ ! command -v docker &> /dev/null ]; then + ViashCritical "Docker doesn't seem to be installed. See 'https://docs.docker.com/get-docker/' for instructions." + exit 1 + fi + + ViashDebug "Checking whether the Docker daemon is running" + save=$-; set +e + docker_version=$(docker version --format '{{.Client.APIVersion}}' 2> /dev/null) + out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashCritical "Docker daemon does not seem to be running. Try one of the following:" + ViashCritical "- Try running 'dockerd' in the command line" + ViashCritical "- See https://docs.docker.com/config/daemon/" + exit 1 + fi +} + +# ViashDockerRemoteTagCheck: check whether a Docker image is available +# on a remote. Assumes `docker login` has been performed, if relevant. +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# ViashDockerRemoteTagCheck python:latest +# echo $? # returns '0' +# ViashDockerRemoteTagCheck sdaizudceahifu +# echo $? # returns '1' +function ViashDockerRemoteTagCheck { + docker manifest inspect $1 > /dev/null 2> /dev/null +} + +# ViashDockerLocalTagCheck: check whether a Docker image is available locally +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# docker pull python:latest +# ViashDockerLocalTagCheck python:latest +# echo $? # returns '0' +# ViashDockerLocalTagCheck sdaizudceahifu +# echo $? # returns '1' +function ViashDockerLocalTagCheck { + [ -n "$(docker images -q $1)" ] +} + +# ViashDockerPull: pull a Docker image +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# ViashDockerPull python:latest +# echo $? # returns '0' +# ViashDockerPull sdaizudceahifu +# echo $? # returns '1' +function ViashDockerPull { + ViashNotice "Checking if Docker image is available at '$1'" + if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then + docker pull $1 && return 0 || return 1 + else + save=$-; set +e + docker pull $1 2> /dev/null > /dev/null + out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashWarning "Could not pull from '$1'. Docker image doesn't exist or is not accessible." + fi + return $out + fi +} + +# ViashDockerPush: push a Docker image +# +# $1 : image identifier with format `[registry/]image[:tag]` +# exit code $? : whether or not the image was found +# examples: +# ViashDockerPush python:latest +# echo $? # returns '0' +# ViashDockerPush sdaizudceahifu +# echo $? # returns '1' +function ViashDockerPush { + ViashNotice "Pushing image to '$1'" + save=$-; set +e + if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then + docker push $1 + out=$? + else + docker push $1 2> /dev/null > /dev/null + out=$? + fi + [[ $save =~ e ]] && set -e + if [ $out -eq 0 ]; then + ViashNotice "Container '$1' push succeeded." + else + ViashError "Container '$1' push errored. You might not be logged in or have the necessary permissions." + fi + return $out +} + +# ViashDockerPullElseBuild: pull a Docker image, else build it +# +# $1 : image identifier with format `[registry/]image[:tag]` +# ViashDockerBuild : a Bash function which builds a docker image, takes image identifier as argument. +# examples: +# ViashDockerPullElseBuild mynewcomponent +function ViashDockerPullElseBuild { + save=$-; set +e + ViashDockerPull $1 + out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashDockerBuild $@ + fi +} + +# ViashDockerSetup: create a Docker image, according to specified docker setup strategy +# +# $1 : image identifier with format `[registry/]image[:tag]` +# $2 : docker setup strategy, see DockerSetupStrategy.scala +# examples: +# ViashDockerSetup mynewcomponent alwaysbuild +function ViashDockerSetup { + local image_id="$1" + local setup_strategy="$2" + if [ "$setup_strategy" == "alwaysbuild" -o "$setup_strategy" == "build" -o "$setup_strategy" == "b" ]; then + ViashDockerBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "alwayspull" -o "$setup_strategy" == "pull" -o "$setup_strategy" == "p" ]; then + ViashDockerPull $image_id + elif [ "$setup_strategy" == "alwayspullelsebuild" -o "$setup_strategy" == "pullelsebuild" ]; then + ViashDockerPullElseBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "alwayspullelsecachedbuild" -o "$setup_strategy" == "pullelsecachedbuild" ]; then + ViashDockerPullElseBuild $image_id $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "alwayscachedbuild" -o "$setup_strategy" == "cachedbuild" -o "$setup_strategy" == "cb" ]; then + ViashDockerBuild $image_id $(ViashDockerBuildArgs "$engine_id") + elif [[ "$setup_strategy" =~ ^ifneedbe ]]; then + local save=$-; set +e + ViashDockerLocalTagCheck $image_id + local outCheck=$? + [[ $save =~ e ]] && set -e + if [ $outCheck -eq 0 ]; then + ViashInfo "Image $image_id already exists" + elif [ "$setup_strategy" == "ifneedbebuild" ]; then + ViashDockerBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "ifneedbecachedbuild" ]; then + ViashDockerBuild $image_id $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "ifneedbepull" ]; then + ViashDockerPull $image_id + elif [ "$setup_strategy" == "ifneedbepullelsebuild" ]; then + ViashDockerPullElseBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id") + elif [ "$setup_strategy" == "ifneedbepullelsecachedbuild" ]; then + ViashDockerPullElseBuild $image_id $(ViashDockerBuildArgs "$engine_id") + else + ViashError "Unrecognised Docker strategy: $setup_strategy" + exit 1 + fi + elif [ "$setup_strategy" == "push" -o "$setup_strategy" == "forcepush" -o "$setup_strategy" == "alwayspush" ]; then + ViashDockerPush "$image_id" + elif [ "$setup_strategy" == "pushifnotpresent" -o "$setup_strategy" == "gentlepush" -o "$setup_strategy" == "maybepush" ]; then + local save=$-; set +e + ViashDockerRemoteTagCheck $image_id + local outCheck=$? + [[ $save =~ e ]] && set -e + if [ $outCheck -eq 0 ]; then + ViashNotice "Container '$image_id' exists, doing nothing." + else + ViashNotice "Container '$image_id' does not yet exist." + ViashDockerPush "$image_id" + fi + elif [ "$setup_strategy" == "donothing" -o "$setup_strategy" == "meh" ]; then + ViashNotice "Skipping setup." + else + ViashError "Unrecognised Docker strategy: $setup_strategy" + exit 1 + fi +} + +# ViashDockerCheckCommands: Check whether a docker container has the required commands +# +# $1 : image identifier with format `[registry/]image[:tag]` +# $@ : commands to verify being present +# examples: +# ViashDockerCheckCommands bash:4.0 bash ps foo +function ViashDockerCheckCommands { + local image_id="$1" + shift 1 + local commands="$@" + local save=$-; set +e + local missing # mark 'missing' as local in advance, otherwise the exit code of the command will be missing and always be '0' + missing=$(docker run --rm --entrypoint=sh "$image_id" -c "for command in $commands; do command -v \$command >/dev/null 2>&1; if [ \$? -ne 0 ]; then echo \$command; exit 1; fi; done") + local outCheck=$? + [[ $save =~ e ]] && set -e + if [ $outCheck -ne 0 ]; then + ViashError "Docker container '$image_id' does not contain command '$missing'." + exit 1 + fi +} + +# ViashDockerBuild: build a docker image +# $1 : image identifier with format `[registry/]image[:tag]` +# $... : additional arguments to pass to docker build +# $VIASH_META_TEMP_DIR : temporary directory to store dockerfile & optional resources in +# $VIASH_META_NAME : name of the component +# $VIASH_META_RESOURCES_DIR : directory containing the resources +# $VIASH_VERBOSITY : verbosity level +# exit code $? : whether or not the image was built successfully +function ViashDockerBuild { + local image_id="$1" + shift 1 + + # create temporary directory to store dockerfile & optional resources in + local tmpdir=$(mktemp -d "$VIASH_META_TEMP_DIR/dockerbuild-$VIASH_META_NAME-XXXXXX") + local dockerfile="$tmpdir/Dockerfile" + function clean_up { + rm -rf "$tmpdir" + } + trap clean_up EXIT + + # store dockerfile and resources + ViashDockerfile "$VIASH_ENGINE_ID" > "$dockerfile" + + # generate the build command + local docker_build_cmd="docker build -t '$image_id' $@ '$VIASH_META_RESOURCES_DIR' -f '$dockerfile'" + + # build the container + ViashNotice "Building container '$image_id' with Dockerfile" + ViashInfo "$docker_build_cmd" + local save=$-; set +e + if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then + eval $docker_build_cmd + else + eval $docker_build_cmd &> "$tmpdir/docker_build.log" + fi + + # check exit code + local out=$? + [[ $save =~ e ]] && set -e + if [ $out -ne 0 ]; then + ViashError "Error occurred while building container '$image_id'" + if [ $VIASH_VERBOSITY -lt $VIASH_LOGCODE_INFO ]; then + ViashError "Transcript: --------------------------------" + cat "$tmpdir/docker_build.log" + ViashError "End of transcript --------------------------" + fi + exit 1 + fi +} + +######## End of helper functions for setting up Docker images for viash ######## + +# ViashDockerFile: print the dockerfile to stdout +# $1 : engine identifier +# return : dockerfile required to run this component +# examples: +# ViashDockerFile +function ViashDockerfile { + local engine_id="$1" + + if [[ "$engine_id" == "docker" ]]; then + cat << 'VIASHDOCKER' +FROM ubuntu:22.04 +ENTRYPOINT [] +ENV STAR_VERSION 2.7.11b +ENV PACKAGES gcc g++ make wget zlib1g-dev unzip xxd +RUN apt-get update && \ + apt-get install -y --no-install-recommends ${PACKAGES} && \ + cd /tmp && \ + wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip && \ + unzip ${STAR_VERSION}.zip && \ + cd STAR-${STAR_VERSION}/source && \ + make STARstatic CXXFLAGS_SIMD=-std=c++11 && \ + cp STAR /usr/local/bin && \ + cd / && \ + rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip && \ + apt-get --purge autoremove -y ${PACKAGES} && \ + apt-get clean + +RUN STAR --version | sed 's#\(.*\)#star: "\1"#' > /var/software_versions.txt + +LABEL org.opencontainers.image.description="Companion container for running component star star_genome_generate" +LABEL org.opencontainers.image.created="2024-06-24T09:12:41Z" +LABEL org.opencontainers.image.source="https://github.com/alexdobin/STAR" +LABEL org.opencontainers.image.revision="b84b29747d0635f2ac83ea63b496be9a9edb6724" +LABEL org.opencontainers.image.version="v0.1.0" + +VIASHDOCKER + fi +} + +# ViashDockerBuildArgs: return the arguments to pass to docker build +# $1 : engine identifier +# return : arguments to pass to docker build +function ViashDockerBuildArgs { + local engine_id="$1" + + if [[ "$engine_id" == "docker" ]]; then + echo "" + fi +} + +# ViashAbsolutePath: generate absolute path from relative path +# borrowed from https://stackoverflow.com/a/21951256 +# $1 : relative filename +# return : absolute path +# examples: +# ViashAbsolutePath some_file.txt # returns /path/to/some_file.txt +# ViashAbsolutePath /foo/bar/.. # returns /foo +function ViashAbsolutePath { + local thePath + if [[ ! "$1" =~ ^/ ]]; then + thePath="$PWD/$1" + else + thePath="$1" + fi + echo "$thePath" | ( + IFS=/ + read -a parr + declare -a outp + for i in "${parr[@]}"; do + case "$i" in + ''|.) continue ;; + ..) + len=${#outp[@]} + if ((len==0)); then + continue + else + unset outp[$((len-1))] + fi + ;; + *) + len=${#outp[@]} + outp[$len]="$i" + ;; + esac + done + echo /"${outp[*]}" + ) +} +# ViashDockerAutodetectMount: auto configuring docker mounts from parameters +# $1 : The parameter value +# returns : New parameter +# $VIASH_DIRECTORY_MOUNTS : Added another parameter to be passed to docker +# examples: +# ViashDockerAutodetectMount /path/to/bar # returns '/viash_automount/path/to/bar' +# ViashDockerAutodetectMountArg /path/to/bar # returns '--volume="/path/to:/viash_automount/path/to"' +function ViashDockerAutodetectMount { + abs_path=$(ViashAbsolutePath "$1") + if [ -d "$abs_path" ]; then + mount_source="$abs_path" + base_name="" + else + mount_source=`dirname "$abs_path"` + base_name=`basename "$abs_path"` + fi + mount_target="/viash_automount$mount_source" + if [ -z "$base_name" ]; then + echo "$mount_target" + else + echo "$mount_target/$base_name" + fi +} +function ViashDockerAutodetectMountArg { + abs_path=$(ViashAbsolutePath "$1") + if [ -d "$abs_path" ]; then + mount_source="$abs_path" + base_name="" + else + mount_source=`dirname "$abs_path"` + base_name=`basename "$abs_path"` + fi + mount_target="/viash_automount$mount_source" + ViashDebug "ViashDockerAutodetectMountArg $1 -> $mount_source -> $mount_target" + echo "--volume=\"$mount_source:$mount_target\"" +} +function ViashDockerStripAutomount { + abs_path=$(ViashAbsolutePath "$1") + echo "${abs_path#/viash_automount}" +} +# initialise variables +VIASH_DIRECTORY_MOUNTS=() + +# initialise docker variables +VIASH_DOCKER_RUN_ARGS=(-i --rm) + +# initialise array +VIASH_POSITIONAL_ARGS='' + +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + ViashHelp + exit + ;; + ---v|---verbose) + let "VIASH_VERBOSITY=VIASH_VERBOSITY+1" + shift 1 + ;; + ---verbosity) + VIASH_VERBOSITY="$2" + shift 2 + ;; + ---verbosity=*) + VIASH_VERBOSITY="$(ViashRemoveFlags "$1")" + shift 1 + ;; + --version) + echo "star_genome_generate v0.1.0" + exit + ;; + --genomeFastaFiles) + if [ -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then + VIASH_PAR_GENOMEFASTAFILES="$2" + else + VIASH_PAR_GENOMEFASTAFILES="$VIASH_PAR_GENOMEFASTAFILES;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeFastaFiles. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeFastaFiles=*) + if [ -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then + VIASH_PAR_GENOMEFASTAFILES=$(ViashRemoveFlags "$1") + else + VIASH_PAR_GENOMEFASTAFILES="$VIASH_PAR_GENOMEFASTAFILES;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + --sjdbGTFfile) + [ -n "$VIASH_PAR_SJDBGTFFILE" ] && ViashError Bad arguments for option \'--sjdbGTFfile\': \'$VIASH_PAR_SJDBGTFFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFFILE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFfile. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFfile=*) + [ -n "$VIASH_PAR_SJDBGTFFILE" ] && ViashError Bad arguments for option \'--sjdbGTFfile=*\': \'$VIASH_PAR_SJDBGTFFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFFILE=$(ViashRemoveFlags "$1") + shift 1 + ;; + --sjdbOverhang) + [ -n "$VIASH_PAR_SJDBOVERHANG" ] && ViashError Bad arguments for option \'--sjdbOverhang\': \'$VIASH_PAR_SJDBOVERHANG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBOVERHANG="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbOverhang. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbOverhang=*) + [ -n "$VIASH_PAR_SJDBOVERHANG" ] && ViashError Bad arguments for option \'--sjdbOverhang=*\': \'$VIASH_PAR_SJDBOVERHANG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBOVERHANG=$(ViashRemoveFlags "$1") + shift 1 + ;; + --sjdbGTFchrPrefix) + [ -n "$VIASH_PAR_SJDBGTFCHRPREFIX" ] && ViashError Bad arguments for option \'--sjdbGTFchrPrefix\': \'$VIASH_PAR_SJDBGTFCHRPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFCHRPREFIX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFchrPrefix. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFchrPrefix=*) + [ -n "$VIASH_PAR_SJDBGTFCHRPREFIX" ] && ViashError Bad arguments for option \'--sjdbGTFchrPrefix=*\': \'$VIASH_PAR_SJDBGTFCHRPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFCHRPREFIX=$(ViashRemoveFlags "$1") + shift 1 + ;; + --sjdbGTFfeatureExon) + [ -n "$VIASH_PAR_SJDBGTFFEATUREEXON" ] && ViashError Bad arguments for option \'--sjdbGTFfeatureExon\': \'$VIASH_PAR_SJDBGTFFEATUREEXON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFFEATUREEXON="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFfeatureExon. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFfeatureExon=*) + [ -n "$VIASH_PAR_SJDBGTFFEATUREEXON" ] && ViashError Bad arguments for option \'--sjdbGTFfeatureExon=*\': \'$VIASH_PAR_SJDBGTFFEATUREEXON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFFEATUREEXON=$(ViashRemoveFlags "$1") + shift 1 + ;; + --sjdbGTFtagExonParentTranscript) + [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentTranscript\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentTranscript. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFtagExonParentTranscript=*) + [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentTranscript=*\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT=$(ViashRemoveFlags "$1") + shift 1 + ;; + --sjdbGTFtagExonParentGene) + [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentGene\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFTAGEXONPARENTGENE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentGene. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFtagExonParentGene=*) + [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentGene=*\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_SJDBGTFTAGEXONPARENTGENE=$(ViashRemoveFlags "$1") + shift 1 + ;; + --sjdbGTFtagExonParentGeneName) + if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME" ]; then + VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME="$2" + else + VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentGeneName. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFtagExonParentGeneName=*) + if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME" ]; then + VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME=$(ViashRemoveFlags "$1") + else + VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + --sjdbGTFtagExonParentGeneType) + if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE" ]; then + VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE="$2" + else + VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE;""$2" + fi + [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentGeneType. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --sjdbGTFtagExonParentGeneType=*) + if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE" ]; then + VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE=$(ViashRemoveFlags "$1") + else + VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE;"$(ViashRemoveFlags "$1") + fi + shift 1 + ;; + --limitGenomeGenerateRAM) + [ -n "$VIASH_PAR_LIMITGENOMEGENERATERAM" ] && ViashError Bad arguments for option \'--limitGenomeGenerateRAM\': \'$VIASH_PAR_LIMITGENOMEGENERATERAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LIMITGENOMEGENERATERAM="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitGenomeGenerateRAM. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --limitGenomeGenerateRAM=*) + [ -n "$VIASH_PAR_LIMITGENOMEGENERATERAM" ] && ViashError Bad arguments for option \'--limitGenomeGenerateRAM=*\': \'$VIASH_PAR_LIMITGENOMEGENERATERAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_LIMITGENOMEGENERATERAM=$(ViashRemoveFlags "$1") + shift 1 + ;; + --genomeSAindexNbases) + [ -n "$VIASH_PAR_GENOMESAINDEXNBASES" ] && ViashError Bad arguments for option \'--genomeSAindexNbases\': \'$VIASH_PAR_GENOMESAINDEXNBASES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMESAINDEXNBASES="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeSAindexNbases. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeSAindexNbases=*) + [ -n "$VIASH_PAR_GENOMESAINDEXNBASES" ] && ViashError Bad arguments for option \'--genomeSAindexNbases=*\': \'$VIASH_PAR_GENOMESAINDEXNBASES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMESAINDEXNBASES=$(ViashRemoveFlags "$1") + shift 1 + ;; + --genomeChrBinNbits) + [ -n "$VIASH_PAR_GENOMECHRBINNBITS" ] && ViashError Bad arguments for option \'--genomeChrBinNbits\': \'$VIASH_PAR_GENOMECHRBINNBITS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMECHRBINNBITS="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeChrBinNbits. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeChrBinNbits=*) + [ -n "$VIASH_PAR_GENOMECHRBINNBITS" ] && ViashError Bad arguments for option \'--genomeChrBinNbits=*\': \'$VIASH_PAR_GENOMECHRBINNBITS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMECHRBINNBITS=$(ViashRemoveFlags "$1") + shift 1 + ;; + --genomeSAsparseD) + [ -n "$VIASH_PAR_GENOMESASPARSED" ] && ViashError Bad arguments for option \'--genomeSAsparseD\': \'$VIASH_PAR_GENOMESASPARSED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMESASPARSED="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeSAsparseD. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeSAsparseD=*) + [ -n "$VIASH_PAR_GENOMESASPARSED" ] && ViashError Bad arguments for option \'--genomeSAsparseD=*\': \'$VIASH_PAR_GENOMESASPARSED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMESASPARSED=$(ViashRemoveFlags "$1") + shift 1 + ;; + --genomeSuffixLengthMax) + [ -n "$VIASH_PAR_GENOMESUFFIXLENGTHMAX" ] && ViashError Bad arguments for option \'--genomeSuffixLengthMax\': \'$VIASH_PAR_GENOMESUFFIXLENGTHMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMESUFFIXLENGTHMAX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeSuffixLengthMax. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeSuffixLengthMax=*) + [ -n "$VIASH_PAR_GENOMESUFFIXLENGTHMAX" ] && ViashError Bad arguments for option \'--genomeSuffixLengthMax=*\': \'$VIASH_PAR_GENOMESUFFIXLENGTHMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMESUFFIXLENGTHMAX=$(ViashRemoveFlags "$1") + shift 1 + ;; + --genomeTransformType) + [ -n "$VIASH_PAR_GENOMETRANSFORMTYPE" ] && ViashError Bad arguments for option \'--genomeTransformType\': \'$VIASH_PAR_GENOMETRANSFORMTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMETRANSFORMTYPE="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeTransformType. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeTransformType=*) + [ -n "$VIASH_PAR_GENOMETRANSFORMTYPE" ] && ViashError Bad arguments for option \'--genomeTransformType=*\': \'$VIASH_PAR_GENOMETRANSFORMTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMETRANSFORMTYPE=$(ViashRemoveFlags "$1") + shift 1 + ;; + --genomeTransformVCF) + [ -n "$VIASH_PAR_GENOMETRANSFORMVCF" ] && ViashError Bad arguments for option \'--genomeTransformVCF\': \'$VIASH_PAR_GENOMETRANSFORMVCF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMETRANSFORMVCF="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeTransformVCF. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --genomeTransformVCF=*) + [ -n "$VIASH_PAR_GENOMETRANSFORMVCF" ] && ViashError Bad arguments for option \'--genomeTransformVCF=*\': \'$VIASH_PAR_GENOMETRANSFORMVCF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_GENOMETRANSFORMVCF=$(ViashRemoveFlags "$1") + shift 1 + ;; + --index) + [ -n "$VIASH_PAR_INDEX" ] && ViashError Bad arguments for option \'--index\': \'$VIASH_PAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INDEX="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --index. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --index=*) + [ -n "$VIASH_PAR_INDEX" ] && ViashError Bad arguments for option \'--index=*\': \'$VIASH_PAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INDEX=$(ViashRemoveFlags "$1") + shift 1 + ;; + ---engine) + VIASH_ENGINE_ID="$2" + shift 2 + ;; + ---engine=*) + VIASH_ENGINE_ID="$(ViashRemoveFlags "$1")" + shift 1 + ;; + ---setup) + VIASH_MODE='setup' + VIASH_SETUP_STRATEGY="$2" + shift 2 + ;; + ---setup=*) + VIASH_MODE='setup' + VIASH_SETUP_STRATEGY="$(ViashRemoveFlags "$1")" + shift 1 + ;; + ---dockerfile) + VIASH_MODE='dockerfile' + shift 1 + ;; + ---debug) + VIASH_MODE='debug' + shift 1 + ;; + ---cpus) + [ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_CPUS="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to ---cpus. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + ---cpus=*) + [ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus=*\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_CPUS=$(ViashRemoveFlags "$1") + shift 1 + ;; + ---memory) + [ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_MEMORY="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to ---memory. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + ---memory=*) + [ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory=*\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_META_MEMORY=$(ViashRemoveFlags "$1") + shift 1 + ;; + *) # positional arg or unknown option + # since the positional args will be eval'd, can we always quote, instead of using ViashQuote + VIASH_POSITIONAL_ARGS="$VIASH_POSITIONAL_ARGS '$1'" + [[ $1 == -* ]] && ViashWarning $1 looks like a parameter but is not a defined parameter and will instead be treated as a positional argument. Use "--help" to get more information on the parameters. + shift # past argument + ;; + esac +done + +# parse positional parameters +eval set -- $VIASH_POSITIONAL_ARGS + + +if [ "$VIASH_ENGINE_ID" == "native" ] ; then + VIASH_ENGINE_TYPE='native' +elif [ "$VIASH_ENGINE_ID" == "docker" ] ; then + VIASH_ENGINE_TYPE='docker' +else + ViashError "Engine '$VIASH_ENGINE_ID' is not recognized. Options are: docker, native." + exit 1 +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # check if docker is installed properly + ViashDockerInstallationCheck + + # determine docker image id + if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then + VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/biobox/star/star_genome_generate:v0.1.0' + fi + + # print dockerfile + if [ "$VIASH_MODE" == "dockerfile" ]; then + ViashDockerfile "$VIASH_ENGINE_ID" + exit 0 + + # enter docker container + elif [[ "$VIASH_MODE" == "debug" ]]; then + VIASH_CMD="docker run --entrypoint=bash ${VIASH_DOCKER_RUN_ARGS[@]} -v '$(pwd)':/pwd --workdir /pwd -t $VIASH_DOCKER_IMAGE_ID" + ViashNotice "+ $VIASH_CMD" + eval $VIASH_CMD + exit + + # build docker image + elif [ "$VIASH_MODE" == "setup" ]; then + ViashDockerSetup "$VIASH_DOCKER_IMAGE_ID" "$VIASH_SETUP_STRATEGY" + ViashDockerCheckCommands "$VIASH_DOCKER_IMAGE_ID" 'ps' 'bash' + exit 0 + fi + + # check if docker image exists + ViashDockerSetup "$VIASH_DOCKER_IMAGE_ID" ifneedbepullelsecachedbuild + ViashDockerCheckCommands "$VIASH_DOCKER_IMAGE_ID" 'ps' 'bash' +fi + +# setting computational defaults + +# helper function for parsing memory strings +function ViashMemoryAsBytes { + local memory=`echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]'` + local memory_regex='^([0-9]+)([kmgtp]i?b?|b)$' + if [[ $memory =~ $memory_regex ]]; then + local number=${memory/[^0-9]*/} + local symbol=${memory/*[0-9]/} + + case $symbol in + b) memory_b=$number ;; + kb|k) memory_b=$(( $number * 1000 )) ;; + mb|m) memory_b=$(( $number * 1000 * 1000 )) ;; + gb|g) memory_b=$(( $number * 1000 * 1000 * 1000 )) ;; + tb|t) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 )) ;; + pb|p) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 * 1000 )) ;; + kib|ki) memory_b=$(( $number * 1024 )) ;; + mib|mi) memory_b=$(( $number * 1024 * 1024 )) ;; + gib|gi) memory_b=$(( $number * 1024 * 1024 * 1024 )) ;; + tib|ti) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 )) ;; + pib|pi) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 * 1024 )) ;; + esac + echo "$memory_b" + fi +} +# compute memory in different units +if [ ! -z ${VIASH_META_MEMORY+x} ]; then + VIASH_META_MEMORY_B=`ViashMemoryAsBytes $VIASH_META_MEMORY` + # do not define other variables if memory_b is an empty string + if [ ! -z "$VIASH_META_MEMORY_B" ]; then + VIASH_META_MEMORY_KB=$(( ($VIASH_META_MEMORY_B+999) / 1000 )) + VIASH_META_MEMORY_MB=$(( ($VIASH_META_MEMORY_KB+999) / 1000 )) + VIASH_META_MEMORY_GB=$(( ($VIASH_META_MEMORY_MB+999) / 1000 )) + VIASH_META_MEMORY_TB=$(( ($VIASH_META_MEMORY_GB+999) / 1000 )) + VIASH_META_MEMORY_PB=$(( ($VIASH_META_MEMORY_TB+999) / 1000 )) + VIASH_META_MEMORY_KIB=$(( ($VIASH_META_MEMORY_B+1023) / 1024 )) + VIASH_META_MEMORY_MIB=$(( ($VIASH_META_MEMORY_KIB+1023) / 1024 )) + VIASH_META_MEMORY_GIB=$(( ($VIASH_META_MEMORY_MIB+1023) / 1024 )) + VIASH_META_MEMORY_TIB=$(( ($VIASH_META_MEMORY_GIB+1023) / 1024 )) + VIASH_META_MEMORY_PIB=$(( ($VIASH_META_MEMORY_TIB+1023) / 1024 )) + else + # unset memory if string is empty + unset $VIASH_META_MEMORY_B + fi +fi +# unset nproc if string is empty +if [ -z "$VIASH_META_CPUS" ]; then + unset $VIASH_META_CPUS +fi + + +# check whether required parameters exist +if [ -z ${VIASH_PAR_GENOMEFASTAFILES+x} ]; then + ViashError '--genomeFastaFiles' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_PAR_INDEX+x} ]; then + ViashError '--index' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_NAME+x} ]; then + ViashError 'name' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then + ViashError 'functionality_name' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_RESOURCES_DIR+x} ]; then + ViashError 'resources_dir' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_EXECUTABLE+x} ]; then + ViashError 'executable' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_CONFIG+x} ]; then + ViashError 'config' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi +if [ -z ${VIASH_META_TEMP_DIR+x} ]; then + ViashError 'temp_dir' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi + +# check whether required files exist +if [ ! -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then + IFS=';' + set -f + for file in $VIASH_PAR_GENOMEFASTAFILES; do + unset IFS + if [ ! -e "$file" ]; then + ViashError "Input file '$file' does not exist." + exit 1 + fi + done + set +f +fi +if [ ! -z "$VIASH_PAR_SJDBGTFFILE" ] && [ ! -e "$VIASH_PAR_SJDBGTFFILE" ]; then + ViashError "Input file '$VIASH_PAR_SJDBGTFFILE' does not exist." + exit 1 +fi +if [ ! -z "$VIASH_PAR_GENOMETRANSFORMVCF" ] && [ ! -e "$VIASH_PAR_GENOMETRANSFORMVCF" ]; then + ViashError "Input file '$VIASH_PAR_GENOMETRANSFORMVCF' does not exist." + exit 1 +fi + +# check whether parameters values are of the right type +if [[ -n "$VIASH_PAR_SJDBOVERHANG" ]]; then + if ! [[ "$VIASH_PAR_SJDBOVERHANG" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--sjdbOverhang' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_LIMITGENOMEGENERATERAM" ]]; then + if ! [[ "$VIASH_PAR_LIMITGENOMEGENERATERAM" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--limitGenomeGenerateRAM' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_GENOMESAINDEXNBASES" ]]; then + if ! [[ "$VIASH_PAR_GENOMESAINDEXNBASES" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--genomeSAindexNbases' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_GENOMECHRBINNBITS" ]]; then + if ! [[ "$VIASH_PAR_GENOMECHRBINNBITS" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--genomeChrBinNbits' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_GENOMESASPARSED" ]]; then + if ! [[ "$VIASH_PAR_GENOMESASPARSED" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--genomeSAsparseD' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi + if [[ $VIASH_PAR_GENOMESASPARSED -lt 0 ]]; then + ViashError '--genomeSAsparseD' has be more than or equal to 0. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_PAR_GENOMESUFFIXLENGTHMAX" ]]; then + if ! [[ "$VIASH_PAR_GENOMESUFFIXLENGTHMAX" =~ ^[-+]?[0-9]+$ ]]; then + ViashError '--genomeSuffixLengthMax' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_CPUS" ]]; then + if ! [[ "$VIASH_META_CPUS" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'cpus' has to be an integer. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_B" ]]; then + if ! [[ "$VIASH_META_MEMORY_B" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_b' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_KB" ]]; then + if ! [[ "$VIASH_META_MEMORY_KB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_kb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_MB" ]]; then + if ! [[ "$VIASH_META_MEMORY_MB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_mb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_GB" ]]; then + if ! [[ "$VIASH_META_MEMORY_GB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_gb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_TB" ]]; then + if ! [[ "$VIASH_META_MEMORY_TB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_tb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_PB" ]]; then + if ! [[ "$VIASH_META_MEMORY_PB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_pb' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_KIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_KIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_kib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_MIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_MIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_mib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_GIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_GIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_gib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_TIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_TIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_tib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi +if [[ -n "$VIASH_META_MEMORY_PIB" ]]; then + if ! [[ "$VIASH_META_MEMORY_PIB" =~ ^[-+]?[0-9]+$ ]]; then + ViashError 'memory_pib' has to be a long. Use "--help" to get more information on the parameters. + exit 1 + fi +fi + +# create parent directories of output files, if so desired +if [ ! -z "$VIASH_PAR_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_INDEX")" ]; then + mkdir -p "$(dirname "$VIASH_PAR_INDEX")" +fi + +if [ "$VIASH_ENGINE_ID" == "native" ] ; then + if [ "$VIASH_MODE" == "run" ]; then + VIASH_CMD="bash" + else + ViashError "Engine '$VIASH_ENGINE_ID' does not support mode '$VIASH_MODE'." + exit 1 + fi +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # detect volumes from file arguments + VIASH_CHOWN_VARS=() +if [ ! -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then + VIASH_TEST_GENOMEFASTAFILES=() + IFS=';' + for var in $VIASH_PAR_GENOMEFASTAFILES; do + unset IFS + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$var")" ) + var=$(ViashDockerAutodetectMount "$var") + VIASH_TEST_GENOMEFASTAFILES+=( "$var" ) + done + VIASH_PAR_GENOMEFASTAFILES=$(IFS=';' ; echo "${VIASH_TEST_GENOMEFASTAFILES[*]}") +fi +if [ ! -z "$VIASH_PAR_SJDBGTFFILE" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_SJDBGTFFILE")" ) + VIASH_PAR_SJDBGTFFILE=$(ViashDockerAutodetectMount "$VIASH_PAR_SJDBGTFFILE") +fi +if [ ! -z "$VIASH_PAR_GENOMETRANSFORMVCF" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_GENOMETRANSFORMVCF")" ) + VIASH_PAR_GENOMETRANSFORMVCF=$(ViashDockerAutodetectMount "$VIASH_PAR_GENOMETRANSFORMVCF") +fi +if [ ! -z "$VIASH_PAR_INDEX" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INDEX")" ) + VIASH_PAR_INDEX=$(ViashDockerAutodetectMount "$VIASH_PAR_INDEX") + VIASH_CHOWN_VARS+=( "$VIASH_PAR_INDEX" ) +fi +if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_RESOURCES_DIR")" ) + VIASH_META_RESOURCES_DIR=$(ViashDockerAutodetectMount "$VIASH_META_RESOURCES_DIR") +fi +if [ ! -z "$VIASH_META_EXECUTABLE" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_EXECUTABLE")" ) + VIASH_META_EXECUTABLE=$(ViashDockerAutodetectMount "$VIASH_META_EXECUTABLE") +fi +if [ ! -z "$VIASH_META_CONFIG" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_CONFIG")" ) + VIASH_META_CONFIG=$(ViashDockerAutodetectMount "$VIASH_META_CONFIG") +fi +if [ ! -z "$VIASH_META_TEMP_DIR" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_TEMP_DIR")" ) + VIASH_META_TEMP_DIR=$(ViashDockerAutodetectMount "$VIASH_META_TEMP_DIR") +fi + + # get unique mounts + VIASH_UNIQUE_MOUNTS=($(for val in "${VIASH_DIRECTORY_MOUNTS[@]}"; do echo "$val"; done | sort -u)) +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # change file ownership + function ViashPerformChown { + if (( ${#VIASH_CHOWN_VARS[@]} )); then + set +e + VIASH_CMD="docker run --entrypoint=bash --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_DOCKER_IMAGE_ID -c 'chown $(id -u):$(id -g) --silent --recursive ${VIASH_CHOWN_VARS[@]}'" + ViashDebug "+ $VIASH_CMD" + eval $VIASH_CMD + set -e + fi + } + trap ViashPerformChown EXIT +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # helper function for filling in extra docker args + if [ ! -z "$VIASH_META_MEMORY_B" ]; then + VIASH_DOCKER_RUN_ARGS+=("--memory=${VIASH_META_MEMORY_B}") + fi + if [ ! -z "$VIASH_META_CPUS" ]; then + VIASH_DOCKER_RUN_ARGS+=("--cpus=${VIASH_META_CPUS}") + fi +fi + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + VIASH_CMD="docker run --entrypoint=bash ${VIASH_DOCKER_RUN_ARGS[@]} ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_DOCKER_IMAGE_ID" +fi + + +# set dependency paths + + +ViashDebug "Running command: $(echo $VIASH_CMD)" +cat << VIASHEOF | eval $VIASH_CMD +set -e +tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-star_genome_generate-XXXXXX").sh +function clean_up { + rm "\$tempscript" +} +function interrupt { + echo -e "\nCTRL-C Pressed..." + exit 1 +} +trap clean_up EXIT +trap interrupt INT SIGINT +cat > "\$tempscript" << 'VIASHMAIN' +#!/bin/bash + +set -e + +## VIASH START +# The following code has been auto-generated by Viash. +$( if [ ! -z ${VIASH_PAR_GENOMEFASTAFILES+x} ]; then echo "${VIASH_PAR_GENOMEFASTAFILES}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeFastaFiles='&'#" ; else echo "# par_genomeFastaFiles="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFFILE+x} ]; then echo "${VIASH_PAR_SJDBGTFFILE}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFfile='&'#" ; else echo "# par_sjdbGTFfile="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBOVERHANG+x} ]; then echo "${VIASH_PAR_SJDBOVERHANG}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbOverhang='&'#" ; else echo "# par_sjdbOverhang="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFCHRPREFIX+x} ]; then echo "${VIASH_PAR_SJDBGTFCHRPREFIX}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFchrPrefix='&'#" ; else echo "# par_sjdbGTFchrPrefix="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFFEATUREEXON+x} ]; then echo "${VIASH_PAR_SJDBGTFFEATUREEXON}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFfeatureExon='&'#" ; else echo "# par_sjdbGTFfeatureExon="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFtagExonParentTranscript='&'#" ; else echo "# par_sjdbGTFtagExonParentTranscript="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENE+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTGENE}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFtagExonParentGene='&'#" ; else echo "# par_sjdbGTFtagExonParentGene="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFtagExonParentGeneName='&'#" ; else echo "# par_sjdbGTFtagExonParentGeneName="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE}" | sed "s#'#'\"'\"'#g;s#.*#par_sjdbGTFtagExonParentGeneType='&'#" ; else echo "# par_sjdbGTFtagExonParentGeneType="; fi ) +$( if [ ! -z ${VIASH_PAR_LIMITGENOMEGENERATERAM+x} ]; then echo "${VIASH_PAR_LIMITGENOMEGENERATERAM}" | sed "s#'#'\"'\"'#g;s#.*#par_limitGenomeGenerateRAM='&'#" ; else echo "# par_limitGenomeGenerateRAM="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMESAINDEXNBASES+x} ]; then echo "${VIASH_PAR_GENOMESAINDEXNBASES}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeSAindexNbases='&'#" ; else echo "# par_genomeSAindexNbases="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMECHRBINNBITS+x} ]; then echo "${VIASH_PAR_GENOMECHRBINNBITS}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeChrBinNbits='&'#" ; else echo "# par_genomeChrBinNbits="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMESASPARSED+x} ]; then echo "${VIASH_PAR_GENOMESASPARSED}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeSAsparseD='&'#" ; else echo "# par_genomeSAsparseD="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMESUFFIXLENGTHMAX+x} ]; then echo "${VIASH_PAR_GENOMESUFFIXLENGTHMAX}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeSuffixLengthMax='&'#" ; else echo "# par_genomeSuffixLengthMax="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMETRANSFORMTYPE+x} ]; then echo "${VIASH_PAR_GENOMETRANSFORMTYPE}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeTransformType='&'#" ; else echo "# par_genomeTransformType="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMETRANSFORMVCF+x} ]; then echo "${VIASH_PAR_GENOMETRANSFORMVCF}" | sed "s#'#'\"'\"'#g;s#.*#par_genomeTransformVCF='&'#" ; else echo "# par_genomeTransformVCF="; fi ) +$( if [ ! -z ${VIASH_PAR_INDEX+x} ]; then echo "${VIASH_PAR_INDEX}" | sed "s#'#'\"'\"'#g;s#.*#par_index='&'#" ; else echo "# par_index="; fi ) +$( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) +$( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) +$( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\"'\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) +$( if [ ! -z ${VIASH_META_EXECUTABLE+x} ]; then echo "${VIASH_META_EXECUTABLE}" | sed "s#'#'\"'\"'#g;s#.*#meta_executable='&'#" ; else echo "# meta_executable="; fi ) +$( if [ ! -z ${VIASH_META_CONFIG+x} ]; then echo "${VIASH_META_CONFIG}" | sed "s#'#'\"'\"'#g;s#.*#meta_config='&'#" ; else echo "# meta_config="; fi ) +$( if [ ! -z ${VIASH_META_TEMP_DIR+x} ]; then echo "${VIASH_META_TEMP_DIR}" | sed "s#'#'\"'\"'#g;s#.*#meta_temp_dir='&'#" ; else echo "# meta_temp_dir="; fi ) +$( if [ ! -z ${VIASH_META_CPUS+x} ]; then echo "${VIASH_META_CPUS}" | sed "s#'#'\"'\"'#g;s#.*#meta_cpus='&'#" ; else echo "# meta_cpus="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_B+x} ]; then echo "${VIASH_META_MEMORY_B}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_b='&'#" ; else echo "# meta_memory_b="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KB+x} ]; then echo "${VIASH_META_MEMORY_KB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_kb='&'#" ; else echo "# meta_memory_kb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MB+x} ]; then echo "${VIASH_META_MEMORY_MB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_mb='&'#" ; else echo "# meta_memory_mb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GB+x} ]; then echo "${VIASH_META_MEMORY_GB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_gb='&'#" ; else echo "# meta_memory_gb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TB+x} ]; then echo "${VIASH_META_MEMORY_TB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_tb='&'#" ; else echo "# meta_memory_tb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PB+x} ]; then echo "${VIASH_META_MEMORY_PB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_pb='&'#" ; else echo "# meta_memory_pb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KIB+x} ]; then echo "${VIASH_META_MEMORY_KIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_kib='&'#" ; else echo "# meta_memory_kib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MIB+x} ]; then echo "${VIASH_META_MEMORY_MIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_mib='&'#" ; else echo "# meta_memory_mib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GIB+x} ]; then echo "${VIASH_META_MEMORY_GIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_gib='&'#" ; else echo "# meta_memory_gib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_tib='&'#" ; else echo "# meta_memory_tib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi ) + +## VIASH END + +mkdir -p \$par_index + +STAR \\ + --runMode genomeGenerate \\ + --genomeDir \$par_index \\ + --genomeFastaFiles \$par_genomeFastaFiles \\ + \${meta_cpus:+--runThreadN "\${meta_cpus}"} \\ + \${par_sjdbGTFfile:+--sjdbGTFfile "\${par_sjdbGTFfile}"} \\ + \${par_sjdbOverhang:+--sjdbOverhang "\${par_sjdbOverhang}"} \\ + \${par_genomeSAindexNbases:+--genomeSAindexNbases "\${par_genomeSAindexNbases}"} \\ + \${par_sjdbGTFchrPrefix:+--sjdbGTFchrPrefix "\${par_sjdbGTFchrPrefix}"} \\ + \${par_sjdbGTFfeatureExon:+--sjdbGTFfeatureExon "\${par_sjdbGTFfeatureExon}"} \\ + \${par_sjdbGTFtagExonParentTranscript:+--sjdbGTFtagExonParentTranscript "\${par_sjdbGTFtagExonParentTranscript}"} \\ + \${par_sjdbGTFtagExonParentGene:+--sjdbGTFtagExonParentGene "\${par_sjdbGTFtagExonParentGene}"} \\ + \${par_sjdbGTFtagExonParentGeneName:+--sjdbGTFtagExonParentGeneName "\${par_sjdbGTFtagExonParentGeneName}"} \\ + \${par_sjdbGTFtagExonParentGeneType:+--sjdbGTFtagExonParentGeneType "\${sjdbGTFtagExonParentGeneType}"} \\ + \${par_limitGenomeGenerateRAM:+--limitGenomeGenerateRAM "\${par_limitGenomeGenerateRAM}"} \\ + \${par_genomeChrBinNbits:+--genomeChrBinNbits "\${par_genomeChrBinNbits}"} \\ + \${par_genomeSAsparseD:+--genomeSAsparseD "\${par_genomeSAsparseD}"} \\ + \${par_genomeSuffixLengthMax:+--genomeSuffixLengthMax "\${par_genomeSuffixLengthMax}"} \\ + \${par_genomeTransformType:+--genomeTransformType "\${par_genomeTransformType}"} \\ + \${par_genomeTransformVCF:+--genomeTransformVCF "\${par_genomeTransformVCF}"} \\ +VIASHMAIN +bash "\$tempscript" & +wait "\$!" + +VIASHEOF + + +if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then + # strip viash automount from file paths + + if [ ! -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then + unset VIASH_TEST_GENOMEFASTAFILES + IFS=';' + for var in $VIASH_PAR_GENOMEFASTAFILES; do + unset IFS + if [ -z "$VIASH_TEST_GENOMEFASTAFILES" ]; then + VIASH_TEST_GENOMEFASTAFILES="$(ViashDockerStripAutomount "$var")" + else + VIASH_TEST_GENOMEFASTAFILES="$VIASH_TEST_GENOMEFASTAFILES;""$(ViashDockerStripAutomount "$var")" + fi + done + VIASH_PAR_GENOMEFASTAFILES="$VIASH_TEST_GENOMEFASTAFILES" + fi + if [ ! -z "$VIASH_PAR_SJDBGTFFILE" ]; then + VIASH_PAR_SJDBGTFFILE=$(ViashDockerStripAutomount "$VIASH_PAR_SJDBGTFFILE") + fi + if [ ! -z "$VIASH_PAR_GENOMETRANSFORMVCF" ]; then + VIASH_PAR_GENOMETRANSFORMVCF=$(ViashDockerStripAutomount "$VIASH_PAR_GENOMETRANSFORMVCF") + fi + if [ ! -z "$VIASH_PAR_INDEX" ]; then + VIASH_PAR_INDEX=$(ViashDockerStripAutomount "$VIASH_PAR_INDEX") + fi + if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then + VIASH_META_RESOURCES_DIR=$(ViashDockerStripAutomount "$VIASH_META_RESOURCES_DIR") + fi + if [ ! -z "$VIASH_META_EXECUTABLE" ]; then + VIASH_META_EXECUTABLE=$(ViashDockerStripAutomount "$VIASH_META_EXECUTABLE") + fi + if [ ! -z "$VIASH_META_CONFIG" ]; then + VIASH_META_CONFIG=$(ViashDockerStripAutomount "$VIASH_META_CONFIG") + fi + if [ ! -z "$VIASH_META_TEMP_DIR" ]; then + VIASH_META_TEMP_DIR=$(ViashDockerStripAutomount "$VIASH_META_TEMP_DIR") + fi +fi + + +# check whether required files exist +if [ ! -z "$VIASH_PAR_INDEX" ] && [ ! -e "$VIASH_PAR_INDEX" ]; then + ViashError "Output file '$VIASH_PAR_INDEX' does not exist." + exit 1 +fi + + +exit 0 diff --git a/target/nextflow/arriba/.config.vsh.yaml b/target/nextflow/arriba/.config.vsh.yaml index a5ee2a08..842862b1 100644 --- a/target/nextflow/arriba/.config.vsh.yaml +++ b/target/nextflow/arriba/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "arriba" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -670,7 +670,7 @@ engines: id: "docker" image: "quay.io/biocontainers/arriba:2.4.0--h0033a41_2" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -688,11 +688,11 @@ build_info: output: "target/nextflow/arriba" executable: "target/nextflow/arriba/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -702,16 +702,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/arriba/main.nf b/target/nextflow/arriba/main.nf index 4328d0b5..59f70c5b 100644 --- a/target/nextflow/arriba/main.nf +++ b/target/nextflow/arriba/main.nf @@ -1,4 +1,4 @@ -// arriba v0.1 +// arriba v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "arriba", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3512,7 +3512,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/arriba:2.4.0--h0033a41_2", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3534,12 +3534,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/arriba", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3548,20 +3548,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -4044,7 +4041,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/arriba", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "cpus" : 1, "tag" : "$id" diff --git a/target/nextflow/arriba/nextflow.config b/target/nextflow/arriba/nextflow.config index bde8d06c..f338a926 100644 --- a/target/nextflow/arriba/nextflow.config +++ b/target/nextflow/arriba/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'arriba' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Detect gene fusions from RNA-Seq data' } diff --git a/target/nextflow/bcl_convert/.config.vsh.yaml b/target/nextflow/bcl_convert/.config.vsh.yaml index cd97dc36..9fa8ed0d 100644 --- a/target/nextflow/bcl_convert/.config.vsh.yaml +++ b/target/nextflow/bcl_convert/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "bcl_convert" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Input arguments" arguments: @@ -270,8 +270,8 @@ resources: path: "script.sh" is_executable: true description: "Convert bcl files to fastq files using bcl-convert.\nInformation about\ - \ upgrading from bcl2fastq via\nhttps://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html\n\ - and https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html\n" + \ upgrading from bcl2fastq via\n[Upgrading from bcl2fastq to BCL Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html)\n\ + and [BCL Convert Compatible Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html)\n" test_resources: - type: "bash_script" path: "test.sh" @@ -283,7 +283,7 @@ requirements: - "ps" license: "MIT" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" runners: - type: "executable" id: "executable" @@ -354,7 +354,7 @@ engines: id: "docker" image: "debian:trixie-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "apt" @@ -386,11 +386,11 @@ build_info: output: "target/nextflow/bcl_convert" executable: "target/nextflow/bcl_convert/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -400,16 +400,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/bcl_convert/main.nf b/target/nextflow/bcl_convert/main.nf index eca14ae3..9ecfb1c8 100644 --- a/target/nextflow/bcl_convert/main.nf +++ b/target/nextflow/bcl_convert/main.nf @@ -1,4 +1,4 @@ -// bcl_convert v0.1 +// bcl_convert v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "bcl_convert", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Input arguments", @@ -3111,7 +3111,7 @@ meta = [ "is_executable" : true } ], - "description" : "Convert bcl files to fastq files using bcl-convert.\nInformation about upgrading from bcl2fastq via\nhttps://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html\nand https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html\n", + "description" : "Convert bcl files to fastq files using bcl-convert.\nInformation about upgrading from bcl2fastq via\n[Upgrading from bcl2fastq to BCL Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html)\nand [BCL Convert Compatible Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html)\n", "test_resources" : [ { "type" : "bash_script", @@ -3127,7 +3127,7 @@ meta = [ }, "license" : "MIT", "links" : { - "repository" : "https://github.com/viash-hub/biobbox" + "repository" : "https://github.com/viash-hub/biobox" }, "runners" : [ { @@ -3209,7 +3209,7 @@ meta = [ "id" : "docker", "image" : "debian:trixie-slim", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3249,12 +3249,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/bcl_convert", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3263,20 +3263,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3733,7 +3730,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/bcl_convert", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/bcl_convert/nextflow.config b/target/nextflow/bcl_convert/nextflow.config index 84b3ee36..9444a227 100644 --- a/target/nextflow/bcl_convert/nextflow.config +++ b/target/nextflow/bcl_convert/nextflow.config @@ -2,8 +2,8 @@ manifest { name = 'bcl_convert' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' - description = 'Convert bcl files to fastq files using bcl-convert.\nInformation about upgrading from bcl2fastq via\nhttps://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html\nand https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html\n' + version = 'v0.1.0' + description = 'Convert bcl files to fastq files using bcl-convert.\nInformation about upgrading from bcl2fastq via\n[Upgrading from bcl2fastq to BCL Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html)\nand [BCL Convert Compatible Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html)\n' } process.container = 'nextflow/bash:latest' diff --git a/target/nextflow/bcl_convert/nextflow_schema.json b/target/nextflow/bcl_convert/nextflow_schema.json index 065d6272..5fa9b054 100644 --- a/target/nextflow/bcl_convert/nextflow_schema.json +++ b/target/nextflow/bcl_convert/nextflow_schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema", "title": "bcl_convert", -"description": "Convert bcl files to fastq files using bcl-convert.\nInformation about upgrading from bcl2fastq via\nhttps://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html\nand https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html\n", +"description": "Convert bcl files to fastq files using bcl-convert.\nInformation about upgrading from bcl2fastq via\n[Upgrading from bcl2fastq to BCL Convert](https://emea.support.illumina.com/bulletins/2020/10/upgrading-from-bcl2fastq-to-bcl-convert.html)\nand [BCL Convert Compatible Products](https://support.illumina.com/sequencing/sequencing_software/bcl-convert/compatibility.html)\n", "type": "object", "definitions": { diff --git a/target/nextflow/bgzip/.config.vsh.yaml b/target/nextflow/bedtools/bedtools_getfasta/.config.vsh.yaml similarity index 51% rename from target/nextflow/bgzip/.config.vsh.yaml rename to target/nextflow/bedtools/bedtools_getfasta/.config.vsh.yaml index 9444dac1..f2a3572d 100644 --- a/target/nextflow/bgzip/.config.vsh.yaml +++ b/target/nextflow/bedtools/bedtools_getfasta/.config.vsh.yaml @@ -1,23 +1,57 @@ -name: "bgzip" -version: "v0.1" +name: "bedtools_getfasta" +namespace: "bedtools" +version: "v0.1.0" argument_groups: -- name: "Inputs" +- name: "Input arguments" arguments: - type: "file" - name: "--input" - description: "file to be compressed or decompressed" + name: "--input_fasta" + description: "FASTA file containing sequences for each interval specified in the\ + \ input BED file.\nThe headers in the input FASTA file must exactly match the\ + \ chromosome column in the BED file.\n" info: null must_exist: true create_parent: true - required: true + required: false direction: "input" multiple: false multiple_sep: ";" -- name: "Outputs" + - type: "file" + name: "--input_bed" + description: "BED file containing intervals to extract from the FASTA file.\n\ + BED files containing a single region require a newline character\nat the end\ + \ of the line, otherwise a blank output file is produced.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--rna" + description: "The FASTA is RNA not DNA. Reverse complementation handled accordingly.\n" + info: null + direction: "input" +- name: "Run arguments" + arguments: + - type: "boolean_true" + name: "--strandedness" + alternatives: + - "-s" + description: "Force strandedness. If the feature occupies the antisense strand,\ + \ the output sequence will\nbe reverse complemented. By default strandedness\ + \ is not taken into account.\n" + info: null + direction: "input" +- name: "Output arguments" arguments: - type: "file" name: "--output" - description: "compressed or decompressed output" + alternatives: + - "-o" + description: "Output file where the output from the 'bedtools getfasta' commend\ + \ will\nbe written to.\n" info: null must_exist: true create_parent: true @@ -25,149 +59,71 @@ argument_groups: direction: "output" multiple: false multiple_sep: ";" - - type: "file" - name: "--index_name" - alternatives: - - "-I" - description: "name of BGZF index file [file.gz.gzi]" - info: null - must_exist: true - create_parent: true - required: false - direction: "output" - multiple: false - multiple_sep: ";" -- name: "Arguments" - arguments: - - type: "integer" - name: "--offset" - alternatives: - - "-b" - description: "decompress at virtual file pointer (0-based uncompressed offset)" - info: null - required: false - direction: "input" - multiple: false - multiple_sep: ";" - type: "boolean_true" - name: "--decompress" - alternatives: - - "-d" - description: "decompress the input file" + name: "--tab" + description: "Report extract sequences in a tab-delimited format instead of in\ + \ FASTA format.\n" info: null direction: "input" - type: "boolean_true" - name: "--rebgzip" - alternatives: - - "-g" - description: "use an index file to bgzip a file" + name: "--bed_out" + description: "Report extract sequences in a tab-delimited BED format instead of\ + \ in FASTA format.\n" info: null direction: "input" - type: "boolean_true" - name: "--index" - alternatives: - - "-i" - description: "compress and create BGZF index" - info: null - direction: "input" - - type: "integer" - name: "--compress_level" - alternatives: - - "-l" - description: "compression level to use when compressing; 0 to 9, or -1 for default\ - \ [-1]" - info: null - required: false - min: -1 - max: 9 - direction: "input" - multiple: false - multiple_sep: ";" - - type: "boolean_true" - name: "--reindex" - alternatives: - - "-r" - description: "(re)index the output file" - info: null - direction: "input" - - type: "integer" - name: "--size" - alternatives: - - "-s" - description: "decompress INT bytes (uncompressed size)" - info: null - required: false - min: 0 - direction: "input" - multiple: false - multiple_sep: ";" - - type: "boolean_true" - name: "--test" - alternatives: - - "-t" - description: "test integrity of compressed file" + name: "--name" + description: "Set the FASTA header for each extracted sequence to be the \"name\"\ + \ and coordinate columns from the BED feature.\n" info: null direction: "input" - type: "boolean_true" - name: "--binary" - description: "Don't align blocks with text lines" + name: "--name_only" + description: "Set the FASTA header for each extracted sequence to be the \"name\"\ + \ columns from the BED feature.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--split" + description: "When --input is in BED12 format, create a separate fasta entry for\ + \ each block in a BED12 record,\nblocks being described in the 11th and 12th\ + \ column of the BED.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--full_header" + description: "Use full fasta header. By default, only the word before the first\ + \ space or tab is used.\n" info: null direction: "input" resources: - type: "bash_script" - text: | - [[ "$par_decompress" == "false" ]] && unset par_decompress - [[ "$par_rebgzip" == "false" ]] && unset par_rebgzip - [[ "$par_index" == "false" ]] && unset par_index - [[ "$par_reindex" == "false" ]] && unset par_reindex - [[ "$par_test" == "false" ]] && unset par_test - [[ "$par_binary" == "false" ]] && unset par_binary - bgzip -c \ - ${meta_cpus:+--threads "${meta_cpus}"} \ - ${par_offset:+-b "${par_offset}"} \ - ${par_decompress:+-d} \ - ${par_rebgzip:+-g} \ - ${par_index:+-i} \ - ${par_index_name:+-I "${par_index_name}"} \ - ${par_compress_level:+-l "${par_compress_level}"} \ - ${par_reindex:+-r} \ - ${par_size:+-s "${par_size}"} \ - ${par_test:+-t} \ - ${par_binary:+--binary} \ - "$par_input" > "$par_output" - - - dest: "./script.sh" + path: "script.sh" is_executable: true -description: "Block compression/decompression utility" +description: "Extract sequences from a FASTA file for each of the intervals defined\ + \ in a BED/GFF/VCF file." test_resources: - type: "bash_script" - text: "set -e\n\n\"$meta_executable\" --input \"$meta_resources_dir/test_data/test.vcf\"\ - \ --output \"test.vcf.gz\"\n\necho \">> Checking output of compressing\"\n[ !\ - \ -f \"test.vcf.gz\" ] && echo \"Output file test.vcf.gz does not exist\" && exit\ - \ 1\n\n\"$meta_executable\" --input \"test.vcf.gz\" --output \"test.vcf\" --decompress\n\ - \necho \">> Checking output of decompressing\"\n[ ! -f \"test.vcf\" ] && echo\ - \ \"Output file test.vcf does not exist\" && exit 1\n\necho \">> Checking original\ - \ and decompressed files are the same\"\nset +e\ncmp --silent -- \"$meta_resources_dir/test_data/test.vcf\"\ - \ \"test.vcf\"\n[ $? -ne 0 ] && echo \"files are different\" && exit 1\nset -e\n\ - \necho \"> Test successful\"\n" - dest: "./script.sh" + path: "test.sh" is_executable: true -- type: "file" - path: "test_data" info: null status: "enabled" requirements: commands: - "ps" -license: "MIT" +keywords: +- "sequencing" +- "fasta" +- "BED" +- "GFF" +- "VCF" +license: "GPL-2.0" references: doi: - - "10.1093/gigascience/giab007" + - "10.1093/bioinformatics/btq033" links: - repository: "https://github.com/samtools/htslib" - homepage: "https://www.htslib.org/" - documentation: "https://www.htslib.org/doc/bgzip.html" + repository: "https://github.com/arq5x/bedtools2" + documentation: "https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html" runners: - type: "executable" id: "executable" @@ -236,31 +192,36 @@ runners: engines: - type: "docker" id: "docker" - image: "quay.io/biocontainers/htslib:1.19--h81da01d_0" + image: "debian:stable-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: + - type: "apt" + packages: + - "bedtools" + - "procps" + interactive: false - type: "docker" run: - - "bgzip -h | grep 'Version:' 2>&1 | sed 's/Version:\\s\\(.*\\)/bgzip: \"\\1\"\ - /' > /var/software_versions.txt\n" + - "echo \"bedtools: \\\"$(bedtools --version | sed -n 's/^bedtools //p')\\\"\"\ + \ > /var/software_versions.txt\n" entrypoint: [] cmd: null - type: "native" id: "native" build_info: - config: "src/bgzip/config.vsh.yaml" + config: "src/bedtools/bedtools_getfasta/config.vsh.yaml" runner: "nextflow" engine: "docker|native" - output: "target/nextflow/bgzip" - executable: "target/nextflow/bgzip/main.nf" + output: "target/nextflow/bedtools/bedtools_getfasta" + executable: "target/nextflow/bedtools/bedtools_getfasta/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -270,16 +231,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/bgzip/main.nf b/target/nextflow/bedtools/bedtools_getfasta/main.nf similarity index 94% rename from target/nextflow/bgzip/main.nf rename to target/nextflow/bedtools/bedtools_getfasta/main.nf index 627b99ad..4b0a0a27 100644 --- a/target/nextflow/bgzip/main.nf +++ b/target/nextflow/bedtools/bedtools_getfasta/main.nf @@ -1,4 +1,4 @@ -// bgzip v0.1 +// bedtools_getfasta v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2778,32 +2778,67 @@ nextflow.enable.dsl=2 meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ - "name" : "bgzip", - "version" : "v0.1", + "name" : "bedtools_getfasta", + "namespace" : "bedtools", + "version" : "v0.1.0", "argument_groups" : [ { - "name" : "Inputs", + "name" : "Input arguments", "arguments" : [ { "type" : "file", - "name" : "--input", - "description" : "file to be compressed or decompressed", + "name" : "--input_fasta", + "description" : "FASTA file containing sequences for each interval specified in the input BED file.\nThe headers in the input FASTA file must exactly match the chromosome column in the BED file.\n", "must_exist" : true, "create_parent" : true, - "required" : true, + "required" : false, "direction" : "input", "multiple" : false, "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--input_bed", + "description" : "BED file containing intervals to extract from the FASTA file.\nBED files containing a single region require a newline character\nat the end of the line, otherwise a blank output file is produced.\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--rna", + "description" : "The FASTA is RNA not DNA. Reverse complementation handled accordingly.\n", + "direction" : "input" } ] }, { - "name" : "Outputs", + "name" : "Run arguments", + "arguments" : [ + { + "type" : "boolean_true", + "name" : "--strandedness", + "alternatives" : [ + "-s" + ], + "description" : "Force strandedness. If the feature occupies the antisense strand, the output sequence will\nbe reverse complemented. By default strandedness is not taken into account.\n", + "direction" : "input" + } + ] + }, + { + "name" : "Output arguments", "arguments" : [ { "type" : "file", "name" : "--output", - "description" : "compressed or decompressed output", + "alternatives" : [ + "-o" + ], + "description" : "Output file where the output from the 'bedtools getfasta' commend will\nbe written to.\n", "must_exist" : true, "create_parent" : true, "required" : true, @@ -2811,113 +2846,40 @@ meta = [ "multiple" : false, "multiple_sep" : ";" }, - { - "type" : "file", - "name" : "--index_name", - "alternatives" : [ - "-I" - ], - "description" : "name of BGZF index file [file.gz.gzi]", - "must_exist" : true, - "create_parent" : true, - "required" : false, - "direction" : "output", - "multiple" : false, - "multiple_sep" : ";" - } - ] - }, - { - "name" : "Arguments", - "arguments" : [ - { - "type" : "integer", - "name" : "--offset", - "alternatives" : [ - "-b" - ], - "description" : "decompress at virtual file pointer (0-based uncompressed offset)", - "required" : false, - "direction" : "input", - "multiple" : false, - "multiple_sep" : ";" - }, { "type" : "boolean_true", - "name" : "--decompress", - "alternatives" : [ - "-d" - ], - "description" : "decompress the input file", + "name" : "--tab", + "description" : "Report extract sequences in a tab-delimited format instead of in FASTA format.\n", "direction" : "input" }, { "type" : "boolean_true", - "name" : "--rebgzip", - "alternatives" : [ - "-g" - ], - "description" : "use an index file to bgzip a file", + "name" : "--bed_out", + "description" : "Report extract sequences in a tab-delimited BED format instead of in FASTA format.\n", "direction" : "input" }, { "type" : "boolean_true", - "name" : "--index", - "alternatives" : [ - "-i" - ], - "description" : "compress and create BGZF index", - "direction" : "input" - }, - { - "type" : "integer", - "name" : "--compress_level", - "alternatives" : [ - "-l" - ], - "description" : "compression level to use when compressing; 0 to 9, or -1 for default [-1]", - "required" : false, - "min" : -1, - "max" : 9, - "direction" : "input", - "multiple" : false, - "multiple_sep" : ";" - }, - { - "type" : "boolean_true", - "name" : "--reindex", - "alternatives" : [ - "-r" - ], - "description" : "(re)index the output file", - "direction" : "input" - }, - { - "type" : "integer", - "name" : "--size", - "alternatives" : [ - "-s" - ], - "description" : "decompress INT bytes (uncompressed size)", - "required" : false, - "min" : 0, - "direction" : "input", - "multiple" : false, - "multiple_sep" : ";" - }, - { - "type" : "boolean_true", - "name" : "--test", - "alternatives" : [ - "-t" - ], - "description" : "test integrity of compressed file", + "name" : "--name", + "description" : "Set the FASTA header for each extracted sequence to be the \\"name\\" and coordinate columns from the BED feature.\n", "direction" : "input" }, { "type" : "boolean_true", - "name" : "--binary", - "description" : "Don't align blocks with text lines", + "name" : "--name_only", + "description" : "Set the FASTA header for each extracted sequence to be the \\"name\\" columns from the BED feature.\n", + "direction" : "input" + }, + { + "type" : "boolean_true", + "name" : "--split", + "description" : "When --input is in BED12 format, create a separate fasta entry for each block in a BED12 record,\nblocks being described in the 11th and 12th column of the BED.\n", + "direction" : "input" + }, + { + "type" : "boolean_true", + "name" : "--full_header", + "description" : "Use full fasta header. By default, only the word before the first space or tab is used.\n", "direction" : "input" } ] @@ -2926,22 +2888,16 @@ meta = [ "resources" : [ { "type" : "bash_script", - "text" : "[[ \\"$par_decompress\\" == \\"false\\" ]] && unset par_decompress\n[[ \\"$par_rebgzip\\" == \\"false\\" ]] && unset par_rebgzip\n[[ \\"$par_index\\" == \\"false\\" ]] && unset par_index\n[[ \\"$par_reindex\\" == \\"false\\" ]] && unset par_reindex\n[[ \\"$par_test\\" == \\"false\\" ]] && unset par_test\n[[ \\"$par_binary\\" == \\"false\\" ]] && unset par_binary\nbgzip -c \\\\\n ${meta_cpus:+--threads \\"${meta_cpus}\\"} \\\\\n ${par_offset:+-b \\"${par_offset}\\"} \\\\\n ${par_decompress:+-d} \\\\\n ${par_rebgzip:+-g} \\\\\n ${par_index:+-i} \\\\\n ${par_index_name:+-I \\"${par_index_name}\\"} \\\\\n ${par_compress_level:+-l \\"${par_compress_level}\\"} \\\\\n ${par_reindex:+-r} \\\\\n ${par_size:+-s \\"${par_size}\\"} \\\\\n ${par_test:+-t} \\\\\n ${par_binary:+--binary} \\\\\n \\"$par_input\\" > \\"$par_output\\"\n", - "dest" : "./script.sh", + "path" : "script.sh", "is_executable" : true } ], - "description" : "Block compression/decompression utility", + "description" : "Extract sequences from a FASTA file for each of the intervals defined in a BED/GFF/VCF file.", "test_resources" : [ { "type" : "bash_script", - "text" : "set -e\n\n\\"$meta_executable\\" --input \\"$meta_resources_dir/test_data/test.vcf\\" --output \\"test.vcf.gz\\"\n\necho \\">> Checking output of compressing\\"\n[ ! -f \\"test.vcf.gz\\" ] && echo \\"Output file test.vcf.gz does not exist\\" && exit 1\n\n\\"$meta_executable\\" --input \\"test.vcf.gz\\" --output \\"test.vcf\\" --decompress\n\necho \\">> Checking output of decompressing\\"\n[ ! -f \\"test.vcf\\" ] && echo \\"Output file test.vcf does not exist\\" && exit 1\n\necho \\">> Checking original and decompressed files are the same\\"\nset +e\ncmp --silent -- \\"$meta_resources_dir/test_data/test.vcf\\" \\"test.vcf\\"\n[ $? -ne 0 ] && echo \\"files are different\\" && exit 1\nset -e\n\necho \\"> Test successful\\"\n", - "dest" : "./script.sh", + "path" : "test.sh", "is_executable" : true - }, - { - "type" : "file", - "path" : "test_data" } ], "status" : "enabled", @@ -2950,16 +2906,22 @@ meta = [ "ps" ] }, - "license" : "MIT", + "keywords" : [ + "sequencing", + "fasta", + "BED", + "GFF", + "VCF" + ], + "license" : "GPL-2.0", "references" : { "doi" : [ - "10.1093/gigascience/giab007" + "10.1093/bioinformatics/btq033" ] }, "links" : { - "repository" : "https://github.com/samtools/htslib", - "homepage" : "https://www.htslib.org/", - "documentation" : "https://www.htslib.org/doc/bgzip.html" + "repository" : "https://github.com/arq5x/bedtools2", + "documentation" : "https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html" }, "runners" : [ { @@ -3039,15 +3001,23 @@ meta = [ { "type" : "docker", "id" : "docker", - "image" : "quay.io/biocontainers/htslib:1.19--h81da01d_0", + "image" : "debian:stable-slim", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ + { + "type" : "apt", + "packages" : [ + "bedtools", + "procps" + ], + "interactive" : false + }, { "type" : "docker", "run" : [ - "bgzip -h | grep 'Version:' 2>&1 | sed 's/Version:\\\\s\\\\(.*\\\\)/bgzip: \\"\\\\1\\"/' > /var/software_versions.txt\n" + "echo \\"bedtools: \\\\\\"$(bedtools --version | sed -n 's/^bedtools //p')\\\\\\"\\" > /var/software_versions.txt\n" ] } ] @@ -3058,17 +3028,17 @@ meta = [ } ], "build_info" : { - "config" : "/workdir/root/repo/src/bgzip/config.vsh.yaml", + "config" : "/workdir/root/repo/src/bedtools/bedtools_getfasta/config.vsh.yaml", "runner" : "nextflow", "engine" : "docker|native", - "output" : "target/nextflow/bgzip", + "output" : "target/nextflow/bedtools/bedtools_getfasta", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3077,20 +3047,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3108,18 +3075,17 @@ tempscript=".viash_script.sh" cat > "$tempscript" << VIASHMAIN ## VIASH START # The following code has been auto-generated by Viash. -$( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_FASTA+x} ]; then echo "${VIASH_PAR_INPUT_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input_fasta='&'#" ; else echo "# par_input_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_BED+x} ]; then echo "${VIASH_PAR_INPUT_BED}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input_bed='&'#" ; else echo "# par_input_bed="; fi ) +$( if [ ! -z ${VIASH_PAR_RNA+x} ]; then echo "${VIASH_PAR_RNA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_rna='&'#" ; else echo "# par_rna="; fi ) +$( if [ ! -z ${VIASH_PAR_STRANDEDNESS+x} ]; then echo "${VIASH_PAR_STRANDEDNESS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_strandedness='&'#" ; else echo "# par_strandedness="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "${VIASH_PAR_OUTPUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_output='&'#" ; else echo "# par_output="; fi ) -$( if [ ! -z ${VIASH_PAR_INDEX_NAME+x} ]; then echo "${VIASH_PAR_INDEX_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#par_index_name='&'#" ; else echo "# par_index_name="; fi ) -$( if [ ! -z ${VIASH_PAR_OFFSET+x} ]; then echo "${VIASH_PAR_OFFSET}" | sed "s#'#'\\"'\\"'#g;s#.*#par_offset='&'#" ; else echo "# par_offset="; fi ) -$( if [ ! -z ${VIASH_PAR_DECOMPRESS+x} ]; then echo "${VIASH_PAR_DECOMPRESS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_decompress='&'#" ; else echo "# par_decompress="; fi ) -$( if [ ! -z ${VIASH_PAR_REBGZIP+x} ]; then echo "${VIASH_PAR_REBGZIP}" | sed "s#'#'\\"'\\"'#g;s#.*#par_rebgzip='&'#" ; else echo "# par_rebgzip="; fi ) -$( if [ ! -z ${VIASH_PAR_INDEX+x} ]; then echo "${VIASH_PAR_INDEX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_index='&'#" ; else echo "# par_index="; fi ) -$( if [ ! -z ${VIASH_PAR_COMPRESS_LEVEL+x} ]; then echo "${VIASH_PAR_COMPRESS_LEVEL}" | sed "s#'#'\\"'\\"'#g;s#.*#par_compress_level='&'#" ; else echo "# par_compress_level="; fi ) -$( if [ ! -z ${VIASH_PAR_REINDEX+x} ]; then echo "${VIASH_PAR_REINDEX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_reindex='&'#" ; else echo "# par_reindex="; fi ) -$( if [ ! -z ${VIASH_PAR_SIZE+x} ]; then echo "${VIASH_PAR_SIZE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_size='&'#" ; else echo "# par_size="; fi ) -$( if [ ! -z ${VIASH_PAR_TEST+x} ]; then echo "${VIASH_PAR_TEST}" | sed "s#'#'\\"'\\"'#g;s#.*#par_test='&'#" ; else echo "# par_test="; fi ) -$( if [ ! -z ${VIASH_PAR_BINARY+x} ]; then echo "${VIASH_PAR_BINARY}" | sed "s#'#'\\"'\\"'#g;s#.*#par_binary='&'#" ; else echo "# par_binary="; fi ) +$( if [ ! -z ${VIASH_PAR_TAB+x} ]; then echo "${VIASH_PAR_TAB}" | sed "s#'#'\\"'\\"'#g;s#.*#par_tab='&'#" ; else echo "# par_tab="; fi ) +$( if [ ! -z ${VIASH_PAR_BED_OUT+x} ]; then echo "${VIASH_PAR_BED_OUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_bed_out='&'#" ; else echo "# par_bed_out="; fi ) +$( if [ ! -z ${VIASH_PAR_NAME+x} ]; then echo "${VIASH_PAR_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#par_name='&'#" ; else echo "# par_name="; fi ) +$( if [ ! -z ${VIASH_PAR_NAME_ONLY+x} ]; then echo "${VIASH_PAR_NAME_ONLY}" | sed "s#'#'\\"'\\"'#g;s#.*#par_name_only='&'#" ; else echo "# par_name_only="; fi ) +$( if [ ! -z ${VIASH_PAR_SPLIT+x} ]; then echo "${VIASH_PAR_SPLIT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_split='&'#" ; else echo "# par_split="; fi ) +$( if [ ! -z ${VIASH_PAR_FULL_HEADER+x} ]; then echo "${VIASH_PAR_FULL_HEADER}" | sed "s#'#'\\"'\\"'#g;s#.*#par_full_header='&'#" ; else echo "# par_full_header="; fi ) $( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) $( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) $( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) @@ -3140,25 +3106,27 @@ $( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}" $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi ) ## VIASH END -[[ "\\$par_decompress" == "false" ]] && unset par_decompress -[[ "\\$par_rebgzip" == "false" ]] && unset par_rebgzip -[[ "\\$par_index" == "false" ]] && unset par_index -[[ "\\$par_reindex" == "false" ]] && unset par_reindex -[[ "\\$par_test" == "false" ]] && unset par_test -[[ "\\$par_binary" == "false" ]] && unset par_binary -bgzip -c \\\\ - \\${meta_cpus:+--threads "\\${meta_cpus}"} \\\\ - \\${par_offset:+-b "\\${par_offset}"} \\\\ - \\${par_decompress:+-d} \\\\ - \\${par_rebgzip:+-g} \\\\ - \\${par_index:+-i} \\\\ - \\${par_index_name:+-I "\\${par_index_name}"} \\\\ - \\${par_compress_level:+-l "\\${par_compress_level}"} \\\\ - \\${par_reindex:+-r} \\\\ - \\${par_size:+-s "\\${par_size}"} \\\\ - \\${par_test:+-t} \\\\ - \\${par_binary:+--binary} \\\\ - "\\$par_input" > "\\$par_output" +#!/usr/bin/env bash +set -eo pipefail + +unset_if_false=( par_rna par_strandedness par_tab par_bed_out par_name par_name_only par_split par_full_header ) + +for par in \\${unset_if_false[@]}; do + test_val="\\${!par}" + [[ "\\$test_val" == "false" ]] && unset \\$par +done + +bedtools getfasta \\\\ + -fi "\\$par_input_fasta" \\\\ + -bed "\\$par_input_bed" \\\\ + \\${par_rna:+-rna} \\\\ + \\${par_name:+-name} \\\\ + \\${par_name_only:+-nameOnly} \\\\ + \\${par_tab:+-tab} \\\\ + \\${par_bed_out:+-bedOut} \\\\ + \\${par_strandedness:+-s} \\\\ + \\${par_split:+-split} \\\\ + \\${par_full_header:+-fullHeader} > "\\$par_output" VIASHMAIN bash "$tempscript" ''' @@ -3514,8 +3482,8 @@ meta["defaults"] = [ directives: readJsonBlob('''{ "container" : { "registry" : "images.viash-hub.com", - "image" : "vsh/biobox/bgzip", - "tag" : "v0.1" + "image" : "vsh/biobox/bedtools/bedtools_getfasta", + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/bedtools/bedtools_getfasta/nextflow.config b/target/nextflow/bedtools/bedtools_getfasta/nextflow.config new file mode 100644 index 00000000..c014f253 --- /dev/null +++ b/target/nextflow/bedtools/bedtools_getfasta/nextflow.config @@ -0,0 +1,125 @@ +manifest { + name = 'bedtools/bedtools_getfasta' + mainScript = 'main.nf' + nextflowVersion = '!>=20.12.1-edge' + version = 'v0.1.0' + description = 'Extract sequences from a FASTA file for each of the intervals defined in a BED/GFF/VCF file.' +} + +process.container = 'nextflow/bash:latest' + +// detect tempdir +tempDir = java.nio.file.Paths.get( + System.getenv('NXF_TEMP') ?: + System.getenv('VIASH_TEMP') ?: + System.getenv('TEMPDIR') ?: + System.getenv('TMPDIR') ?: + '/tmp' +).toAbsolutePath() + +profiles { + no_publish { + process { + withName: '.*' { + publishDir = [ + enabled: false + ] + } + } + } + mount_temp { + docker.temp = tempDir + podman.temp = tempDir + charliecloud.temp = tempDir + } + docker { + docker.enabled = true + // docker.userEmulation = true + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + singularity { + singularity.enabled = true + singularity.autoMounts = true + docker.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + podman { + podman.enabled = true + docker.enabled = false + singularity.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + shifter { + shifter.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + charliecloud.enabled = false + } + charliecloud { + charliecloud.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + } +} + +process{ + withLabel: mem1gb { memory = 1000000000.B } + withLabel: mem2gb { memory = 2000000000.B } + withLabel: mem5gb { memory = 5000000000.B } + withLabel: mem10gb { memory = 10000000000.B } + withLabel: mem20gb { memory = 20000000000.B } + withLabel: mem50gb { memory = 50000000000.B } + withLabel: mem100gb { memory = 100000000000.B } + withLabel: mem200gb { memory = 200000000000.B } + withLabel: mem500gb { memory = 500000000000.B } + withLabel: mem1tb { memory = 1000000000000.B } + withLabel: mem2tb { memory = 2000000000000.B } + withLabel: mem5tb { memory = 5000000000000.B } + withLabel: mem10tb { memory = 10000000000000.B } + withLabel: mem20tb { memory = 20000000000000.B } + withLabel: mem50tb { memory = 50000000000000.B } + withLabel: mem100tb { memory = 100000000000000.B } + withLabel: mem200tb { memory = 200000000000000.B } + withLabel: mem500tb { memory = 500000000000000.B } + withLabel: mem1gib { memory = 1073741824.B } + withLabel: mem2gib { memory = 2147483648.B } + withLabel: mem4gib { memory = 4294967296.B } + withLabel: mem8gib { memory = 8589934592.B } + withLabel: mem16gib { memory = 17179869184.B } + withLabel: mem32gib { memory = 34359738368.B } + withLabel: mem64gib { memory = 68719476736.B } + withLabel: mem128gib { memory = 137438953472.B } + withLabel: mem256gib { memory = 274877906944.B } + withLabel: mem512gib { memory = 549755813888.B } + withLabel: mem1tib { memory = 1099511627776.B } + withLabel: mem2tib { memory = 2199023255552.B } + withLabel: mem4tib { memory = 4398046511104.B } + withLabel: mem8tib { memory = 8796093022208.B } + withLabel: mem16tib { memory = 17592186044416.B } + withLabel: mem32tib { memory = 35184372088832.B } + withLabel: mem64tib { memory = 70368744177664.B } + withLabel: mem128tib { memory = 140737488355328.B } + withLabel: mem256tib { memory = 281474976710656.B } + withLabel: mem512tib { memory = 562949953421312.B } + withLabel: cpu1 { cpus = 1 } + withLabel: cpu2 { cpus = 2 } + withLabel: cpu5 { cpus = 5 } + withLabel: cpu10 { cpus = 10 } + withLabel: cpu20 { cpus = 20 } + withLabel: cpu50 { cpus = 50 } + withLabel: cpu100 { cpus = 100 } + withLabel: cpu200 { cpus = 200 } + withLabel: cpu500 { cpus = 500 } + withLabel: cpu1000 { cpus = 1000 } +} + + diff --git a/target/nextflow/bgzip/nextflow_schema.json b/target/nextflow/bedtools/bedtools_getfasta/nextflow_schema.json similarity index 58% rename from target/nextflow/bgzip/nextflow_schema.json rename to target/nextflow/bedtools/bedtools_getfasta/nextflow_schema.json index 43475aec..c3f7e079 100644 --- a/target/nextflow/bgzip/nextflow_schema.json +++ b/target/nextflow/bedtools/bedtools_getfasta/nextflow_schema.json @@ -1,34 +1,76 @@ { "$schema": "http://json-schema.org/draft-07/schema", -"title": "bgzip", -"description": "Block compression/decompression utility", +"title": "bedtools_getfasta", +"description": "Extract sequences from a FASTA file for each of the intervals defined in a BED/GFF/VCF file.", "type": "object", "definitions": { - "inputs" : { - "title": "Inputs", + "input arguments" : { + "title": "Input arguments", "type": "object", "description": "No description", "properties": { - "input": { + "input_fasta": { "type": "string", - "description": "Type: `file`, required. file to be compressed or decompressed", - "help_text": "Type: `file`, required. file to be compressed or decompressed" + "description": "Type: `file`. FASTA file containing sequences for each interval specified in the input BED file", + "help_text": "Type: `file`. FASTA file containing sequences for each interval specified in the input BED file.\nThe headers in the input FASTA file must exactly match the chromosome column in the BED file.\n" } + , + "input_bed": { + "type": + "string", + "description": "Type: `file`. BED file containing intervals to extract from the FASTA file", + "help_text": "Type: `file`. BED file containing intervals to extract from the FASTA file.\nBED files containing a single region require a newline character\nat the end of the line, otherwise a blank output file is produced.\n" + + } + + + , + "rna": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. The FASTA is RNA not DNA", + "help_text": "Type: `boolean_true`, default: `false`. The FASTA is RNA not DNA. Reverse complementation handled accordingly.\n" + , + "default": "False" + } + + } }, - "outputs" : { - "title": "Outputs", + "run arguments" : { + "title": "Run arguments", + "type": "object", + "description": "No description", + "properties": { + + + "strandedness": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Force strandedness", + "help_text": "Type: `boolean_true`, default: `false`. Force strandedness. If the feature occupies the antisense strand, the output sequence will\nbe reverse complemented. By default strandedness is not taken into account.\n" + , + "default": "False" + } + + +} +}, + + + "output arguments" : { + "title": "Output arguments", "type": "object", "description": "No description", "properties": { @@ -37,125 +79,74 @@ "output": { "type": "string", - "description": "Type: `file`, required, default: `$id.$key.output.output`. compressed or decompressed output", - "help_text": "Type: `file`, required, default: `$id.$key.output.output`. compressed or decompressed output" + "description": "Type: `file`, required, default: `$id.$key.output.output`. Output file where the output from the \u0027bedtools getfasta\u0027 commend will\nbe written to", + "help_text": "Type: `file`, required, default: `$id.$key.output.output`. Output file where the output from the \u0027bedtools getfasta\u0027 commend will\nbe written to.\n" , "default": "$id.$key.output.output" } , - "index_name": { - "type": - "string", - "description": "Type: `file`, default: `$id.$key.index_name.index_name`. name of BGZF index file [file", - "help_text": "Type: `file`, default: `$id.$key.index_name.index_name`. name of BGZF index file [file.gz.gzi]" - , - "default": "$id.$key.index_name.index_name" - } - - -} -}, - - - "arguments" : { - "title": "Arguments", - "type": "object", - "description": "No description", - "properties": { - - - "offset": { - "type": - "integer", - "description": "Type: `integer`. decompress at virtual file pointer (0-based uncompressed offset)", - "help_text": "Type: `integer`. decompress at virtual file pointer (0-based uncompressed offset)" - - } - - - , - "decompress": { + "tab": { "type": "boolean", - "description": "Type: `boolean_true`, default: `false`. decompress the input file", - "help_text": "Type: `boolean_true`, default: `false`. decompress the input file" + "description": "Type: `boolean_true`, default: `false`. Report extract sequences in a tab-delimited format instead of in FASTA format", + "help_text": "Type: `boolean_true`, default: `false`. Report extract sequences in a tab-delimited format instead of in FASTA format.\n" , "default": "False" } , - "rebgzip": { + "bed_out": { "type": "boolean", - "description": "Type: `boolean_true`, default: `false`. use an index file to bgzip a file", - "help_text": "Type: `boolean_true`, default: `false`. use an index file to bgzip a file" + "description": "Type: `boolean_true`, default: `false`. Report extract sequences in a tab-delimited BED format instead of in FASTA format", + "help_text": "Type: `boolean_true`, default: `false`. Report extract sequences in a tab-delimited BED format instead of in FASTA format.\n" , "default": "False" } , - "index": { + "name": { "type": "boolean", - "description": "Type: `boolean_true`, default: `false`. compress and create BGZF index", - "help_text": "Type: `boolean_true`, default: `false`. compress and create BGZF index" + "description": "Type: `boolean_true`, default: `false`. Set the FASTA header for each extracted sequence to be the \"name\" and coordinate columns from the BED feature", + "help_text": "Type: `boolean_true`, default: `false`. Set the FASTA header for each extracted sequence to be the \"name\" and coordinate columns from the BED feature.\n" , "default": "False" } , - "compress_level": { - "type": - "integer", - "description": "Type: `integer`. compression level to use when compressing; 0 to 9, or -1 for default [-1]", - "help_text": "Type: `integer`. compression level to use when compressing; 0 to 9, or -1 for default [-1]" - - } - - - , - "reindex": { + "name_only": { "type": "boolean", - "description": "Type: `boolean_true`, default: `false`. (re)index the output file", - "help_text": "Type: `boolean_true`, default: `false`. (re)index the output file" + "description": "Type: `boolean_true`, default: `false`. Set the FASTA header for each extracted sequence to be the \"name\" columns from the BED feature", + "help_text": "Type: `boolean_true`, default: `false`. Set the FASTA header for each extracted sequence to be the \"name\" columns from the BED feature.\n" , "default": "False" } , - "size": { - "type": - "integer", - "description": "Type: `integer`. decompress INT bytes (uncompressed size)", - "help_text": "Type: `integer`. decompress INT bytes (uncompressed size)" - - } - - - , - "test": { + "split": { "type": "boolean", - "description": "Type: `boolean_true`, default: `false`. test integrity of compressed file", - "help_text": "Type: `boolean_true`, default: `false`. test integrity of compressed file" + "description": "Type: `boolean_true`, default: `false`. When --input is in BED12 format, create a separate fasta entry for each block in a BED12 record,\nblocks being described in the 11th and 12th column of the BED", + "help_text": "Type: `boolean_true`, default: `false`. When --input is in BED12 format, create a separate fasta entry for each block in a BED12 record,\nblocks being described in the 11th and 12th column of the BED.\n" , "default": "False" } , - "binary": { + "full_header": { "type": "boolean", - "description": "Type: `boolean_true`, default: `false`. Don\u0027t align blocks with text lines", - "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t align blocks with text lines" + "description": "Type: `boolean_true`, default: `false`. Use full fasta header", + "help_text": "Type: `boolean_true`, default: `false`. Use full fasta header. By default, only the word before the first space or tab is used.\n" , "default": "False" } @@ -198,15 +189,15 @@ "allOf": [ { - "$ref": "#/definitions/inputs" + "$ref": "#/definitions/input arguments" }, { - "$ref": "#/definitions/outputs" + "$ref": "#/definitions/run arguments" }, { - "$ref": "#/definitions/arguments" + "$ref": "#/definitions/output arguments" }, { diff --git a/target/nextflow/busco/busco_download_datasets/.config.vsh.yaml b/target/nextflow/busco/busco_download_datasets/.config.vsh.yaml index 4dbb45ed..964f0742 100644 --- a/target/nextflow/busco/busco_download_datasets/.config.vsh.yaml +++ b/target/nextflow/busco/busco_download_datasets/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "busco_download_datasets" namespace: "busco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -127,7 +127,7 @@ engines: id: "docker" image: "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -144,11 +144,11 @@ build_info: output: "target/nextflow/busco/busco_download_datasets" executable: "target/nextflow/busco/busco_download_datasets/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -158,16 +158,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/busco/busco_download_datasets/main.nf b/target/nextflow/busco/busco_download_datasets/main.nf index 71b61dc4..b4dc8383 100644 --- a/target/nextflow/busco/busco_download_datasets/main.nf +++ b/target/nextflow/busco/busco_download_datasets/main.nf @@ -1,4 +1,4 @@ -// busco_download_datasets v0.1 +// busco_download_datasets v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "busco_download_datasets", "namespace" : "busco", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -2937,7 +2937,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -2959,12 +2959,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/busco/busco_download_datasets", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -2973,20 +2973,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3394,7 +3391,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/busco/busco_download_datasets", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/busco/busco_download_datasets/nextflow.config b/target/nextflow/busco/busco_download_datasets/nextflow.config index 94535fee..9b02f8b2 100644 --- a/target/nextflow/busco/busco_download_datasets/nextflow.config +++ b/target/nextflow/busco/busco_download_datasets/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'busco/busco_download_datasets' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Downloads available busco datasets' } diff --git a/target/nextflow/busco/busco_list_datasets/.config.vsh.yaml b/target/nextflow/busco/busco_list_datasets/.config.vsh.yaml index 7fa785bd..1c66c6f7 100644 --- a/target/nextflow/busco/busco_list_datasets/.config.vsh.yaml +++ b/target/nextflow/busco/busco_list_datasets/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "busco_list_datasets" namespace: "busco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Outputs" arguments: @@ -114,7 +114,7 @@ engines: id: "docker" image: "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -131,11 +131,11 @@ build_info: output: "target/nextflow/busco/busco_list_datasets" executable: "target/nextflow/busco/busco_list_datasets/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -145,16 +145,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/busco/busco_list_datasets/main.nf b/target/nextflow/busco/busco_list_datasets/main.nf index 4498c207..0304e033 100644 --- a/target/nextflow/busco/busco_list_datasets/main.nf +++ b/target/nextflow/busco/busco_list_datasets/main.nf @@ -1,4 +1,4 @@ -// busco_list_datasets v0.1 +// busco_list_datasets v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "busco_list_datasets", "namespace" : "busco", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Outputs", @@ -2923,7 +2923,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -2945,12 +2945,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/busco/busco_list_datasets", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -2959,20 +2959,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3371,7 +3368,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/busco/busco_list_datasets", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/busco/busco_list_datasets/nextflow.config b/target/nextflow/busco/busco_list_datasets/nextflow.config index b61d68c5..10b3265e 100644 --- a/target/nextflow/busco/busco_list_datasets/nextflow.config +++ b/target/nextflow/busco/busco_list_datasets/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'busco/busco_list_datasets' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Lists the available busco datasets' } diff --git a/target/nextflow/busco/busco_run/.config.vsh.yaml b/target/nextflow/busco/busco_run/.config.vsh.yaml index 6c34f418..4539d4d7 100644 --- a/target/nextflow/busco/busco_run/.config.vsh.yaml +++ b/target/nextflow/busco/busco_run/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "busco_run" namespace: "busco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -387,7 +387,7 @@ engines: id: "docker" image: "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -404,11 +404,11 @@ build_info: output: "target/nextflow/busco/busco_run" executable: "target/nextflow/busco/busco_run/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -418,16 +418,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/busco/busco_run/main.nf b/target/nextflow/busco/busco_run/main.nf index 2c68dd7f..26d4fcef 100644 --- a/target/nextflow/busco/busco_run/main.nf +++ b/target/nextflow/busco/busco_run/main.nf @@ -1,4 +1,4 @@ -// busco_run v0.1 +// busco_run v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "busco_run", "namespace" : "busco", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3229,7 +3229,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3251,12 +3251,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/busco/busco_run", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3265,20 +3265,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3767,7 +3764,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/busco/busco_run", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/busco/busco_run/nextflow.config b/target/nextflow/busco/busco_run/nextflow.config index bd6490b8..38283a13 100644 --- a/target/nextflow/busco/busco_run/nextflow.config +++ b/target/nextflow/busco/busco_run/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'busco/busco_run' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Assessment of genome assembly and annotation completeness with single copy orthologs' } diff --git a/target/nextflow/cutadapt/.config.vsh.yaml b/target/nextflow/cutadapt/.config.vsh.yaml new file mode 100644 index 00000000..d26efaf8 --- /dev/null +++ b/target/nextflow/cutadapt/.config.vsh.yaml @@ -0,0 +1,733 @@ +name: "cutadapt" +version: "v0.1.0" +argument_groups: +- name: "Specify Adapters for R1" + arguments: + - type: "string" + name: "--adapter" + alternatives: + - "-a" + description: "Sequence of an adapter ligated to the 3' end (paired data:\nof the\ + \ first read). The adapter and subsequent bases are\ntrimmed. If a '$' character\ + \ is appended ('anchoring'), the\nadapter is only found if it is a suffix of\ + \ the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--front" + alternatives: + - "-g" + description: "Sequence of an adapter ligated to the 5' end (paired data:\nof the\ + \ first read). The adapter and any preceding bases\nare trimmed. Partial matches\ + \ at the 5' end are allowed. If\na '^' character is prepended ('anchoring'),\ + \ the adapter is\nonly found if it is a prefix of the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--anywhere" + alternatives: + - "-b" + description: "Sequence of an adapter that may be ligated to the 5' or 3'\nend\ + \ (paired data: of the first read). Both types of\nmatches as described under\ + \ -a and -g are allowed. If the\nfirst base of the read is part of the match,\ + \ the behavior\nis as with -g, otherwise as with -a. This option is mostly\n\ + for rescuing failed library preparations - do not use if\nyou know which end\ + \ your adapter was ligated to!\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" +- name: "Specify Adapters using Fasta files for R1" + arguments: + - type: "file" + name: "--adapter_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 3'\ + \ end (paired data:\nof the first read). The adapter and subsequent bases are\n\ + trimmed. If a '$' character is appended ('anchoring'), the\nadapter is only\ + \ found if it is a suffix of the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "file" + name: "--front_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 5'\ + \ end (paired data:\nof the first read). The adapter and any preceding bases\n\ + are trimmed. Partial matches at the 5' end are allowed. If\na '^' character\ + \ is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of\ + \ the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--anywhere_fasta" + description: "Fasta file containing sequences of an adapter that may be ligated\ + \ to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches\ + \ as described under -a and -g are allowed. If the\nfirst base of the read is\ + \ part of the match, the behavior\nis as with -g, otherwise as with -a. This\ + \ option is mostly\nfor rescuing failed library preparations - do not use if\n\ + you know which end your adapter was ligated to!\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" +- name: "Specify Adapters for R2" + arguments: + - type: "string" + name: "--adapter_r2" + alternatives: + - "-A" + description: "Sequence of an adapter ligated to the 3' end (paired data:\nof the\ + \ first read). The adapter and subsequent bases are\ntrimmed. If a '$' character\ + \ is appended ('anchoring'), the\nadapter is only found if it is a suffix of\ + \ the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--front_r2" + alternatives: + - "-G" + description: "Sequence of an adapter ligated to the 5' end (paired data:\nof the\ + \ first read). The adapter and any preceding bases\nare trimmed. Partial matches\ + \ at the 5' end are allowed. If\na '^' character is prepended ('anchoring'),\ + \ the adapter is\nonly found if it is a prefix of the read.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--anywhere_r2" + alternatives: + - "-B" + description: "Sequence of an adapter that may be ligated to the 5' or 3'\nend\ + \ (paired data: of the first read). Both types of\nmatches as described under\ + \ -a and -g are allowed. If the\nfirst base of the read is part of the match,\ + \ the behavior\nis as with -g, otherwise as with -a. This option is mostly\n\ + for rescuing failed library preparations - do not use if\nyou know which end\ + \ your adapter was ligated to!\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" +- name: "Specify Adapters using Fasta files for R2" + arguments: + - type: "file" + name: "--adapter_r2_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 3'\ + \ end (paired data:\nof the first read). The adapter and subsequent bases are\n\ + trimmed. If a '$' character is appended ('anchoring'), the\nadapter is only\ + \ found if it is a suffix of the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--front_r2_fasta" + description: "Fasta file containing sequences of an adapter ligated to the 5'\ + \ end (paired data:\nof the first read). The adapter and any preceding bases\n\ + are trimmed. Partial matches at the 5' end are allowed. If\na '^' character\ + \ is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of\ + \ the read.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--anywhere_r2_fasta" + description: "Fasta file containing sequences of an adapter that may be ligated\ + \ to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches\ + \ as described under -a and -g are allowed. If the\nfirst base of the read is\ + \ part of the match, the behavior\nis as with -g, otherwise as with -a. This\ + \ option is mostly\nfor rescuing failed library preparations - do not use if\n\ + you know which end your adapter was ligated to!\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" +- name: "Paired-end options" + arguments: + - type: "boolean_true" + name: "--pair_adapters" + description: "Treat adapters given with -a/-A etc. as pairs. Either both\nor none\ + \ are removed from each read pair.\n" + info: null + direction: "input" + - type: "string" + name: "--pair_filter" + description: "Which of the reads in a paired-end read have to match the\nfiltering\ + \ criterion in order for the pair to be filtered.\n" + info: null + required: false + choices: + - "any" + - "both" + - "first" + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--interleaved" + description: "Read and/or write interleaved paired-end reads.\n" + info: null + direction: "input" +- name: "Input parameters" + arguments: + - type: "file" + name: "--input" + description: "Input fastq file for single-end reads or R1 for paired-end reads.\n" + info: null + must_exist: true + create_parent: true + required: true + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--input_r2" + description: "Input fastq file for R2 in the case of paired-end reads.\n" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "double" + name: "--error_rate" + alternatives: + - "-E" + - "--errors" + description: "Maximum allowed error rate (if 0 <= E < 1), or absolute\nnumber\ + \ of errors for full-length adapter match (if E is an\ninteger >= 1). Error\ + \ rate = no. of errors divided by\nlength of matching region. Default: 0.1 (10%).\n" + info: null + example: + - 0.1 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_false" + name: "--no_indels" + description: "Allow only mismatches in alignments.\n" + info: null + direction: "input" + - type: "integer" + name: "--times" + alternatives: + - "-n" + description: "Remove up to COUNT adapters from each read. Default: 1.\n" + info: null + example: + - 1 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--overlap" + alternatives: + - "-O" + description: "Require MINLENGTH overlap between read and adapter for an\nadapter\ + \ to be found. The default is 3.\n" + info: null + example: + - 3 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--match_read_wildcards" + description: "Interpret IUPAC wildcards in reads.\n" + info: null + direction: "input" + - type: "boolean_false" + name: "--no_match_adapter_wildcards" + description: "Do not interpret IUPAC wildcards in adapters.\n" + info: null + direction: "input" + - type: "string" + name: "--action" + description: "What to do if a match was found. trim: trim adapter and\nup- or\ + \ downstream sequence; retain: trim, but retain\nadapter; mask: replace with\ + \ 'N' characters; lowercase:\nconvert to lowercase; none: leave unchanged.\n\ + The default is trim.\n" + info: null + example: + - "trim" + required: false + choices: + - "trim" + - "retain" + - "mask" + - "lowercase" + - "none" + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--revcomp" + alternatives: + - "--rc" + description: "Check both the read and its reverse complement for adapter\nmatches.\ + \ If match is on reverse-complemented version,\noutput that one.\n" + info: null + direction: "input" +- name: "Read modifications" + arguments: + - type: "integer" + name: "--cut" + alternatives: + - "-u" + description: "Remove LEN bases from each read (or R1 if paired; use --cut_r2\n\ + option for R2). If LEN is positive, remove bases from the\nbeginning. If LEN\ + \ is negative, remove bases from the end.\nCan be used twice if LENs have different\ + \ signs. Applied\n*before* adapter trimming.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "integer" + name: "--cut_r2" + description: "Remove LEN bases from each read (for R2). If LEN is positive, remove\ + \ bases from the\nbeginning. If LEN is negative, remove bases from the end.\n\ + Can be used twice if LENs have different signs. Applied\n*before* adapter trimming.\n" + info: null + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--nextseq_trim" + description: "NextSeq-specific quality trimming (each read). Trims also\ndark\ + \ cycles appearing as high-quality G bases.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--quality_cutoff" + alternatives: + - "-q" + description: "Trim low-quality bases from 5' and/or 3' ends of each read\nbefore\ + \ adapter removal. Applied to both reads if data is\npaired. If one value is\ + \ given, only the 3' end is trimmed.\nIf two comma-separated cutoffs are given,\ + \ the 5' end is\ntrimmed with the first cutoff, the 3' end with the second.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--quality_cutoff_r2" + alternatives: + - "-Q" + description: "Quality-trimming cutoff for R2. Default: same as for R1\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--quality_base" + description: "Assume that quality values in FASTQ are encoded as\nascii(quality\ + \ + N). This needs to be set to 64 for some\nold Illumina FASTQ files. The default\ + \ is 33.\n" + info: null + example: + - 33 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--poly_a" + description: "Trim poly-A tails" + info: null + direction: "input" + - type: "integer" + name: "--length" + alternatives: + - "-l" + description: "Shorten reads to LENGTH. Positive values remove bases at\nthe end\ + \ while negative ones remove bases at the beginning.\nThis and the following\ + \ modifications are applied after\nadapter trimming.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--trim_n" + description: "Trim N's on ends of reads." + info: null + direction: "input" + - type: "string" + name: "--length_tag" + description: "Search for TAG followed by a decimal number in the\ndescription\ + \ field of the read. Replace the decimal number\nwith the correct length of\ + \ the trimmed read. For example,\nuse --length-tag 'length=' to correct fields\ + \ like\n'length=123'.\n" + info: null + example: + - "length=" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--strip_suffix" + description: "Remove this suffix from read names if present. Can be\ngiven multiple\ + \ times.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--prefix" + alternatives: + - "-x" + description: "Add this prefix to read names. Use {name} to insert the\nname of\ + \ the matching adapter.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--suffix" + alternatives: + - "-y" + description: "Add this suffix to read names; can also include {name}\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--rename" + description: "Rename reads using TEMPLATE containing variables such as\n{id},\ + \ {adapter_name} etc. (see documentation)\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--zero_cap" + alternatives: + - "-z" + description: "Change negative quality values to zero." + info: null + direction: "input" +- name: "Filtering of processed reads" + description: "Filters are applied after above read modifications. Paired-end reads\ + \ are\nalways discarded pairwise (see also --pair_filter).\n" + arguments: + - type: "string" + name: "--minimum_length" + alternatives: + - "-m" + description: "Discard reads shorter than LEN. Default is 0.\nWhen trimming paired-end\ + \ reads, the minimum lengths for R1 and R2 can be specified separately by separating\ + \ them with a colon (:).\nIf the colon syntax is not used, the same minimum\ + \ length applies to both reads, as discussed above.\nAlso, one of the values\ + \ can be omitted to impose no restrictions.\nFor example, with -m 17:, the length\ + \ of R1 must be at least 17, but the length of R2 is ignored.\n" + info: null + example: + - "0" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--maximum_length" + alternatives: + - "-M" + description: "Discard reads longer than LEN. Default: no limit.\nFor paired reads,\ + \ see the remark for --minimum_length\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--max_n" + description: "Discard reads with more than COUNT 'N' bases. If COUNT is\na number\ + \ between 0 and 1, it is interpreted as a fraction\nof the read length.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "long" + name: "--max_expected_errors" + alternatives: + - "--max_ee" + description: "Discard reads whose expected number of errors (computed\nfrom quality\ + \ values) exceeds ERRORS.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "long" + name: "--max_average_error_rate" + alternatives: + - "--max_aer" + description: "as --max_expected_errors (see above), but divided by\nlength to\ + \ account for reads of varying length.\n" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--discard_trimmed" + alternatives: + - "--discard" + description: "Discard reads that contain an adapter. Use also -O to\navoid discarding\ + \ too many randomly matching reads.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--discard_untrimmed" + alternatives: + - "--trimmed_only" + description: "Discard reads that do not contain an adapter.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--discard_casava" + description: "Discard reads that did not pass CASAVA filtering (header\nhas :Y:).\n" + info: null + direction: "input" +- name: "Output parameters" + arguments: + - type: "string" + name: "--report" + description: "Which type of report to print: 'full' (default) or 'minimal'.\n" + info: null + example: + - "full" + required: false + choices: + - "full" + - "minimal" + direction: "input" + multiple: false + multiple_sep: ";" + - type: "boolean_true" + name: "--json" + description: "Write report in JSON format to this file.\n" + info: null + direction: "input" + - type: "file" + name: "--output" + description: "Glob pattern for matching the expected output files.\nShould include\ + \ `$output_dir`.\n" + info: null + example: + - "fastq/*_001.fast[a,q]" + must_exist: true + create_parent: true + required: true + direction: "output" + multiple: true + multiple_sep: ";" + - type: "boolean_true" + name: "--fasta" + description: "Output FASTA to standard output even on FASTQ input.\n" + info: null + direction: "input" + - type: "boolean_true" + name: "--info_file" + description: "Write information about each read and its adapter matches\ninto\ + \ info.txt in the output directory.\nSee the documentation for the file format.\n" + info: null + direction: "input" +- name: "Debug" + arguments: + - type: "boolean_true" + name: "--debug" + description: "Print debug information" + info: null + direction: "input" +resources: +- type: "bash_script" + path: "script.sh" + is_executable: true +description: "Cutadapt removes adapter sequences from high-throughput sequencing reads.\n" +test_resources: +- type: "bash_script" + path: "test.sh" + is_executable: true +info: null +status: "enabled" +requirements: + commands: + - "ps" +keywords: +- "RNA-seq" +- "scRNA-seq" +- "high-throughput" +license: "MIT" +references: + doi: + - "10.14806/ej.17.1.200" +links: + repository: "https://github.com/marcelm/cutadapt" + homepage: "https://cutadapt.readthedocs.io" + documentation: "https://cutadapt.readthedocs.io" +runners: +- type: "executable" + id: "executable" + docker_setup_strategy: "ifneedbepullelsecachedbuild" +- type: "nextflow" + id: "nextflow" + directives: + tag: "$id" + auto: + simplifyInput: true + simplifyOutput: false + transcript: false + publish: false + config: + labels: + mem1gb: "memory = 1000000000.B" + mem2gb: "memory = 2000000000.B" + mem5gb: "memory = 5000000000.B" + mem10gb: "memory = 10000000000.B" + mem20gb: "memory = 20000000000.B" + mem50gb: "memory = 50000000000.B" + mem100gb: "memory = 100000000000.B" + mem200gb: "memory = 200000000000.B" + mem500gb: "memory = 500000000000.B" + mem1tb: "memory = 1000000000000.B" + mem2tb: "memory = 2000000000000.B" + mem5tb: "memory = 5000000000000.B" + mem10tb: "memory = 10000000000000.B" + mem20tb: "memory = 20000000000000.B" + mem50tb: "memory = 50000000000000.B" + mem100tb: "memory = 100000000000000.B" + mem200tb: "memory = 200000000000000.B" + mem500tb: "memory = 500000000000000.B" + mem1gib: "memory = 1073741824.B" + mem2gib: "memory = 2147483648.B" + mem4gib: "memory = 4294967296.B" + mem8gib: "memory = 8589934592.B" + mem16gib: "memory = 17179869184.B" + mem32gib: "memory = 34359738368.B" + mem64gib: "memory = 68719476736.B" + mem128gib: "memory = 137438953472.B" + mem256gib: "memory = 274877906944.B" + mem512gib: "memory = 549755813888.B" + mem1tib: "memory = 1099511627776.B" + mem2tib: "memory = 2199023255552.B" + mem4tib: "memory = 4398046511104.B" + mem8tib: "memory = 8796093022208.B" + mem16tib: "memory = 17592186044416.B" + mem32tib: "memory = 35184372088832.B" + mem64tib: "memory = 70368744177664.B" + mem128tib: "memory = 140737488355328.B" + mem256tib: "memory = 281474976710656.B" + mem512tib: "memory = 562949953421312.B" + cpu1: "cpus = 1" + cpu2: "cpus = 2" + cpu5: "cpus = 5" + cpu10: "cpus = 10" + cpu20: "cpus = 20" + cpu50: "cpus = 50" + cpu100: "cpus = 100" + cpu200: "cpus = 200" + cpu500: "cpus = 500" + cpu1000: "cpus = 1000" + debug: false + container: "docker" +engines: +- type: "docker" + id: "docker" + image: "python:3.12" + target_registry: "images.viash-hub.com" + target_tag: "v0.1.0" + namespace_separator: "/" + setup: + - type: "python" + user: false + pip: + - "cutadapt" + upgrade: true + - type: "docker" + run: + - "cutadapt --version | sed 's/\\(.*\\)/cutadapt: \"\\1\"/' > /var/software_versions.txt\n" + entrypoint: [] + cmd: null +- type: "native" + id: "native" +build_info: + config: "src/cutadapt/config.vsh.yaml" + runner: "nextflow" + engine: "docker|native" + output: "target/nextflow/cutadapt" + executable: "target/nextflow/cutadapt/main.nf" + viash_version: "0.9.0-RC6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" + git_remote: "https://github.com/viash-hub/biobox" +package_config: + name: "biobox" + version: "v0.1.0" + description: "A collection of bioinformatics tools for working with sequence data.\n" + info: null + viash_version: "0.9.0-RC6" + source: "src" + target: "target" + config_mods: + - ".requirements.commands := ['ps']\n" + - ".engines += { type: \"native\" }" + - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" + keywords: + - "bioinformatics" + - "modules" + - "sequencing" + license: "MIT" + organization: "vsh" + links: + repository: "https://github.com/viash-hub/biobox" + issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/cutadapt/main.nf b/target/nextflow/cutadapt/main.nf new file mode 100644 index 00000000..8956722f --- /dev/null +++ b/target/nextflow/cutadapt/main.nf @@ -0,0 +1,4371 @@ +// cutadapt v0.1.0 +// +// This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a +// derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from +// Data Intuitive. +// +// The component may contain files which fall under a different license. The +// authors of this component should specify the license in the header of such +// files, or include a separate license file detailing the licenses of all included +// files. + +//////////////////////////// +// VDSL3 helper functions // +//////////////////////////// + +// helper file: 'src/main/resources/io/viash/runners/nextflow/arguments/_checkArgumentType.nf' +class UnexpectedArgumentTypeException extends Exception { + String errorIdentifier + String stage + String plainName + String expectedClass + String foundClass + + // ${key ? " in module '$key'" : ""}${id ? " id '$id'" : ""} + UnexpectedArgumentTypeException(String errorIdentifier, String stage, String plainName, String expectedClass, String foundClass) { + super("Error${errorIdentifier ? " $errorIdentifier" : ""}:${stage ? " $stage" : "" } argument '${plainName}' has the wrong type. " + + "Expected type: ${expectedClass}. Found type: ${foundClass}") + this.errorIdentifier = errorIdentifier + this.stage = stage + this.plainName = plainName + this.expectedClass = expectedClass + this.foundClass = foundClass + } +} + +/** + * Checks if the given value is of the expected type. If not, an exception is thrown. + * + * @param stage The stage of the argument (input or output) + * @param par The parameter definition + * @param value The value to check + * @param errorIdentifier The identifier to use in the error message + * @return The value, if it is of the expected type + * @throws UnexpectedArgumentTypeException If the value is not of the expected type +*/ +def _checkArgumentType(String stage, Map par, Object value, String errorIdentifier) { + // expectedClass will only be != null if value is not of the expected type + def expectedClass = null + def foundClass = null + + // todo: split if need be + + if (!par.required && value == null) { + expectedClass = null + } else if (par.multiple) { + if (value !instanceof Collection) { + value = [value] + } + + // split strings + value = value.collectMany{ val -> + if (val instanceof String) { + // collect() to ensure that the result is a List and not simply an array + val.split(par.multiple_sep).collect() + } else { + [val] + } + } + + // process globs + if (par.type == "file" && par.direction == "input") { + value = value.collect{ it instanceof String ? file(it, hidden: true) : it }.flatten() + } + + // check types of elements in list + try { + value = value.collect { listVal -> + _checkArgumentType(stage, par + [multiple: false], listVal, errorIdentifier) + } + } catch (UnexpectedArgumentTypeException e) { + expectedClass = "List[${e.expectedClass}]" + foundClass = "List[${e.foundClass}]" + } + } else if (par.type == "string") { + // cast to string if need be + if (value instanceof GString) { + value = value.toString() + } + expectedClass = value instanceof String ? null : "String" + } else if (par.type == "integer") { + // cast to integer if need be + if (value instanceof String) { + try { + value = value.toInteger() + } catch (NumberFormatException e) { + // do nothing + } + } + if (value instanceof java.math.BigInteger) { + value = value.intValue() + } + expectedClass = value instanceof Integer ? null : "Integer" + } else if (par.type == "long") { + // cast to long if need be + if (value instanceof String) { + try { + value = value.toLong() + } catch (NumberFormatException e) { + // do nothing + } + } + if (value instanceof Integer) { + value = value.toLong() + } + expectedClass = value instanceof Long ? null : "Long" + } else if (par.type == "double") { + // cast to double if need be + if (value instanceof String) { + try { + value = value.toDouble() + } catch (NumberFormatException e) { + // do nothing + } + } + if (value instanceof java.math.BigDecimal) { + value = value.doubleValue() + } + if (value instanceof Float) { + value = value.toDouble() + } + expectedClass = value instanceof Double ? null : "Double" + } else if (par.type == "boolean" | par.type == "boolean_true" | par.type == "boolean_false") { + // cast to boolean if need be + if (value instanceof String) { + def valueLower = value.toLowerCase() + if (valueLower == "true") { + value = true + } else if (valueLower == "false") { + value = false + } + } + expectedClass = value instanceof Boolean ? null : "Boolean" + } else if (par.type == "file" && (par.direction == "input" || stage == "output")) { + // cast to path if need be + if (value instanceof String) { + value = file(value, hidden: true) + } + if (value instanceof File) { + value = value.toPath() + } + expectedClass = value instanceof Path ? null : "Path" + } else if (par.type == "file" && stage == "input" && par.direction == "output") { + // cast to string if need be + if (value instanceof GString) { + value = value.toString() + } + expectedClass = value instanceof String ? null : "String" + } else { + // didn't find a match for par.type + expectedClass = par.type + } + + if (expectedClass != null) { + if (foundClass == null) { + foundClass = value.getClass().getName() + } + throw new UnexpectedArgumentTypeException(errorIdentifier, stage, par.plainName, expectedClass, foundClass) + } + + return value +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/arguments/_processInputValues.nf' +Map _processInputValues(Map inputs, Map config, String id, String key) { + if (!workflow.stubRun) { + config.allArguments.each { arg -> + if (arg.required) { + assert inputs.containsKey(arg.plainName) && inputs.get(arg.plainName) != null : + "Error in module '${key}' id '${id}': required input argument '${arg.plainName}' is missing" + } + } + + inputs = inputs.collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && (it.direction == "input" || it.type == "file") } + assert par != null : "Error in module '${key}' id '${id}': '${name}' is not a valid input argument" + + value = _checkArgumentType("input", par, value, "in module '$key' id '$id'") + + [ name, value ] + } + } + return inputs +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/arguments/_processOutputValues.nf' +Map _processOutputValues(Map outputs, Map config, String id, String key) { + if (!workflow.stubRun) { + config.allArguments.each { arg -> + if (arg.direction == "output" && arg.required) { + assert outputs.containsKey(arg.plainName) && outputs.get(arg.plainName) != null : + "Error in module '${key}' id '${id}': required output argument '${arg.plainName}' is missing" + } + } + + outputs = outputs.collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && it.direction == "output" } + assert par != null : "Error in module '${key}' id '${id}': '${name}' is not a valid output argument" + + value = _checkArgumentType("output", par, value, "in module '$key' id '$id'") + + [ name, value ] + } + } + return outputs +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/IDChecker.nf' +class IDChecker { + final def items = [] as Set + + @groovy.transform.WithWriteLock + boolean observe(String item) { + if (items.contains(item)) { + return false + } else { + items << item + return true + } + } + + @groovy.transform.WithReadLock + boolean contains(String item) { + return items.contains(item) + } + + @groovy.transform.WithReadLock + Set getItems() { + return items.clone() + } +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_checkUniqueIds.nf' + +/** + * Check if the ids are unique across parameter sets + * + * @param parameterSets a list of parameter sets. + */ +private void _checkUniqueIds(List>> parameterSets) { + def ppIds = parameterSets.collect{it[0]} + assert ppIds.size() == ppIds.unique().size() : "All argument sets should have unique ids. Detected ids: $ppIds" +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_getChild.nf' + +// helper functions for reading params from file // +def _getChild(parent, child) { + if (child.contains("://") || java.nio.file.Paths.get(child).isAbsolute()) { + child + } else { + def parentAbsolute = java.nio.file.Paths.get(parent).toAbsolutePath().toString() + parentAbsolute.replaceAll('/[^/]*$', "/") + child + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_parseParamList.nf' +/** + * Figure out the param list format based on the file extension + * + * @param param_list A String containing the path to the parameter list file. + * + * @return A String containing the format of the parameter list file. + */ +def _paramListGuessFormat(param_list) { + if (param_list !instanceof String) { + "asis" + } else if (param_list.endsWith(".csv")) { + "csv" + } else if (param_list.endsWith(".json") || param_list.endsWith(".jsn")) { + "json" + } else if (param_list.endsWith(".yaml") || param_list.endsWith(".yml")) { + "yaml" + } else { + "yaml_blob" + } +} + + +/** + * Read the param list + * + * @param param_list One of the following: + * - A String containing the path to the parameter list file (csv, json or yaml), + * - A yaml blob of a list of maps (yaml_blob), + * - Or a groovy list of maps (asis). + * @param config A Map of the Viash configuration. + * + * @return A List of Maps containing the parameters. + */ +def _parseParamList(param_list, Map config) { + // first determine format by extension + def paramListFormat = _paramListGuessFormat(param_list) + + def paramListPath = (paramListFormat != "asis" && paramListFormat != "yaml_blob") ? + file(param_list, hidden: true) : + null + + // get the correct parser function for the detected params_list format + def paramSets = [] + if (paramListFormat == "asis") { + paramSets = param_list + } else if (paramListFormat == "yaml_blob") { + paramSets = readYamlBlob(param_list) + } else if (paramListFormat == "yaml") { + paramSets = readYaml(paramListPath) + } else if (paramListFormat == "json") { + paramSets = readJson(paramListPath) + } else if (paramListFormat == "csv") { + paramSets = readCsv(paramListPath) + } else { + error "Format of provided --param_list not recognised.\n" + + "Found: '$paramListFormat'.\n" + + "Expected: a csv file, a json file, a yaml file,\n" + + "a yaml blob or a groovy list of maps." + } + + // data checks + assert paramSets instanceof List: "--param_list should contain a list of maps" + for (value in paramSets) { + assert value instanceof Map: "--param_list should contain a list of maps" + } + + // id is argument + def idIsArgument = config.allArguments.any{it.plainName == "id"} + + // Reformat from List to List> by adding the ID as first element of a Tuple2 + paramSets = paramSets.collect({ data -> + def id = data.id + if (!idIsArgument) { + data = data.findAll{k, v -> k != "id"} + } + [id, data] + }) + + // Split parameters with 'multiple: true' + paramSets = paramSets.collect({ id, data -> + data = _splitParams(data, config) + [id, data] + }) + + // The paths of input files inside a param_list file may have been specified relatively to the + // location of the param_list file. These paths must be made absolute. + if (paramListPath) { + paramSets = paramSets.collect({ id, data -> + def new_data = data.collectEntries{ parName, parValue -> + def par = config.allArguments.find{it.plainName == parName} + if (par && par.type == "file" && par.direction == "input") { + if (parValue instanceof Collection) { + parValue = parValue.collectMany{path -> + def x = _resolveSiblingIfNotAbsolute(path, paramListPath) + x instanceof Collection ? x : [x] + } + } else { + parValue = _resolveSiblingIfNotAbsolute(parValue, paramListPath) + } + } + [parName, parValue] + } + [id, new_data] + }) + } + + return paramSets +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_splitParams.nf' +/** + * Split parameters for arguments that accept multiple values using their separator + * + * @param paramList A Map containing parameters to split. + * @param config A Map of the Viash configuration. This Map can be generated from the config file + * using the readConfig() function. + * + * @return A Map of parameters where the parameter values have been split into a list using + * their seperator. + */ +Map _splitParams(Map parValues, Map config){ + def parsedParamValues = parValues.collectEntries { parName, parValue -> + def parameterSettings = config.allArguments.find({it.plainName == parName}) + + if (!parameterSettings) { + // if argument is not found, do not alter + return [parName, parValue] + } + if (parameterSettings.multiple) { // Check if parameter can accept multiple values + if (parValue instanceof Collection) { + parValue = parValue.collect{it instanceof String ? it.split(parameterSettings.multiple_sep) : it } + } else if (parValue instanceof String) { + parValue = parValue.split(parameterSettings.multiple_sep) + } else if (parValue == null) { + parValue = [] + } else { + parValue = [ parValue ] + } + parValue = parValue.flatten() + } + // For all parameters check if multiple values are only passed for + // arguments that allow it. Quietly simplify lists of length 1. + if (!parameterSettings.multiple && parValue instanceof Collection) { + assert parValue.size() == 1 : + "Error: argument ${parName} has too many values.\n" + + " Expected amount: 1. Found: ${parValue.size()}" + parValue = parValue[0] + } + [parName, parValue] + } + return parsedParamValues +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf' +/** + * Parse nextflow parameters based on settings defined in a viash config. + * Return a list of parameter sets, each parameter set corresponding to + * an event in a nextflow channel. The output from this function can be used + * with Channel.fromList to create a nextflow channel with Vdsl3 formatted + * events. + * + * This function performs: + * - A filtering of the params which can be found in the config file. + * - Process the params_list argument which allows a user to to initialise + * a Vsdl3 channel with multiple parameter sets. Possible formats are + * csv, json, yaml, or simply a yaml_blob. A csv should have column names + * which correspond to the different arguments of this pipeline. A json or a yaml + * file should be a list of maps, each of which has keys corresponding to the + * arguments of the pipeline. A yaml blob can also be passed directly as a parameter. + * When passing a csv, json or yaml, relative path names are relativized to the + * location of the parameter file. + * - Combine the parameter sets into a vdsl3 Channel. + * + * @param params Input parameters. Can optionaly contain a 'param_list' key that + * provides a list of arguments that can be split up into multiple events + * in the output channel possible formats of param_lists are: a csv file, + * json file, a yaml file or a yaml blob. Each parameters set (event) must + * have a unique ID. + * @param config A Map of the Viash configuration. This Map can be generated from the config file + * using the readConfig() function. + * + * @return A list of parameters with the first element of the event being + * the event ID and the second element containing a map of the parsed parameters. + */ + +private List>> _paramsToParamSets(Map params, Map config){ + // todo: fetch key from run args + def key_ = config.name + + /* parse regular parameters (not in param_list) */ + /*************************************************/ + def globalParams = config.allArguments + .findAll { params.containsKey(it.plainName) } + .collectEntries { [ it.plainName, params[it.plainName] ] } + def globalID = params.get("id", null) + + /* process params_list arguments */ + /*********************************/ + def paramList = params.containsKey("param_list") && params.param_list != null ? + params.param_list : [] + // if (paramList instanceof String) { + // paramList = [paramList] + // } + // def paramSets = paramList.collectMany{ _parseParamList(it, config) } + // TODO: be able to process param_list when it is a list of strings + def paramSets = _parseParamList(paramList, config) + if (paramSets.isEmpty()) { + paramSets = [[null, [:]]] + } + + /* combine arguments into channel */ + /**********************************/ + def processedParams = paramSets.indexed().collect{ index, tup -> + // Process ID + def id = tup[0] ?: globalID + + if (workflow.stubRun && !id) { + // if stub run, explicitly add an id if missing + id = "stub${index}" + } + assert id != null: "Each parameter set should have at least an 'id'" + + // Process params + def parValues = globalParams + tup[1] + // // Remove parameters which are null, if the default is also null + // parValues = parValues.collectEntries{paramName, paramValue -> + // parameterSettings = config.functionality.allArguments.find({it.plainName == paramName}) + // if ( paramValue != null || parameterSettings.get("default", null) != null ) { + // [paramName, paramValue] + // } + // } + parValues = parValues.collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && (it.direction == "input" || it.type == "file") } + assert par != null : "Error in module '${key_}' id '${id}': '${name}' is not a valid input argument" + + if (par == null) { + return [:] + } + value = _checkArgumentType("input", par, value, "in module '$key_' id '$id'") + + [ name, value ] + } + + [id, parValues] + } + + // Check if ids (first element of each list) is unique + _checkUniqueIds(processedParams) + return processedParams +} + +/** + * Parse nextflow parameters based on settings defined in a viash config + * and return a nextflow channel. + * + * @param params Input parameters. Can optionaly contain a 'param_list' key that + * provides a list of arguments that can be split up into multiple events + * in the output channel possible formats of param_lists are: a csv file, + * json file, a yaml file or a yaml blob. Each parameters set (event) must + * have a unique ID. + * @param config A Map of the Viash configuration. This Map can be generated from the config file + * using the readConfig() function. + * + * @return A nextflow Channel with events. Events are formatted as a tuple that contains + * first contains the ID of the event and as second element holds a parameter map. + * + * + */ +def channelFromParams(Map params, Map config) { + def processedParams = _paramsToParamSets(params, config) + return Channel.fromList(processedParams) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/checkUniqueIds.nf' +def checkUniqueIds(Map args) { + def stopOnError = args.stopOnError == null ? args.stopOnError : true + + def idChecker = new IDChecker() + + return filter { tup -> + if (!idChecker.observe(tup[0])) { + if (stopOnError) { + error "Duplicate id: ${tup[0]}" + } else { + log.warn "Duplicate id: ${tup[0]}, removing duplicate entry" + return false + } + } + return true + } +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/preprocessInputs.nf' +// This helper file will be deprecated soon +preprocessInputsDeprecationWarningPrinted = false + +def preprocessInputsDeprecationWarning() { + if (!preprocessInputsDeprecationWarningPrinted) { + preprocessInputsDeprecationWarningPrinted = true + System.err.println("Warning: preprocessInputs() is deprecated and will be removed in Viash 0.9.0.") + } +} + +/** + * Generate a nextflow Workflow that allows processing a channel of + * Vdsl3 formatted events and apply a Viash config to them: + * - Gather default parameters from the Viash config and make + * sure that they are correctly formatted (see applyConfig method). + * - Format the input parameters (also using the applyConfig method). + * - Apply the default parameter to the input parameters. + * - Do some assertions: + * ~ Check if the event IDs in the channel are unique. + * + * The events in the channel are formatted as tuples, with the + * first element of the tuples being a unique id of the parameter set, + * and the second element containg the the parameters themselves. + * Optional extra elements of the tuples will be passed to the output as is. + * + * @param args A map that must contain a 'config' key that points + * to a parsed config (see readConfig()). Optionally, a + * 'key' key can be provided which can be used to create a unique + * name for the workflow process. + * + * @return A workflow that allows processing a channel of Vdsl3 formatted events + * and apply a Viash config to them. + */ +def preprocessInputs(Map args) { + preprocessInputsDeprecationWarning() + + def config = args.config + assert config instanceof Map : + "Error in preprocessInputs: config must be a map. " + + "Expected class: Map. Found: config.getClass() is ${config.getClass()}" + def key_ = args.key ?: config.name + + // Get different parameter types (used throughout this function) + def defaultArgs = config.allArguments + .findAll { it.containsKey("default") } + .collectEntries { [ it.plainName, it.default ] } + + map { tup -> + def id = tup[0] + def data = tup[1] + def passthrough = tup.drop(2) + + def new_data = (defaultArgs + data).collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && (it.direction == "input" || it.type == "file") } + + if (par != null) { + value = _checkArgumentType("input", par, value, "in module '$key_' id '$id'") + } + + [ name, value ] + } + + [ id, new_data ] + passthrough + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/runComponents.nf' +/** + * Run a list of components on a stream of data. + * + * @param components: list of Viash VDSL3 modules to run + * @param fromState: a closure, a map or a list of keys to extract from the input data. + * If a closure, it will be called with the id, the data and the component config. + * @param toState: a closure, a map or a list of keys to extract from the output data + * If a closure, it will be called with the id, the output data, the old state and the component config. + * @param filter: filter function to apply to the input. + * It will be called with the id, the data and the component config. + * @param id: id to use for the output data + * If a closure, it will be called with the id, the data and the component config. + * @param auto: auto options to pass to the components + * + * @return: a workflow that runs the components + **/ +def runComponents(Map args) { + log.warn("runComponents is deprecated, use runEach instead") + assert args.components: "runComponents should be passed a list of components to run" + + def components_ = args.components + if (components_ !instanceof List) { + components_ = [ components_ ] + } + assert components_.size() > 0: "pass at least one component to runComponents" + + def fromState_ = args.fromState + def toState_ = args.toState + def filter_ = args.filter + def id_ = args.id + + workflow runComponentsWf { + take: input_ch + main: + + // generate one channel per method + out_chs = components_.collect{ comp_ -> + def comp_config = comp_.config + + def filter_ch = filter_ + ? input_ch | filter{tup -> + filter_(tup[0], tup[1], comp_config) + } + : input_ch + def id_ch = id_ + ? filter_ch | map{tup -> + // def new_id = id_(tup[0], tup[1], comp_config) + def new_id = tup[0] + if (id_ instanceof String) { + new_id = id_ + } else if (id_ instanceof Closure) { + new_id = id_(new_id, tup[1], comp_config) + } + [new_id] + tup.drop(1) + } + : filter_ch + def data_ch = id_ch | map{tup -> + def new_data = tup[1] + if (fromState_ instanceof Map) { + new_data = fromState_.collectEntries{ key0, key1 -> + [key0, new_data[key1]] + } + } else if (fromState_ instanceof List) { + new_data = fromState_.collectEntries{ key -> + [key, new_data[key]] + } + } else if (fromState_ instanceof Closure) { + new_data = fromState_(tup[0], new_data, comp_config) + } + tup.take(1) + [new_data] + tup.drop(1) + } + def out_ch = data_ch + | comp_.run( + auto: (args.auto ?: [:]) + [simplifyInput: false, simplifyOutput: false] + ) + def post_ch = toState_ + ? out_ch | map{tup -> + def output = tup[1] + def old_state = tup[2] + def new_state = null + if (toState_ instanceof Map) { + new_state = old_state + toState_.collectEntries{ key0, key1 -> + [key0, output[key1]] + } + } else if (toState_ instanceof List) { + new_state = old_state + toState_.collectEntries{ key -> + [key, output[key]] + } + } else if (toState_ instanceof Closure) { + new_state = toState_(tup[0], output, old_state, comp_config) + } + [tup[0], new_state] + tup.drop(3) + } + : out_ch + + post_ch + } + + // mix all results + output_ch = + (out_chs.size == 1) + ? out_chs[0] + : out_chs[0].mix(*out_chs.drop(1)) + + emit: output_ch + } + + return runComponentsWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/runEach.nf' +/** + * Run a list of components on a stream of data. + * + * @param components: list of Viash VDSL3 modules to run + * @param fromState: a closure, a map or a list of keys to extract from the input data. + * If a closure, it will be called with the id, the data and the component itself. + * @param toState: a closure, a map or a list of keys to extract from the output data + * If a closure, it will be called with the id, the output data, the old state and the component itself. + * @param filter: filter function to apply to the input. + * It will be called with the id, the data and the component itself. + * @param id: id to use for the output data + * If a closure, it will be called with the id, the data and the component itself. + * @param auto: auto options to pass to the components + * + * @return: a workflow that runs the components + **/ +def runEach(Map args) { + assert args.components: "runEach should be passed a list of components to run" + + def components_ = args.components + if (components_ !instanceof List) { + components_ = [ components_ ] + } + assert components_.size() > 0: "pass at least one component to runEach" + + def fromState_ = args.fromState + def toState_ = args.toState + def filter_ = args.filter + def id_ = args.id + + workflow runEachWf { + take: input_ch + main: + + // generate one channel per method + out_chs = components_.collect{ comp_ -> + def filter_ch = filter_ + ? input_ch | filter{tup -> + filter_(tup[0], tup[1], comp_) + } + : input_ch + def id_ch = id_ + ? filter_ch | map{tup -> + def new_id = id_ + if (new_id instanceof Closure) { + new_id = new_id(tup[0], tup[1], comp_) + } + assert new_id instanceof String : "Error in runEach: id should be a String or a Closure that returns a String. Expected: id instanceof String. Found: ${new_id.getClass()}" + [new_id] + tup.drop(1) + } + : filter_ch + def data_ch = id_ch | map{tup -> + def new_data = tup[1] + if (fromState_ instanceof Map) { + new_data = fromState_.collectEntries{ key0, key1 -> + [key0, new_data[key1]] + } + } else if (fromState_ instanceof List) { + new_data = fromState_.collectEntries{ key -> + [key, new_data[key]] + } + } else if (fromState_ instanceof Closure) { + new_data = fromState_(tup[0], new_data, comp_) + } + tup.take(1) + [new_data] + tup.drop(1) + } + def out_ch = data_ch + | comp_.run( + auto: (args.auto ?: [:]) + [simplifyInput: false, simplifyOutput: false] + ) + def post_ch = toState_ + ? out_ch | map{tup -> + def output = tup[1] + def old_state = tup[2] + def new_state = null + if (toState_ instanceof Map) { + new_state = old_state + toState_.collectEntries{ key0, key1 -> + [key0, output[key1]] + } + } else if (toState_ instanceof List) { + new_state = old_state + toState_.collectEntries{ key -> + [key, output[key]] + } + } else if (toState_ instanceof Closure) { + new_state = toState_(tup[0], output, old_state, comp_) + } + [tup[0], new_state] + tup.drop(3) + } + : out_ch + + post_ch + } + + // mix all results + output_ch = + (out_chs.size == 1) + ? out_chs[0] + : out_chs[0].mix(*out_chs.drop(1)) + + emit: output_ch + } + + return runEachWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/safeJoin.nf' +/** + * Join sourceChannel to targetChannel + * + * This function joins the sourceChannel to the targetChannel. + * However, each id in the targetChannel must be present in the + * sourceChannel. If _meta.join_id exists in the targetChannel, that is + * used as an id instead. If the id doesn't match any id in the sourceChannel, + * an error is thrown. + */ + +def safeJoin(targetChannel, sourceChannel, key) { + def sourceIDs = new IDChecker() + + def sourceCheck = sourceChannel + | map { tup -> + sourceIDs.observe(tup[0]) + tup + } + def targetCheck = targetChannel + | map { tup -> + def id = tup[0] + + if (!sourceIDs.contains(id)) { + error ( + "Error in module '${key}' when merging output with original state.\n" + + " Reason: output with id '${id}' could not be joined with source channel.\n" + + " If the IDs in the output channel differ from the input channel,\n" + + " please set `tup[1]._meta.join_id to the original ID.\n" + + " Original IDs in input channel: ['${sourceIDs.getItems().join("', '")}'].\n" + + " Unexpected ID in the output channel: '${id}'.\n" + + " Example input event: [\"id\", [input: file(...)]],\n" + + " Example output event: [\"newid\", [output: file(...), _meta: [join_id: \"id\"]]]" + ) + } + // TODO: add link to our documentation on how to fix this + + tup + } + + sourceCheck.cross(targetChannel) + | map{ left, right -> + right + left.drop(1) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/_processArgument.nf' +def _processArgument(arg) { + arg.multiple = arg.multiple != null ? arg.multiple : false + arg.required = arg.required != null ? arg.required : false + arg.direction = arg.direction != null ? arg.direction : "input" + arg.multiple_sep = arg.multiple_sep != null ? arg.multiple_sep : ";" + arg.plainName = arg.name.replaceAll("^-*", "") + + if (arg.type == "file") { + arg.must_exist = arg.must_exist != null ? arg.must_exist : true + arg.create_parent = arg.create_parent != null ? arg.create_parent : true + } + + // add default values to output files which haven't already got a default + if (arg.type == "file" && arg.direction == "output" && arg.default == null) { + def mult = arg.multiple ? "_*" : "" + def extSearch = "" + if (arg.default != null) { + extSearch = arg.default + } else if (arg.example != null) { + extSearch = arg.example + } + if (extSearch instanceof List) { + extSearch = extSearch[0] + } + def extSearchResult = extSearch.find("\\.[^\\.]+\$") + def ext = extSearchResult != null ? extSearchResult : "" + arg.default = "\$id.\$key.${arg.plainName}${mult}${ext}" + if (arg.multiple) { + arg.default = [arg.default] + } + } + + if (!arg.multiple) { + if (arg.default != null && arg.default instanceof List) { + arg.default = arg.default[0] + } + if (arg.example != null && arg.example instanceof List) { + arg.example = arg.example[0] + } + } + + if (arg.type == "boolean_true") { + arg.default = false + } + if (arg.type == "boolean_false") { + arg.default = true + } + + arg +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/addGlobalParams.nf' +def addGlobalArguments(config) { + def localConfig = [ + "argument_groups": [ + [ + "name": "Nextflow input-output arguments", + "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.", + "arguments" : [ + [ + 'name': '--publish_dir', + 'required': true, + 'type': 'string', + 'description': 'Path to an output directory.', + 'example': 'output/', + 'multiple': false + ], + [ + 'name': '--param_list', + 'required': false, + 'type': 'string', + 'description': '''Allows inputting multiple parameter sets to initialise a Nextflow channel. A `param_list` can either be a list of maps, a csv file, a json file, a yaml file, or simply a yaml blob. + | + |* A list of maps (as-is) where the keys of each map corresponds to the arguments of the pipeline. Example: in a `nextflow.config` file: `param_list: [ ['id': 'foo', 'input': 'foo.txt'], ['id': 'bar', 'input': 'bar.txt'] ]`. + |* A csv file should have column names which correspond to the different arguments of this pipeline. Example: `--param_list data.csv` with columns `id,input`. + |* A json or a yaml file should be a list of maps, each of which has keys corresponding to the arguments of the pipeline. Example: `--param_list data.json` with contents `[ {'id': 'foo', 'input': 'foo.txt'}, {'id': 'bar', 'input': 'bar.txt'} ]`. + |* A yaml blob can also be passed directly as a string. Example: `--param_list "[ {'id': 'foo', 'input': 'foo.txt'}, {'id': 'bar', 'input': 'bar.txt'} ]"`. + | + |When passing a csv, json or yaml file, relative path names are relativized to the location of the parameter file. No relativation is performed when `param_list` is a list of maps (as-is) or a yaml blob.'''.stripMargin(), + 'example': 'my_params.yaml', + 'multiple': false, + 'hidden': true + ] + // TODO: allow multiple: true in param_list? + // TODO: allow to specify a --param_list_regex to filter the param_list? + // TODO: allow to specify a --param_list_from_state to remap entries in the param_list? + ] + ] + ] + ] + + return processConfig(_mergeMap(config, localConfig)) +} + +def _mergeMap(Map lhs, Map rhs) { + return rhs.inject(lhs.clone()) { map, entry -> + if (map[entry.key] instanceof Map && entry.value instanceof Map) { + map[entry.key] = _mergeMap(map[entry.key], entry.value) + } else if (map[entry.key] instanceof Collection && entry.value instanceof Collection) { + map[entry.key] += entry.value + } else { + map[entry.key] = entry.value + } + return map + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/generateHelp.nf' +def _generateArgumentHelp(param) { + // alternatives are not supported + // def names = param.alternatives ::: List(param.name) + + def unnamedProps = [ + ["required parameter", param.required], + ["multiple values allowed", param.multiple], + ["output", param.direction.toLowerCase() == "output"], + ["file must exist", param.type == "file" && param.must_exist] + ].findAll{it[1]}.collect{it[0]} + + def dflt = null + if (param.default != null) { + if (param.default instanceof List) { + dflt = param.default.join(param.multiple_sep != null ? param.multiple_sep : ", ") + } else { + dflt = param.default.toString() + } + } + def example = null + if (param.example != null) { + if (param.example instanceof List) { + example = param.example.join(param.multiple_sep != null ? param.multiple_sep : ", ") + } else { + example = param.example.toString() + } + } + def min = param.min?.toString() + def max = param.max?.toString() + + def escapeChoice = { choice -> + def s1 = choice.replaceAll("\\n", "\\\\n") + def s2 = s1.replaceAll("\"", """\\\"""") + s2.contains(",") || s2 != choice ? "\"" + s2 + "\"" : s2 + } + def choices = param.choices == null ? + null : + "[ " + param.choices.collect{escapeChoice(it.toString())}.join(", ") + " ]" + + def namedPropsStr = [ + ["type", ([param.type] + unnamedProps).join(", ")], + ["default", dflt], + ["example", example], + ["choices", choices], + ["min", min], + ["max", max] + ] + .findAll{it[1]} + .collect{"\n " + it[0] + ": " + it[1].replaceAll("\n", "\\n")} + .join("") + + def descStr = param.description == null ? + "" : + _paragraphWrap("\n" + param.description.trim(), 80 - 8).join("\n ") + + "\n --" + param.plainName + + namedPropsStr + + descStr +} + +// Based on Helper.generateHelp() in Helper.scala +def _generateHelp(config) { + def fun = config + + // PART 1: NAME AND VERSION + def nameStr = fun.name + + (fun.version == null ? "" : " " + fun.version) + + // PART 2: DESCRIPTION + def descrStr = fun.description == null ? + "" : + "\n\n" + _paragraphWrap(fun.description.trim(), 80).join("\n") + + // PART 3: Usage + def usageStr = fun.usage == null ? + "" : + "\n\nUsage:\n" + fun.usage.trim() + + // PART 4: Options + def argGroupStrs = fun.allArgumentGroups.collect{argGroup -> + def name = argGroup.name + def descriptionStr = argGroup.description == null ? + "" : + "\n " + _paragraphWrap(argGroup.description.trim(), 80-4).join("\n ") + "\n" + def arguments = argGroup.arguments.collect{arg -> + arg instanceof String ? fun.allArguments.find{it.plainName == arg} : arg + }.findAll{it != null} + def argumentStrs = arguments.collect{param -> _generateArgumentHelp(param)} + + "\n\n$name:" + + descriptionStr + + argumentStrs.join("\n") + } + + // FINAL: combine + def out = nameStr + + descrStr + + usageStr + + argGroupStrs.join("") + + return out +} + +// based on Format._paragraphWrap +def _paragraphWrap(str, maxLength) { + def outLines = [] + str.split("\n").each{par -> + def words = par.split("\\s").toList() + + def word = null + def line = words.pop() + while(!words.isEmpty()) { + word = words.pop() + if (line.length() + word.length() + 1 <= maxLength) { + line = line + " " + word + } else { + outLines.add(line) + line = word + } + } + if (words.isEmpty()) { + outLines.add(line) + } + } + return outLines +} + +def helpMessage(config) { + if (params.containsKey("help") && params.help) { + def mergedConfig = addGlobalArguments(config) + def helpStr = _generateHelp(mergedConfig) + println(helpStr) + exit 0 + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/processConfig.nf' +def processConfig(config) { + // set defaults for arguments + config.arguments = + (config.arguments ?: []).collect{_processArgument(it)} + + // set defaults for argument_group arguments + config.argument_groups = + (config.argument_groups ?: []).collect{grp -> + grp.arguments = (grp.arguments ?: []).collect{_processArgument(it)} + grp + } + + // create combined arguments list + config.allArguments = + config.arguments + + config.argument_groups.collectMany{it.arguments} + + // add missing argument groups (based on Functionality::allArgumentGroups()) + def argGroups = config.argument_groups + if (argGroups.any{it.name.toLowerCase() == "arguments"}) { + argGroups = argGroups.collect{ grp -> + if (grp.name.toLowerCase() == "arguments") { + grp = grp + [ + arguments: grp.arguments + config.arguments + ] + } + grp + } + } else { + argGroups = argGroups + [ + name: "Arguments", + arguments: config.arguments + ] + } + config.allArgumentGroups = argGroups + + config +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/readConfig.nf' + +def readConfig(file) { + def config = readYaml(file ?: moduleDir.resolve("config.vsh.yaml")) + processConfig(config) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/_resolveSiblingIfNotAbsolute.nf' +/** + * Resolve a path relative to the current file. + * + * @param str The path to resolve, as a String. + * @param parentPath The path to resolve relative to, as a Path. + * + * @return The path that may have been resovled, as a Path. + */ +def _resolveSiblingIfNotAbsolute(str, parentPath) { + if (str !instanceof String) { + return str + } + if (!_stringIsAbsolutePath(str)) { + return parentPath.resolveSibling(str) + } else { + return file(str, hidden: true) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/_stringIsAbsolutePath.nf' +/** + * Check whether a path as a string is absolute. + * + * In the past, we tried using `file(., relative: true).isAbsolute()`, + * but the 'relative' option was added in 22.10.0. + * + * @param path The path to check, as a String. + * + * @return Whether the path is absolute, as a boolean. + */ +def _stringIsAbsolutePath(path) { + def _resolve_URL_PROTOCOL = ~/^([a-zA-Z][a-zA-Z0-9]*:)?\\/.+/ + + assert path instanceof String + return _resolve_URL_PROTOCOL.matcher(path).matches() +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/collectTraces.nf' +class CustomTraceObserver implements nextflow.trace.TraceObserver { + List traces + + CustomTraceObserver(List traces) { + this.traces = traces + } + + @Override + void onProcessComplete(nextflow.processor.TaskHandler handler, nextflow.trace.TraceRecord trace) { + def trace2 = trace.store.clone() + trace2.script = null + traces.add(trace2) + } + + @Override + void onProcessCached(nextflow.processor.TaskHandler handler, nextflow.trace.TraceRecord trace) { + def trace2 = trace.store.clone() + trace2.script = null + traces.add(trace2) + } +} + +def collectTraces() { + def traces = Collections.synchronizedList([]) + + // add custom trace observer which stores traces in the traces object + session.observers.add(new CustomTraceObserver(traces)) + + traces +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/deepClone.nf' +/** + * Performs a deep clone of the given object. + * @param x an object + */ +def deepClone(x) { + iterateMap(x, {it instanceof Cloneable ? it.clone() : it}) +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/getPublishDir.nf' +def getPublishDir() { + return params.containsKey("publish_dir") ? params.publish_dir : + params.containsKey("publishDir") ? params.publishDir : + null +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/getRootDir.nf' + +// Recurse upwards until we find a '.build.yaml' file +def _findBuildYamlFile(pathPossiblySymlink) { + def path = pathPossiblySymlink.toRealPath() + def child = path.resolve(".build.yaml") + if (java.nio.file.Files.isDirectory(path) && java.nio.file.Files.exists(child)) { + return child + } else { + def parent = path.getParent() + if (parent == null) { + return null + } else { + return _findBuildYamlFile(parent) + } + } +} + +// get the root of the target folder +def getRootDir() { + def dir = _findBuildYamlFile(meta.resources_dir) + assert dir != null: "Could not find .build.yaml in the folder structure" + dir.getParent() +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/iterateMap.nf' +/** + * Recursively apply a function over the leaves of an object. + * @param obj The object to iterate over. + * @param fun The function to apply to each value. + * @return The object with the function applied to each value. + */ +def iterateMap(obj, fun) { + if (obj instanceof List && obj !instanceof String) { + return obj.collect{item -> + iterateMap(item, fun) + } + } else if (obj instanceof Map) { + return obj.collectEntries{key, item -> + [key.toString(), iterateMap(item, fun)] + } + } else { + return fun(obj) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/niceView.nf' +/** + * A view for printing the event of each channel as a YAML blob. + * This is useful for debugging. + */ +def niceView() { + workflow niceViewWf { + take: input + main: + output = input + | view{toYamlBlob(it)} + emit: output + } + return niceViewWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readCsv.nf' + +def readCsv(file_path) { + def output = [] + def inputFile = file_path !instanceof Path ? file(file_path, hidden: true) : file_path + + // todo: allow escaped quotes in string + // todo: allow single quotes? + def splitRegex = java.util.regex.Pattern.compile(''',(?=(?:[^"]*"[^"]*")*[^"]*$)''') + def removeQuote = java.util.regex.Pattern.compile('''"(.*)"''') + + def br = java.nio.file.Files.newBufferedReader(inputFile) + + def row = -1 + def header = null + while (br.ready() && header == null) { + def line = br.readLine() + row++ + if (!line.startsWith("#")) { + header = splitRegex.split(line, -1).collect{field -> + m = removeQuote.matcher(field) + m.find() ? m.replaceFirst('$1') : field + } + } + } + assert header != null: "CSV file should contain a header" + + while (br.ready()) { + def line = br.readLine() + row++ + if (line == null) { + br.close() + break + } + + if (!line.startsWith("#")) { + def predata = splitRegex.split(line, -1) + def data = predata.collect{field -> + if (field == "") { + return null + } + def m = removeQuote.matcher(field) + if (m.find()) { + return m.replaceFirst('$1') + } else { + return field + } + } + assert header.size() == data.size(): "Row $row should contain the same number as fields as the header" + + def dataMap = [header, data].transpose().collectEntries().findAll{it.value != null} + output.add(dataMap) + } + } + + output +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readJson.nf' +def readJson(file_path) { + def inputFile = file_path !instanceof Path ? file(file_path, hidden: true) : file_path + def jsonSlurper = new groovy.json.JsonSlurper() + jsonSlurper.parse(inputFile) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readJsonBlob.nf' +def readJsonBlob(str) { + def jsonSlurper = new groovy.json.JsonSlurper() + jsonSlurper.parseText(str) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readTaggedYaml.nf' +// Custom constructor to modify how certain objects are parsed from YAML +class CustomConstructor extends org.yaml.snakeyaml.constructor.Constructor { + Path root + + class ConstructPath extends org.yaml.snakeyaml.constructor.AbstractConstruct { + public Object construct(org.yaml.snakeyaml.nodes.Node node) { + String filename = (String) constructScalar(node); + if (root != null) { + return root.resolve(filename); + } + return java.nio.file.Paths.get(filename); + } + } + + CustomConstructor(org.yaml.snakeyaml.LoaderOptions options, Path root) { + super(options) + this.root = root + // Handling !file tag and parse it back to a File type + this.yamlConstructors.put(new org.yaml.snakeyaml.nodes.Tag("!file"), new ConstructPath()) + } +} + +def readTaggedYaml(Path path) { + def options = new org.yaml.snakeyaml.LoaderOptions() + def constructor = new CustomConstructor(options, path.getParent()) + def yaml = new org.yaml.snakeyaml.Yaml(constructor) + return yaml.load(path.text) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readYaml.nf' +def readYaml(file_path) { + def inputFile = file_path !instanceof Path ? file(file_path, hidden: true) : file_path + def yamlSlurper = new org.yaml.snakeyaml.Yaml() + yamlSlurper.load(inputFile) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readYamlBlob.nf' +def readYamlBlob(str) { + def yamlSlurper = new org.yaml.snakeyaml.Yaml() + yamlSlurper.load(str) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/toJsonBlob.nf' +String toJsonBlob(data) { + return groovy.json.JsonOutput.toJson(data) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/toTaggedYamlBlob.nf' +// Custom representer to modify how certain objects are represented in YAML +class CustomRepresenter extends org.yaml.snakeyaml.representer.Representer { + Path relativizer + + class RepresentPath implements org.yaml.snakeyaml.representer.Represent { + public String getFileName(Object obj) { + if (obj instanceof File) { + obj = ((File) obj).toPath(); + } + if (obj !instanceof Path) { + throw new IllegalArgumentException("Object: " + obj + " is not a Path or File"); + } + def path = (Path) obj; + + if (relativizer != null) { + return relativizer.relativize(path).toString() + } else { + return path.toString() + } + } + + public org.yaml.snakeyaml.nodes.Node representData(Object data) { + String filename = getFileName(data); + def tag = new org.yaml.snakeyaml.nodes.Tag("!file"); + return representScalar(tag, filename); + } + } + CustomRepresenter(org.yaml.snakeyaml.DumperOptions options, Path relativizer) { + super(options) + this.relativizer = relativizer + this.representers.put(sun.nio.fs.UnixPath, new RepresentPath()) + this.representers.put(Path, new RepresentPath()) + this.representers.put(File, new RepresentPath()) + } +} + +String toTaggedYamlBlob(data) { + return toRelativeTaggedYamlBlob(data, null) +} +String toRelativeTaggedYamlBlob(data, Path relativizer) { + def options = new org.yaml.snakeyaml.DumperOptions() + options.setDefaultFlowStyle(org.yaml.snakeyaml.DumperOptions.FlowStyle.BLOCK) + def representer = new CustomRepresenter(options, relativizer) + def yaml = new org.yaml.snakeyaml.Yaml(representer, options) + return yaml.dump(data) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/toYamlBlob.nf' +String toYamlBlob(data) { + def options = new org.yaml.snakeyaml.DumperOptions() + options.setDefaultFlowStyle(org.yaml.snakeyaml.DumperOptions.FlowStyle.BLOCK) + options.setPrettyFlow(true) + def yaml = new org.yaml.snakeyaml.Yaml(options) + def cleanData = iterateMap(data, { it instanceof Path ? it.toString() : it }) + return yaml.dump(cleanData) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/writeJson.nf' +void writeJson(data, file) { + assert data: "writeJson: data should not be null" + assert file: "writeJson: file should not be null" + file.write(toJsonBlob(data)) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/writeYaml.nf' +void writeYaml(data, file) { + assert data: "writeYaml: data should not be null" + assert file: "writeYaml: file should not be null" + file.write(toYamlBlob(data)) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/findStates.nf' +def findStates(Map params, Map config) { + def auto_config = deepClone(config) + def auto_params = deepClone(params) + + auto_config = auto_config.clone() + // override arguments + auto_config.argument_groups = [] + auto_config.arguments = [ + [ + type: "string", + name: "--id", + description: "A dummy identifier", + required: false + ], + [ + type: "file", + name: "--input_states", + example: "/path/to/input/directory/**/state.yaml", + description: "Path to input directory containing the datasets to be integrated.", + required: true, + multiple: true, + multiple_sep: ";" + ], + [ + type: "string", + name: "--filter", + example: "foo/.*/state.yaml", + description: "Regex to filter state files by path.", + required: false + ], + // to do: make this a yaml blob? + [ + type: "string", + name: "--rename_keys", + example: ["newKey1:oldKey1", "newKey2:oldKey2"], + description: "Rename keys in the detected input files. This is useful if the input files do not match the set of input arguments of the workflow.", + required: false, + multiple: true, + multiple_sep: ";" + ], + [ + type: "string", + name: "--settings", + example: '{"output_dataset": "dataset.h5ad", "k": 10}', + description: "Global arguments as a JSON glob to be passed to all components.", + required: false + ] + ] + if (!(auto_params.containsKey("id"))) { + auto_params["id"] = "auto" + } + + // run auto config through processConfig once more + auto_config = processConfig(auto_config) + + workflow findStatesWf { + helpMessage(auto_config) + + output_ch = + channelFromParams(auto_params, auto_config) + | flatMap { autoId, args -> + + def globalSettings = args.settings ? readYamlBlob(args.settings) : [:] + + // look for state files in input dir + def stateFiles = args.input_states + + // filter state files by regex + if (args.filter) { + stateFiles = stateFiles.findAll{ stateFile -> + def stateFileStr = stateFile.toString() + def matcher = stateFileStr =~ args.filter + matcher.matches()} + } + + // read in states + def states = stateFiles.collect { stateFile -> + def state_ = readTaggedYaml(stateFile) + [state_.id, state_] + } + + // construct renameMap + if (args.rename_keys) { + def renameMap = args.rename_keys.collectEntries{renameString -> + def split = renameString.split(";") + assert split.size() == 2: "Argument 'rename_keys' should be of the form 'newKey:oldKey,newKey:oldKey'" + split + } + + // rename keys in state, only let states through which have all keys + // also add global settings + states = states.collectMany{id, state -> + def newState = [:] + + for (key in renameMap.keySet()) { + def origKey = renameMap[key] + if (!(state.containsKey(origKey))) { + return [] + } + newState[key] = state[origKey] + } + + [[id, globalSettings + newState]] + } + } + + states + } + emit: + output_ch + } + + return findStatesWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/joinStates.nf' +def joinStates(Closure apply_) { + workflow joinStatesWf { + take: input_ch + main: + output_ch = input_ch + | toSortedList + | filter{ it.size() > 0 } + | map{ tups -> + def ids = tups.collect{it[0]} + def states = tups.collect{it[1]} + apply_(ids, states) + } + + emit: output_ch + } + return joinStatesWf +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/publishStates.nf' +def collectFiles(obj) { + if (obj instanceof java.io.File || obj instanceof Path) { + return [obj] + } else if (obj instanceof List && obj !instanceof String) { + return obj.collectMany{item -> + collectFiles(item) + } + } else if (obj instanceof Map) { + return obj.collectMany{key, item -> + collectFiles(item) + } + } else { + return [] + } +} + +/** + * Recurse through a state and collect all input files and their target output filenames. + * @param obj The state to recurse through. + * @param prefix The prefix to prepend to the output filenames. + */ +def collectInputOutputPaths(obj, prefix) { + if (obj instanceof File || obj instanceof Path) { + def path = obj instanceof Path ? obj : obj.toPath() + def ext = path.getFileName().toString().find("\\.[^\\.]+\$") ?: "" + def newFilename = prefix + ext + return [[obj, newFilename]] + } else if (obj instanceof List && obj !instanceof String) { + return obj.withIndex().collectMany{item, ix -> + collectInputOutputPaths(item, prefix + "_" + ix) + } + } else if (obj instanceof Map) { + return obj.collectMany{key, item -> + collectInputOutputPaths(item, prefix + "." + key) + } + } else { + return [] + } +} + +def publishStates(Map args) { + def key_ = args.get("key") + def yamlTemplate_ = args.get("output_state", args.get("outputState", '$id.$key.state.yaml')) + + assert key_ != null : "publishStates: key must be specified" + + workflow publishStatesWf { + take: input_ch + main: + input_ch + | map { tup -> + def id_ = tup[0] + def state_ = tup[1] + + // the input files and the target output filenames + def inputoutputFilenames_ = collectInputOutputPaths(state_, id_ + "." + key_).transpose() + def inputFiles_ = inputoutputFilenames_[0] + def outputFilenames_ = inputoutputFilenames_[1] + + def yamlFilename = yamlTemplate_ + .replaceAll('\\$id', id_) + .replaceAll('\\$key', key_) + + // TODO: do the pathnames in state_ match up with the outputFilenames_? + + // convert state to yaml blob + def yamlBlob_ = toRelativeTaggedYamlBlob([id: id_] + state_, java.nio.file.Paths.get(yamlFilename)) + + [id_, yamlBlob_, yamlFilename, inputFiles_, outputFilenames_] + } + | publishStatesProc + emit: input_ch + } + return publishStatesWf +} +process publishStatesProc { + // todo: check publishpath? + publishDir path: "${getPublishDir()}/", mode: "copy" + tag "$id" + input: + tuple val(id), val(yamlBlob), val(yamlFile), path(inputFiles, stageAs: "_inputfile?/*"), val(outputFiles) + output: + tuple val(id), path{[yamlFile] + outputFiles} + script: + def copyCommands = [ + inputFiles instanceof List ? inputFiles : [inputFiles], + outputFiles instanceof List ? outputFiles : [outputFiles] + ] + .transpose() + .collectMany{infile, outfile -> + if (infile.toString() != outfile.toString()) { + [ + "[ -d \"\$(dirname '${outfile.toString()}')\" ] || mkdir -p \"\$(dirname '${outfile.toString()}')\"", + "cp -r '${infile.toString()}' '${outfile.toString()}'" + ] + } else { + // no need to copy if infile is the same as outfile + [] + } + } + """ +mkdir -p "\$(dirname '${yamlFile}')" +echo "Storing state as yaml" +echo '${yamlBlob}' > '${yamlFile}' +echo "Copying output files to destination folder" +${copyCommands.join("\n ")} +""" +} + + +// this assumes that the state contains no other values other than those specified in the config +def publishStatesByConfig(Map args) { + def config = args.get("config") + assert config != null : "publishStatesByConfig: config must be specified" + + def key_ = args.get("key", config.name) + assert key_ != null : "publishStatesByConfig: key must be specified" + + workflow publishStatesSimpleWf { + take: input_ch + main: + input_ch + | map { tup -> + def id_ = tup[0] + def state_ = tup[1] // e.g. [output: new File("myoutput.h5ad"), k: 10] + def origState_ = tup[2] // e.g. [output: '$id.$key.foo.h5ad'] + + // TODO: allow overriding the state.yaml template + // TODO TODO: if auto.publish == "state", add output_state as an argument + def yamlTemplate = params.containsKey("output_state") ? params.output_state : '$id.$key.state.yaml' + def yamlFilename = yamlTemplate + .replaceAll('\\$id', id_) + .replaceAll('\\$key', key_) + def yamlDir = java.nio.file.Paths.get(yamlFilename).getParent() + + // the processed state is a list of [key, value, inputPath, outputFilename] tuples, where + // - key is a String + // - value is any object that can be serialized to a Yaml (so a String/Integer/Long/Double/Boolean, a List, a Map, or a Path) + // - inputPath is a List[Path] + // - outputFilename is a List[String] + // - (key, value) are the tuples that will be saved to the state.yaml file + // - (inputPath, outputFilename) are the files that will be copied from src to dest (relative to the state.yaml) + def processedState = + config.allArguments + .findAll { it.direction == "output" } + .collectMany { par -> + def plainName_ = par.plainName + // if the state does not contain the key, it's an + // optional argument for which the component did + // not generate any output + if (!state_.containsKey(plainName_)) { + return [] + } + def value = state_[plainName_] + // if the parameter is not a file, it should be stored + // in the state as-is, but is not something that needs + // to be copied from the source path to the dest path + if (par.type != "file") { + return [[key: plainName_, value: value, inputPath: [], outputFilename: []]] + } + // if the orig state does not contain this filename, + // it's an optional argument for which the user specified + // that it should not be returned as a state + if (!origState_.containsKey(plainName_)) { + return [] + } + def filenameTemplate = origState_[plainName_] + // if the pararameter is multiple: true, fetch the template + if (par.multiple && filenameTemplate instanceof List) { + filenameTemplate = filenameTemplate[0] + } + // instantiate the template + def filename = filenameTemplate + .replaceAll('\\$id', id_) + .replaceAll('\\$key', key_) + if (par.multiple) { + // if the parameter is multiple: true, the filename + // should contain a wildcard '*' that is replaced with + // the index of the file + assert filename.contains("*") : "Module '${key_}' id '${id_}': Multiple output files specified, but no wildcard '*' in the filename: ${filename}" + def outputPerFile = value.withIndex().collect{ val, ix -> + def filename_ix = filename.replace("*", ix.toString()) + def value_ = java.nio.file.Paths.get(filename_ix) + // if id contains a slash + if (yamlDir != null) { + value_ = yamlDir.relativize(value_) + } + def inputPath = val instanceof File ? val.toPath() : val + [value: value_, inputPath: inputPath, outputFilename: filename_ix] + } + def transposedOutputs = ["value", "inputPath", "outputFilename"].collectEntries{ key -> + [key, outputPerFile.collect{dic -> dic[key]}] + } + return [[key: plainName_] + transposedOutputs] + } else { + def value_ = java.nio.file.Paths.get(filename) + // if id contains a slash + if (yamlDir != null) { + value_ = yamlDir.relativize(value_) + } + def inputPath = value instanceof File ? value.toPath() : value + return [[key: plainName_, value: value_, inputPath: [inputPath], outputFilename: [filename]]] + } + } + + def updatedState_ = processedState.collectEntries{[it.key, it.value]} + def inputPaths = processedState.collectMany{it.inputPath} + def outputFilenames = processedState.collectMany{it.outputFilename} + + // convert state to yaml blob + def yamlBlob_ = toTaggedYamlBlob([id: id_] + updatedState_) + + [id_, yamlBlob_, yamlFilename, inputPaths, outputFilenames] + } + | publishStatesProc + emit: input_ch + } + return publishStatesSimpleWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/setState.nf' +def setState(fun) { + assert fun instanceof Closure || fun instanceof Map || fun instanceof List : + "Error in setState: Expected process argument to be a Closure, a Map, or a List. Found: class ${fun.getClass()}" + + // if fun is a List, convert to map + if (fun instanceof List) { + // check whether fun is a list[string] + assert fun.every{it instanceof CharSequence} : "Error in setState: argument is a List, but not all elements are Strings" + fun = fun.collectEntries{[it, it]} + } + + // if fun is a map, convert to closure + if (fun instanceof Map) { + // check whether fun is a map[string, string] + assert fun.values().every{it instanceof CharSequence} : "Error in setState: argument is a Map, but not all values are Strings" + assert fun.keySet().every{it instanceof CharSequence} : "Error in setState: argument is a Map, but not all keys are Strings" + def funMap = fun.clone() + // turn the map into a closure to be used later on + fun = { id_, state_ -> + assert state_ instanceof Map : "Error in setState: the state is not a Map" + funMap.collectMany{newkey, origkey -> + if (state_.containsKey(origkey)) { + [[newkey, state_[origkey]]] + } else { + [] + } + }.collectEntries() + } + } + + map { tup -> + def id = tup[0] + def state = tup[1] + def unfilteredState = fun(id, state) + def newState = unfilteredState.findAll{key, val -> val != null} + [id, newState] + tup.drop(2) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/processAuto.nf' +// TODO: unit test processAuto +def processAuto(Map auto) { + // remove null values + auto = auto.findAll{k, v -> v != null} + + // check for unexpected keys + def expectedKeys = ["simplifyInput", "simplifyOutput", "transcript", "publish"] + def unexpectedKeys = auto.keySet() - expectedKeys + assert unexpectedKeys.isEmpty(), "unexpected keys in auto: '${unexpectedKeys.join("', '")}'" + + // check auto.simplifyInput + assert auto.simplifyInput instanceof Boolean, "auto.simplifyInput must be a boolean" + + // check auto.simplifyOutput + assert auto.simplifyOutput instanceof Boolean, "auto.simplifyOutput must be a boolean" + + // check auto.transcript + assert auto.transcript instanceof Boolean, "auto.transcript must be a boolean" + + // check auto.publish + assert auto.publish instanceof Boolean || auto.publish == "state", "auto.publish must be a boolean or 'state'" + + return auto.subMap(expectedKeys) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/processDirectives.nf' +def assertMapKeys(map, expectedKeys, requiredKeys, mapName) { + assert map instanceof Map : "Expected argument '$mapName' to be a Map. Found: class ${map.getClass()}" + map.forEach { key, val -> + assert key in expectedKeys : "Unexpected key '$key' in ${mapName ? mapName + " " : ""}map" + } + requiredKeys.forEach { requiredKey -> + assert map.containsKey(requiredKey) : "Missing required key '$key' in ${mapName ? mapName + " " : ""}map" + } +} + +// TODO: unit test processDirectives +def processDirectives(Map drctv) { + // remove null values + drctv = drctv.findAll{k, v -> v != null} + + // check for unexpected keys + def expectedKeys = [ + "accelerator", "afterScript", "beforeScript", "cache", "conda", "container", "containerOptions", "cpus", "disk", "echo", "errorStrategy", "executor", "machineType", "maxErrors", "maxForks", "maxRetries", "memory", "module", "penv", "pod", "publishDir", "queue", "label", "scratch", "storeDir", "stageInMode", "stageOutMode", "tag", "time" + ] + def unexpectedKeys = drctv.keySet() - expectedKeys + assert unexpectedKeys.isEmpty() : "Unexpected keys in process directive: '${unexpectedKeys.join("', '")}'" + + /* DIRECTIVE accelerator + accepted examples: + - [ limit: 4, type: "nvidia-tesla-k80" ] + */ + if (drctv.containsKey("accelerator")) { + assertMapKeys(drctv["accelerator"], ["type", "limit", "request", "runtime"], [], "accelerator") + } + + /* DIRECTIVE afterScript + accepted examples: + - "source /cluster/bin/cleanup" + */ + if (drctv.containsKey("afterScript")) { + assert drctv["afterScript"] instanceof CharSequence + } + + /* DIRECTIVE beforeScript + accepted examples: + - "source /cluster/bin/setup" + */ + if (drctv.containsKey("beforeScript")) { + assert drctv["beforeScript"] instanceof CharSequence + } + + /* DIRECTIVE cache + accepted examples: + - true + - false + - "deep" + - "lenient" + */ + if (drctv.containsKey("cache")) { + assert drctv["cache"] instanceof CharSequence || drctv["cache"] instanceof Boolean + if (drctv["cache"] instanceof CharSequence) { + assert drctv["cache"] in ["deep", "lenient"] : "Unexpected value for cache" + } + } + + /* DIRECTIVE conda + accepted examples: + - "bwa=0.7.15" + - "bwa=0.7.15 fastqc=0.11.5" + - ["bwa=0.7.15", "fastqc=0.11.5"] + */ + if (drctv.containsKey("conda")) { + if (drctv["conda"] instanceof List) { + drctv["conda"] = drctv["conda"].join(" ") + } + assert drctv["conda"] instanceof CharSequence + } + + /* DIRECTIVE container + accepted examples: + - "foo/bar:tag" + - [ registry: "reg", image: "im", tag: "ta" ] + is transformed to "reg/im:ta" + - [ image: "im" ] + is transformed to "im:latest" + */ + if (drctv.containsKey("container")) { + assert drctv["container"] instanceof Map || drctv["container"] instanceof CharSequence + if (drctv["container"] instanceof Map) { + def m = drctv["container"] + assertMapKeys(m, [ "registry", "image", "tag" ], ["image"], "container") + def part1 = + System.getenv('OVERRIDE_CONTAINER_REGISTRY') ? System.getenv('OVERRIDE_CONTAINER_REGISTRY') + "/" : + params.containsKey("override_container_registry") ? params["override_container_registry"] + "/" : // todo: remove? + m.registry ? m.registry + "/" : + "" + def part2 = m.image + def part3 = m.tag ? ":" + m.tag : ":latest" + drctv["container"] = part1 + part2 + part3 + } + } + + /* DIRECTIVE containerOptions + accepted examples: + - "--foo bar" + - ["--foo bar", "-f b"] + */ + if (drctv.containsKey("containerOptions")) { + if (drctv["containerOptions"] instanceof List) { + drctv["containerOptions"] = drctv["containerOptions"].join(" ") + } + assert drctv["containerOptions"] instanceof CharSequence + } + + /* DIRECTIVE cpus + accepted examples: + - 1 + - 10 + */ + if (drctv.containsKey("cpus")) { + assert drctv["cpus"] instanceof Integer + } + + /* DIRECTIVE disk + accepted examples: + - "1 GB" + - "2TB" + - "3.2KB" + - "10.B" + */ + if (drctv.containsKey("disk")) { + assert drctv["disk"] instanceof CharSequence + // assert drctv["disk"].matches("[0-9]+(\\.[0-9]*)? *[KMGTPEZY]?B") + // ^ does not allow closures + } + + /* DIRECTIVE echo + accepted examples: + - true + - false + */ + if (drctv.containsKey("echo")) { + assert drctv["echo"] instanceof Boolean + } + + /* DIRECTIVE errorStrategy + accepted examples: + - "terminate" + - "finish" + */ + if (drctv.containsKey("errorStrategy")) { + assert drctv["errorStrategy"] instanceof CharSequence + assert drctv["errorStrategy"] in ["terminate", "finish", "ignore", "retry"] : "Unexpected value for errorStrategy" + } + + /* DIRECTIVE executor + accepted examples: + - "local" + - "sge" + */ + if (drctv.containsKey("executor")) { + assert drctv["executor"] instanceof CharSequence + assert drctv["executor"] in ["local", "sge", "uge", "lsf", "slurm", "pbs", "pbspro", "moab", "condor", "nqsii", "ignite", "k8s", "awsbatch", "google-pipelines"] : "Unexpected value for executor" + } + + /* DIRECTIVE machineType + accepted examples: + - "n1-highmem-8" + */ + if (drctv.containsKey("machineType")) { + assert drctv["machineType"] instanceof CharSequence + } + + /* DIRECTIVE maxErrors + accepted examples: + - 1 + - 3 + */ + if (drctv.containsKey("maxErrors")) { + assert drctv["maxErrors"] instanceof Integer + } + + /* DIRECTIVE maxForks + accepted examples: + - 1 + - 3 + */ + if (drctv.containsKey("maxForks")) { + assert drctv["maxForks"] instanceof Integer + } + + /* DIRECTIVE maxRetries + accepted examples: + - 1 + - 3 + */ + if (drctv.containsKey("maxRetries")) { + assert drctv["maxRetries"] instanceof Integer + } + + /* DIRECTIVE memory + accepted examples: + - "1 GB" + - "2TB" + - "3.2KB" + - "10.B" + */ + if (drctv.containsKey("memory")) { + assert drctv["memory"] instanceof CharSequence + // assert drctv["memory"].matches("[0-9]+(\\.[0-9]*)? *[KMGTPEZY]?B") + // ^ does not allow closures + } + + /* DIRECTIVE module + accepted examples: + - "ncbi-blast/2.2.27" + - "ncbi-blast/2.2.27:t_coffee/10.0" + - ["ncbi-blast/2.2.27", "t_coffee/10.0"] + */ + if (drctv.containsKey("module")) { + if (drctv["module"] instanceof List) { + drctv["module"] = drctv["module"].join(":") + } + assert drctv["module"] instanceof CharSequence + } + + /* DIRECTIVE penv + accepted examples: + - "smp" + */ + if (drctv.containsKey("penv")) { + assert drctv["penv"] instanceof CharSequence + } + + /* DIRECTIVE pod + accepted examples: + - [ label: "key", value: "val" ] + - [ annotation: "key", value: "val" ] + - [ env: "key", value: "val" ] + - [ [label: "l", value: "v"], [env: "e", value: "v"]] + */ + if (drctv.containsKey("pod")) { + if (drctv["pod"] instanceof Map) { + drctv["pod"] = [ drctv["pod"] ] + } + assert drctv["pod"] instanceof List + drctv["pod"].forEach { pod -> + assert pod instanceof Map + // TODO: should more checks be added? + // See https://www.nextflow.io/docs/latest/process.html?highlight=directives#pod + // e.g. does it contain 'label' and 'value', or 'annotation' and 'value', or ...? + } + } + + /* DIRECTIVE publishDir + accepted examples: + - [] + - [ [ path: "foo", enabled: true ], [ path: "bar", enabled: false ] ] + - "/path/to/dir" + is transformed to [[ path: "/path/to/dir" ]] + - [ path: "/path/to/dir", mode: "cache" ] + is transformed to [[ path: "/path/to/dir", mode: "cache" ]] + */ + // TODO: should we also look at params["publishDir"]? + if (drctv.containsKey("publishDir")) { + def pblsh = drctv["publishDir"] + + // check different options + assert pblsh instanceof List || pblsh instanceof Map || pblsh instanceof CharSequence + + // turn into list if not already so + // for some reason, 'if (!pblsh instanceof List) pblsh = [ pblsh ]' doesn't work. + pblsh = pblsh instanceof List ? pblsh : [ pblsh ] + + // check elements of publishDir + pblsh = pblsh.collect{ elem -> + // turn into map if not already so + elem = elem instanceof CharSequence ? [ path: elem ] : elem + + // check types and keys + assert elem instanceof Map : "Expected publish argument '$elem' to be a String or a Map. Found: class ${elem.getClass()}" + assertMapKeys(elem, [ "path", "mode", "overwrite", "pattern", "saveAs", "enabled" ], ["path"], "publishDir") + + // check elements in map + assert elem.containsKey("path") + assert elem["path"] instanceof CharSequence + if (elem.containsKey("mode")) { + assert elem["mode"] instanceof CharSequence + assert elem["mode"] in [ "symlink", "rellink", "link", "copy", "copyNoFollow", "move" ] + } + if (elem.containsKey("overwrite")) { + assert elem["overwrite"] instanceof Boolean + } + if (elem.containsKey("pattern")) { + assert elem["pattern"] instanceof CharSequence + } + if (elem.containsKey("saveAs")) { + assert elem["saveAs"] instanceof CharSequence //: "saveAs as a Closure is currently not supported. Surround your closure with single quotes to get the desired effect. Example: '\{ foo \}'" + } + if (elem.containsKey("enabled")) { + assert elem["enabled"] instanceof Boolean + } + + // return final result + elem + } + // store final directive + drctv["publishDir"] = pblsh + } + + /* DIRECTIVE queue + accepted examples: + - "long" + - "short,long" + - ["short", "long"] + */ + if (drctv.containsKey("queue")) { + if (drctv["queue"] instanceof List) { + drctv["queue"] = drctv["queue"].join(",") + } + assert drctv["queue"] instanceof CharSequence + } + + /* DIRECTIVE label + accepted examples: + - "big_mem" + - "big_cpu" + - ["big_mem", "big_cpu"] + */ + if (drctv.containsKey("label")) { + if (drctv["label"] instanceof CharSequence) { + drctv["label"] = [ drctv["label"] ] + } + assert drctv["label"] instanceof List + drctv["label"].forEach { label -> + assert label instanceof CharSequence + // assert label.matches("[a-zA-Z0-9]([a-zA-Z0-9_]*[a-zA-Z0-9])?") + // ^ does not allow closures + } + } + + /* DIRECTIVE scratch + accepted examples: + - true + - "/path/to/scratch" + - '$MY_PATH_TO_SCRATCH' + - "ram-disk" + */ + if (drctv.containsKey("scratch")) { + assert drctv["scratch"] == true || drctv["scratch"] instanceof CharSequence + } + + /* DIRECTIVE storeDir + accepted examples: + - "/path/to/storeDir" + */ + if (drctv.containsKey("storeDir")) { + assert drctv["storeDir"] instanceof CharSequence + } + + /* DIRECTIVE stageInMode + accepted examples: + - "copy" + - "link" + */ + if (drctv.containsKey("stageInMode")) { + assert drctv["stageInMode"] instanceof CharSequence + assert drctv["stageInMode"] in ["copy", "link", "symlink", "rellink"] + } + + /* DIRECTIVE stageOutMode + accepted examples: + - "copy" + - "link" + */ + if (drctv.containsKey("stageOutMode")) { + assert drctv["stageOutMode"] instanceof CharSequence + assert drctv["stageOutMode"] in ["copy", "move", "rsync"] + } + + /* DIRECTIVE tag + accepted examples: + - "foo" + - '$id' + */ + if (drctv.containsKey("tag")) { + assert drctv["tag"] instanceof CharSequence + } + + /* DIRECTIVE time + accepted examples: + - "1h" + - "2days" + - "1day 6hours 3minutes 30seconds" + */ + if (drctv.containsKey("time")) { + assert drctv["time"] instanceof CharSequence + // todo: validation regex? + } + + return drctv +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/processWorkflowArgs.nf' +def processWorkflowArgs(Map args, Map defaultWfArgs, Map meta) { + // override defaults with args + def workflowArgs = defaultWfArgs + args + + // check whether 'key' exists + assert workflowArgs.containsKey("key") : "Error in module '${meta.config.name}': key is a required argument" + + // if 'key' is a closure, apply it to the original key + if (workflowArgs["key"] instanceof Closure) { + workflowArgs["key"] = workflowArgs["key"](meta.config.name) + } + def key = workflowArgs["key"] + assert key instanceof CharSequence : "Expected process argument 'key' to be a String. Found: class ${key.getClass()}" + assert key ==~ /^[a-zA-Z_]\w*$/ : "Error in module '$key': Expected process argument 'key' to consist of only letters, digits or underscores. Found: ${key}" + + // check for any unexpected keys + def expectedKeys = ["key", "directives", "auto", "map", "mapId", "mapData", "mapPassthrough", "filter", "runIf", "fromState", "toState", "args", "renameKeys", "debug"] + def unexpectedKeys = workflowArgs.keySet() - expectedKeys + assert unexpectedKeys.isEmpty() : "Error in module '$key': unexpected arguments to the '.run()' function: '${unexpectedKeys.join("', '")}'" + + // check whether directives exists and apply defaults + assert workflowArgs.containsKey("directives") : "Error in module '$key': directives is a required argument" + assert workflowArgs["directives"] instanceof Map : "Error in module '$key': Expected process argument 'directives' to be a Map. Found: class ${workflowArgs['directives'].getClass()}" + workflowArgs["directives"] = processDirectives(defaultWfArgs.directives + workflowArgs["directives"]) + + // check whether directives exists and apply defaults + assert workflowArgs.containsKey("auto") : "Error in module '$key': auto is a required argument" + assert workflowArgs["auto"] instanceof Map : "Error in module '$key': Expected process argument 'auto' to be a Map. Found: class ${workflowArgs['auto'].getClass()}" + workflowArgs["auto"] = processAuto(defaultWfArgs.auto + workflowArgs["auto"]) + + // auto define publish, if so desired + if (workflowArgs.auto.publish == true && (workflowArgs.directives.publishDir != null ? workflowArgs.directives.publishDir : [:]).isEmpty()) { + // can't assert at this level thanks to the no_publish profile + // assert params.containsKey("publishDir") || params.containsKey("publish_dir") : + // "Error in module '${workflowArgs['key']}': if auto.publish is true, params.publish_dir needs to be defined.\n" + + // " Example: params.publish_dir = \"./output/\"" + def publishDir = getPublishDir() + + if (publishDir != null) { + workflowArgs.directives.publishDir = [[ + path: publishDir, + saveAs: "{ it.startsWith('.') ? null : it }", // don't publish hidden files, by default + mode: "copy" + ]] + } + } + + // auto define transcript, if so desired + if (workflowArgs.auto.transcript == true) { + // can't assert at this level thanks to the no_publish profile + // assert params.containsKey("transcriptsDir") || params.containsKey("transcripts_dir") || params.containsKey("publishDir") || params.containsKey("publish_dir") : + // "Error in module '${workflowArgs['key']}': if auto.transcript is true, either params.transcripts_dir or params.publish_dir needs to be defined.\n" + + // " Example: params.transcripts_dir = \"./transcripts/\"" + def transcriptsDir = + params.containsKey("transcripts_dir") ? params.transcripts_dir : + params.containsKey("transcriptsDir") ? params.transcriptsDir : + params.containsKey("publish_dir") ? params.publish_dir + "/_transcripts" : + params.containsKey("publishDir") ? params.publishDir + "/_transcripts" : + null + if (transcriptsDir != null) { + def timestamp = nextflow.Nextflow.getSession().getWorkflowMetadata().start.format('yyyy-MM-dd_HH-mm-ss') + def transcriptsPublishDir = [ + path: "$transcriptsDir/$timestamp/\${task.process.replaceAll(':', '-')}/\${id}/", + saveAs: "{ it.startsWith('.') ? it.replaceAll('^.', '') : null }", + mode: "copy" + ] + def publishDirs = workflowArgs.directives.publishDir != null ? workflowArgs.directives.publishDir : null ? workflowArgs.directives.publishDir : [] + workflowArgs.directives.publishDir = publishDirs + transcriptsPublishDir + } + } + + // if this is a stubrun, remove certain directives? + if (workflow.stubRun) { + workflowArgs.directives.keySet().removeAll(["publishDir", "cpus", "memory", "label"]) + } + + for (nam in ["map", "mapId", "mapData", "mapPassthrough", "filter", "runIf"]) { + if (workflowArgs.containsKey(nam) && workflowArgs[nam]) { + assert workflowArgs[nam] instanceof Closure : "Error in module '$key': Expected process argument '$nam' to be null or a Closure. Found: class ${workflowArgs[nam].getClass()}" + } + } + + // TODO: should functions like 'map', 'mapId', 'mapData', 'mapPassthrough' be deprecated as well? + for (nam in ["map", "mapData", "mapPassthrough", "renameKeys"]) { + if (workflowArgs.containsKey(nam) && workflowArgs[nam] != null) { + log.warn "module '$key': workflow argument '$nam' is deprecated and will be removed in Viash 0.9.0. Please use 'fromState' and 'toState' instead." + } + } + + // check fromState + workflowArgs["fromState"] = _processFromState(workflowArgs.get("fromState"), key, meta.config) + + // check toState + workflowArgs["toState"] = _processToState(workflowArgs.get("toState"), key, meta.config) + + // return output + return workflowArgs +} + +def _processFromState(fromState, key_, config_) { + assert fromState == null || fromState instanceof Closure || fromState instanceof Map || fromState instanceof List : + "Error in module '$key_': Expected process argument 'fromState' to be null, a Closure, a Map, or a List. Found: class ${fromState.getClass()}" + if (fromState == null) { + return null + } + + // if fromState is a List, convert to map + if (fromState instanceof List) { + // check whether fromstate is a list[string] + assert fromState.every{it instanceof CharSequence} : "Error in module '$key_': fromState is a List, but not all elements are Strings" + fromState = fromState.collectEntries{[it, it]} + } + + // if fromState is a map, convert to closure + if (fromState instanceof Map) { + // check whether fromstate is a map[string, string] + assert fromState.values().every{it instanceof CharSequence} : "Error in module '$key_': fromState is a Map, but not all values are Strings" + assert fromState.keySet().every{it instanceof CharSequence} : "Error in module '$key_': fromState is a Map, but not all keys are Strings" + def fromStateMap = fromState.clone() + def requiredInputNames = meta.config.allArguments.findAll{it.required && it.direction == "Input"}.collect{it.plainName} + // turn the map into a closure to be used later on + fromState = { it -> + def state = it[1] + assert state instanceof Map : "Error in module '$key_': the state is not a Map" + def data = fromStateMap.collectMany{newkey, origkey -> + // check whether newkey corresponds to a required argument + if (state.containsKey(origkey)) { + [[newkey, state[origkey]]] + } else if (!requiredInputNames.contains(origkey)) { + [] + } else { + throw new Exception("Error in module '$key_': fromState key '$origkey' not found in current state") + } + }.collectEntries() + data + } + } + + return fromState +} + +def _processToState(toState, key_, config_) { + if (toState == null) { + toState = { tup -> tup[1] } + } + + // toState should be a closure, map[string, string], or list[string] + assert toState instanceof Closure || toState instanceof Map || toState instanceof List : + "Error in module '$key_': Expected process argument 'toState' to be a Closure, a Map, or a List. Found: class ${toState.getClass()}" + + // if toState is a List, convert to map + if (toState instanceof List) { + // check whether toState is a list[string] + assert toState.every{it instanceof CharSequence} : "Error in module '$key_': toState is a List, but not all elements are Strings" + toState = toState.collectEntries{[it, it]} + } + + // if toState is a map, convert to closure + if (toState instanceof Map) { + // check whether toState is a map[string, string] + assert toState.values().every{it instanceof CharSequence} : "Error in module '$key_': toState is a Map, but not all values are Strings" + assert toState.keySet().every{it instanceof CharSequence} : "Error in module '$key_': toState is a Map, but not all keys are Strings" + def toStateMap = toState.clone() + def requiredOutputNames = config_.allArguments.findAll{it.required && it.direction == "Output"}.collect{it.plainName} + // turn the map into a closure to be used later on + toState = { it -> + def output = it[1] + def state = it[2] + assert output instanceof Map : "Error in module '$key_': the output is not a Map" + assert state instanceof Map : "Error in module '$key_': the state is not a Map" + def extraEntries = toStateMap.collectMany{newkey, origkey -> + // check whether newkey corresponds to a required argument + if (output.containsKey(origkey)) { + [[newkey, output[origkey]]] + } else if (!requiredOutputNames.contains(origkey)) { + [] + } else { + throw new Exception("Error in module '$key_': toState key '$origkey' not found in current output") + } + }.collectEntries() + state + extraEntries + } + } + + return toState +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/workflowFactory.nf' +def _debug(workflowArgs, debugKey) { + if (workflowArgs.debug) { + view { "process '${workflowArgs.key}' $debugKey tuple: $it" } + } else { + map { it } + } +} + +// depends on: innerWorkflowFactory +def workflowFactory(Map args, Map defaultWfArgs, Map meta) { + def workflowArgs = processWorkflowArgs(args, defaultWfArgs, meta) + def key_ = workflowArgs["key"] + + workflow workflowInstance { + take: input_ + + main: + def chModified = input_ + | checkUniqueIds([:]) + | _debug(workflowArgs, "input") + | map { tuple -> + tuple = deepClone(tuple) + + if (workflowArgs.map) { + tuple = workflowArgs.map(tuple) + } + if (workflowArgs.mapId) { + tuple[0] = workflowArgs.mapId(tuple[0]) + } + if (workflowArgs.mapData) { + tuple[1] = workflowArgs.mapData(tuple[1]) + } + if (workflowArgs.mapPassthrough) { + tuple = tuple.take(2) + workflowArgs.mapPassthrough(tuple.drop(2)) + } + + // check tuple + assert tuple instanceof List : + "Error in module '${key_}': element in channel should be a tuple [id, data, ...otherargs...]\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Expected class: List. Found: tuple.getClass() is ${tuple.getClass()}" + assert tuple.size() >= 2 : + "Error in module '${key_}': expected length of tuple in input channel to be two or greater.\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Found: tuple.size() == ${tuple.size()}" + + // check id field + if (tuple[0] instanceof GString) { + tuple[0] = tuple[0].toString() + } + assert tuple[0] instanceof CharSequence : + "Error in module '${key_}': first element of tuple in channel should be a String\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Found: ${tuple[0]}" + + // match file to input file + if (workflowArgs.auto.simplifyInput && (tuple[1] instanceof Path || tuple[1] instanceof List)) { + def inputFiles = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "input" } + + assert inputFiles.size() == 1 : + "Error in module '${key_}' id '${tuple[0]}'.\n" + + " Anonymous file inputs are only allowed when the process has exactly one file input.\n" + + " Expected: inputFiles.size() == 1. Found: inputFiles.size() is ${inputFiles.size()}" + + tuple[1] = [[ inputFiles[0].plainName, tuple[1] ]].collectEntries() + } + + // check data field + assert tuple[1] instanceof Map : + "Error in module '${key_}' id '${tuple[0]}': second element of tuple in channel should be a Map\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Expected class: Map. Found: tuple[1].getClass() is ${tuple[1].getClass()}" + + // rename keys of data field in tuple + if (workflowArgs.renameKeys) { + assert workflowArgs.renameKeys instanceof Map : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Example: renameKeys: ['new_key': 'old_key'].\n" + + " Expected class: Map. Found: renameKeys.getClass() is ${workflowArgs.renameKeys.getClass()}" + assert tuple[1] instanceof Map : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Expected class: Map. Found: tuple[1].getClass() is ${tuple[1].getClass()}" + + // TODO: allow renameKeys to be a function? + workflowArgs.renameKeys.each { newKey, oldKey -> + assert newKey instanceof CharSequence : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Example: renameKeys: ['new_key': 'old_key'].\n" + + " Expected class of newKey: String. Found: newKey.getClass() is ${newKey.getClass()}" + assert oldKey instanceof CharSequence : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Example: renameKeys: ['new_key': 'old_key'].\n" + + " Expected class of oldKey: String. Found: oldKey.getClass() is ${oldKey.getClass()}" + assert tuple[1].containsKey(oldKey) : + "Error renaming data keys in module '${key}' id '${tuple[0]}'.\n" + + " Key '$oldKey' is missing in the data map. tuple[1].keySet() is '${tuple[1].keySet()}'" + tuple[1].put(newKey, tuple[1][oldKey]) + } + tuple[1].keySet().removeAll(workflowArgs.renameKeys.collect{ newKey, oldKey -> oldKey }) + } + tuple + } + + def chModifiedFiltered = workflowArgs.filter ? + chModified | filter{workflowArgs.filter(it)} : + chModified + + def chRun = null + def chPassthrough = null + if (workflowArgs.runIf) { + def runIfBranch = chModifiedFiltered.branch{ tup -> + run: workflowArgs.runIf(tup[0], tup[1]) + passthrough: true + } + chRun = runIfBranch.run + chPassthrough = runIfBranch.passthrough + } else { + chRun = chModifiedFiltered + chPassthrough = Channel.empty() + } + + def chArgs = workflowArgs.fromState ? + chRun | map{ + def new_data = workflowArgs.fromState(it.take(2)) + [it[0], new_data] + } : + chRun | map {tup -> tup.take(2)} + + // fill in defaults + def chArgsWithDefaults = chArgs + | map { tuple -> + def id_ = tuple[0] + def data_ = tuple[1] + + // TODO: could move fromState to here + + // fetch default params from functionality + def defaultArgs = meta.config.allArguments + .findAll { it.containsKey("default") } + .collectEntries { [ it.plainName, it.default ] } + + // fetch overrides in params + def paramArgs = meta.config.allArguments + .findAll { par -> + def argKey = key_ + "__" + par.plainName + params.containsKey(argKey) + } + .collectEntries { [ it.plainName, params[key_ + "__" + it.plainName] ] } + + // fetch overrides in data + def dataArgs = meta.config.allArguments + .findAll { data_.containsKey(it.plainName) } + .collectEntries { [ it.plainName, data_[it.plainName] ] } + + // combine params + def combinedArgs = defaultArgs + paramArgs + workflowArgs.args + dataArgs + + // remove arguments with explicit null values + combinedArgs + .removeAll{_, val -> val == null || val == "viash_no_value" || val == "force_null"} + + combinedArgs = _processInputValues(combinedArgs, meta.config, id_, key_) + + [id_, combinedArgs] + tuple.drop(2) + } + + // TODO: move some of the _meta.join_id wrangling to the safeJoin() function. + def chInitialOutput = chArgsWithDefaults + | _debug(workflowArgs, "processed") + // run workflow + | innerWorkflowFactory(workflowArgs) + // check output tuple + | map { id_, output_ -> + + // see if output map contains metadata + def meta_ = + output_ instanceof Map && output_.containsKey("_meta") ? + output_["_meta"] : + [:] + def join_id = meta_.join_id ?: id_ + + // remove metadata + output_ = output_.findAll{k, v -> k != "_meta"} + + // check value types + output_ = _processOutputValues(output_, meta.config, id_, key_) + + // simplify output if need be + if (workflowArgs.auto.simplifyOutput && output_.size() == 1) { + output_ = output_.values()[0] + } + + [join_id, id_, output_] + } + // | view{"chInitialOutput: ${it.take(3)}"} + + // join the output [prev_id, new_id, output] with the previous state [prev_id, state, ...] + def chNewState = safeJoin(chInitialOutput, chModifiedFiltered, key_) + // input tuple format: [join_id, id, output, prev_state, ...] + // output tuple format: [join_id, id, new_state, ...] + | map{ tup -> + def new_state = workflowArgs.toState(tup.drop(1).take(3)) + tup.take(2) + [new_state] + tup.drop(4) + } + + if (workflowArgs.auto.publish == "state") { + def chPublish = chNewState + // input tuple format: [join_id, id, new_state, ...] + // output tuple format: [join_id, id, new_state] + | map{ tup -> + tup.take(3) + } + + safeJoin(chPublish, chArgsWithDefaults, key_) + // input tuple format: [join_id, id, new_state, orig_state, ...] + // output tuple format: [id, new_state, orig_state] + | map { tup -> + tup.drop(1).take(3) + } + | publishStatesByConfig(key: key_, config: meta.config) + } + + // remove join_id and meta + chReturn = chNewState + | map { tup -> + // input tuple format: [join_id, id, new_state, ...] + // output tuple format: [id, new_state, ...] + tup.drop(1) + } + | _debug(workflowArgs, "output") + | concat(chPassthrough) + + emit: chReturn + } + + def wf = workflowInstance.cloneWithName(key_) + + // add factory function + wf.metaClass.run = { runArgs -> + workflowFactory(runArgs, workflowArgs, meta) + } + // add config to module for later introspection + wf.metaClass.config = meta.config + + return wf +} + +nextflow.enable.dsl=2 + +// START COMPONENT-SPECIFIC CODE + +// create meta object +meta = [ + "resources_dir": moduleDir.toRealPath().normalize(), + "config": processConfig(readJsonBlob('''{ + "name" : "cutadapt", + "version" : "v0.1.0", + "argument_groups" : [ + { + "name" : "Specify Adapters for R1", + "arguments" : [ + { + "type" : "string", + "name" : "--adapter", + "alternatives" : [ + "-a" + ], + "description" : "Sequence of an adapter ligated to the 3' end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a '$' character is appended ('anchoring'), the\nadapter is only found if it is a suffix of the read.\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--front", + "alternatives" : [ + "-g" + ], + "description" : "Sequence of an adapter ligated to the 5' end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5' end are allowed. If\na '^' character is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of the read.\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--anywhere", + "alternatives" : [ + "-b" + ], + "description" : "Sequence of an adapter that may be ligated to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + } + ] + }, + { + "name" : "Specify Adapters using Fasta files for R1", + "arguments" : [ + { + "type" : "file", + "name" : "--adapter_fasta", + "description" : "Fasta file containing sequences of an adapter ligated to the 3' end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a '$' character is appended ('anchoring'), the\nadapter is only found if it is a suffix of the read.\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--front_fasta", + "description" : "Fasta file containing sequences of an adapter ligated to the 5' end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5' end are allowed. If\na '^' character is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of the read.\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--anywhere_fasta", + "description" : "Fasta file containing sequences of an adapter that may be ligated to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + } + ] + }, + { + "name" : "Specify Adapters for R2", + "arguments" : [ + { + "type" : "string", + "name" : "--adapter_r2", + "alternatives" : [ + "-A" + ], + "description" : "Sequence of an adapter ligated to the 3' end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a '$' character is appended ('anchoring'), the\nadapter is only found if it is a suffix of the read.\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--front_r2", + "alternatives" : [ + "-G" + ], + "description" : "Sequence of an adapter ligated to the 5' end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5' end are allowed. If\na '^' character is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of the read.\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--anywhere_r2", + "alternatives" : [ + "-B" + ], + "description" : "Sequence of an adapter that may be ligated to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + } + ] + }, + { + "name" : "Specify Adapters using Fasta files for R2", + "arguments" : [ + { + "type" : "file", + "name" : "--adapter_r2_fasta", + "description" : "Fasta file containing sequences of an adapter ligated to the 3' end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a '$' character is appended ('anchoring'), the\nadapter is only found if it is a suffix of the read.\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--front_r2_fasta", + "description" : "Fasta file containing sequences of an adapter ligated to the 5' end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5' end are allowed. If\na '^' character is prepended ('anchoring'), the adapter is\nonly found if it is a prefix of the read.\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--anywhere_r2_fasta", + "description" : "Fasta file containing sequences of an adapter that may be ligated to the 5' or 3'\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + } + ] + }, + { + "name" : "Paired-end options", + "arguments" : [ + { + "type" : "boolean_true", + "name" : "--pair_adapters", + "description" : "Treat adapters given with -a/-A etc. as pairs. Either both\nor none are removed from each read pair.\n", + "direction" : "input" + }, + { + "type" : "string", + "name" : "--pair_filter", + "description" : "Which of the reads in a paired-end read have to match the\nfiltering criterion in order for the pair to be filtered.\n", + "required" : false, + "choices" : [ + "any", + "both", + "first" + ], + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--interleaved", + "description" : "Read and/or write interleaved paired-end reads.\n", + "direction" : "input" + } + ] + }, + { + "name" : "Input parameters", + "arguments" : [ + { + "type" : "file", + "name" : "--input", + "description" : "Input fastq file for single-end reads or R1 for paired-end reads.\n", + "must_exist" : true, + "create_parent" : true, + "required" : true, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--input_r2", + "description" : "Input fastq file for R2 in the case of paired-end reads.\n", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "double", + "name" : "--error_rate", + "alternatives" : [ + "-E", + "--errors" + ], + "description" : "Maximum allowed error rate (if 0 <= E < 1), or absolute\nnumber of errors for full-length adapter match (if E is an\ninteger >= 1). Error rate = no. of errors divided by\nlength of matching region. Default: 0.1 (10%).\n", + "example" : [ + 0.1 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_false", + "name" : "--no_indels", + "description" : "Allow only mismatches in alignments.\n", + "direction" : "input" + }, + { + "type" : "integer", + "name" : "--times", + "alternatives" : [ + "-n" + ], + "description" : "Remove up to COUNT adapters from each read. Default: 1.\n", + "example" : [ + 1 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--overlap", + "alternatives" : [ + "-O" + ], + "description" : "Require MINLENGTH overlap between read and adapter for an\nadapter to be found. The default is 3.\n", + "example" : [ + 3 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--match_read_wildcards", + "description" : "Interpret IUPAC wildcards in reads.\n", + "direction" : "input" + }, + { + "type" : "boolean_false", + "name" : "--no_match_adapter_wildcards", + "description" : "Do not interpret IUPAC wildcards in adapters.\n", + "direction" : "input" + }, + { + "type" : "string", + "name" : "--action", + "description" : "What to do if a match was found. trim: trim adapter and\nup- or downstream sequence; retain: trim, but retain\nadapter; mask: replace with 'N' characters; lowercase:\nconvert to lowercase; none: leave unchanged.\nThe default is trim.\n", + "example" : [ + "trim" + ], + "required" : false, + "choices" : [ + "trim", + "retain", + "mask", + "lowercase", + "none" + ], + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--revcomp", + "alternatives" : [ + "--rc" + ], + "description" : "Check both the read and its reverse complement for adapter\nmatches. If match is on reverse-complemented version,\noutput that one.\n", + "direction" : "input" + } + ] + }, + { + "name" : "Read modifications", + "arguments" : [ + { + "type" : "integer", + "name" : "--cut", + "alternatives" : [ + "-u" + ], + "description" : "Remove LEN bases from each read (or R1 if paired; use --cut_r2\noption for R2). If LEN is positive, remove bases from the\nbeginning. If LEN is negative, remove bases from the end.\nCan be used twice if LENs have different signs. Applied\n*before* adapter trimming.\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--cut_r2", + "description" : "Remove LEN bases from each read (for R2). If LEN is positive, remove bases from the\nbeginning. If LEN is negative, remove bases from the end.\nCan be used twice if LENs have different signs. Applied\n*before* adapter trimming.\n", + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--nextseq_trim", + "description" : "NextSeq-specific quality trimming (each read). Trims also\ndark cycles appearing as high-quality G bases.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--quality_cutoff", + "alternatives" : [ + "-q" + ], + "description" : "Trim low-quality bases from 5' and/or 3' ends of each read\nbefore adapter removal. Applied to both reads if data is\npaired. If one value is given, only the 3' end is trimmed.\nIf two comma-separated cutoffs are given, the 5' end is\ntrimmed with the first cutoff, the 3' end with the second.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--quality_cutoff_r2", + "alternatives" : [ + "-Q" + ], + "description" : "Quality-trimming cutoff for R2. Default: same as for R1\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--quality_base", + "description" : "Assume that quality values in FASTQ are encoded as\nascii(quality + N). This needs to be set to 64 for some\nold Illumina FASTQ files. The default is 33.\n", + "example" : [ + 33 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--poly_a", + "description" : "Trim poly-A tails", + "direction" : "input" + }, + { + "type" : "integer", + "name" : "--length", + "alternatives" : [ + "-l" + ], + "description" : "Shorten reads to LENGTH. Positive values remove bases at\nthe end while negative ones remove bases at the beginning.\nThis and the following modifications are applied after\nadapter trimming.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--trim_n", + "description" : "Trim N's on ends of reads.", + "direction" : "input" + }, + { + "type" : "string", + "name" : "--length_tag", + "description" : "Search for TAG followed by a decimal number in the\ndescription field of the read. Replace the decimal number\nwith the correct length of the trimmed read. For example,\nuse --length-tag 'length=' to correct fields like\n'length=123'.\n", + "example" : [ + "length=" + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--strip_suffix", + "description" : "Remove this suffix from read names if present. Can be\ngiven multiple times.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--prefix", + "alternatives" : [ + "-x" + ], + "description" : "Add this prefix to read names. Use {name} to insert the\nname of the matching adapter.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--suffix", + "alternatives" : [ + "-y" + ], + "description" : "Add this suffix to read names; can also include {name}\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--rename", + "description" : "Rename reads using TEMPLATE containing variables such as\n{id}, {adapter_name} etc. (see documentation)\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--zero_cap", + "alternatives" : [ + "-z" + ], + "description" : "Change negative quality values to zero.", + "direction" : "input" + } + ] + }, + { + "name" : "Filtering of processed reads", + "description" : "Filters are applied after above read modifications. Paired-end reads are\nalways discarded pairwise (see also --pair_filter).\n", + "arguments" : [ + { + "type" : "string", + "name" : "--minimum_length", + "alternatives" : [ + "-m" + ], + "description" : "Discard reads shorter than LEN. Default is 0.\nWhen trimming paired-end reads, the minimum lengths for R1 and R2 can be specified separately by separating them with a colon (:).\nIf the colon syntax is not used, the same minimum length applies to both reads, as discussed above.\nAlso, one of the values can be omitted to impose no restrictions.\nFor example, with -m 17:, the length of R1 must be at least 17, but the length of R2 is ignored.\n", + "example" : [ + "0" + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--maximum_length", + "alternatives" : [ + "-M" + ], + "description" : "Discard reads longer than LEN. Default: no limit.\nFor paired reads, see the remark for --minimum_length\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--max_n", + "description" : "Discard reads with more than COUNT 'N' bases. If COUNT is\na number between 0 and 1, it is interpreted as a fraction\nof the read length.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "long", + "name" : "--max_expected_errors", + "alternatives" : [ + "--max_ee" + ], + "description" : "Discard reads whose expected number of errors (computed\nfrom quality values) exceeds ERRORS.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "long", + "name" : "--max_average_error_rate", + "alternatives" : [ + "--max_aer" + ], + "description" : "as --max_expected_errors (see above), but divided by\nlength to account for reads of varying length.\n", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--discard_trimmed", + "alternatives" : [ + "--discard" + ], + "description" : "Discard reads that contain an adapter. Use also -O to\navoid discarding too many randomly matching reads.\n", + "direction" : "input" + }, + { + "type" : "boolean_true", + "name" : "--discard_untrimmed", + "alternatives" : [ + "--trimmed_only" + ], + "description" : "Discard reads that do not contain an adapter.\n", + "direction" : "input" + }, + { + "type" : "boolean_true", + "name" : "--discard_casava", + "description" : "Discard reads that did not pass CASAVA filtering (header\nhas :Y:).\n", + "direction" : "input" + } + ] + }, + { + "name" : "Output parameters", + "arguments" : [ + { + "type" : "string", + "name" : "--report", + "description" : "Which type of report to print: 'full' (default) or 'minimal'.\n", + "example" : [ + "full" + ], + "required" : false, + "choices" : [ + "full", + "minimal" + ], + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--json", + "description" : "Write report in JSON format to this file.\n", + "direction" : "input" + }, + { + "type" : "file", + "name" : "--output", + "description" : "Glob pattern for matching the expected output files.\nShould include `$output_dir`.\n", + "example" : [ + "fastq/*_001.fast[a,q]" + ], + "must_exist" : true, + "create_parent" : true, + "required" : true, + "direction" : "output", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "boolean_true", + "name" : "--fasta", + "description" : "Output FASTA to standard output even on FASTQ input.\n", + "direction" : "input" + }, + { + "type" : "boolean_true", + "name" : "--info_file", + "description" : "Write information about each read and its adapter matches\ninto info.txt in the output directory.\nSee the documentation for the file format.\n", + "direction" : "input" + } + ] + }, + { + "name" : "Debug", + "arguments" : [ + { + "type" : "boolean_true", + "name" : "--debug", + "description" : "Print debug information", + "direction" : "input" + } + ] + } + ], + "resources" : [ + { + "type" : "bash_script", + "path" : "script.sh", + "is_executable" : true + } + ], + "description" : "Cutadapt removes adapter sequences from high-throughput sequencing reads.\n", + "test_resources" : [ + { + "type" : "bash_script", + "path" : "test.sh", + "is_executable" : true + } + ], + "status" : "enabled", + "requirements" : { + "commands" : [ + "ps" + ] + }, + "keywords" : [ + "RNA-seq", + "scRNA-seq", + "high-throughput" + ], + "license" : "MIT", + "references" : { + "doi" : [ + "10.14806/ej.17.1.200" + ] + }, + "links" : { + "repository" : "https://github.com/marcelm/cutadapt", + "homepage" : "https://cutadapt.readthedocs.io", + "documentation" : "https://cutadapt.readthedocs.io" + }, + "runners" : [ + { + "type" : "executable", + "id" : "executable", + "docker_setup_strategy" : "ifneedbepullelsecachedbuild" + }, + { + "type" : "nextflow", + "id" : "nextflow", + "directives" : { + "tag" : "$id" + }, + "auto" : { + "simplifyInput" : true, + "simplifyOutput" : false, + "transcript" : false, + "publish" : false + }, + "config" : { + "labels" : { + "mem1gb" : "memory = 1000000000.B", + "mem2gb" : "memory = 2000000000.B", + "mem5gb" : "memory = 5000000000.B", + "mem10gb" : "memory = 10000000000.B", + "mem20gb" : "memory = 20000000000.B", + "mem50gb" : "memory = 50000000000.B", + "mem100gb" : "memory = 100000000000.B", + "mem200gb" : "memory = 200000000000.B", + "mem500gb" : "memory = 500000000000.B", + "mem1tb" : "memory = 1000000000000.B", + "mem2tb" : "memory = 2000000000000.B", + "mem5tb" : "memory = 5000000000000.B", + "mem10tb" : "memory = 10000000000000.B", + "mem20tb" : "memory = 20000000000000.B", + "mem50tb" : "memory = 50000000000000.B", + "mem100tb" : "memory = 100000000000000.B", + "mem200tb" : "memory = 200000000000000.B", + "mem500tb" : "memory = 500000000000000.B", + "mem1gib" : "memory = 1073741824.B", + "mem2gib" : "memory = 2147483648.B", + "mem4gib" : "memory = 4294967296.B", + "mem8gib" : "memory = 8589934592.B", + "mem16gib" : "memory = 17179869184.B", + "mem32gib" : "memory = 34359738368.B", + "mem64gib" : "memory = 68719476736.B", + "mem128gib" : "memory = 137438953472.B", + "mem256gib" : "memory = 274877906944.B", + "mem512gib" : "memory = 549755813888.B", + "mem1tib" : "memory = 1099511627776.B", + "mem2tib" : "memory = 2199023255552.B", + "mem4tib" : "memory = 4398046511104.B", + "mem8tib" : "memory = 8796093022208.B", + "mem16tib" : "memory = 17592186044416.B", + "mem32tib" : "memory = 35184372088832.B", + "mem64tib" : "memory = 70368744177664.B", + "mem128tib" : "memory = 140737488355328.B", + "mem256tib" : "memory = 281474976710656.B", + "mem512tib" : "memory = 562949953421312.B", + "cpu1" : "cpus = 1", + "cpu2" : "cpus = 2", + "cpu5" : "cpus = 5", + "cpu10" : "cpus = 10", + "cpu20" : "cpus = 20", + "cpu50" : "cpus = 50", + "cpu100" : "cpus = 100", + "cpu200" : "cpus = 200", + "cpu500" : "cpus = 500", + "cpu1000" : "cpus = 1000" + } + }, + "debug" : false, + "container" : "docker" + } + ], + "engines" : [ + { + "type" : "docker", + "id" : "docker", + "image" : "python:3.12", + "target_registry" : "images.viash-hub.com", + "target_tag" : "v0.1.0", + "namespace_separator" : "/", + "setup" : [ + { + "type" : "python", + "user" : false, + "pip" : [ + "cutadapt" + ], + "upgrade" : true + }, + { + "type" : "docker", + "run" : [ + "cutadapt --version | sed 's/\\\\(.*\\\\)/cutadapt: \\"\\\\1\\"/' > /var/software_versions.txt\n" + ] + } + ] + }, + { + "type" : "native", + "id" : "native" + } + ], + "build_info" : { + "config" : "/workdir/root/repo/src/cutadapt/config.vsh.yaml", + "runner" : "nextflow", + "engine" : "docker|native", + "output" : "target/nextflow/cutadapt", + "viash_version" : "0.9.0-RC6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", + "git_remote" : "https://github.com/viash-hub/biobox" + }, + "package_config" : { + "name" : "biobox", + "version" : "v0.1.0", + "description" : "A collection of bioinformatics tools for working with sequence data.\n", + "viash_version" : "0.9.0-RC6", + "source" : "src", + "target" : "target", + "config_mods" : [ + ".requirements.commands := ['ps']\n", + ".engines += { type: \\"native\\" }", + ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" + ], + "keywords" : [ + "bioinformatics", + "modules", + "sequencing" + ], + "license" : "MIT", + "organization" : "vsh", + "links" : { + "repository" : "https://github.com/viash-hub/biobox", + "issue_tracker" : "https://github.com/viash-hub/biobox/issues" + } + } +}''')) +] + +// resolve dependencies dependencies (if any) + + +// inner workflow +// inner workflow hook +def innerWorkflowFactory(args) { + def rawScript = '''set -e +tempscript=".viash_script.sh" +cat > "$tempscript" << VIASHMAIN +#!/bin/bash + +## VIASH START +# The following code has been auto-generated by Viash. +$( if [ ! -z ${VIASH_PAR_ADAPTER+x} ]; then echo "${VIASH_PAR_ADAPTER}" | sed "s#'#'\\"'\\"'#g;s#.*#par_adapter='&'#" ; else echo "# par_adapter="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT+x} ]; then echo "${VIASH_PAR_FRONT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_front='&'#" ; else echo "# par_front="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE+x} ]; then echo "${VIASH_PAR_ANYWHERE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_anywhere='&'#" ; else echo "# par_anywhere="; fi ) +$( if [ ! -z ${VIASH_PAR_ADAPTER_FASTA+x} ]; then echo "${VIASH_PAR_ADAPTER_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_adapter_fasta='&'#" ; else echo "# par_adapter_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT_FASTA+x} ]; then echo "${VIASH_PAR_FRONT_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_front_fasta='&'#" ; else echo "# par_front_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE_FASTA+x} ]; then echo "${VIASH_PAR_ANYWHERE_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_anywhere_fasta='&'#" ; else echo "# par_anywhere_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_ADAPTER_R2+x} ]; then echo "${VIASH_PAR_ADAPTER_R2}" | sed "s#'#'\\"'\\"'#g;s#.*#par_adapter_r2='&'#" ; else echo "# par_adapter_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT_R2+x} ]; then echo "${VIASH_PAR_FRONT_R2}" | sed "s#'#'\\"'\\"'#g;s#.*#par_front_r2='&'#" ; else echo "# par_front_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE_R2+x} ]; then echo "${VIASH_PAR_ANYWHERE_R2}" | sed "s#'#'\\"'\\"'#g;s#.*#par_anywhere_r2='&'#" ; else echo "# par_anywhere_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_ADAPTER_R2_FASTA+x} ]; then echo "${VIASH_PAR_ADAPTER_R2_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_adapter_r2_fasta='&'#" ; else echo "# par_adapter_r2_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_FRONT_R2_FASTA+x} ]; then echo "${VIASH_PAR_FRONT_R2_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_front_r2_fasta='&'#" ; else echo "# par_front_r2_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_ANYWHERE_R2_FASTA+x} ]; then echo "${VIASH_PAR_ANYWHERE_R2_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_anywhere_r2_fasta='&'#" ; else echo "# par_anywhere_r2_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_PAIR_ADAPTERS+x} ]; then echo "${VIASH_PAR_PAIR_ADAPTERS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_pair_adapters='&'#" ; else echo "# par_pair_adapters="; fi ) +$( if [ ! -z ${VIASH_PAR_PAIR_FILTER+x} ]; then echo "${VIASH_PAR_PAIR_FILTER}" | sed "s#'#'\\"'\\"'#g;s#.*#par_pair_filter='&'#" ; else echo "# par_pair_filter="; fi ) +$( if [ ! -z ${VIASH_PAR_INTERLEAVED+x} ]; then echo "${VIASH_PAR_INTERLEAVED}" | sed "s#'#'\\"'\\"'#g;s#.*#par_interleaved='&'#" ; else echo "# par_interleaved="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_R2+x} ]; then echo "${VIASH_PAR_INPUT_R2}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input_r2='&'#" ; else echo "# par_input_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_ERROR_RATE+x} ]; then echo "${VIASH_PAR_ERROR_RATE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_error_rate='&'#" ; else echo "# par_error_rate="; fi ) +$( if [ ! -z ${VIASH_PAR_NO_INDELS+x} ]; then echo "${VIASH_PAR_NO_INDELS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_no_indels='&'#" ; else echo "# par_no_indels="; fi ) +$( if [ ! -z ${VIASH_PAR_TIMES+x} ]; then echo "${VIASH_PAR_TIMES}" | sed "s#'#'\\"'\\"'#g;s#.*#par_times='&'#" ; else echo "# par_times="; fi ) +$( if [ ! -z ${VIASH_PAR_OVERLAP+x} ]; then echo "${VIASH_PAR_OVERLAP}" | sed "s#'#'\\"'\\"'#g;s#.*#par_overlap='&'#" ; else echo "# par_overlap="; fi ) +$( if [ ! -z ${VIASH_PAR_MATCH_READ_WILDCARDS+x} ]; then echo "${VIASH_PAR_MATCH_READ_WILDCARDS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_match_read_wildcards='&'#" ; else echo "# par_match_read_wildcards="; fi ) +$( if [ ! -z ${VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS+x} ]; then echo "${VIASH_PAR_NO_MATCH_ADAPTER_WILDCARDS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_no_match_adapter_wildcards='&'#" ; else echo "# par_no_match_adapter_wildcards="; fi ) +$( if [ ! -z ${VIASH_PAR_ACTION+x} ]; then echo "${VIASH_PAR_ACTION}" | sed "s#'#'\\"'\\"'#g;s#.*#par_action='&'#" ; else echo "# par_action="; fi ) +$( if [ ! -z ${VIASH_PAR_REVCOMP+x} ]; then echo "${VIASH_PAR_REVCOMP}" | sed "s#'#'\\"'\\"'#g;s#.*#par_revcomp='&'#" ; else echo "# par_revcomp="; fi ) +$( if [ ! -z ${VIASH_PAR_CUT+x} ]; then echo "${VIASH_PAR_CUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_cut='&'#" ; else echo "# par_cut="; fi ) +$( if [ ! -z ${VIASH_PAR_CUT_R2+x} ]; then echo "${VIASH_PAR_CUT_R2}" | sed "s#'#'\\"'\\"'#g;s#.*#par_cut_r2='&'#" ; else echo "# par_cut_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_NEXTSEQ_TRIM+x} ]; then echo "${VIASH_PAR_NEXTSEQ_TRIM}" | sed "s#'#'\\"'\\"'#g;s#.*#par_nextseq_trim='&'#" ; else echo "# par_nextseq_trim="; fi ) +$( if [ ! -z ${VIASH_PAR_QUALITY_CUTOFF+x} ]; then echo "${VIASH_PAR_QUALITY_CUTOFF}" | sed "s#'#'\\"'\\"'#g;s#.*#par_quality_cutoff='&'#" ; else echo "# par_quality_cutoff="; fi ) +$( if [ ! -z ${VIASH_PAR_QUALITY_CUTOFF_R2+x} ]; then echo "${VIASH_PAR_QUALITY_CUTOFF_R2}" | sed "s#'#'\\"'\\"'#g;s#.*#par_quality_cutoff_r2='&'#" ; else echo "# par_quality_cutoff_r2="; fi ) +$( if [ ! -z ${VIASH_PAR_QUALITY_BASE+x} ]; then echo "${VIASH_PAR_QUALITY_BASE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_quality_base='&'#" ; else echo "# par_quality_base="; fi ) +$( if [ ! -z ${VIASH_PAR_POLY_A+x} ]; then echo "${VIASH_PAR_POLY_A}" | sed "s#'#'\\"'\\"'#g;s#.*#par_poly_a='&'#" ; else echo "# par_poly_a="; fi ) +$( if [ ! -z ${VIASH_PAR_LENGTH+x} ]; then echo "${VIASH_PAR_LENGTH}" | sed "s#'#'\\"'\\"'#g;s#.*#par_length='&'#" ; else echo "# par_length="; fi ) +$( if [ ! -z ${VIASH_PAR_TRIM_N+x} ]; then echo "${VIASH_PAR_TRIM_N}" | sed "s#'#'\\"'\\"'#g;s#.*#par_trim_n='&'#" ; else echo "# par_trim_n="; fi ) +$( if [ ! -z ${VIASH_PAR_LENGTH_TAG+x} ]; then echo "${VIASH_PAR_LENGTH_TAG}" | sed "s#'#'\\"'\\"'#g;s#.*#par_length_tag='&'#" ; else echo "# par_length_tag="; fi ) +$( if [ ! -z ${VIASH_PAR_STRIP_SUFFIX+x} ]; then echo "${VIASH_PAR_STRIP_SUFFIX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_strip_suffix='&'#" ; else echo "# par_strip_suffix="; fi ) +$( if [ ! -z ${VIASH_PAR_PREFIX+x} ]; then echo "${VIASH_PAR_PREFIX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_prefix='&'#" ; else echo "# par_prefix="; fi ) +$( if [ ! -z ${VIASH_PAR_SUFFIX+x} ]; then echo "${VIASH_PAR_SUFFIX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_suffix='&'#" ; else echo "# par_suffix="; fi ) +$( if [ ! -z ${VIASH_PAR_RENAME+x} ]; then echo "${VIASH_PAR_RENAME}" | sed "s#'#'\\"'\\"'#g;s#.*#par_rename='&'#" ; else echo "# par_rename="; fi ) +$( if [ ! -z ${VIASH_PAR_ZERO_CAP+x} ]; then echo "${VIASH_PAR_ZERO_CAP}" | sed "s#'#'\\"'\\"'#g;s#.*#par_zero_cap='&'#" ; else echo "# par_zero_cap="; fi ) +$( if [ ! -z ${VIASH_PAR_MINIMUM_LENGTH+x} ]; then echo "${VIASH_PAR_MINIMUM_LENGTH}" | sed "s#'#'\\"'\\"'#g;s#.*#par_minimum_length='&'#" ; else echo "# par_minimum_length="; fi ) +$( if [ ! -z ${VIASH_PAR_MAXIMUM_LENGTH+x} ]; then echo "${VIASH_PAR_MAXIMUM_LENGTH}" | sed "s#'#'\\"'\\"'#g;s#.*#par_maximum_length='&'#" ; else echo "# par_maximum_length="; fi ) +$( if [ ! -z ${VIASH_PAR_MAX_N+x} ]; then echo "${VIASH_PAR_MAX_N}" | sed "s#'#'\\"'\\"'#g;s#.*#par_max_n='&'#" ; else echo "# par_max_n="; fi ) +$( if [ ! -z ${VIASH_PAR_MAX_EXPECTED_ERRORS+x} ]; then echo "${VIASH_PAR_MAX_EXPECTED_ERRORS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_max_expected_errors='&'#" ; else echo "# par_max_expected_errors="; fi ) +$( if [ ! -z ${VIASH_PAR_MAX_AVERAGE_ERROR_RATE+x} ]; then echo "${VIASH_PAR_MAX_AVERAGE_ERROR_RATE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_max_average_error_rate='&'#" ; else echo "# par_max_average_error_rate="; fi ) +$( if [ ! -z ${VIASH_PAR_DISCARD_TRIMMED+x} ]; then echo "${VIASH_PAR_DISCARD_TRIMMED}" | sed "s#'#'\\"'\\"'#g;s#.*#par_discard_trimmed='&'#" ; else echo "# par_discard_trimmed="; fi ) +$( if [ ! -z ${VIASH_PAR_DISCARD_UNTRIMMED+x} ]; then echo "${VIASH_PAR_DISCARD_UNTRIMMED}" | sed "s#'#'\\"'\\"'#g;s#.*#par_discard_untrimmed='&'#" ; else echo "# par_discard_untrimmed="; fi ) +$( if [ ! -z ${VIASH_PAR_DISCARD_CASAVA+x} ]; then echo "${VIASH_PAR_DISCARD_CASAVA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_discard_casava='&'#" ; else echo "# par_discard_casava="; fi ) +$( if [ ! -z ${VIASH_PAR_REPORT+x} ]; then echo "${VIASH_PAR_REPORT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_report='&'#" ; else echo "# par_report="; fi ) +$( if [ ! -z ${VIASH_PAR_JSON+x} ]; then echo "${VIASH_PAR_JSON}" | sed "s#'#'\\"'\\"'#g;s#.*#par_json='&'#" ; else echo "# par_json="; fi ) +$( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "${VIASH_PAR_OUTPUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_output='&'#" ; else echo "# par_output="; fi ) +$( if [ ! -z ${VIASH_PAR_FASTA+x} ]; then echo "${VIASH_PAR_FASTA}" | sed "s#'#'\\"'\\"'#g;s#.*#par_fasta='&'#" ; else echo "# par_fasta="; fi ) +$( if [ ! -z ${VIASH_PAR_INFO_FILE+x} ]; then echo "${VIASH_PAR_INFO_FILE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_info_file='&'#" ; else echo "# par_info_file="; fi ) +$( if [ ! -z ${VIASH_PAR_DEBUG+x} ]; then echo "${VIASH_PAR_DEBUG}" | sed "s#'#'\\"'\\"'#g;s#.*#par_debug='&'#" ; else echo "# par_debug="; fi ) +$( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) +$( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) +$( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) +$( if [ ! -z ${VIASH_META_EXECUTABLE+x} ]; then echo "${VIASH_META_EXECUTABLE}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_executable='&'#" ; else echo "# meta_executable="; fi ) +$( if [ ! -z ${VIASH_META_CONFIG+x} ]; then echo "${VIASH_META_CONFIG}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_config='&'#" ; else echo "# meta_config="; fi ) +$( if [ ! -z ${VIASH_META_TEMP_DIR+x} ]; then echo "${VIASH_META_TEMP_DIR}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_temp_dir='&'#" ; else echo "# meta_temp_dir="; fi ) +$( if [ ! -z ${VIASH_META_CPUS+x} ]; then echo "${VIASH_META_CPUS}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_cpus='&'#" ; else echo "# meta_cpus="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_B+x} ]; then echo "${VIASH_META_MEMORY_B}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_b='&'#" ; else echo "# meta_memory_b="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KB+x} ]; then echo "${VIASH_META_MEMORY_KB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_kb='&'#" ; else echo "# meta_memory_kb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MB+x} ]; then echo "${VIASH_META_MEMORY_MB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_mb='&'#" ; else echo "# meta_memory_mb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GB+x} ]; then echo "${VIASH_META_MEMORY_GB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_gb='&'#" ; else echo "# meta_memory_gb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TB+x} ]; then echo "${VIASH_META_MEMORY_TB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_tb='&'#" ; else echo "# meta_memory_tb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PB+x} ]; then echo "${VIASH_META_MEMORY_PB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_pb='&'#" ; else echo "# meta_memory_pb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KIB+x} ]; then echo "${VIASH_META_MEMORY_KIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_kib='&'#" ; else echo "# meta_memory_kib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MIB+x} ]; then echo "${VIASH_META_MEMORY_MIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_mib='&'#" ; else echo "# meta_memory_mib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GIB+x} ]; then echo "${VIASH_META_MEMORY_GIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_gib='&'#" ; else echo "# meta_memory_gib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_tib='&'#" ; else echo "# meta_memory_tib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi ) + +## VIASH END + +function debug { + [[ "\\$par_debug" == "true" ]] && echo "DEBUG: \\$@" +} + +output_dir=\\$(dirname \\$par_output) +[[ ! -d \\$output_dir ]] && mkdir -p \\$output_dir + +# Init +########################################################### + +echo ">> Paired-end data or not?" + +mode="" +if [[ -z \\$par_input_r2 ]]; then + mode="se" + echo " Single end" + input="\\$par_input" +else + echo " Paired end" + mode="pe" + input="\\$par_input \\$par_input_r2" +fi + +# Adapter arguments +# - paired and single-end +# - string and fasta +########################################################### + +function add_flags { + local arg=\\$1 + local flag=\\$2 + local prefix=\\$3 + [[ -z \\$prefix ]] && prefix="" + + # This function should not be called if the input is empty + # but check for it just in case + if [[ -z \\$arg ]]; then + return + fi + + local output="" + IFS=';' read -r -a array <<< "\\$arg" + for a in "\\${array[@]}"; do + output="\\$output \\$flag \\$prefix\\$a" + done + echo \\$output +} + +debug ">> Parsing arguments dealing with adapters" +adapter_args=\\$(echo \\\\ + \\${par_adapter:+\\$(add_flags "\\$par_adapter" "--adapter")} \\\\ + \\${par_adapter_fasta:+\\$(add_flags "\\$par_adapter_fasta" "--adapter" "file:")} \\\\ + \\${par_front:+\\$(add_flags "\\$par_front" "--front")} \\\\ + \\${par_front_fasta:+\\$(add_flags "\\$par_front_fasta" "--front" "file:")} \\\\ + \\${par_anywhere:+\\$(add_flags "\\$par_anywhere" "--anywhere")} \\\\ + \\${par_anywhere_fasta:+\\$(add_flags "\\$par_anywhere_fasta" "--anywhere" "file:")} \\\\ + \\${par_adapter_r2:+\\$(add_flags "\\$par_adapter_r2" "-A")} \\\\ + \\${par_adapter_fasta_r2:+\\$(add_flags "\\$par_adapter_fasta_r2" "-A" "file:")} \\\\ + \\${par_front_r2:+\\$(add_flags "\\$par_front_r2" "-G")} \\\\ + \\${par_front_fasta_r2:+\\$(add_flags "\\$par_front_fasta_r2" "-G" "file:")} \\\\ + \\${par_anywhere_r2:+\\$(add_flags "\\$par_anywhere_r2" "-B")} \\\\ + \\${par_anywhere_fasta_r2:+\\$(add_flags "\\$par_anywhere_fasta_r2" "-B" "file:")} \\\\ +) + +debug "Arguments to cutadapt:" +debug "\\$adapter_args" +debug + +# Paired-end options +########################################################### +echo ">> Parsing arguments for paired-end reads" +[[ "\\$par_pair_adapters" == "false" ]] && unset par_pair_adapters +[[ "\\$par_interleaved" == "false" ]] && unset par_interleaved + +paired_args=\\$(echo \\\\ + \\${par_pair_adapters:+--pair-adapters} \\\\ + \\${par_pair_filter:+--pair-filter "\\${par_pair_filter}"} \\\\ + \\${par_interleaved:+--interleaved} +) +debug "Arguments to cutadapt:" +debug \\$paired_args +debug + +# Input arguments +########################################################### +echo ">> Parsing input arguments" +[[ "\\$par_no_indels" == "true" ]] && unset par_no_indels +[[ "\\$par_match_read_wildcards" == "false" ]] && unset par_match_read_wildcards +[[ "\\$par_no_match_adapter_wildcards" == "true" ]] && unset par_no_match_adapter_wildcards +[[ "\\$par_revcomp" == "false" ]] && unset par_revcomp + +input_args=\\$(echo \\\\ + \\${par_error_rate:+--error-rate "\\${par_error_rate}"} \\\\ + \\${par_no_indels:+--no-indels} \\\\ + \\${par_times:+--times "\\${par_times}"} \\\\ + \\${par_overlap:+--overlap "\\${par_overlap}"} \\\\ + \\${par_match_read_wildcards:+--match-read-wildcards} \\\\ + \\${par_no_match_adapter_wildcards:+--no-match-adapter-wildcards} \\\\ + \\${par_action:+--action "\\${par_action}"} \\\\ + \\${par_revcomp:+--revcomp} \\\\ +) +debug "Arguments to cutadapt:" +debug \\$input_args +debug + +# Read modifications +########################################################### +echo ">> Parsing read modification arguments" +[[ "\\$par_poly_a" == "false" ]] && unset par_poly_a +[[ "\\$par_trim_n" == "false" ]] && unset par_trim_n +[[ "\\$par_zero_cap" == "false" ]] && unset par_zero_cap + +mod_args=\\$(echo \\\\ + \\${par_cut:+--cut "\\${par_cut}"} \\\\ + \\${par_cut_r2:+--cut_r2 "\\${par_cut_r2}"} \\\\ + \\${par_nextseq_trim:+--nextseq-trim "\\${par_nextseq_trim}"} \\\\ + \\${par_quality_cutoff:+--quality-cutoff "\\${par_quality_cutoff}"} \\\\ + \\${par_quality_cutoff_r2:+--quality-cutoff_r2 "\\${par_quality_cutoff_r2}"} \\\\ + \\${par_quality_base:+--quality-base "\\${par_quality_base}"} \\\\ + \\${par_poly_a:+--poly-a} \\\\ + \\${par_length:+--length "\\${par_length}"} \\\\ + \\${par_trim_n:+--trim-n} \\\\ + \\${par_length_tag:+--length-tag "\\${par_length_tag}"} \\\\ + \\${par_strip_suffix:+--strip-suffix "\\${par_strip_suffix}"} \\\\ + \\${par_prefix:+--prefix "\\${par_prefix}"} \\\\ + \\${par_suffix:+--suffix "\\${par_suffix}"} \\\\ + \\${par_rename:+--rename "\\${par_rename}"} \\\\ + \\${par_zero_cap:+--zero-cap} \\\\ +) +debug "Arguments to cutadapt:" +debug \\$mod_args +debug + +# Filtering of processed reads arguments +########################################################### +echo ">> Filtering of processed reads arguments" +[[ "\\$par_discard_trimmed" == "false" ]] && unset par_discard_trimmed +[[ "\\$par_discard_untrimmed" == "false" ]] && unset par_discard_untrimmed +[[ "\\$par_discard_casava" == "false" ]] && unset par_discard_casava + +# Parse and transform the minimum and maximum length arguments +[[ -z \\$par_minimum_length ]] + +filter_args=\\$(echo \\\\ + \\${par_minimum_length:+--minimum-length "\\${par_minimum_length}"} \\\\ + \\${par_maximum_length:+--maximum-length "\\${par_maximum_length}"} \\\\ + \\${par_max_n:+--max-n "\\${par_max_n}"} \\\\ + \\${par_max_expected_errors:+--max-expected-errors "\\${par_max_expected_errors}"} \\\\ + \\${par_max_average_error_rate:+--max-average-error-rate "\\${par_max_average_error_rate}"} \\\\ + \\${par_discard_trimmed:+--discard-trimmed} \\\\ + \\${par_discard_untrimmed:+--discard-untrimmed} \\\\ + \\${par_discard_casava:+--discard-casava} \\\\ +) +debug "Arguments to cutadapt:" +debug \\$filter_args +debug + +# Optional output arguments +########################################################### +echo ">> Optional arguments" +[[ "\\$par_json" == "false" ]] && unset par_json +[[ "\\$par_fasta" == "false" ]] && unset par_fasta +[[ "\\$par_info_file" == "false" ]] && unset par_info_file + +optional_output_args=\\$(echo \\\\ + \\${par_report:+--report "\\${par_report}"} \\\\ + \\${par_json:+--json "report.json"} \\\\ + \\${par_fasta:+--fasta} \\\\ + \\${par_info_file:+--info-file "info.txt"} \\\\ +) + +debug "Arguments to cutadapt:" +debug \\$optional_output_args +debug + +# Output arguments +# We write the output to a directory rather than +# individual files. +########################################################### + +if [[ -z \\$par_fasta ]]; then + ext="fastq" +else + ext="fasta" +fi + +if [ \\$mode = "se" ]; then + output_args=\\$(echo \\\\ + --output "\\$output_dir/{name}_001.\\$ext" \\\\ + ) +else + output_args=\\$(echo \\\\ + --output "\\$output_dir/{name}_R1_001.\\$ext" \\\\ + --paired-output "\\$output_dir/{name}_R2_001.\\$ext" \\\\ + ) +fi + +debug "Arguments to cutadapt:" +debug \\$output_args +debug + +# Full CLI +# Set the --cores argument to 0 unless meta_cpus is set +########################################################### +echo ">> Running cutadapt" +par_cpus=0 +[[ ! -z \\$meta_cpus ]] && par_cpus=\\$meta_cpus + +cli=\\$(echo \\\\ + \\$input \\\\ + \\$adapter_args \\\\ + \\$paired_args \\\\ + \\$input_args \\\\ + \\$mod_args \\\\ + \\$filter_args \\\\ + \\$optional_output_args \\\\ + \\$output_args \\\\ + --cores \\$par_cpus +) + +debug ">> Full CLI to be run:" +debug cutadapt \\$cli | sed -e 's/--/\\\\r\\\\n --/g' +debug + +cutadapt \\$cli +VIASHMAIN +bash "$tempscript" +''' + + return vdsl3WorkflowFactory(args, meta, rawScript) +} + + + +/** + * Generate a workflow for VDSL3 modules. + * + * This function is called by the workflowFactory() function. + * + * Input channel: [id, input_map] + * Output channel: [id, output_map] + * + * Internally, this workflow will convert the input channel + * to a format which the Nextflow module will be able to handle. + */ +def vdsl3WorkflowFactory(Map args, Map meta, String rawScript) { + def key = args["key"] + def processObj = null + + workflow processWf { + take: input_ + main: + + if (processObj == null) { + processObj = _vdsl3ProcessFactory(args, meta, rawScript) + } + + output_ = input_ + | map { tuple -> + def id = tuple[0] + def data_ = tuple[1] + + if (workflow.stubRun) { + // add id if missing + data_ = [id: 'stub'] + data_ + } + + // process input files separately + def inputPaths = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "input" } + .collect { par -> + def val = data_.containsKey(par.plainName) ? data_[par.plainName] : [] + def inputFiles = [] + if (val == null) { + inputFiles = [] + } else if (val instanceof List) { + inputFiles = val + } else if (val instanceof Path) { + inputFiles = [ val ] + } else { + inputFiles = [] + } + if (!workflow.stubRun) { + // throw error when an input file doesn't exist + inputFiles.each{ file -> + assert file.exists() : + "Error in module '${key}' id '${id}' argument '${par.plainName}'.\n" + + " Required input file does not exist.\n" + + " Path: '$file'.\n" + + " Expected input file to exist" + } + } + inputFiles + } + + // remove input files + def argsExclInputFiles = meta.config.allArguments + .findAll { (it.type != "file" || it.direction != "input") && data_.containsKey(it.plainName) } + .collectEntries { par -> + def parName = par.plainName + def val = data_[parName] + if (par.multiple && val instanceof Collection) { + val = val.join(par.multiple_sep) + } + if (par.direction == "output" && par.type == "file") { + val = val.replaceAll('\\$id', id).replaceAll('\\$key', key) + } + [parName, val] + } + + [ id ] + inputPaths + [ argsExclInputFiles, meta.resources_dir ] + } + | processObj + | map { output -> + def outputFiles = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" } + .indexed() + .collectEntries{ index, par -> + def out = output[index + 1] + // strip dummy '.exitcode' file from output (see nextflow-io/nextflow#2678) + if (!out instanceof List || out.size() <= 1) { + if (par.multiple) { + out = [] + } else { + assert !par.required : + "Error in module '${key}' id '${output[0]}' argument '${par.plainName}'.\n" + + " Required output file is missing" + out = null + } + } else if (out.size() == 2 && !par.multiple) { + out = out[1] + } else { + out = out.drop(1) + } + [ par.plainName, out ] + } + + // drop null outputs + outputFiles.removeAll{it.value == null} + + [ output[0], outputFiles ] + } + emit: output_ + } + + return processWf +} + +// depends on: session? +def _vdsl3ProcessFactory(Map workflowArgs, Map meta, String rawScript) { + // autodetect process key + def wfKey = workflowArgs["key"] + def procKeyPrefix = "${wfKey}_process" + def scriptMeta = nextflow.script.ScriptMeta.current() + def existing = scriptMeta.getProcessNames().findAll{it.startsWith(procKeyPrefix)} + def numbers = existing.collect{it.replace(procKeyPrefix, "0").toInteger()} + def newNumber = (numbers + [-1]).max() + 1 + + def procKey = newNumber == 0 ? procKeyPrefix : "$procKeyPrefix$newNumber" + + if (newNumber > 0) { + log.warn "Key for module '${wfKey}' is duplicated.\n", + "If you run a component multiple times in the same workflow,\n" + + "it's recommended you set a unique key for every call,\n" + + "for example: ${wfKey}.run(key: \"foo\")." + } + + // subset directives and convert to list of tuples + def drctv = workflowArgs.directives + + // TODO: unit test the two commands below + // convert publish array into tags + def valueToStr = { val -> + // ignore closures + if (val instanceof CharSequence) { + if (!val.matches('^[{].*[}]$')) { + '"' + val + '"' + } else { + val + } + } else if (val instanceof List) { + "[" + val.collect{valueToStr(it)}.join(", ") + "]" + } else if (val instanceof Map) { + "[" + val.collect{k, v -> k + ": " + valueToStr(v)}.join(", ") + "]" + } else { + val.inspect() + } + } + + // multiple entries allowed: label, publishdir + def drctvStrs = drctv.collect { key, value -> + if (key in ["label", "publishDir"]) { + value.collect{ val -> + if (val instanceof Map) { + "\n$key " + val.collect{ k, v -> k + ": " + valueToStr(v) }.join(", ") + } else if (val == null) { + "" + } else { + "\n$key " + valueToStr(val) + } + }.join() + } else if (value instanceof Map) { + "\n$key " + value.collect{ k, v -> k + ": " + valueToStr(v) }.join(", ") + } else { + "\n$key " + valueToStr(value) + } + }.join() + + def inputPaths = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "input" } + .collect { ', path(viash_par_' + it.plainName + ', stageAs: "_viash_par/' + it.plainName + '_?/*")' } + .join() + + def outputPaths = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" } + .collect { par -> + // insert dummy into every output (see nextflow-io/nextflow#2678) + if (!par.multiple) { + ', path{[".exitcode", args.' + par.plainName + ']}' + } else { + ', path{[".exitcode"] + args.' + par.plainName + '}' + } + } + .join() + + // TODO: move this functionality somewhere else? + if (workflowArgs.auto.transcript) { + outputPaths = outputPaths + ', path{[".exitcode", ".command*"]}' + } else { + outputPaths = outputPaths + ', path{[".exitcode"]}' + } + + // create dirs for output files (based on BashWrapper.createParentFiles) + def createParentStr = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" && it.create_parent } + .collect { par -> + "\${ args.containsKey(\"${par.plainName}\") ? \"mkdir_parent \\\"\" + (args[\"${par.plainName}\"] instanceof String ? args[\"${par.plainName}\"] : args[\"${par.plainName}\"].join('\" \"')) + \"\\\"\" : \"\" }" + } + .join("\n") + + // construct inputFileExports + def inputFileExports = meta.config.allArguments + .findAll { it.type == "file" && it.direction.toLowerCase() == "input" } + .collect { par -> + def viash_par_contents = "(viash_par_${par.plainName} instanceof List ? viash_par_${par.plainName}.join(\"${par.multiple_sep}\") : viash_par_${par.plainName})" + "\n\${viash_par_${par.plainName}.empty ? \"\" : \"export VIASH_PAR_${par.plainName.toUpperCase()}=\\\"\" + ${viash_par_contents} + \"\\\"\"}" + } + + // NOTE: if using docker, use /tmp instead of tmpDir! + def tmpDir = java.nio.file.Paths.get( + System.getenv('NXF_TEMP') ?: + System.getenv('VIASH_TEMP') ?: + System.getenv('VIASH_TMPDIR') ?: + System.getenv('VIASH_TEMPDIR') ?: + System.getenv('VIASH_TMP') ?: + System.getenv('TEMP') ?: + System.getenv('TMPDIR') ?: + System.getenv('TEMPDIR') ?: + System.getenv('TMP') ?: + '/tmp' + ).toAbsolutePath() + + // construct stub + def stub = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" } + .collect { par -> + "\${ args.containsKey(\"${par.plainName}\") ? \"touch2 \\\"\" + (args[\"${par.plainName}\"] instanceof String ? args[\"${par.plainName}\"].replace(\"_*\", \"_0\") : args[\"${par.plainName}\"].join('\" \"')) + \"\\\"\" : \"\" }" + } + .join("\n") + + // escape script + def escapedScript = rawScript.replace('\\', '\\\\').replace('$', '\\$').replace('"""', '\\"\\"\\"') + + // publishdir assert + def assertStr = (workflowArgs.auto.publish == true) || workflowArgs.auto.transcript ? + """\nassert task.publishDir.size() > 0: "if auto.publish is true, params.publish_dir needs to be defined.\\n Example: --publish_dir './output/'" """ : + "" + + // generate process string + def procStr = + """nextflow.enable.dsl=2 + | + |process $procKey {$drctvStrs + |input: + | tuple val(id)$inputPaths, val(args), path(resourcesDir, stageAs: ".viash_meta_resources") + |output: + | tuple val("\$id")$outputPaths, optional: true + |stub: + |\"\"\" + |touch2() { mkdir -p "\\\$(dirname "\\\$1")" && touch "\\\$1" ; } + |$stub + |\"\"\" + |script:$assertStr + |def escapeText = { s -> s.toString().replaceAll('([`"])', '\\\\\\\\\$1') } + |def parInject = args + | .findAll{key, value -> value != null} + | .collect{key, value -> "export VIASH_PAR_\${key.toUpperCase()}=\\\"\${escapeText(value)}\\\""} + | .join("\\n") + |\"\"\" + |# meta exports + |export VIASH_META_RESOURCES_DIR="\${resourcesDir}" + |export VIASH_META_TEMP_DIR="${['docker', 'podman', 'charliecloud'].any{ it == workflow.containerEngine } ? '/tmp' : tmpDir}" + |export VIASH_META_NAME="${meta.config.name}" + |# export VIASH_META_EXECUTABLE="\\\$VIASH_META_RESOURCES_DIR/\\\$VIASH_META_NAME" + |export VIASH_META_CONFIG="\\\$VIASH_META_RESOURCES_DIR/.config.vsh.yaml" + |\${task.cpus ? "export VIASH_META_CPUS=\$task.cpus" : "" } + |\${task.memory?.bytes != null ? "export VIASH_META_MEMORY_B=\$task.memory.bytes" : "" } + |if [ ! -z \\\${VIASH_META_MEMORY_B+x} ]; then + | export VIASH_META_MEMORY_KB=\\\$(( (\\\$VIASH_META_MEMORY_B+999) / 1000 )) + | export VIASH_META_MEMORY_MB=\\\$(( (\\\$VIASH_META_MEMORY_KB+999) / 1000 )) + | export VIASH_META_MEMORY_GB=\\\$(( (\\\$VIASH_META_MEMORY_MB+999) / 1000 )) + | export VIASH_META_MEMORY_TB=\\\$(( (\\\$VIASH_META_MEMORY_GB+999) / 1000 )) + | export VIASH_META_MEMORY_PB=\\\$(( (\\\$VIASH_META_MEMORY_TB+999) / 1000 )) + | export VIASH_META_MEMORY_KIB=\\\$(( (\\\$VIASH_META_MEMORY_B+1023) / 1024 )) + | export VIASH_META_MEMORY_MIB=\\\$(( (\\\$VIASH_META_MEMORY_KIB+1023) / 1024 )) + | export VIASH_META_MEMORY_GIB=\\\$(( (\\\$VIASH_META_MEMORY_MIB+1023) / 1024 )) + | export VIASH_META_MEMORY_TIB=\\\$(( (\\\$VIASH_META_MEMORY_GIB+1023) / 1024 )) + | export VIASH_META_MEMORY_PIB=\\\$(( (\\\$VIASH_META_MEMORY_TIB+1023) / 1024 )) + |fi + | + |# meta synonyms + |export VIASH_TEMP="\\\$VIASH_META_TEMP_DIR" + |export TEMP_DIR="\\\$VIASH_META_TEMP_DIR" + | + |# create output dirs if need be + |function mkdir_parent { + | for file in "\\\$@"; do + | mkdir -p "\\\$(dirname "\\\$file")" + | done + |} + |$createParentStr + | + |# argument exports${inputFileExports.join()} + |\$parInject + | + |# process script + |${escapedScript} + |\"\"\" + |} + |""".stripMargin() + + // TODO: print on debug + // if (workflowArgs.debug == true) { + // println("######################\n$procStr\n######################") + // } + + // write process to temp file + def tempFile = java.nio.file.Files.createTempFile("viash-process-${procKey}-", ".nf") + addShutdownHook { java.nio.file.Files.deleteIfExists(tempFile) } + tempFile.text = procStr + + // create process from temp file + def binding = new nextflow.script.ScriptBinding([:]) + def session = nextflow.Nextflow.getSession() + def parser = new nextflow.script.ScriptParser(session) + .setModule(true) + .setBinding(binding) + def moduleScript = parser.runScript(tempFile) + .getScript() + + // register module in meta + def module = new nextflow.script.IncludeDef.Module(name: procKey) + scriptMeta.addModule(moduleScript, module.name, module.alias) + + // retrieve and return process from meta + return scriptMeta.getProcess(procKey) +} + +// defaults +meta["defaults"] = [ + // key to be used to trace the process and determine output names + key: null, + + // fixed arguments to be passed to script + args: [:], + + // default directives + directives: readJsonBlob('''{ + "container" : { + "registry" : "images.viash-hub.com", + "image" : "vsh/biobox/cutadapt", + "tag" : "v0.1.0" + }, + "tag" : "$id" +}'''), + + // auto settings + auto: readJsonBlob('''{ + "simplifyInput" : true, + "simplifyOutput" : false, + "transcript" : false, + "publish" : false +}'''), + + // Apply a map over the incoming tuple + // Example: `{ tup -> [ tup[0], [input: tup[1].output] ] + tup.drop(2) }` + map: null, + + // Apply a map over the ID element of a tuple (i.e. the first element) + // Example: `{ id -> id + "_foo" }` + mapId: null, + + // Apply a map over the data element of a tuple (i.e. the second element) + // Example: `{ data -> [ input: data.output ] }` + mapData: null, + + // Apply a map over the passthrough elements of a tuple (i.e. the tuple excl. the first two elements) + // Example: `{ pt -> pt.drop(1) }` + mapPassthrough: null, + + // Filter the channel + // Example: `{ tup -> tup[0] == "foo" }` + filter: null, + + // Choose whether or not to run the component on the tuple if the condition is true. + // Otherwise, the tuple will be passed through. + // Example: `{ tup -> tup[0] != "skip_this" }` + runIf: null, + + // Rename keys in the data field of the tuple (i.e. the second element) + // Will likely be deprecated in favour of `fromState`. + // Example: `[ "new_key": "old_key" ]` + renameKeys: null, + + // Fetch data from the state and pass it to the module without altering the current state. + // + // `fromState` should be `null`, `List[String]`, `Map[String, String]` or a function. + // + // - If it is `null`, the state will be passed to the module as is. + // - If it is a `List[String]`, the data will be the values of the state at the given keys. + // - If it is a `Map[String, String]`, the data will be the values of the state at the given keys, with the keys renamed according to the map. + // - If it is a function, the tuple (`[id, state]`) in the channel will be passed to the function, and the result will be used as the data. + // + // Example: `{ id, state -> [input: state.fastq_file] }` + // Default: `null` + fromState: null, + + // Determine how the state should be updated after the module has been run. + // + // `toState` should be `null`, `List[String]`, `Map[String, String]` or a function. + // + // - If it is `null`, the state will be replaced with the output of the module. + // - If it is a `List[String]`, the state will be updated with the values of the data at the given keys. + // - If it is a `Map[String, String]`, the state will be updated with the values of the data at the given keys, with the keys renamed according to the map. + // - If it is a function, a tuple (`[id, output, state]`) will be passed to the function, and the result will be used as the new state. + // + // Example: `{ id, output, state -> state + [counts: state.output] }` + // Default: `{ id, output, state -> output }` + toState: null, + + // Whether or not to print debug messages + // Default: `false` + debug: false +] + +// initialise default workflow +meta["workflow"] = workflowFactory([key: meta.config.name], meta.defaults, meta) + +// add workflow to environment +nextflow.script.ScriptMeta.current().addDefinition(meta.workflow) + +// anonymous workflow for running this module as a standalone +workflow { + // add id argument if it's not already in the config + // TODO: deep copy + def newConfig = deepClone(meta.config) + def newParams = deepClone(params) + + def argsContainsId = newConfig.allArguments.any{it.plainName == "id"} + if (!argsContainsId) { + def idArg = [ + 'name': '--id', + 'required': false, + 'type': 'string', + 'description': 'A unique id for every entry.', + 'multiple': false + ] + newConfig.arguments.add(0, idArg) + newConfig = processConfig(newConfig) + } + if (!newParams.containsKey("id")) { + newParams.id = "run" + } + + helpMessage(newConfig) + + channelFromParams(newParams, newConfig) + // make sure id is not in the state if id is not in the args + | map {id, state -> + if (!argsContainsId) { + [id, state.findAll{k, v -> k != "id"}] + } else { + [id, state] + } + } + | meta.workflow.run( + auto: [ publish: "state" ] + ) +} + +// END COMPONENT-SPECIFIC CODE diff --git a/target/nextflow/cutadapt/nextflow.config b/target/nextflow/cutadapt/nextflow.config new file mode 100644 index 00000000..0b8b606f --- /dev/null +++ b/target/nextflow/cutadapt/nextflow.config @@ -0,0 +1,125 @@ +manifest { + name = 'cutadapt' + mainScript = 'main.nf' + nextflowVersion = '!>=20.12.1-edge' + version = 'v0.1.0' + description = 'Cutadapt removes adapter sequences from high-throughput sequencing reads.\n' +} + +process.container = 'nextflow/bash:latest' + +// detect tempdir +tempDir = java.nio.file.Paths.get( + System.getenv('NXF_TEMP') ?: + System.getenv('VIASH_TEMP') ?: + System.getenv('TEMPDIR') ?: + System.getenv('TMPDIR') ?: + '/tmp' +).toAbsolutePath() + +profiles { + no_publish { + process { + withName: '.*' { + publishDir = [ + enabled: false + ] + } + } + } + mount_temp { + docker.temp = tempDir + podman.temp = tempDir + charliecloud.temp = tempDir + } + docker { + docker.enabled = true + // docker.userEmulation = true + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + singularity { + singularity.enabled = true + singularity.autoMounts = true + docker.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + podman { + podman.enabled = true + docker.enabled = false + singularity.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + shifter { + shifter.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + charliecloud.enabled = false + } + charliecloud { + charliecloud.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + } +} + +process{ + withLabel: mem1gb { memory = 1000000000.B } + withLabel: mem2gb { memory = 2000000000.B } + withLabel: mem5gb { memory = 5000000000.B } + withLabel: mem10gb { memory = 10000000000.B } + withLabel: mem20gb { memory = 20000000000.B } + withLabel: mem50gb { memory = 50000000000.B } + withLabel: mem100gb { memory = 100000000000.B } + withLabel: mem200gb { memory = 200000000000.B } + withLabel: mem500gb { memory = 500000000000.B } + withLabel: mem1tb { memory = 1000000000000.B } + withLabel: mem2tb { memory = 2000000000000.B } + withLabel: mem5tb { memory = 5000000000000.B } + withLabel: mem10tb { memory = 10000000000000.B } + withLabel: mem20tb { memory = 20000000000000.B } + withLabel: mem50tb { memory = 50000000000000.B } + withLabel: mem100tb { memory = 100000000000000.B } + withLabel: mem200tb { memory = 200000000000000.B } + withLabel: mem500tb { memory = 500000000000000.B } + withLabel: mem1gib { memory = 1073741824.B } + withLabel: mem2gib { memory = 2147483648.B } + withLabel: mem4gib { memory = 4294967296.B } + withLabel: mem8gib { memory = 8589934592.B } + withLabel: mem16gib { memory = 17179869184.B } + withLabel: mem32gib { memory = 34359738368.B } + withLabel: mem64gib { memory = 68719476736.B } + withLabel: mem128gib { memory = 137438953472.B } + withLabel: mem256gib { memory = 274877906944.B } + withLabel: mem512gib { memory = 549755813888.B } + withLabel: mem1tib { memory = 1099511627776.B } + withLabel: mem2tib { memory = 2199023255552.B } + withLabel: mem4tib { memory = 4398046511104.B } + withLabel: mem8tib { memory = 8796093022208.B } + withLabel: mem16tib { memory = 17592186044416.B } + withLabel: mem32tib { memory = 35184372088832.B } + withLabel: mem64tib { memory = 70368744177664.B } + withLabel: mem128tib { memory = 140737488355328.B } + withLabel: mem256tib { memory = 281474976710656.B } + withLabel: mem512tib { memory = 562949953421312.B } + withLabel: cpu1 { cpus = 1 } + withLabel: cpu2 { cpus = 2 } + withLabel: cpu5 { cpus = 5 } + withLabel: cpu10 { cpus = 10 } + withLabel: cpu20 { cpus = 20 } + withLabel: cpu50 { cpus = 50 } + withLabel: cpu100 { cpus = 100 } + withLabel: cpu200 { cpus = 200 } + withLabel: cpu500 { cpus = 500 } + withLabel: cpu1000 { cpus = 1000 } +} + + diff --git a/target/nextflow/cutadapt/nextflow_schema.json b/target/nextflow/cutadapt/nextflow_schema.json new file mode 100644 index 00000000..2438aca0 --- /dev/null +++ b/target/nextflow/cutadapt/nextflow_schema.json @@ -0,0 +1,749 @@ +{ +"$schema": "http://json-schema.org/draft-07/schema", +"title": "cutadapt", +"description": "Cutadapt removes adapter sequences from high-throughput sequencing reads.\n", +"type": "object", +"definitions": { + + + + "specify adapters for r1" : { + "title": "Specify Adapters for R1", + "type": "object", + "description": "No description", + "properties": { + + + "adapter": { + "type": + "string", + "description": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 3\u0027 end (paired data:\nof the first read)", + "help_text": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 3\u0027 end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a \u0027$\u0027 character is appended (\u0027anchoring\u0027), the\nadapter is only found if it is a suffix of the read.\n" + + } + + + , + "front": { + "type": + "string", + "description": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 5\u0027 end (paired data:\nof the first read)", + "help_text": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 5\u0027 end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5\u0027 end are allowed. If\na \u0027^\u0027 character is prepended (\u0027anchoring\u0027), the adapter is\nonly found if it is a prefix of the read.\n" + + } + + + , + "anywhere": { + "type": + "string", + "description": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read)", + "help_text": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n" + + } + + +} +}, + + + "specify adapters using fasta files for r1" : { + "title": "Specify Adapters using Fasta files for R1", + "type": "object", + "description": "No description", + "properties": { + + + "adapter_fasta": { + "type": + "string", + "description": "Type: List of `file`, multiple_sep: `\":\"`. Fasta file containing sequences of an adapter ligated to the 3\u0027 end (paired data:\nof the first read)", + "help_text": "Type: List of `file`, multiple_sep: `\":\"`. Fasta file containing sequences of an adapter ligated to the 3\u0027 end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a \u0027$\u0027 character is appended (\u0027anchoring\u0027), the\nadapter is only found if it is a suffix of the read.\n" + + } + + + , + "front_fasta": { + "type": + "string", + "description": "Type: `file`. Fasta file containing sequences of an adapter ligated to the 5\u0027 end (paired data:\nof the first read)", + "help_text": "Type: `file`. Fasta file containing sequences of an adapter ligated to the 5\u0027 end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5\u0027 end are allowed. If\na \u0027^\u0027 character is prepended (\u0027anchoring\u0027), the adapter is\nonly found if it is a prefix of the read.\n" + + } + + + , + "anywhere_fasta": { + "type": + "string", + "description": "Type: `file`. Fasta file containing sequences of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read)", + "help_text": "Type: `file`. Fasta file containing sequences of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n" + + } + + +} +}, + + + "specify adapters for r2" : { + "title": "Specify Adapters for R2", + "type": "object", + "description": "No description", + "properties": { + + + "adapter_r2": { + "type": + "string", + "description": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 3\u0027 end (paired data:\nof the first read)", + "help_text": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 3\u0027 end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a \u0027$\u0027 character is appended (\u0027anchoring\u0027), the\nadapter is only found if it is a suffix of the read.\n" + + } + + + , + "front_r2": { + "type": + "string", + "description": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 5\u0027 end (paired data:\nof the first read)", + "help_text": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter ligated to the 5\u0027 end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5\u0027 end are allowed. If\na \u0027^\u0027 character is prepended (\u0027anchoring\u0027), the adapter is\nonly found if it is a prefix of the read.\n" + + } + + + , + "anywhere_r2": { + "type": + "string", + "description": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read)", + "help_text": "Type: List of `string`, multiple_sep: `\":\"`. Sequence of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n" + + } + + +} +}, + + + "specify adapters using fasta files for r2" : { + "title": "Specify Adapters using Fasta files for R2", + "type": "object", + "description": "No description", + "properties": { + + + "adapter_r2_fasta": { + "type": + "string", + "description": "Type: `file`. Fasta file containing sequences of an adapter ligated to the 3\u0027 end (paired data:\nof the first read)", + "help_text": "Type: `file`. Fasta file containing sequences of an adapter ligated to the 3\u0027 end (paired data:\nof the first read). The adapter and subsequent bases are\ntrimmed. If a \u0027$\u0027 character is appended (\u0027anchoring\u0027), the\nadapter is only found if it is a suffix of the read.\n" + + } + + + , + "front_r2_fasta": { + "type": + "string", + "description": "Type: `file`. Fasta file containing sequences of an adapter ligated to the 5\u0027 end (paired data:\nof the first read)", + "help_text": "Type: `file`. Fasta file containing sequences of an adapter ligated to the 5\u0027 end (paired data:\nof the first read). The adapter and any preceding bases\nare trimmed. Partial matches at the 5\u0027 end are allowed. If\na \u0027^\u0027 character is prepended (\u0027anchoring\u0027), the adapter is\nonly found if it is a prefix of the read.\n" + + } + + + , + "anywhere_r2_fasta": { + "type": + "string", + "description": "Type: `file`. Fasta file containing sequences of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read)", + "help_text": "Type: `file`. Fasta file containing sequences of an adapter that may be ligated to the 5\u0027 or 3\u0027\nend (paired data: of the first read). Both types of\nmatches as described under -a and -g are allowed. If the\nfirst base of the read is part of the match, the behavior\nis as with -g, otherwise as with -a. This option is mostly\nfor rescuing failed library preparations - do not use if\nyou know which end your adapter was ligated to!\n" + + } + + +} +}, + + + "paired-end options" : { + "title": "Paired-end options", + "type": "object", + "description": "No description", + "properties": { + + + "pair_adapters": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Treat adapters given with -a/-A etc", + "help_text": "Type: `boolean_true`, default: `false`. Treat adapters given with -a/-A etc. as pairs. Either both\nor none are removed from each read pair.\n" + , + "default": "False" + } + + + , + "pair_filter": { + "type": + "string", + "description": "Type: `string`, choices: ``any`, `both`, `first``. Which of the reads in a paired-end read have to match the\nfiltering criterion in order for the pair to be filtered", + "help_text": "Type: `string`, choices: ``any`, `both`, `first``. Which of the reads in a paired-end read have to match the\nfiltering criterion in order for the pair to be filtered.\n", + "enum": ["any", "both", "first"] + + + } + + + , + "interleaved": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Read and/or write interleaved paired-end reads", + "help_text": "Type: `boolean_true`, default: `false`. Read and/or write interleaved paired-end reads.\n" + , + "default": "False" + } + + +} +}, + + + "input parameters" : { + "title": "Input parameters", + "type": "object", + "description": "No description", + "properties": { + + + "input": { + "type": + "string", + "description": "Type: `file`, required. Input fastq file for single-end reads or R1 for paired-end reads", + "help_text": "Type: `file`, required. Input fastq file for single-end reads or R1 for paired-end reads.\n" + + } + + + , + "input_r2": { + "type": + "string", + "description": "Type: `file`. Input fastq file for R2 in the case of paired-end reads", + "help_text": "Type: `file`. Input fastq file for R2 in the case of paired-end reads.\n" + + } + + + , + "error_rate": { + "type": + "number", + "description": "Type: `double`, example: `0.1`. Maximum allowed error rate (if 0 \u003c= E \u003c 1), or absolute\nnumber of errors for full-length adapter match (if E is an\ninteger \u003e= 1)", + "help_text": "Type: `double`, example: `0.1`. Maximum allowed error rate (if 0 \u003c= E \u003c 1), or absolute\nnumber of errors for full-length adapter match (if E is an\ninteger \u003e= 1). Error rate = no. of errors divided by\nlength of matching region. Default: 0.1 (10%).\n" + + } + + + , + "no_indels": { + "type": + "boolean", + "description": "Type: `boolean_false`, default: `true`. Allow only mismatches in alignments", + "help_text": "Type: `boolean_false`, default: `true`. Allow only mismatches in alignments.\n" + , + "default": "True" + } + + + , + "times": { + "type": + "integer", + "description": "Type: `integer`, example: `1`. Remove up to COUNT adapters from each read", + "help_text": "Type: `integer`, example: `1`. Remove up to COUNT adapters from each read. Default: 1.\n" + + } + + + , + "overlap": { + "type": + "integer", + "description": "Type: `integer`, example: `3`. Require MINLENGTH overlap between read and adapter for an\nadapter to be found", + "help_text": "Type: `integer`, example: `3`. Require MINLENGTH overlap between read and adapter for an\nadapter to be found. The default is 3.\n" + + } + + + , + "match_read_wildcards": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Interpret IUPAC wildcards in reads", + "help_text": "Type: `boolean_true`, default: `false`. Interpret IUPAC wildcards in reads.\n" + , + "default": "False" + } + + + , + "no_match_adapter_wildcards": { + "type": + "boolean", + "description": "Type: `boolean_false`, default: `true`. Do not interpret IUPAC wildcards in adapters", + "help_text": "Type: `boolean_false`, default: `true`. Do not interpret IUPAC wildcards in adapters.\n" + , + "default": "True" + } + + + , + "action": { + "type": + "string", + "description": "Type: `string`, example: `trim`, choices: ``trim`, `retain`, `mask`, `lowercase`, `none``. What to do if a match was found", + "help_text": "Type: `string`, example: `trim`, choices: ``trim`, `retain`, `mask`, `lowercase`, `none``. What to do if a match was found. trim: trim adapter and\nup- or downstream sequence; retain: trim, but retain\nadapter; mask: replace with \u0027N\u0027 characters; lowercase:\nconvert to lowercase; none: leave unchanged.\nThe default is trim.\n", + "enum": ["trim", "retain", "mask", "lowercase", "none"] + + + } + + + , + "revcomp": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Check both the read and its reverse complement for adapter\nmatches", + "help_text": "Type: `boolean_true`, default: `false`. Check both the read and its reverse complement for adapter\nmatches. If match is on reverse-complemented version,\noutput that one.\n" + , + "default": "False" + } + + +} +}, + + + "read modifications" : { + "title": "Read modifications", + "type": "object", + "description": "No description", + "properties": { + + + "cut": { + "type": + "string", + "description": "Type: List of `integer`, multiple_sep: `\":\"`. Remove LEN bases from each read (or R1 if paired; use --cut_r2\noption for R2)", + "help_text": "Type: List of `integer`, multiple_sep: `\":\"`. Remove LEN bases from each read (or R1 if paired; use --cut_r2\noption for R2). If LEN is positive, remove bases from the\nbeginning. If LEN is negative, remove bases from the end.\nCan be used twice if LENs have different signs. Applied\n*before* adapter trimming.\n" + + } + + + , + "cut_r2": { + "type": + "string", + "description": "Type: List of `integer`, multiple_sep: `\":\"`. Remove LEN bases from each read (for R2)", + "help_text": "Type: List of `integer`, multiple_sep: `\":\"`. Remove LEN bases from each read (for R2). If LEN is positive, remove bases from the\nbeginning. If LEN is negative, remove bases from the end.\nCan be used twice if LENs have different signs. Applied\n*before* adapter trimming.\n" + + } + + + , + "nextseq_trim": { + "type": + "string", + "description": "Type: `string`. NextSeq-specific quality trimming (each read)", + "help_text": "Type: `string`. NextSeq-specific quality trimming (each read). Trims also\ndark cycles appearing as high-quality G bases.\n" + + } + + + , + "quality_cutoff": { + "type": + "string", + "description": "Type: `string`. Trim low-quality bases from 5\u0027 and/or 3\u0027 ends of each read\nbefore adapter removal", + "help_text": "Type: `string`. Trim low-quality bases from 5\u0027 and/or 3\u0027 ends of each read\nbefore adapter removal. Applied to both reads if data is\npaired. If one value is given, only the 3\u0027 end is trimmed.\nIf two comma-separated cutoffs are given, the 5\u0027 end is\ntrimmed with the first cutoff, the 3\u0027 end with the second.\n" + + } + + + , + "quality_cutoff_r2": { + "type": + "string", + "description": "Type: `string`. Quality-trimming cutoff for R2", + "help_text": "Type: `string`. Quality-trimming cutoff for R2. Default: same as for R1\n" + + } + + + , + "quality_base": { + "type": + "integer", + "description": "Type: `integer`, example: `33`. Assume that quality values in FASTQ are encoded as\nascii(quality + N)", + "help_text": "Type: `integer`, example: `33`. Assume that quality values in FASTQ are encoded as\nascii(quality + N). This needs to be set to 64 for some\nold Illumina FASTQ files. The default is 33.\n" + + } + + + , + "poly_a": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Trim poly-A tails", + "help_text": "Type: `boolean_true`, default: `false`. Trim poly-A tails" + , + "default": "False" + } + + + , + "length": { + "type": + "integer", + "description": "Type: `integer`. Shorten reads to LENGTH", + "help_text": "Type: `integer`. Shorten reads to LENGTH. Positive values remove bases at\nthe end while negative ones remove bases at the beginning.\nThis and the following modifications are applied after\nadapter trimming.\n" + + } + + + , + "trim_n": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Trim N\u0027s on ends of reads", + "help_text": "Type: `boolean_true`, default: `false`. Trim N\u0027s on ends of reads." + , + "default": "False" + } + + + , + "length_tag": { + "type": + "string", + "description": "Type: `string`, example: `length=`. Search for TAG followed by a decimal number in the\ndescription field of the read", + "help_text": "Type: `string`, example: `length=`. Search for TAG followed by a decimal number in the\ndescription field of the read. Replace the decimal number\nwith the correct length of the trimmed read. For example,\nuse --length-tag \u0027length=\u0027 to correct fields like\n\u0027length=123\u0027.\n" + + } + + + , + "strip_suffix": { + "type": + "string", + "description": "Type: `string`. Remove this suffix from read names if present", + "help_text": "Type: `string`. Remove this suffix from read names if present. Can be\ngiven multiple times.\n" + + } + + + , + "prefix": { + "type": + "string", + "description": "Type: `string`. Add this prefix to read names", + "help_text": "Type: `string`. Add this prefix to read names. Use {name} to insert the\nname of the matching adapter.\n" + + } + + + , + "suffix": { + "type": + "string", + "description": "Type: `string`. Add this suffix to read names; can also include {name}\n", + "help_text": "Type: `string`. Add this suffix to read names; can also include {name}\n" + + } + + + , + "rename": { + "type": + "string", + "description": "Type: `string`. Rename reads using TEMPLATE containing variables such as\n{id}, {adapter_name} etc", + "help_text": "Type: `string`. Rename reads using TEMPLATE containing variables such as\n{id}, {adapter_name} etc. (see documentation)\n" + + } + + + , + "zero_cap": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Change negative quality values to zero", + "help_text": "Type: `boolean_true`, default: `false`. Change negative quality values to zero." + , + "default": "False" + } + + +} +}, + + + "filtering of processed reads" : { + "title": "Filtering of processed reads", + "type": "object", + "description": "Filters are applied after above read modifications. Paired-end reads are\nalways discarded pairwise (see also --pair_filter).\n", + "properties": { + + + "minimum_length": { + "type": + "string", + "description": "Type: `string`, example: `0`. Discard reads shorter than LEN", + "help_text": "Type: `string`, example: `0`. Discard reads shorter than LEN. Default is 0.\nWhen trimming paired-end reads, the minimum lengths for R1 and R2 can be specified separately by separating them with a colon (:).\nIf the colon syntax is not used, the same minimum length applies to both reads, as discussed above.\nAlso, one of the values can be omitted to impose no restrictions.\nFor example, with -m 17:, the length of R1 must be at least 17, but the length of R2 is ignored.\n" + + } + + + , + "maximum_length": { + "type": + "string", + "description": "Type: `string`. Discard reads longer than LEN", + "help_text": "Type: `string`. Discard reads longer than LEN. Default: no limit.\nFor paired reads, see the remark for --minimum_length\n" + + } + + + , + "max_n": { + "type": + "string", + "description": "Type: `string`. Discard reads with more than COUNT \u0027N\u0027 bases", + "help_text": "Type: `string`. Discard reads with more than COUNT \u0027N\u0027 bases. If COUNT is\na number between 0 and 1, it is interpreted as a fraction\nof the read length.\n" + + } + + + , + "max_expected_errors": { + "type": + "string", + "description": "Type: `long`. Discard reads whose expected number of errors (computed\nfrom quality values) exceeds ERRORS", + "help_text": "Type: `long`. Discard reads whose expected number of errors (computed\nfrom quality values) exceeds ERRORS.\n" + + } + + + , + "max_average_error_rate": { + "type": + "string", + "description": "Type: `long`. as --max_expected_errors (see above), but divided by\nlength to account for reads of varying length", + "help_text": "Type: `long`. as --max_expected_errors (see above), but divided by\nlength to account for reads of varying length.\n" + + } + + + , + "discard_trimmed": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Discard reads that contain an adapter", + "help_text": "Type: `boolean_true`, default: `false`. Discard reads that contain an adapter. Use also -O to\navoid discarding too many randomly matching reads.\n" + , + "default": "False" + } + + + , + "discard_untrimmed": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Discard reads that do not contain an adapter", + "help_text": "Type: `boolean_true`, default: `false`. Discard reads that do not contain an adapter.\n" + , + "default": "False" + } + + + , + "discard_casava": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Discard reads that did not pass CASAVA filtering (header\nhas :Y:)", + "help_text": "Type: `boolean_true`, default: `false`. Discard reads that did not pass CASAVA filtering (header\nhas :Y:).\n" + , + "default": "False" + } + + +} +}, + + + "output parameters" : { + "title": "Output parameters", + "type": "object", + "description": "No description", + "properties": { + + + "report": { + "type": + "string", + "description": "Type: `string`, example: `full`, choices: ``full`, `minimal``. Which type of report to print: \u0027full\u0027 (default) or \u0027minimal\u0027", + "help_text": "Type: `string`, example: `full`, choices: ``full`, `minimal``. Which type of report to print: \u0027full\u0027 (default) or \u0027minimal\u0027.\n", + "enum": ["full", "minimal"] + + + } + + + , + "json": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Write report in JSON format to this file", + "help_text": "Type: `boolean_true`, default: `false`. Write report in JSON format to this file.\n" + , + "default": "False" + } + + + , + "output": { + "type": + "string", + "description": "Type: List of `file`, required, default: `$id.$key.output_*.fast[a,q]`, example: `fastq/*_001.fast[a,q]`, multiple_sep: `\":\"`. Glob pattern for matching the expected output files", + "help_text": "Type: List of `file`, required, default: `$id.$key.output_*.fast[a,q]`, example: `fastq/*_001.fast[a,q]`, multiple_sep: `\":\"`. Glob pattern for matching the expected output files.\nShould include `$output_dir`.\n" + , + "default": "$id.$key.output_*.fast[a,q]" + } + + + , + "fasta": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Output FASTA to standard output even on FASTQ input", + "help_text": "Type: `boolean_true`, default: `false`. Output FASTA to standard output even on FASTQ input.\n" + , + "default": "False" + } + + + , + "info_file": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Write information about each read and its adapter matches\ninto info", + "help_text": "Type: `boolean_true`, default: `false`. Write information about each read and its adapter matches\ninto info.txt in the output directory.\nSee the documentation for the file format.\n" + , + "default": "False" + } + + +} +}, + + + "debug" : { + "title": "Debug", + "type": "object", + "description": "No description", + "properties": { + + + "debug": { + "type": + "boolean", + "description": "Type: `boolean_true`, default: `false`. Print debug information", + "help_text": "Type: `boolean_true`, default: `false`. Print debug information" + , + "default": "False" + } + + +} +}, + + + "nextflow input-output arguments" : { + "title": "Nextflow input-output arguments", + "type": "object", + "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.", + "properties": { + + + "publish_dir": { + "type": + "string", + "description": "Type: `string`, required, example: `output/`. Path to an output directory", + "help_text": "Type: `string`, required, example: `output/`. Path to an output directory." + + } + + + , + "param_list": { + "type": + "string", + "description": "Type: `string`, example: `my_params.yaml`. Allows inputting multiple parameter sets to initialise a Nextflow channel", + "help_text": "Type: `string`, example: `my_params.yaml`. Allows inputting multiple parameter sets to initialise a Nextflow channel. A `param_list` can either be a list of maps, a csv file, a json file, a yaml file, or simply a yaml blob.\n\n* A list of maps (as-is) where the keys of each map corresponds to the arguments of the pipeline. Example: in a `nextflow.config` file: `param_list: [ [\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027], [\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027] ]`.\n* A csv file should have column names which correspond to the different arguments of this pipeline. Example: `--param_list data.csv` with columns `id,input`.\n* A json or a yaml file should be a list of maps, each of which has keys corresponding to the arguments of the pipeline. Example: `--param_list data.json` with contents `[ {\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027}, {\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027} ]`.\n* A yaml blob can also be passed directly as a string. Example: `--param_list \"[ {\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027}, {\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027} ]\"`.\n\nWhen passing a csv, json or yaml file, relative path names are relativized to the location of the parameter file. No relativation is performed when `param_list` is a list of maps (as-is) or a yaml blob.", + "hidden": true + + } + + +} +} +}, +"allOf": [ + + { + "$ref": "#/definitions/specify adapters for r1" + }, + + { + "$ref": "#/definitions/specify adapters using fasta files for r1" + }, + + { + "$ref": "#/definitions/specify adapters for r2" + }, + + { + "$ref": "#/definitions/specify adapters using fasta files for r2" + }, + + { + "$ref": "#/definitions/paired-end options" + }, + + { + "$ref": "#/definitions/input parameters" + }, + + { + "$ref": "#/definitions/read modifications" + }, + + { + "$ref": "#/definitions/filtering of processed reads" + }, + + { + "$ref": "#/definitions/output parameters" + }, + + { + "$ref": "#/definitions/debug" + }, + + { + "$ref": "#/definitions/nextflow input-output arguments" + } +] +} diff --git a/target/nextflow/falco/.config.vsh.yaml b/target/nextflow/falco/.config.vsh.yaml index 801f5d07..c7e812b0 100644 --- a/target/nextflow/falco/.config.vsh.yaml +++ b/target/nextflow/falco/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "falco" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Input arguments" arguments: @@ -274,7 +274,7 @@ engines: id: "docker" image: "debian:trixie-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "apt" @@ -304,11 +304,11 @@ build_info: output: "target/nextflow/falco" executable: "target/nextflow/falco/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -318,16 +318,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/falco/main.nf b/target/nextflow/falco/main.nf index ea765a37..d0389dfe 100644 --- a/target/nextflow/falco/main.nf +++ b/target/nextflow/falco/main.nf @@ -1,4 +1,4 @@ -// falco v0.1 +// falco v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "falco", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Input arguments", @@ -3080,7 +3080,7 @@ meta = [ "id" : "docker", "image" : "debian:trixie-slim", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3119,12 +3119,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/falco", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3133,20 +3133,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3577,7 +3574,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/falco", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/falco/nextflow.config b/target/nextflow/falco/nextflow.config index 38361a0f..3ac4103c 100644 --- a/target/nextflow/falco/nextflow.config +++ b/target/nextflow/falco/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'falco' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'A C++ drop-in replacement of FastQC to assess the quality of sequence read data' } diff --git a/target/nextflow/fastp/.config.vsh.yaml b/target/nextflow/fastp/.config.vsh.yaml index 3e10b340..45b66e42 100644 --- a/target/nextflow/fastp/.config.vsh.yaml +++ b/target/nextflow/fastp/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "fastp" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" description: "`fastp` supports both single-end (SE) and paired-end (PE) input.\n\ @@ -1048,7 +1048,7 @@ engines: id: "docker" image: "quay.io/biocontainers/fastp:0.23.4--hadf994f_2" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -1065,11 +1065,11 @@ build_info: output: "target/nextflow/fastp" executable: "target/nextflow/fastp/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -1079,16 +1079,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/fastp/main.nf b/target/nextflow/fastp/main.nf index ecb1372a..b343e1ab 100644 --- a/target/nextflow/fastp/main.nf +++ b/target/nextflow/fastp/main.nf @@ -1,4 +1,4 @@ -// fastp v0.1 +// fastp v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "fastp", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3943,7 +3943,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/fastp:0.23.4--hadf994f_2", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3965,12 +3965,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/fastp", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3979,20 +3979,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -4565,7 +4562,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/fastp", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/fastp/nextflow.config b/target/nextflow/fastp/nextflow.config index 011adbdd..3df03602 100644 --- a/target/nextflow/fastp/nextflow.config +++ b/target/nextflow/fastp/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'fastp' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'An ultra-fast all-in-one FASTQ preprocessor (QC/adapters/trimming/filtering/splitting/merging...).\n\nFeatures:\n\n - comprehensive quality profiling for both before and after filtering data (quality curves, base contents, KMER, Q20/Q30, GC Ratio, duplication, adapter contents...)\n - filter out bad reads (too low quality, too short, or too many N...)\n - cut low quality bases for per read in its 5\' and 3\' by evaluating the mean quality from a sliding window (like Trimmomatic but faster).\n - trim all reads in front and tail\n - cut adapters. Adapter sequences can be automatically detected, which means you don\'t have to input the adapter sequences to trim them.\n - correct mismatched base pairs in overlapped regions of paired end reads, if one base is with high quality while the other is with ultra low quality\n - trim polyG in 3\' ends, which is commonly seen in NovaSeq/NextSeq data. Trim polyX in 3\' ends to remove unwanted polyX tailing (i.e. polyA tailing for mRNA-Seq data)\n - preprocess unique molecular identifier (UMI) enabled data, shift UMI to sequence name.\n - report JSON format result for further interpreting.\n - visualize quality control and filtering results on a single HTML page (like FASTQC but faster and more informative).\n - split the output to multiple files (0001.R1.gz, 0002.R1.gz...) to support parallel processing. Two modes can be used, limiting the total split file number, or limitting the lines of each split file.\n - support long reads (data from PacBio / Nanopore devices).\n - support reading from STDIN and writing to STDOUT\n - support interleaved input\n - support ultra-fast FASTQ-level deduplication\n' } diff --git a/target/nextflow/featurecounts/.config.vsh.yaml b/target/nextflow/featurecounts/.config.vsh.yaml index 39954ed8..dfe37780 100644 --- a/target/nextflow/featurecounts/.config.vsh.yaml +++ b/target/nextflow/featurecounts/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "featurecounts" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -613,7 +613,7 @@ engines: id: "docker" image: "quay.io/biocontainers/subread:2.0.6--he4a0461_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -631,11 +631,11 @@ build_info: output: "target/nextflow/featurecounts" executable: "target/nextflow/featurecounts/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -645,16 +645,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/featurecounts/main.nf b/target/nextflow/featurecounts/main.nf index 14d86e56..cb1303c3 100644 --- a/target/nextflow/featurecounts/main.nf +++ b/target/nextflow/featurecounts/main.nf @@ -1,4 +1,4 @@ -// featurecounts v0.1 +// featurecounts v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "featurecounts", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3475,7 +3475,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/subread:2.0.6--he4a0461_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3497,12 +3497,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/featurecounts", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3511,20 +3511,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -4054,7 +4051,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/featurecounts", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/featurecounts/nextflow.config b/target/nextflow/featurecounts/nextflow.config index 63e813b9..e2416021 100644 --- a/target/nextflow/featurecounts/nextflow.config +++ b/target/nextflow/featurecounts/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'featurecounts' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'featureCounts is a read summarization program for counting reads generated from either RNA or genomic DNA sequencing experiments by implementing highly efficient chromosome hashing and feature blocking techniques. It works with either single or paired-end reads and provides a wide range of options appropriate for different sequencing applications.\n' } diff --git a/target/nextflow/gffread/.config.vsh.yaml b/target/nextflow/gffread/.config.vsh.yaml index 8d5d0d69..0cd2c44a 100644 --- a/target/nextflow/gffread/.config.vsh.yaml +++ b/target/nextflow/gffread/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "gffread" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -654,7 +654,7 @@ engines: id: "docker" image: "quay.io/biocontainers/gffread:0.12.7--hdcf5f25_3" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -671,11 +671,11 @@ build_info: output: "target/nextflow/gffread" executable: "target/nextflow/gffread/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -685,16 +685,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/gffread/main.nf b/target/nextflow/gffread/main.nf index fc8a697f..5abd37a6 100644 --- a/target/nextflow/gffread/main.nf +++ b/target/nextflow/gffread/main.nf @@ -1,4 +1,4 @@ -// gffread v0.1 +// gffread v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "gffread", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3532,7 +3532,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/gffread:0.12.7--hdcf5f25_3", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3554,12 +3554,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/gffread", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3568,20 +3568,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -4155,7 +4152,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/gffread", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/gffread/nextflow.config b/target/nextflow/gffread/nextflow.config index 11f31fbc..8006c08a 100644 --- a/target/nextflow/gffread/nextflow.config +++ b/target/nextflow/gffread/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'gffread' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Validate, filter, convert and perform various other operations on GFF files.' } diff --git a/target/nextflow/lofreq/lofreq_call/.config.vsh.yaml b/target/nextflow/lofreq/lofreq_call/.config.vsh.yaml index f9b07d18..9838a11a 100644 --- a/target/nextflow/lofreq/lofreq_call/.config.vsh.yaml +++ b/target/nextflow/lofreq/lofreq_call/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "lofreq_call" namespace: "lofreq" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -398,7 +398,7 @@ references: doi: - "10.1093/nar/gks918" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" homepage: "https://csb5.github.io/lofreq/" documentation: "https://csb5.github.io/lofreq/commands/" runners: @@ -471,7 +471,7 @@ engines: id: "docker" image: "quay.io/biocontainers/lofreq:2.1.5--py38h794fc9e_10" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -489,11 +489,11 @@ build_info: output: "target/nextflow/lofreq/lofreq_call" executable: "target/nextflow/lofreq/lofreq_call/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -503,16 +503,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/lofreq/lofreq_call/main.nf b/target/nextflow/lofreq/lofreq_call/main.nf index d2b2fd9f..16bba506 100644 --- a/target/nextflow/lofreq/lofreq_call/main.nf +++ b/target/nextflow/lofreq/lofreq_call/main.nf @@ -1,4 +1,4 @@ -// lofreq_call v0.1 +// lofreq_call v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "lofreq_call", "namespace" : "lofreq", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3250,7 +3250,7 @@ meta = [ ] }, "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "homepage" : "https://csb5.github.io/lofreq/", "documentation" : "https://csb5.github.io/lofreq/commands/" }, @@ -3334,7 +3334,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/lofreq:2.1.5--py38h794fc9e_10", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3356,12 +3356,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/lofreq/lofreq_call", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3370,20 +3370,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3867,7 +3864,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/lofreq/lofreq_call", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/lofreq/lofreq_call/nextflow.config b/target/nextflow/lofreq/lofreq_call/nextflow.config index b161cd17..e101bba9 100644 --- a/target/nextflow/lofreq/lofreq_call/nextflow.config +++ b/target/nextflow/lofreq/lofreq_call/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'lofreq/lofreq_call' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Call variants from a BAM file.\n\nLoFreq* (i.e. LoFreq version 2) is a fast and sensitive variant-caller for inferring SNVs and indels from next-generation sequencing data. It makes full use of base-call qualities and other sources of errors inherent in sequencing (e.g. mapping or base/indel alignment uncertainty), which are usually ignored by other methods or only used for filtering.\n\nLoFreq* can run on almost any type of aligned sequencing data (e.g. Illumina, IonTorrent or Pacbio) since no machine- or sequencing-technology dependent thresholds are used. It automatically adapts to changes in coverage and sequencing quality and can therefore be applied to a variety of data-sets e.g. viral/quasispecies, bacterial, metagenomics or somatic data.\n\nLoFreq* is very sensitive; most notably, it is able to predict variants below the average base-call quality (i.e. sequencing error rate). Each variant call is assigned a p-value which allows for rigorous false positive control. Even though it uses no approximations or heuristics, it is very efficient due to several runtime optimizations and also provides a (pseudo-)parallel implementation. LoFreq* is generic and fast enough to be applied to high-coverage data and large genomes. On a single processor it takes a minute to analyze Dengue genome sequencing data with nearly 4000X coverage, roughly one hour to call SNVs on a 600X coverage E.coli genome and also roughly an hour to run on a 100X coverage human exome dataset.\n' } diff --git a/target/nextflow/lofreq/lofreq_indelqual/.config.vsh.yaml b/target/nextflow/lofreq/lofreq_indelqual/.config.vsh.yaml index 3f71ab62..56bc8ad8 100644 --- a/target/nextflow/lofreq/lofreq_indelqual/.config.vsh.yaml +++ b/target/nextflow/lofreq/lofreq_indelqual/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "lofreq_indelqual" namespace: "lofreq" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -106,7 +106,7 @@ references: doi: - "10.1093/nar/gks918" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" homepage: "https://csb5.github.io/lofreq/" documentation: "https://csb5.github.io/lofreq/commands/" runners: @@ -179,7 +179,7 @@ engines: id: "docker" image: "quay.io/biocontainers/lofreq:2.1.5--py38h794fc9e_10" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -197,11 +197,11 @@ build_info: output: "target/nextflow/lofreq/lofreq_indelqual" executable: "target/nextflow/lofreq/lofreq_indelqual/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -211,16 +211,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/lofreq/lofreq_indelqual/main.nf b/target/nextflow/lofreq/lofreq_indelqual/main.nf index e22ecd8a..17e8544e 100644 --- a/target/nextflow/lofreq/lofreq_indelqual/main.nf +++ b/target/nextflow/lofreq/lofreq_indelqual/main.nf @@ -1,4 +1,4 @@ -// lofreq_indelqual v0.1 +// lofreq_indelqual v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "lofreq_indelqual", "namespace" : "lofreq", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -2913,7 +2913,7 @@ meta = [ ] }, "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "homepage" : "https://csb5.github.io/lofreq/", "documentation" : "https://csb5.github.io/lofreq/commands/" }, @@ -2997,7 +2997,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/lofreq:2.1.5--py38h794fc9e_10", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3019,12 +3019,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/lofreq/lofreq_indelqual", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3033,20 +3033,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3461,7 +3458,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/lofreq/lofreq_indelqual", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/lofreq/lofreq_indelqual/nextflow.config b/target/nextflow/lofreq/lofreq_indelqual/nextflow.config index 9744a041..cee4e44a 100644 --- a/target/nextflow/lofreq/lofreq_indelqual/nextflow.config +++ b/target/nextflow/lofreq/lofreq_indelqual/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'lofreq/lofreq_indelqual' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Insert indel qualities into BAM file (required for indel predictions).\n\nThe preferred way of inserting indel qualities should be via GATK\'s BQSR (>=2) If that\'s not possible, use this subcommand.\nThe command has two modes: \'uniform\' and \'dindel\':\n- \'uniform\' will assign a given value uniformly, whereas\n- \'dindel\' will insert indel qualities based on Dindel (PMID 20980555).\nBoth will overwrite any existing values.\nDo not realign your BAM file afterwards!\n' } diff --git a/target/nextflow/multiqc/.config.vsh.yaml b/target/nextflow/multiqc/.config.vsh.yaml index 77ac6dc4..fcf4762f 100644 --- a/target/nextflow/multiqc/.config.vsh.yaml +++ b/target/nextflow/multiqc/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "multiqc" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Input" arguments: @@ -344,7 +344,7 @@ requirements: - "ps" license: "MIT" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" runners: - type: "executable" id: "executable" @@ -415,7 +415,7 @@ engines: id: "docker" image: "quay.io/biocontainers/multiqc:1.21--pyhdfd78af_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -438,11 +438,11 @@ build_info: output: "target/nextflow/multiqc" executable: "target/nextflow/multiqc/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -452,16 +452,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/multiqc/main.nf b/target/nextflow/multiqc/main.nf index b5f5adc9..d7f771d4 100644 --- a/target/nextflow/multiqc/main.nf +++ b/target/nextflow/multiqc/main.nf @@ -1,4 +1,4 @@ -// multiqc v0.1 +// multiqc v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "multiqc", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Input", @@ -3197,7 +3197,7 @@ meta = [ }, "license" : "MIT", "links" : { - "repository" : "https://github.com/viash-hub/biobbox" + "repository" : "https://github.com/viash-hub/biobox" }, "runners" : [ { @@ -3279,7 +3279,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/multiqc:1.21--pyhdfd78af_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3310,12 +3310,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/multiqc", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3324,20 +3324,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3897,7 +3894,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/multiqc", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/multiqc/nextflow.config b/target/nextflow/multiqc/nextflow.config index d52ad1ff..2443ee90 100644 --- a/target/nextflow/multiqc/nextflow.config +++ b/target/nextflow/multiqc/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'multiqc' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'MultiQC aggregates results from bioinformatics analyses across many samples into a single report.\nIt searches a given directory for analysis logs and compiles a HTML report. It\'s a general use tool, perfect for summarising the output from numerous bioinformatics tools.\n' } diff --git a/target/nextflow/pear/.config.vsh.yaml b/target/nextflow/pear/.config.vsh.yaml index 03a6506a..1acbafd8 100644 --- a/target/nextflow/pear/.config.vsh.yaml +++ b/target/nextflow/pear/.config.vsh.yaml @@ -1,5 +1,5 @@ name: "pear" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -362,7 +362,7 @@ engines: id: "docker" image: "quay.io/biocontainers/pear:0.9.6--h9d449c0_10" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -380,11 +380,11 @@ build_info: output: "target/nextflow/pear" executable: "target/nextflow/pear/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -394,16 +394,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/pear/main.nf b/target/nextflow/pear/main.nf index 3362debf..af0476c9 100644 --- a/target/nextflow/pear/main.nf +++ b/target/nextflow/pear/main.nf @@ -1,4 +1,4 @@ -// pear v0.1 +// pear v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2779,7 +2779,7 @@ meta = [ "resources_dir": moduleDir.toRealPath().normalize(), "config": processConfig(readJsonBlob('''{ "name" : "pear", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3179,7 +3179,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/pear:0.9.6--h9d449c0_10", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3201,12 +3201,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/pear", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3215,20 +3215,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3702,7 +3699,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/pear", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/pear/nextflow.config b/target/nextflow/pear/nextflow.config index 2343ef3d..b4a0ff1d 100644 --- a/target/nextflow/pear/nextflow.config +++ b/target/nextflow/pear/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'pear' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'PEAR is an ultrafast, memory-efficient and highly accurate pair-end read merger. It is fully parallelized and can run with as low as just a few kilobytes of memory.\n\nPEAR evaluates all possible paired-end read overlaps and without requiring the target fragment size as input. In addition, it implements a statistical test for minimizing false-positive results. Together with a highly optimized implementation, it can merge millions of paired end reads within a couple of minutes on a standard desktop computer.\n' } diff --git a/target/nextflow/salmon/salmon_index/.config.vsh.yaml b/target/nextflow/salmon/salmon_index/.config.vsh.yaml index b93ecc54..ef77f535 100644 --- a/target/nextflow/salmon/salmon_index/.config.vsh.yaml +++ b/target/nextflow/salmon/salmon_index/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "salmon_index" namespace: "salmon" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -246,7 +246,7 @@ engines: id: "docker" image: "quay.io/biocontainers/salmon:1.10.2--hecfa306_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -263,11 +263,11 @@ build_info: output: "target/nextflow/salmon/salmon_index" executable: "target/nextflow/salmon/salmon_index/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -277,16 +277,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/salmon/salmon_index/main.nf b/target/nextflow/salmon/salmon_index/main.nf index a1f75f2f..3a7c328e 100644 --- a/target/nextflow/salmon/salmon_index/main.nf +++ b/target/nextflow/salmon/salmon_index/main.nf @@ -1,4 +1,4 @@ -// salmon_index v0.1 +// salmon_index v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "salmon_index", "namespace" : "salmon", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3055,7 +3055,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/salmon:1.10.2--hecfa306_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3077,12 +3077,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/salmon/salmon_index", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3091,20 +3091,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3558,7 +3555,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/salmon/salmon_index", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/salmon/salmon_index/nextflow.config b/target/nextflow/salmon/salmon_index/nextflow.config index 85426092..4dc4ee3b 100644 --- a/target/nextflow/salmon/salmon_index/nextflow.config +++ b/target/nextflow/salmon/salmon_index/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'salmon/salmon_index' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Salmon is a tool for wicked-fast transcript quantification from RNA-seq data. It can either make use of pre-computed alignments (in the form of a SAM/BAM file) to the transcripts rather than the raw reads, or can be run in the mapping-based mode. This component creates a salmon index for the transcriptome to use Salmon in the mapping-based mode. It is generally recommend that you build a decoy-aware transcriptome file. This is done using the entire genome of the organism as the decoy sequence by concatenating the genome to the end of the transcriptome to be indexed and populating the decoys.txt file with the chromosome names.\n' } diff --git a/target/nextflow/salmon/salmon_quant/.config.vsh.yaml b/target/nextflow/salmon/salmon_quant/.config.vsh.yaml index 5912aef4..381e2379 100644 --- a/target/nextflow/salmon/salmon_quant/.config.vsh.yaml +++ b/target/nextflow/salmon/salmon_quant/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "salmon_quant" namespace: "salmon" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Common input options" arguments: @@ -54,7 +54,7 @@ argument_groups: - "transcriptome_index" must_exist: true create_parent: true - required: true + required: false direction: "input" multiple: false multiple_sep: ";" @@ -561,7 +561,7 @@ argument_groups: direction: "input" multiple: false multiple_sep: ";" - - type: "file" + - type: "boolean_true" name: "--write_mappings" alternatives: - "-z" @@ -569,6 +569,12 @@ argument_groups: \ will be written out in SAM-compatible format. By default, output will be directed\ \ to stdout, but an alternative file name can be provided instead.\n" info: null + direction: "input" + - type: "file" + name: "--mapping_sam" + description: "Path to file that should output the selective-alignment results\ + \ in SAM-compatible format. THis option must be provided while using --write_mappings" + info: null example: - "mappings.sam" must_exist: true @@ -1136,7 +1142,7 @@ engines: id: "docker" image: "quay.io/biocontainers/salmon:1.10.2--hecfa306_0" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -1153,11 +1159,11 @@ build_info: output: "target/nextflow/salmon/salmon_quant" executable: "target/nextflow/salmon/salmon_quant/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -1167,16 +1173,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/salmon/salmon_quant/main.nf b/target/nextflow/salmon/salmon_quant/main.nf index 8a59f4d2..18765df8 100644 --- a/target/nextflow/salmon/salmon_quant/main.nf +++ b/target/nextflow/salmon/salmon_quant/main.nf @@ -1,4 +1,4 @@ -// salmon_quant v0.1 +// salmon_quant v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "salmon_quant", "namespace" : "salmon", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Common input options", @@ -2835,7 +2835,7 @@ meta = [ ], "must_exist" : true, "create_parent" : true, - "required" : true, + "required" : false, "direction" : "input", "multiple" : false, "multiple_sep" : ";" @@ -3312,12 +3312,18 @@ meta = [ "multiple_sep" : ";" }, { - "type" : "file", + "type" : "boolean_true", "name" : "--write_mappings", "alternatives" : [ "-z" ], "description" : "If this option is provided, then the selective-alignment results will be written out in SAM-compatible format. By default, output will be directed to stdout, but an alternative file name can be provided instead.\n", + "direction" : "input" + }, + { + "type" : "file", + "name" : "--mapping_sam", + "description" : "Path to file that should output the selective-alignment results in SAM-compatible format. THis option must be provided while using --write_mappings", "example" : [ "mappings.sam" ], @@ -3884,7 +3890,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/salmon:1.10.2--hecfa306_0", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3906,12 +3912,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/salmon/salmon_quant", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3920,20 +3926,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3999,6 +4002,7 @@ $( if [ ! -z ${VIASH_PAR_FULL_LENGTH_ALIGNMENT+x} ]; then echo "${VIASH_PAR_FULL $( if [ ! -z ${VIASH_PAR_HARD_FILTER+x} ]; then echo "${VIASH_PAR_HARD_FILTER}" | sed "s#'#'\\"'\\"'#g;s#.*#par_hard_filter='&'#" ; else echo "# par_hard_filter="; fi ) $( if [ ! -z ${VIASH_PAR_MIN_ALN_PROB+x} ]; then echo "${VIASH_PAR_MIN_ALN_PROB}" | sed "s#'#'\\"'\\"'#g;s#.*#par_min_aln_prob='&'#" ; else echo "# par_min_aln_prob="; fi ) $( if [ ! -z ${VIASH_PAR_WRITE_MAPPINGS+x} ]; then echo "${VIASH_PAR_WRITE_MAPPINGS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_write_mappings='&'#" ; else echo "# par_write_mappings="; fi ) +$( if [ ! -z ${VIASH_PAR_MAPPING_SAM+x} ]; then echo "${VIASH_PAR_MAPPING_SAM}" | sed "s#'#'\\"'\\"'#g;s#.*#par_mapping_sam='&'#" ; else echo "# par_mapping_sam="; fi ) $( if [ ! -z ${VIASH_PAR_WRITE_QUALITIES+x} ]; then echo "${VIASH_PAR_WRITE_QUALITIES}" | sed "s#'#'\\"'\\"'#g;s#.*#par_write_qualities='&'#" ; else echo "# par_write_qualities="; fi ) $( if [ ! -z ${VIASH_PAR_HIT_FILTER_POLICY+x} ]; then echo "${VIASH_PAR_HIT_FILTER_POLICY}" | sed "s#'#'\\"'\\"'#g;s#.*#par_hit_filter_policy='&'#" ; else echo "# par_hit_filter_policy="; fi ) $( if [ ! -z ${VIASH_PAR_ALTERNATIVE_INIT_MODE+x} ]; then echo "${VIASH_PAR_ALTERNATIVE_INIT_MODE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_alternative_init_mode='&'#" ; else echo "# par_alternative_init_mode="; fi ) @@ -4082,6 +4086,7 @@ $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" [[ "\\$par_softclip_overhangs" == "false" ]] && unset par_softclip_overhangs [[ "\\$par_full_length_alignment" == "false" ]] && unset par_full_length_alignment [[ "\\$par_hard_filter" == "false" ]] && unset par_hard_filter +[[ "\\$par_write_mappings" == "false" ]] && unset par_write_mappings [[ "\\$par_write_qualities" == "false" ]] && unset par_write_qualities [[ "\\$par_alternative_init_mode" == "false" ]] && unset par_alternative_init_mode [[ "\\$par_skip_quant" == "false" ]] && unset par_skip_quant @@ -4157,7 +4162,7 @@ salmon quant \\\\ \\${par_full_length_alignment:+--fullLengthAlignment} \\\\ \\${par_hard_filter:+--hardFilter} \\\\ \\${par_min_aln_prob:+--minAlnProb "\\${par_min_aln_prob}"} \\\\ - \\${par_write_mappings:+-z "\\${par_write_mappings}"} \\\\ + \\${par_write_mappings:+--write_mappings="\\${par_mappings_sam}"} \\\\ \\${par_write_qualities:+--writeQualities} \\\\ \\${par_hit_filter_policy:+--hitFilterPolicy "\\${par_hit_filter_policy}"} \\\\ \\${par_alternative_init_mode:+--alternativeInitMode} \\\\ @@ -4566,7 +4571,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/salmon/salmon_quant", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/salmon/salmon_quant/nextflow.config b/target/nextflow/salmon/salmon_quant/nextflow.config index 1114b9db..c9fccf9f 100644 --- a/target/nextflow/salmon/salmon_quant/nextflow.config +++ b/target/nextflow/salmon/salmon_quant/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'salmon/salmon_quant' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Salmon is a tool for wicked-fast transcript quantification from RNA-seq data. It can either make use of pre-computed alignments (in the form of a SAM/BAM file) to the transcripts rather than the raw reads, or can be run in the mapping-based mode. \n' } diff --git a/target/nextflow/salmon/salmon_quant/nextflow_schema.json b/target/nextflow/salmon/salmon_quant/nextflow_schema.json index f8820ec4..80b21398 100644 --- a/target/nextflow/salmon/salmon_quant/nextflow_schema.json +++ b/target/nextflow/salmon/salmon_quant/nextflow_schema.json @@ -40,8 +40,8 @@ "index": { "type": "string", - "description": "Type: `file`, required, example: `transcriptome_index`. Salmon index", - "help_text": "Type: `file`, required, example: `transcriptome_index`. Salmon index.\n" + "description": "Type: `file`, example: `transcriptome_index`. Salmon index", + "help_text": "Type: `file`, example: `transcriptome_index`. Salmon index.\n" } @@ -517,11 +517,22 @@ , "write_mappings": { "type": - "string", - "description": "Type: `file`, default: `$id.$key.write_mappings.sam`, example: `mappings.sam`. If this option is provided, then the selective-alignment results will be written out in SAM-compatible format", - "help_text": "Type: `file`, default: `$id.$key.write_mappings.sam`, example: `mappings.sam`. If this option is provided, then the selective-alignment results will be written out in SAM-compatible format. By default, output will be directed to stdout, but an alternative file name can be provided instead.\n" + "boolean", + "description": "Type: `boolean_true`, default: `false`. If this option is provided, then the selective-alignment results will be written out in SAM-compatible format", + "help_text": "Type: `boolean_true`, default: `false`. If this option is provided, then the selective-alignment results will be written out in SAM-compatible format. By default, output will be directed to stdout, but an alternative file name can be provided instead.\n" , - "default": "$id.$key.write_mappings.sam" + "default": "False" + } + + + , + "mapping_sam": { + "type": + "string", + "description": "Type: `file`, default: `$id.$key.mapping_sam.sam`, example: `mappings.sam`. Path to file that should output the selective-alignment results in SAM-compatible format", + "help_text": "Type: `file`, default: `$id.$key.mapping_sam.sam`, example: `mappings.sam`. Path to file that should output the selective-alignment results in SAM-compatible format. THis option must be provided while using --write_mappings" + , + "default": "$id.$key.mapping_sam.sam" } diff --git a/target/nextflow/samtools/samtools_collate/.config.vsh.yaml b/target/nextflow/samtools/samtools_collate/.config.vsh.yaml index ba9afb38..328741f4 100644 --- a/target/nextflow/samtools/samtools_collate/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_collate/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_collate" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -232,7 +232,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -250,11 +250,11 @@ build_info: output: "target/nextflow/samtools/samtools_collate" executable: "target/nextflow/samtools/samtools_collate/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -264,16 +264,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_collate/main.nf b/target/nextflow/samtools/samtools_collate/main.nf index 007e413b..cdfa80c3 100644 --- a/target/nextflow/samtools/samtools_collate/main.nf +++ b/target/nextflow/samtools/samtools_collate/main.nf @@ -1,4 +1,4 @@ -// samtools_collate v0.1 +// samtools_collate v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_collate", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3066,7 +3066,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3088,12 +3088,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_collate", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3102,20 +3102,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3547,7 +3544,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_collate", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_collate/nextflow.config b/target/nextflow/samtools/samtools_collate/nextflow.config index 16705895..0d171a62 100644 --- a/target/nextflow/samtools/samtools_collate/nextflow.config +++ b/target/nextflow/samtools/samtools_collate/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_collate' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Shuffles and groups reads in SAM/BAM/CRAM files together by their names.' } diff --git a/target/nextflow/samtools/samtools_faidx/.config.vsh.yaml b/target/nextflow/samtools/samtools_faidx/.config.vsh.yaml index 43bab568..1279abd1 100644 --- a/target/nextflow/samtools/samtools_faidx/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_faidx/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_faidx" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -211,7 +211,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -229,11 +229,11 @@ build_info: output: "target/nextflow/samtools/samtools_faidx" executable: "target/nextflow/samtools/samtools_faidx/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -243,16 +243,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_faidx/main.nf b/target/nextflow/samtools/samtools_faidx/main.nf index 24bb8630..91652b86 100644 --- a/target/nextflow/samtools/samtools_faidx/main.nf +++ b/target/nextflow/samtools/samtools_faidx/main.nf @@ -1,4 +1,4 @@ -// samtools_faidx v0.1 +// samtools_faidx v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_faidx", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3038,7 +3038,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3060,12 +3060,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_faidx", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3074,20 +3074,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3513,7 +3510,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_faidx", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_faidx/nextflow.config b/target/nextflow/samtools/samtools_faidx/nextflow.config index b8843f86..915c16f5 100644 --- a/target/nextflow/samtools/samtools_faidx/nextflow.config +++ b/target/nextflow/samtools/samtools_faidx/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_faidx' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Indexes FASTA files to enable random access to fasta and fastq files.' } diff --git a/target/nextflow/samtools/samtools_fastq/.config.vsh.yaml b/target/nextflow/samtools/samtools_fastq/.config.vsh.yaml index cbb20f42..c287c2c1 100644 --- a/target/nextflow/samtools/samtools_fastq/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_fastq/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_fastq" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -399,7 +399,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -417,11 +417,11 @@ build_info: output: "target/nextflow/samtools/samtools_fastq" executable: "target/nextflow/samtools/samtools_fastq/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -431,16 +431,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_fastq/main.nf b/target/nextflow/samtools/samtools_fastq/main.nf index 7e3bba35..6dcfcd1e 100644 --- a/target/nextflow/samtools/samtools_fastq/main.nf +++ b/target/nextflow/samtools/samtools_fastq/main.nf @@ -1,4 +1,4 @@ -// samtools_fastq v0.1 +// samtools_fastq v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_fastq", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3230,7 +3230,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3252,12 +3252,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_fastq", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3266,20 +3266,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3735,7 +3732,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_fastq", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_fastq/nextflow.config b/target/nextflow/samtools/samtools_fastq/nextflow.config index f9706942..3345ecd8 100644 --- a/target/nextflow/samtools/samtools_fastq/nextflow.config +++ b/target/nextflow/samtools/samtools_fastq/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_fastq' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Converts a SAM, BAM or CRAM to FASTQ format.' } diff --git a/target/nextflow/samtools/samtools_flagstat/.config.vsh.yaml b/target/nextflow/samtools/samtools_flagstat/.config.vsh.yaml index 175f05d4..0d6e9f38 100644 --- a/target/nextflow/samtools/samtools_flagstat/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_flagstat/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_flagstat" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -141,7 +141,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -159,11 +159,11 @@ build_info: output: "target/nextflow/samtools/samtools_flagstat" executable: "target/nextflow/samtools/samtools_flagstat/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -173,16 +173,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_flagstat/main.nf b/target/nextflow/samtools/samtools_flagstat/main.nf index c0110f0c..43073109 100644 --- a/target/nextflow/samtools/samtools_flagstat/main.nf +++ b/target/nextflow/samtools/samtools_flagstat/main.nf @@ -1,4 +1,4 @@ -// samtools_flagstat v0.1 +// samtools_flagstat v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_flagstat", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -2954,7 +2954,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -2976,12 +2976,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_flagstat", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -2990,20 +2990,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3409,7 +3406,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_flagstat", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_flagstat/nextflow.config b/target/nextflow/samtools/samtools_flagstat/nextflow.config index 364a7176..5f257fec 100644 --- a/target/nextflow/samtools/samtools_flagstat/nextflow.config +++ b/target/nextflow/samtools/samtools_flagstat/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_flagstat' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Counts the number of alignments in SAM/BAM/CRAM files for each FLAG type.' } diff --git a/target/nextflow/samtools/samtools_idxstats/.config.vsh.yaml b/target/nextflow/samtools/samtools_idxstats/.config.vsh.yaml index b424822d..b719c407 100644 --- a/target/nextflow/samtools/samtools_idxstats/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_idxstats/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_idxstats" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -151,7 +151,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -169,11 +169,11 @@ build_info: output: "target/nextflow/samtools/samtools_idxstats" executable: "target/nextflow/samtools/samtools_idxstats/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -183,16 +183,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_idxstats/main.nf b/target/nextflow/samtools/samtools_idxstats/main.nf index b7f28e79..14bc7da8 100644 --- a/target/nextflow/samtools/samtools_idxstats/main.nf +++ b/target/nextflow/samtools/samtools_idxstats/main.nf @@ -1,4 +1,4 @@ -// samtools_idxstats v0.1 +// samtools_idxstats v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_idxstats", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -2966,7 +2966,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -2988,12 +2988,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_idxstats", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3002,20 +3002,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3419,7 +3416,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_idxstats", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_idxstats/nextflow.config b/target/nextflow/samtools/samtools_idxstats/nextflow.config index 53e44917..94bbecb0 100644 --- a/target/nextflow/samtools/samtools_idxstats/nextflow.config +++ b/target/nextflow/samtools/samtools_idxstats/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_idxstats' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Reports alignment summary statistics for a BAM file.' } diff --git a/target/nextflow/samtools/samtools_index/.config.vsh.yaml b/target/nextflow/samtools/samtools_index/.config.vsh.yaml index 0d65d415..f5dd78db 100644 --- a/target/nextflow/samtools/samtools_index/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_index/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_index" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -157,7 +157,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -175,11 +175,11 @@ build_info: output: "target/nextflow/samtools/samtools_index" executable: "target/nextflow/samtools/samtools_index/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -189,16 +189,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_index/main.nf b/target/nextflow/samtools/samtools_index/main.nf index 5b72214b..a60ee5cb 100644 --- a/target/nextflow/samtools/samtools_index/main.nf +++ b/target/nextflow/samtools/samtools_index/main.nf @@ -1,4 +1,4 @@ -// samtools_index v0.1 +// samtools_index v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_index", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -2979,7 +2979,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3001,12 +3001,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_index", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3015,20 +3015,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3443,7 +3440,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_index", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_index/nextflow.config b/target/nextflow/samtools/samtools_index/nextflow.config index 20eba9bb..c4359c19 100644 --- a/target/nextflow/samtools/samtools_index/nextflow.config +++ b/target/nextflow/samtools/samtools_index/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_index' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Index SAM/BAM/CRAM files.' } diff --git a/target/nextflow/samtools/samtools_sort/.config.vsh.yaml b/target/nextflow/samtools/samtools_sort/.config.vsh.yaml index d838641b..ac8efcbd 100644 --- a/target/nextflow/samtools/samtools_sort/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_sort/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_sort" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -300,7 +300,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -318,11 +318,11 @@ build_info: output: "target/nextflow/samtools/samtools_sort" executable: "target/nextflow/samtools/samtools_sort/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -332,16 +332,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_sort/main.nf b/target/nextflow/samtools/samtools_sort/main.nf index e3857138..673ac483 100644 --- a/target/nextflow/samtools/samtools_sort/main.nf +++ b/target/nextflow/samtools/samtools_sort/main.nf @@ -1,4 +1,4 @@ -// samtools_sort v0.1 +// samtools_sort v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_sort", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3151,7 +3151,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3173,12 +3173,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_sort", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3187,20 +3187,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3656,7 +3653,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_sort", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_sort/nextflow.config b/target/nextflow/samtools/samtools_sort/nextflow.config index f1228ed0..2248d9e9 100644 --- a/target/nextflow/samtools/samtools_sort/nextflow.config +++ b/target/nextflow/samtools/samtools_sort/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_sort' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Sort SAM/BAM/CRAM file.' } diff --git a/target/nextflow/samtools/samtools_stats/.config.vsh.yaml b/target/nextflow/samtools/samtools_stats/.config.vsh.yaml index fd07e15a..c9523dfb 100644 --- a/target/nextflow/samtools/samtools_stats/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_stats/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_stats" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -362,7 +362,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -380,11 +380,11 @@ build_info: output: "target/nextflow/samtools/samtools_stats" executable: "target/nextflow/samtools/samtools_stats/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -394,16 +394,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_stats/main.nf b/target/nextflow/samtools/samtools_stats/main.nf index f6317664..167148fb 100644 --- a/target/nextflow/samtools/samtools_stats/main.nf +++ b/target/nextflow/samtools/samtools_stats/main.nf @@ -1,4 +1,4 @@ -// samtools_stats v0.1 +// samtools_stats v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_stats", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3216,7 +3216,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3238,12 +3238,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_stats", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3252,20 +3252,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3717,7 +3714,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_stats", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_stats/nextflow.config b/target/nextflow/samtools/samtools_stats/nextflow.config index 344d854f..d746263a 100644 --- a/target/nextflow/samtools/samtools_stats/nextflow.config +++ b/target/nextflow/samtools/samtools_stats/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_stats' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Reports alignment summary statistics for a BAM file.' } diff --git a/target/nextflow/samtools/samtools_view/.config.vsh.yaml b/target/nextflow/samtools/samtools_view/.config.vsh.yaml index e8f8b9b4..10eef093 100644 --- a/target/nextflow/samtools/samtools_view/.config.vsh.yaml +++ b/target/nextflow/samtools/samtools_view/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "samtools_view" namespace: "samtools" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Inputs" arguments: @@ -633,7 +633,7 @@ engines: id: "docker" image: "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "docker" @@ -651,11 +651,11 @@ build_info: output: "target/nextflow/samtools/samtools_view" executable: "target/nextflow/samtools/samtools_view/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -665,16 +665,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/samtools/samtools_view/main.nf b/target/nextflow/samtools/samtools_view/main.nf index 862b918d..9eaf5c68 100644 --- a/target/nextflow/samtools/samtools_view/main.nf +++ b/target/nextflow/samtools/samtools_view/main.nf @@ -1,4 +1,4 @@ -// samtools_view v0.1 +// samtools_view v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "samtools_view", "namespace" : "samtools", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Inputs", @@ -3402,7 +3402,7 @@ meta = [ "id" : "docker", "image" : "quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -3424,12 +3424,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_view", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -3438,20 +3438,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -3959,7 +3956,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/samtools/samtools_view", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/samtools/samtools_view/nextflow.config b/target/nextflow/samtools/samtools_view/nextflow.config index b52e2ca9..3f3e0114 100644 --- a/target/nextflow/samtools/samtools_view/nextflow.config +++ b/target/nextflow/samtools/samtools_view/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'samtools/samtools_view' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Views and converts SAM/BAM/CRAM files.' } diff --git a/target/nextflow/star/star_align_reads/.config.vsh.yaml b/target/nextflow/star/star_align_reads/.config.vsh.yaml index a5f723a6..41253ce2 100644 --- a/target/nextflow/star/star_align_reads/.config.vsh.yaml +++ b/target/nextflow/star/star_align_reads/.config.vsh.yaml @@ -1,6 +1,6 @@ name: "star_align_reads" namespace: "star" -version: "v0.1" +version: "v0.1.0" argument_groups: - name: "Run Parameters" arguments: @@ -2061,7 +2061,7 @@ engines: id: "docker" image: "python:3.12-slim" target_registry: "images.viash-hub.com" - target_tag: "v0.1" + target_tag: "v0.1.0" namespace_separator: "/" setup: - type: "apt" @@ -2095,11 +2095,11 @@ build_info: output: "target/nextflow/star/star_align_reads" executable: "target/nextflow/star/star_align_reads/main.nf" viash_version: "0.9.0-RC6" - git_commit: "d97e3156feb1839752aa080bfbe8a2153489dfd6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" git_remote: "https://github.com/viash-hub/biobox" package_config: name: "biobox" - version: "v0.1" + version: "v0.1.0" description: "A collection of bioinformatics tools for working with sequence data.\n" info: null viash_version: "0.9.0-RC6" @@ -2109,16 +2109,13 @@ package_config: - ".requirements.commands := ['ps']\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - - ".engines[.type == 'docker'].target_tag := 'v0.1'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" keywords: - "bioinformatics" - - "sequence" - - "alignment" - - "variant calling" - - "dna" - - "rna" + - "modules" + - "sequencing" license: "MIT" organization: "vsh" links: - repository: "https://github.com/viash-hub/biobbox" + repository: "https://github.com/viash-hub/biobox" issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/star/star_align_reads/main.nf b/target/nextflow/star/star_align_reads/main.nf index d490d180..10b0c965 100644 --- a/target/nextflow/star/star_align_reads/main.nf +++ b/target/nextflow/star/star_align_reads/main.nf @@ -1,4 +1,4 @@ -// star_align_reads v0.1 +// star_align_reads v0.1.0 // // This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a // derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from @@ -2780,7 +2780,7 @@ meta = [ "config": processConfig(readJsonBlob('''{ "name" : "star_align_reads", "namespace" : "star", - "version" : "v0.1", + "version" : "v0.1.0", "argument_groups" : [ { "name" : "Run Parameters", @@ -4467,7 +4467,7 @@ meta = [ { "type" : "string", "name" : "--chimOutType", - "description" : "type of chimeric output\n\n- Junctions ... Chimeric.out.junction\n- SeparateSAMold ... output old SAM into separate Chimeric.out.sam file\n- WithinBAM ... output into main aligned BAM files (Aligned.*.bam)\n- WithinBAM HardClip ... (defaul''' + '''t) hard-clipping in the CIGAR for supplemental chimeric alignments (default if no 2nd word is present)\n- WithinBAM SoftClip ... soft-clipping in the CIGAR for supplemental chimeric alignments", + "description" : "type of chimeric output\n\n- Junctions ... Chimeric.out.junction\n- SeparateSAMold ... output old SAM into separate Chimeric.out.sam file\n- WithinBAM ... output into main aligned BAM files (Aligned.*.bam)\n- WithinBAM HardClip ... (defa''' + '''ult) hard-clipping in the CIGAR for supplemental chimeric alignments (default if no 2nd word is present)\n- WithinBAM SoftClip ... soft-clipping in the CIGAR for supplemental chimeric alignments", "example" : [ "Junctions" ], @@ -4968,7 +4968,7 @@ meta = [ "id" : "docker", "image" : "python:3.12-slim", "target_registry" : "images.viash-hub.com", - "target_tag" : "v0.1", + "target_tag" : "v0.1.0", "namespace_separator" : "/", "setup" : [ { @@ -5009,12 +5009,12 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/star/star_align_reads", "viash_version" : "0.9.0-RC6", - "git_commit" : "d97e3156feb1839752aa080bfbe8a2153489dfd6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", "git_remote" : "https://github.com/viash-hub/biobox" }, "package_config" : { "name" : "biobox", - "version" : "v0.1", + "version" : "v0.1.0", "description" : "A collection of bioinformatics tools for working with sequence data.\n", "viash_version" : "0.9.0-RC6", "source" : "src", @@ -5023,20 +5023,17 @@ meta = [ ".requirements.commands := ['ps']\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", - ".engines[.type == 'docker'].target_tag := 'v0.1'" + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" ], "keywords" : [ "bioinformatics", - "sequence", - "alignment", - "variant calling", - "dna", - "rna" + "modules", + "sequencing" ], "license" : "MIT", "organization" : "vsh", "links" : { - "repository" : "https://github.com/viash-hub/biobbox", + "repository" : "https://github.com/viash-hub/biobox", "issue_tracker" : "https://github.com/viash-hub/biobox/issues" } } @@ -5693,7 +5690,7 @@ meta["defaults"] = [ "container" : { "registry" : "images.viash-hub.com", "image" : "vsh/biobox/star/star_align_reads", - "tag" : "v0.1" + "tag" : "v0.1.0" }, "tag" : "$id" }'''), diff --git a/target/nextflow/star/star_align_reads/nextflow.config b/target/nextflow/star/star_align_reads/nextflow.config index 6f0fb83e..54b1a38f 100644 --- a/target/nextflow/star/star_align_reads/nextflow.config +++ b/target/nextflow/star/star_align_reads/nextflow.config @@ -2,7 +2,7 @@ manifest { name = 'star/star_align_reads' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' + version = 'v0.1.0' description = 'Aligns reads to a reference genome using STAR.\n' } diff --git a/target/nextflow/star/star_genome_generate/.config.vsh.yaml b/target/nextflow/star/star_genome_generate/.config.vsh.yaml new file mode 100644 index 00000000..576cd1a2 --- /dev/null +++ b/target/nextflow/star/star_genome_generate/.config.vsh.yaml @@ -0,0 +1,345 @@ +name: "star_genome_generate" +namespace: "star" +version: "v0.1.0" +argument_groups: +- name: "Input" + arguments: + - type: "file" + name: "--genomeFastaFiles" + description: "Path(s) to the fasta files with the genome sequences, separated\ + \ by spaces. These files should be plain text FASTA files, they *cannot* be\ + \ zipped.\n" + info: null + must_exist: true + create_parent: true + required: true + direction: "input" + multiple: true + multiple_sep: ";" + - type: "file" + name: "--sjdbGTFfile" + description: "Path to the GTF file with annotations" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--sjdbOverhang" + description: "Length of the donor/acceptor sequence on each side of the junctions,\ + \ ideally = (mate_length - 1)" + info: null + example: + - 100 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFchrPrefix" + description: "Prefix for chromosome names in a GTF file (e.g. 'chr' for using\ + \ ENSMEBL annotations with UCSC genomes)" + info: null + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFfeatureExon" + description: "Feature type in GTF file to be used as exons for building transcripts" + info: null + example: + - "exon" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentTranscript" + description: "GTF attribute name for parent transcript ID (default \"transcript_id\"\ + \ works for GTF files)" + info: null + example: + - "transcript_id" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentGene" + description: "GTF attribute name for parent gene ID (default \"gene_id\" works\ + \ for GTF files)" + info: null + example: + - "gene_id" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentGeneName" + description: "GTF attribute name for parent gene name" + info: null + example: + - "gene_name" + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "string" + name: "--sjdbGTFtagExonParentGeneType" + description: "GTF attribute name for parent gene type" + info: null + example: + - "gene_type" + - "gene_biotype" + required: false + direction: "input" + multiple: true + multiple_sep: ";" + - type: "long" + name: "--limitGenomeGenerateRAM" + description: "Maximum available RAM (bytes) for genome generation" + info: null + example: + - 31000000000 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeSAindexNbases" + description: "Length (bases) of the SA pre-indexing string. Typically between\ + \ 10 and 15. Longer strings will use much more memory, but allow faster searches.\ + \ For small genomes, this parameter must be scaled down to min(14, log2(GenomeLength)/2\ + \ - 1)." + info: null + example: + - 14 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeChrBinNbits" + description: "Defined as log2(chrBin), where chrBin is the size of the bins for\ + \ genome storage. Each chromosome will occupy an integer number of bins. For\ + \ a genome with large number of contigs, it is recommended to scale this parameter\ + \ as min(18, log2[max(GenomeLength/NumberOfReferences,ReadLength)])." + info: null + example: + - 18 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeSAsparseD" + description: "Suffux array sparsity, i.e. distance between indices. Use bigger\ + \ numbers to decrease needed RAM at the cost of mapping speed reduction." + info: null + example: + - 1 + required: false + min: 0 + direction: "input" + multiple: false + multiple_sep: ";" + - type: "integer" + name: "--genomeSuffixLengthMax" + description: "Maximum length of the suffixes, has to be longer than read length.\ + \ Use -1 for infinite length." + info: null + example: + - -1 + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "string" + name: "--genomeTransformType" + description: "Type of genome transformation\n None ... no transformation\n\ + \ Haploid ... replace reference alleles with alternative alleles from VCF\ + \ file (e.g. consensus allele)\n Diploid ... create two haplotypes for each\ + \ chromosome listed in VCF file, for genotypes 1|2, assumes perfect phasing\ + \ (e.g. personal genome)\n" + info: null + example: + - "None" + required: false + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--genomeTransformVCF" + description: "path to VCF file for genome transformation" + info: null + must_exist: true + create_parent: true + required: false + direction: "input" + multiple: false + multiple_sep: ";" +- name: "Output" + arguments: + - type: "file" + name: "--index" + description: "STAR index directory." + info: null + default: + - "STAR_index" + must_exist: true + create_parent: true + required: true + direction: "output" + multiple: false + multiple_sep: ";" +resources: +- type: "bash_script" + path: "script.sh" + is_executable: true +description: "Create index for STAR\n" +test_resources: +- type: "bash_script" + path: "test.sh" + is_executable: true +info: null +status: "enabled" +requirements: + commands: + - "ps" +keywords: +- "genome" +- "index" +- "align" +license: "MIT" +references: + doi: + - "10.1093/bioinformatics/bts635" +links: + repository: "https://github.com/alexdobin/STAR" + documentation: "https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf" +runners: +- type: "executable" + id: "executable" + docker_setup_strategy: "ifneedbepullelsecachedbuild" +- type: "nextflow" + id: "nextflow" + directives: + tag: "$id" + auto: + simplifyInput: true + simplifyOutput: false + transcript: false + publish: false + config: + labels: + mem1gb: "memory = 1000000000.B" + mem2gb: "memory = 2000000000.B" + mem5gb: "memory = 5000000000.B" + mem10gb: "memory = 10000000000.B" + mem20gb: "memory = 20000000000.B" + mem50gb: "memory = 50000000000.B" + mem100gb: "memory = 100000000000.B" + mem200gb: "memory = 200000000000.B" + mem500gb: "memory = 500000000000.B" + mem1tb: "memory = 1000000000000.B" + mem2tb: "memory = 2000000000000.B" + mem5tb: "memory = 5000000000000.B" + mem10tb: "memory = 10000000000000.B" + mem20tb: "memory = 20000000000000.B" + mem50tb: "memory = 50000000000000.B" + mem100tb: "memory = 100000000000000.B" + mem200tb: "memory = 200000000000000.B" + mem500tb: "memory = 500000000000000.B" + mem1gib: "memory = 1073741824.B" + mem2gib: "memory = 2147483648.B" + mem4gib: "memory = 4294967296.B" + mem8gib: "memory = 8589934592.B" + mem16gib: "memory = 17179869184.B" + mem32gib: "memory = 34359738368.B" + mem64gib: "memory = 68719476736.B" + mem128gib: "memory = 137438953472.B" + mem256gib: "memory = 274877906944.B" + mem512gib: "memory = 549755813888.B" + mem1tib: "memory = 1099511627776.B" + mem2tib: "memory = 2199023255552.B" + mem4tib: "memory = 4398046511104.B" + mem8tib: "memory = 8796093022208.B" + mem16tib: "memory = 17592186044416.B" + mem32tib: "memory = 35184372088832.B" + mem64tib: "memory = 70368744177664.B" + mem128tib: "memory = 140737488355328.B" + mem256tib: "memory = 281474976710656.B" + mem512tib: "memory = 562949953421312.B" + cpu1: "cpus = 1" + cpu2: "cpus = 2" + cpu5: "cpus = 5" + cpu10: "cpus = 10" + cpu20: "cpus = 20" + cpu50: "cpus = 50" + cpu100: "cpus = 100" + cpu200: "cpus = 200" + cpu500: "cpus = 500" + cpu1000: "cpus = 1000" + debug: false + container: "docker" +engines: +- type: "docker" + id: "docker" + image: "ubuntu:22.04" + target_registry: "images.viash-hub.com" + target_tag: "v0.1.0" + namespace_separator: "/" + setup: + - type: "docker" + run: + - "apt-get update && \\\n apt-get install -y --no-install-recommends ${PACKAGES}\ + \ && \\\n cd /tmp && \\\n wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip\ + \ && \\\n unzip ${STAR_VERSION}.zip && \\\n cd STAR-${STAR_VERSION}/source\ + \ && \\\n make STARstatic CXXFLAGS_SIMD=-std=c++11 && \\\n cp STAR /usr/local/bin\ + \ && \\\n cd / && \\\n rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip\ + \ && \\\n apt-get --purge autoremove -y ${PACKAGES} && \\\n apt-get clean\n" + env: + - "STAR_VERSION 2.7.11b" + - "PACKAGES gcc g++ make wget zlib1g-dev unzip xxd" + - type: "docker" + run: + - "STAR --version | sed 's#\\(.*\\)#star: \"\\1\"#' > /var/software_versions.txt\n" + entrypoint: [] + cmd: null +- type: "native" + id: "native" +build_info: + config: "src/star/star_genome_generate/config.vsh.yaml" + runner: "nextflow" + engine: "docker|native" + output: "target/nextflow/star/star_genome_generate" + executable: "target/nextflow/star/star_genome_generate/main.nf" + viash_version: "0.9.0-RC6" + git_commit: "b84b29747d0635f2ac83ea63b496be9a9edb6724" + git_remote: "https://github.com/viash-hub/biobox" +package_config: + name: "biobox" + version: "v0.1.0" + description: "A collection of bioinformatics tools for working with sequence data.\n" + info: null + viash_version: "0.9.0-RC6" + source: "src" + target: "target" + config_mods: + - ".requirements.commands := ['ps']\n" + - ".engines += { type: \"native\" }" + - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" + - ".engines[.type == 'docker'].target_tag := 'v0.1.0'" + keywords: + - "bioinformatics" + - "modules" + - "sequencing" + license: "MIT" + organization: "vsh" + links: + repository: "https://github.com/viash-hub/biobox" + issue_tracker: "https://github.com/viash-hub/biobox/issues" diff --git a/target/nextflow/star/star_genome_generate/main.nf b/target/nextflow/star/star_genome_generate/main.nf new file mode 100644 index 00000000..0d0a3e06 --- /dev/null +++ b/target/nextflow/star/star_genome_generate/main.nf @@ -0,0 +1,3727 @@ +// star_genome_generate v0.1.0 +// +// This wrapper script is auto-generated by viash 0.9.0-RC6 and is thus a +// derivative work thereof. This software comes with ABSOLUTELY NO WARRANTY from +// Data Intuitive. +// +// The component may contain files which fall under a different license. The +// authors of this component should specify the license in the header of such +// files, or include a separate license file detailing the licenses of all included +// files. + +//////////////////////////// +// VDSL3 helper functions // +//////////////////////////// + +// helper file: 'src/main/resources/io/viash/runners/nextflow/arguments/_checkArgumentType.nf' +class UnexpectedArgumentTypeException extends Exception { + String errorIdentifier + String stage + String plainName + String expectedClass + String foundClass + + // ${key ? " in module '$key'" : ""}${id ? " id '$id'" : ""} + UnexpectedArgumentTypeException(String errorIdentifier, String stage, String plainName, String expectedClass, String foundClass) { + super("Error${errorIdentifier ? " $errorIdentifier" : ""}:${stage ? " $stage" : "" } argument '${plainName}' has the wrong type. " + + "Expected type: ${expectedClass}. Found type: ${foundClass}") + this.errorIdentifier = errorIdentifier + this.stage = stage + this.plainName = plainName + this.expectedClass = expectedClass + this.foundClass = foundClass + } +} + +/** + * Checks if the given value is of the expected type. If not, an exception is thrown. + * + * @param stage The stage of the argument (input or output) + * @param par The parameter definition + * @param value The value to check + * @param errorIdentifier The identifier to use in the error message + * @return The value, if it is of the expected type + * @throws UnexpectedArgumentTypeException If the value is not of the expected type +*/ +def _checkArgumentType(String stage, Map par, Object value, String errorIdentifier) { + // expectedClass will only be != null if value is not of the expected type + def expectedClass = null + def foundClass = null + + // todo: split if need be + + if (!par.required && value == null) { + expectedClass = null + } else if (par.multiple) { + if (value !instanceof Collection) { + value = [value] + } + + // split strings + value = value.collectMany{ val -> + if (val instanceof String) { + // collect() to ensure that the result is a List and not simply an array + val.split(par.multiple_sep).collect() + } else { + [val] + } + } + + // process globs + if (par.type == "file" && par.direction == "input") { + value = value.collect{ it instanceof String ? file(it, hidden: true) : it }.flatten() + } + + // check types of elements in list + try { + value = value.collect { listVal -> + _checkArgumentType(stage, par + [multiple: false], listVal, errorIdentifier) + } + } catch (UnexpectedArgumentTypeException e) { + expectedClass = "List[${e.expectedClass}]" + foundClass = "List[${e.foundClass}]" + } + } else if (par.type == "string") { + // cast to string if need be + if (value instanceof GString) { + value = value.toString() + } + expectedClass = value instanceof String ? null : "String" + } else if (par.type == "integer") { + // cast to integer if need be + if (value instanceof String) { + try { + value = value.toInteger() + } catch (NumberFormatException e) { + // do nothing + } + } + if (value instanceof java.math.BigInteger) { + value = value.intValue() + } + expectedClass = value instanceof Integer ? null : "Integer" + } else if (par.type == "long") { + // cast to long if need be + if (value instanceof String) { + try { + value = value.toLong() + } catch (NumberFormatException e) { + // do nothing + } + } + if (value instanceof Integer) { + value = value.toLong() + } + expectedClass = value instanceof Long ? null : "Long" + } else if (par.type == "double") { + // cast to double if need be + if (value instanceof String) { + try { + value = value.toDouble() + } catch (NumberFormatException e) { + // do nothing + } + } + if (value instanceof java.math.BigDecimal) { + value = value.doubleValue() + } + if (value instanceof Float) { + value = value.toDouble() + } + expectedClass = value instanceof Double ? null : "Double" + } else if (par.type == "boolean" | par.type == "boolean_true" | par.type == "boolean_false") { + // cast to boolean if need be + if (value instanceof String) { + def valueLower = value.toLowerCase() + if (valueLower == "true") { + value = true + } else if (valueLower == "false") { + value = false + } + } + expectedClass = value instanceof Boolean ? null : "Boolean" + } else if (par.type == "file" && (par.direction == "input" || stage == "output")) { + // cast to path if need be + if (value instanceof String) { + value = file(value, hidden: true) + } + if (value instanceof File) { + value = value.toPath() + } + expectedClass = value instanceof Path ? null : "Path" + } else if (par.type == "file" && stage == "input" && par.direction == "output") { + // cast to string if need be + if (value instanceof GString) { + value = value.toString() + } + expectedClass = value instanceof String ? null : "String" + } else { + // didn't find a match for par.type + expectedClass = par.type + } + + if (expectedClass != null) { + if (foundClass == null) { + foundClass = value.getClass().getName() + } + throw new UnexpectedArgumentTypeException(errorIdentifier, stage, par.plainName, expectedClass, foundClass) + } + + return value +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/arguments/_processInputValues.nf' +Map _processInputValues(Map inputs, Map config, String id, String key) { + if (!workflow.stubRun) { + config.allArguments.each { arg -> + if (arg.required) { + assert inputs.containsKey(arg.plainName) && inputs.get(arg.plainName) != null : + "Error in module '${key}' id '${id}': required input argument '${arg.plainName}' is missing" + } + } + + inputs = inputs.collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && (it.direction == "input" || it.type == "file") } + assert par != null : "Error in module '${key}' id '${id}': '${name}' is not a valid input argument" + + value = _checkArgumentType("input", par, value, "in module '$key' id '$id'") + + [ name, value ] + } + } + return inputs +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/arguments/_processOutputValues.nf' +Map _processOutputValues(Map outputs, Map config, String id, String key) { + if (!workflow.stubRun) { + config.allArguments.each { arg -> + if (arg.direction == "output" && arg.required) { + assert outputs.containsKey(arg.plainName) && outputs.get(arg.plainName) != null : + "Error in module '${key}' id '${id}': required output argument '${arg.plainName}' is missing" + } + } + + outputs = outputs.collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && it.direction == "output" } + assert par != null : "Error in module '${key}' id '${id}': '${name}' is not a valid output argument" + + value = _checkArgumentType("output", par, value, "in module '$key' id '$id'") + + [ name, value ] + } + } + return outputs +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/IDChecker.nf' +class IDChecker { + final def items = [] as Set + + @groovy.transform.WithWriteLock + boolean observe(String item) { + if (items.contains(item)) { + return false + } else { + items << item + return true + } + } + + @groovy.transform.WithReadLock + boolean contains(String item) { + return items.contains(item) + } + + @groovy.transform.WithReadLock + Set getItems() { + return items.clone() + } +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_checkUniqueIds.nf' + +/** + * Check if the ids are unique across parameter sets + * + * @param parameterSets a list of parameter sets. + */ +private void _checkUniqueIds(List>> parameterSets) { + def ppIds = parameterSets.collect{it[0]} + assert ppIds.size() == ppIds.unique().size() : "All argument sets should have unique ids. Detected ids: $ppIds" +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_getChild.nf' + +// helper functions for reading params from file // +def _getChild(parent, child) { + if (child.contains("://") || java.nio.file.Paths.get(child).isAbsolute()) { + child + } else { + def parentAbsolute = java.nio.file.Paths.get(parent).toAbsolutePath().toString() + parentAbsolute.replaceAll('/[^/]*$', "/") + child + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_parseParamList.nf' +/** + * Figure out the param list format based on the file extension + * + * @param param_list A String containing the path to the parameter list file. + * + * @return A String containing the format of the parameter list file. + */ +def _paramListGuessFormat(param_list) { + if (param_list !instanceof String) { + "asis" + } else if (param_list.endsWith(".csv")) { + "csv" + } else if (param_list.endsWith(".json") || param_list.endsWith(".jsn")) { + "json" + } else if (param_list.endsWith(".yaml") || param_list.endsWith(".yml")) { + "yaml" + } else { + "yaml_blob" + } +} + + +/** + * Read the param list + * + * @param param_list One of the following: + * - A String containing the path to the parameter list file (csv, json or yaml), + * - A yaml blob of a list of maps (yaml_blob), + * - Or a groovy list of maps (asis). + * @param config A Map of the Viash configuration. + * + * @return A List of Maps containing the parameters. + */ +def _parseParamList(param_list, Map config) { + // first determine format by extension + def paramListFormat = _paramListGuessFormat(param_list) + + def paramListPath = (paramListFormat != "asis" && paramListFormat != "yaml_blob") ? + file(param_list, hidden: true) : + null + + // get the correct parser function for the detected params_list format + def paramSets = [] + if (paramListFormat == "asis") { + paramSets = param_list + } else if (paramListFormat == "yaml_blob") { + paramSets = readYamlBlob(param_list) + } else if (paramListFormat == "yaml") { + paramSets = readYaml(paramListPath) + } else if (paramListFormat == "json") { + paramSets = readJson(paramListPath) + } else if (paramListFormat == "csv") { + paramSets = readCsv(paramListPath) + } else { + error "Format of provided --param_list not recognised.\n" + + "Found: '$paramListFormat'.\n" + + "Expected: a csv file, a json file, a yaml file,\n" + + "a yaml blob or a groovy list of maps." + } + + // data checks + assert paramSets instanceof List: "--param_list should contain a list of maps" + for (value in paramSets) { + assert value instanceof Map: "--param_list should contain a list of maps" + } + + // id is argument + def idIsArgument = config.allArguments.any{it.plainName == "id"} + + // Reformat from List to List> by adding the ID as first element of a Tuple2 + paramSets = paramSets.collect({ data -> + def id = data.id + if (!idIsArgument) { + data = data.findAll{k, v -> k != "id"} + } + [id, data] + }) + + // Split parameters with 'multiple: true' + paramSets = paramSets.collect({ id, data -> + data = _splitParams(data, config) + [id, data] + }) + + // The paths of input files inside a param_list file may have been specified relatively to the + // location of the param_list file. These paths must be made absolute. + if (paramListPath) { + paramSets = paramSets.collect({ id, data -> + def new_data = data.collectEntries{ parName, parValue -> + def par = config.allArguments.find{it.plainName == parName} + if (par && par.type == "file" && par.direction == "input") { + if (parValue instanceof Collection) { + parValue = parValue.collectMany{path -> + def x = _resolveSiblingIfNotAbsolute(path, paramListPath) + x instanceof Collection ? x : [x] + } + } else { + parValue = _resolveSiblingIfNotAbsolute(parValue, paramListPath) + } + } + [parName, parValue] + } + [id, new_data] + }) + } + + return paramSets +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/_splitParams.nf' +/** + * Split parameters for arguments that accept multiple values using their separator + * + * @param paramList A Map containing parameters to split. + * @param config A Map of the Viash configuration. This Map can be generated from the config file + * using the readConfig() function. + * + * @return A Map of parameters where the parameter values have been split into a list using + * their seperator. + */ +Map _splitParams(Map parValues, Map config){ + def parsedParamValues = parValues.collectEntries { parName, parValue -> + def parameterSettings = config.allArguments.find({it.plainName == parName}) + + if (!parameterSettings) { + // if argument is not found, do not alter + return [parName, parValue] + } + if (parameterSettings.multiple) { // Check if parameter can accept multiple values + if (parValue instanceof Collection) { + parValue = parValue.collect{it instanceof String ? it.split(parameterSettings.multiple_sep) : it } + } else if (parValue instanceof String) { + parValue = parValue.split(parameterSettings.multiple_sep) + } else if (parValue == null) { + parValue = [] + } else { + parValue = [ parValue ] + } + parValue = parValue.flatten() + } + // For all parameters check if multiple values are only passed for + // arguments that allow it. Quietly simplify lists of length 1. + if (!parameterSettings.multiple && parValue instanceof Collection) { + assert parValue.size() == 1 : + "Error: argument ${parName} has too many values.\n" + + " Expected amount: 1. Found: ${parValue.size()}" + parValue = parValue[0] + } + [parName, parValue] + } + return parsedParamValues +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf' +/** + * Parse nextflow parameters based on settings defined in a viash config. + * Return a list of parameter sets, each parameter set corresponding to + * an event in a nextflow channel. The output from this function can be used + * with Channel.fromList to create a nextflow channel with Vdsl3 formatted + * events. + * + * This function performs: + * - A filtering of the params which can be found in the config file. + * - Process the params_list argument which allows a user to to initialise + * a Vsdl3 channel with multiple parameter sets. Possible formats are + * csv, json, yaml, or simply a yaml_blob. A csv should have column names + * which correspond to the different arguments of this pipeline. A json or a yaml + * file should be a list of maps, each of which has keys corresponding to the + * arguments of the pipeline. A yaml blob can also be passed directly as a parameter. + * When passing a csv, json or yaml, relative path names are relativized to the + * location of the parameter file. + * - Combine the parameter sets into a vdsl3 Channel. + * + * @param params Input parameters. Can optionaly contain a 'param_list' key that + * provides a list of arguments that can be split up into multiple events + * in the output channel possible formats of param_lists are: a csv file, + * json file, a yaml file or a yaml blob. Each parameters set (event) must + * have a unique ID. + * @param config A Map of the Viash configuration. This Map can be generated from the config file + * using the readConfig() function. + * + * @return A list of parameters with the first element of the event being + * the event ID and the second element containing a map of the parsed parameters. + */ + +private List>> _paramsToParamSets(Map params, Map config){ + // todo: fetch key from run args + def key_ = config.name + + /* parse regular parameters (not in param_list) */ + /*************************************************/ + def globalParams = config.allArguments + .findAll { params.containsKey(it.plainName) } + .collectEntries { [ it.plainName, params[it.plainName] ] } + def globalID = params.get("id", null) + + /* process params_list arguments */ + /*********************************/ + def paramList = params.containsKey("param_list") && params.param_list != null ? + params.param_list : [] + // if (paramList instanceof String) { + // paramList = [paramList] + // } + // def paramSets = paramList.collectMany{ _parseParamList(it, config) } + // TODO: be able to process param_list when it is a list of strings + def paramSets = _parseParamList(paramList, config) + if (paramSets.isEmpty()) { + paramSets = [[null, [:]]] + } + + /* combine arguments into channel */ + /**********************************/ + def processedParams = paramSets.indexed().collect{ index, tup -> + // Process ID + def id = tup[0] ?: globalID + + if (workflow.stubRun && !id) { + // if stub run, explicitly add an id if missing + id = "stub${index}" + } + assert id != null: "Each parameter set should have at least an 'id'" + + // Process params + def parValues = globalParams + tup[1] + // // Remove parameters which are null, if the default is also null + // parValues = parValues.collectEntries{paramName, paramValue -> + // parameterSettings = config.functionality.allArguments.find({it.plainName == paramName}) + // if ( paramValue != null || parameterSettings.get("default", null) != null ) { + // [paramName, paramValue] + // } + // } + parValues = parValues.collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && (it.direction == "input" || it.type == "file") } + assert par != null : "Error in module '${key_}' id '${id}': '${name}' is not a valid input argument" + + if (par == null) { + return [:] + } + value = _checkArgumentType("input", par, value, "in module '$key_' id '$id'") + + [ name, value ] + } + + [id, parValues] + } + + // Check if ids (first element of each list) is unique + _checkUniqueIds(processedParams) + return processedParams +} + +/** + * Parse nextflow parameters based on settings defined in a viash config + * and return a nextflow channel. + * + * @param params Input parameters. Can optionaly contain a 'param_list' key that + * provides a list of arguments that can be split up into multiple events + * in the output channel possible formats of param_lists are: a csv file, + * json file, a yaml file or a yaml blob. Each parameters set (event) must + * have a unique ID. + * @param config A Map of the Viash configuration. This Map can be generated from the config file + * using the readConfig() function. + * + * @return A nextflow Channel with events. Events are formatted as a tuple that contains + * first contains the ID of the event and as second element holds a parameter map. + * + * + */ +def channelFromParams(Map params, Map config) { + def processedParams = _paramsToParamSets(params, config) + return Channel.fromList(processedParams) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/checkUniqueIds.nf' +def checkUniqueIds(Map args) { + def stopOnError = args.stopOnError == null ? args.stopOnError : true + + def idChecker = new IDChecker() + + return filter { tup -> + if (!idChecker.observe(tup[0])) { + if (stopOnError) { + error "Duplicate id: ${tup[0]}" + } else { + log.warn "Duplicate id: ${tup[0]}, removing duplicate entry" + return false + } + } + return true + } +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/preprocessInputs.nf' +// This helper file will be deprecated soon +preprocessInputsDeprecationWarningPrinted = false + +def preprocessInputsDeprecationWarning() { + if (!preprocessInputsDeprecationWarningPrinted) { + preprocessInputsDeprecationWarningPrinted = true + System.err.println("Warning: preprocessInputs() is deprecated and will be removed in Viash 0.9.0.") + } +} + +/** + * Generate a nextflow Workflow that allows processing a channel of + * Vdsl3 formatted events and apply a Viash config to them: + * - Gather default parameters from the Viash config and make + * sure that they are correctly formatted (see applyConfig method). + * - Format the input parameters (also using the applyConfig method). + * - Apply the default parameter to the input parameters. + * - Do some assertions: + * ~ Check if the event IDs in the channel are unique. + * + * The events in the channel are formatted as tuples, with the + * first element of the tuples being a unique id of the parameter set, + * and the second element containg the the parameters themselves. + * Optional extra elements of the tuples will be passed to the output as is. + * + * @param args A map that must contain a 'config' key that points + * to a parsed config (see readConfig()). Optionally, a + * 'key' key can be provided which can be used to create a unique + * name for the workflow process. + * + * @return A workflow that allows processing a channel of Vdsl3 formatted events + * and apply a Viash config to them. + */ +def preprocessInputs(Map args) { + preprocessInputsDeprecationWarning() + + def config = args.config + assert config instanceof Map : + "Error in preprocessInputs: config must be a map. " + + "Expected class: Map. Found: config.getClass() is ${config.getClass()}" + def key_ = args.key ?: config.name + + // Get different parameter types (used throughout this function) + def defaultArgs = config.allArguments + .findAll { it.containsKey("default") } + .collectEntries { [ it.plainName, it.default ] } + + map { tup -> + def id = tup[0] + def data = tup[1] + def passthrough = tup.drop(2) + + def new_data = (defaultArgs + data).collectEntries { name, value -> + def par = config.allArguments.find { it.plainName == name && (it.direction == "input" || it.type == "file") } + + if (par != null) { + value = _checkArgumentType("input", par, value, "in module '$key_' id '$id'") + } + + [ name, value ] + } + + [ id, new_data ] + passthrough + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/runComponents.nf' +/** + * Run a list of components on a stream of data. + * + * @param components: list of Viash VDSL3 modules to run + * @param fromState: a closure, a map or a list of keys to extract from the input data. + * If a closure, it will be called with the id, the data and the component config. + * @param toState: a closure, a map or a list of keys to extract from the output data + * If a closure, it will be called with the id, the output data, the old state and the component config. + * @param filter: filter function to apply to the input. + * It will be called with the id, the data and the component config. + * @param id: id to use for the output data + * If a closure, it will be called with the id, the data and the component config. + * @param auto: auto options to pass to the components + * + * @return: a workflow that runs the components + **/ +def runComponents(Map args) { + log.warn("runComponents is deprecated, use runEach instead") + assert args.components: "runComponents should be passed a list of components to run" + + def components_ = args.components + if (components_ !instanceof List) { + components_ = [ components_ ] + } + assert components_.size() > 0: "pass at least one component to runComponents" + + def fromState_ = args.fromState + def toState_ = args.toState + def filter_ = args.filter + def id_ = args.id + + workflow runComponentsWf { + take: input_ch + main: + + // generate one channel per method + out_chs = components_.collect{ comp_ -> + def comp_config = comp_.config + + def filter_ch = filter_ + ? input_ch | filter{tup -> + filter_(tup[0], tup[1], comp_config) + } + : input_ch + def id_ch = id_ + ? filter_ch | map{tup -> + // def new_id = id_(tup[0], tup[1], comp_config) + def new_id = tup[0] + if (id_ instanceof String) { + new_id = id_ + } else if (id_ instanceof Closure) { + new_id = id_(new_id, tup[1], comp_config) + } + [new_id] + tup.drop(1) + } + : filter_ch + def data_ch = id_ch | map{tup -> + def new_data = tup[1] + if (fromState_ instanceof Map) { + new_data = fromState_.collectEntries{ key0, key1 -> + [key0, new_data[key1]] + } + } else if (fromState_ instanceof List) { + new_data = fromState_.collectEntries{ key -> + [key, new_data[key]] + } + } else if (fromState_ instanceof Closure) { + new_data = fromState_(tup[0], new_data, comp_config) + } + tup.take(1) + [new_data] + tup.drop(1) + } + def out_ch = data_ch + | comp_.run( + auto: (args.auto ?: [:]) + [simplifyInput: false, simplifyOutput: false] + ) + def post_ch = toState_ + ? out_ch | map{tup -> + def output = tup[1] + def old_state = tup[2] + def new_state = null + if (toState_ instanceof Map) { + new_state = old_state + toState_.collectEntries{ key0, key1 -> + [key0, output[key1]] + } + } else if (toState_ instanceof List) { + new_state = old_state + toState_.collectEntries{ key -> + [key, output[key]] + } + } else if (toState_ instanceof Closure) { + new_state = toState_(tup[0], output, old_state, comp_config) + } + [tup[0], new_state] + tup.drop(3) + } + : out_ch + + post_ch + } + + // mix all results + output_ch = + (out_chs.size == 1) + ? out_chs[0] + : out_chs[0].mix(*out_chs.drop(1)) + + emit: output_ch + } + + return runComponentsWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/runEach.nf' +/** + * Run a list of components on a stream of data. + * + * @param components: list of Viash VDSL3 modules to run + * @param fromState: a closure, a map or a list of keys to extract from the input data. + * If a closure, it will be called with the id, the data and the component itself. + * @param toState: a closure, a map or a list of keys to extract from the output data + * If a closure, it will be called with the id, the output data, the old state and the component itself. + * @param filter: filter function to apply to the input. + * It will be called with the id, the data and the component itself. + * @param id: id to use for the output data + * If a closure, it will be called with the id, the data and the component itself. + * @param auto: auto options to pass to the components + * + * @return: a workflow that runs the components + **/ +def runEach(Map args) { + assert args.components: "runEach should be passed a list of components to run" + + def components_ = args.components + if (components_ !instanceof List) { + components_ = [ components_ ] + } + assert components_.size() > 0: "pass at least one component to runEach" + + def fromState_ = args.fromState + def toState_ = args.toState + def filter_ = args.filter + def id_ = args.id + + workflow runEachWf { + take: input_ch + main: + + // generate one channel per method + out_chs = components_.collect{ comp_ -> + def filter_ch = filter_ + ? input_ch | filter{tup -> + filter_(tup[0], tup[1], comp_) + } + : input_ch + def id_ch = id_ + ? filter_ch | map{tup -> + def new_id = id_ + if (new_id instanceof Closure) { + new_id = new_id(tup[0], tup[1], comp_) + } + assert new_id instanceof String : "Error in runEach: id should be a String or a Closure that returns a String. Expected: id instanceof String. Found: ${new_id.getClass()}" + [new_id] + tup.drop(1) + } + : filter_ch + def data_ch = id_ch | map{tup -> + def new_data = tup[1] + if (fromState_ instanceof Map) { + new_data = fromState_.collectEntries{ key0, key1 -> + [key0, new_data[key1]] + } + } else if (fromState_ instanceof List) { + new_data = fromState_.collectEntries{ key -> + [key, new_data[key]] + } + } else if (fromState_ instanceof Closure) { + new_data = fromState_(tup[0], new_data, comp_) + } + tup.take(1) + [new_data] + tup.drop(1) + } + def out_ch = data_ch + | comp_.run( + auto: (args.auto ?: [:]) + [simplifyInput: false, simplifyOutput: false] + ) + def post_ch = toState_ + ? out_ch | map{tup -> + def output = tup[1] + def old_state = tup[2] + def new_state = null + if (toState_ instanceof Map) { + new_state = old_state + toState_.collectEntries{ key0, key1 -> + [key0, output[key1]] + } + } else if (toState_ instanceof List) { + new_state = old_state + toState_.collectEntries{ key -> + [key, output[key]] + } + } else if (toState_ instanceof Closure) { + new_state = toState_(tup[0], output, old_state, comp_) + } + [tup[0], new_state] + tup.drop(3) + } + : out_ch + + post_ch + } + + // mix all results + output_ch = + (out_chs.size == 1) + ? out_chs[0] + : out_chs[0].mix(*out_chs.drop(1)) + + emit: output_ch + } + + return runEachWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/channel/safeJoin.nf' +/** + * Join sourceChannel to targetChannel + * + * This function joins the sourceChannel to the targetChannel. + * However, each id in the targetChannel must be present in the + * sourceChannel. If _meta.join_id exists in the targetChannel, that is + * used as an id instead. If the id doesn't match any id in the sourceChannel, + * an error is thrown. + */ + +def safeJoin(targetChannel, sourceChannel, key) { + def sourceIDs = new IDChecker() + + def sourceCheck = sourceChannel + | map { tup -> + sourceIDs.observe(tup[0]) + tup + } + def targetCheck = targetChannel + | map { tup -> + def id = tup[0] + + if (!sourceIDs.contains(id)) { + error ( + "Error in module '${key}' when merging output with original state.\n" + + " Reason: output with id '${id}' could not be joined with source channel.\n" + + " If the IDs in the output channel differ from the input channel,\n" + + " please set `tup[1]._meta.join_id to the original ID.\n" + + " Original IDs in input channel: ['${sourceIDs.getItems().join("', '")}'].\n" + + " Unexpected ID in the output channel: '${id}'.\n" + + " Example input event: [\"id\", [input: file(...)]],\n" + + " Example output event: [\"newid\", [output: file(...), _meta: [join_id: \"id\"]]]" + ) + } + // TODO: add link to our documentation on how to fix this + + tup + } + + sourceCheck.cross(targetChannel) + | map{ left, right -> + right + left.drop(1) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/_processArgument.nf' +def _processArgument(arg) { + arg.multiple = arg.multiple != null ? arg.multiple : false + arg.required = arg.required != null ? arg.required : false + arg.direction = arg.direction != null ? arg.direction : "input" + arg.multiple_sep = arg.multiple_sep != null ? arg.multiple_sep : ";" + arg.plainName = arg.name.replaceAll("^-*", "") + + if (arg.type == "file") { + arg.must_exist = arg.must_exist != null ? arg.must_exist : true + arg.create_parent = arg.create_parent != null ? arg.create_parent : true + } + + // add default values to output files which haven't already got a default + if (arg.type == "file" && arg.direction == "output" && arg.default == null) { + def mult = arg.multiple ? "_*" : "" + def extSearch = "" + if (arg.default != null) { + extSearch = arg.default + } else if (arg.example != null) { + extSearch = arg.example + } + if (extSearch instanceof List) { + extSearch = extSearch[0] + } + def extSearchResult = extSearch.find("\\.[^\\.]+\$") + def ext = extSearchResult != null ? extSearchResult : "" + arg.default = "\$id.\$key.${arg.plainName}${mult}${ext}" + if (arg.multiple) { + arg.default = [arg.default] + } + } + + if (!arg.multiple) { + if (arg.default != null && arg.default instanceof List) { + arg.default = arg.default[0] + } + if (arg.example != null && arg.example instanceof List) { + arg.example = arg.example[0] + } + } + + if (arg.type == "boolean_true") { + arg.default = false + } + if (arg.type == "boolean_false") { + arg.default = true + } + + arg +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/addGlobalParams.nf' +def addGlobalArguments(config) { + def localConfig = [ + "argument_groups": [ + [ + "name": "Nextflow input-output arguments", + "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.", + "arguments" : [ + [ + 'name': '--publish_dir', + 'required': true, + 'type': 'string', + 'description': 'Path to an output directory.', + 'example': 'output/', + 'multiple': false + ], + [ + 'name': '--param_list', + 'required': false, + 'type': 'string', + 'description': '''Allows inputting multiple parameter sets to initialise a Nextflow channel. A `param_list` can either be a list of maps, a csv file, a json file, a yaml file, or simply a yaml blob. + | + |* A list of maps (as-is) where the keys of each map corresponds to the arguments of the pipeline. Example: in a `nextflow.config` file: `param_list: [ ['id': 'foo', 'input': 'foo.txt'], ['id': 'bar', 'input': 'bar.txt'] ]`. + |* A csv file should have column names which correspond to the different arguments of this pipeline. Example: `--param_list data.csv` with columns `id,input`. + |* A json or a yaml file should be a list of maps, each of which has keys corresponding to the arguments of the pipeline. Example: `--param_list data.json` with contents `[ {'id': 'foo', 'input': 'foo.txt'}, {'id': 'bar', 'input': 'bar.txt'} ]`. + |* A yaml blob can also be passed directly as a string. Example: `--param_list "[ {'id': 'foo', 'input': 'foo.txt'}, {'id': 'bar', 'input': 'bar.txt'} ]"`. + | + |When passing a csv, json or yaml file, relative path names are relativized to the location of the parameter file. No relativation is performed when `param_list` is a list of maps (as-is) or a yaml blob.'''.stripMargin(), + 'example': 'my_params.yaml', + 'multiple': false, + 'hidden': true + ] + // TODO: allow multiple: true in param_list? + // TODO: allow to specify a --param_list_regex to filter the param_list? + // TODO: allow to specify a --param_list_from_state to remap entries in the param_list? + ] + ] + ] + ] + + return processConfig(_mergeMap(config, localConfig)) +} + +def _mergeMap(Map lhs, Map rhs) { + return rhs.inject(lhs.clone()) { map, entry -> + if (map[entry.key] instanceof Map && entry.value instanceof Map) { + map[entry.key] = _mergeMap(map[entry.key], entry.value) + } else if (map[entry.key] instanceof Collection && entry.value instanceof Collection) { + map[entry.key] += entry.value + } else { + map[entry.key] = entry.value + } + return map + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/generateHelp.nf' +def _generateArgumentHelp(param) { + // alternatives are not supported + // def names = param.alternatives ::: List(param.name) + + def unnamedProps = [ + ["required parameter", param.required], + ["multiple values allowed", param.multiple], + ["output", param.direction.toLowerCase() == "output"], + ["file must exist", param.type == "file" && param.must_exist] + ].findAll{it[1]}.collect{it[0]} + + def dflt = null + if (param.default != null) { + if (param.default instanceof List) { + dflt = param.default.join(param.multiple_sep != null ? param.multiple_sep : ", ") + } else { + dflt = param.default.toString() + } + } + def example = null + if (param.example != null) { + if (param.example instanceof List) { + example = param.example.join(param.multiple_sep != null ? param.multiple_sep : ", ") + } else { + example = param.example.toString() + } + } + def min = param.min?.toString() + def max = param.max?.toString() + + def escapeChoice = { choice -> + def s1 = choice.replaceAll("\\n", "\\\\n") + def s2 = s1.replaceAll("\"", """\\\"""") + s2.contains(",") || s2 != choice ? "\"" + s2 + "\"" : s2 + } + def choices = param.choices == null ? + null : + "[ " + param.choices.collect{escapeChoice(it.toString())}.join(", ") + " ]" + + def namedPropsStr = [ + ["type", ([param.type] + unnamedProps).join(", ")], + ["default", dflt], + ["example", example], + ["choices", choices], + ["min", min], + ["max", max] + ] + .findAll{it[1]} + .collect{"\n " + it[0] + ": " + it[1].replaceAll("\n", "\\n")} + .join("") + + def descStr = param.description == null ? + "" : + _paragraphWrap("\n" + param.description.trim(), 80 - 8).join("\n ") + + "\n --" + param.plainName + + namedPropsStr + + descStr +} + +// Based on Helper.generateHelp() in Helper.scala +def _generateHelp(config) { + def fun = config + + // PART 1: NAME AND VERSION + def nameStr = fun.name + + (fun.version == null ? "" : " " + fun.version) + + // PART 2: DESCRIPTION + def descrStr = fun.description == null ? + "" : + "\n\n" + _paragraphWrap(fun.description.trim(), 80).join("\n") + + // PART 3: Usage + def usageStr = fun.usage == null ? + "" : + "\n\nUsage:\n" + fun.usage.trim() + + // PART 4: Options + def argGroupStrs = fun.allArgumentGroups.collect{argGroup -> + def name = argGroup.name + def descriptionStr = argGroup.description == null ? + "" : + "\n " + _paragraphWrap(argGroup.description.trim(), 80-4).join("\n ") + "\n" + def arguments = argGroup.arguments.collect{arg -> + arg instanceof String ? fun.allArguments.find{it.plainName == arg} : arg + }.findAll{it != null} + def argumentStrs = arguments.collect{param -> _generateArgumentHelp(param)} + + "\n\n$name:" + + descriptionStr + + argumentStrs.join("\n") + } + + // FINAL: combine + def out = nameStr + + descrStr + + usageStr + + argGroupStrs.join("") + + return out +} + +// based on Format._paragraphWrap +def _paragraphWrap(str, maxLength) { + def outLines = [] + str.split("\n").each{par -> + def words = par.split("\\s").toList() + + def word = null + def line = words.pop() + while(!words.isEmpty()) { + word = words.pop() + if (line.length() + word.length() + 1 <= maxLength) { + line = line + " " + word + } else { + outLines.add(line) + line = word + } + } + if (words.isEmpty()) { + outLines.add(line) + } + } + return outLines +} + +def helpMessage(config) { + if (params.containsKey("help") && params.help) { + def mergedConfig = addGlobalArguments(config) + def helpStr = _generateHelp(mergedConfig) + println(helpStr) + exit 0 + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/processConfig.nf' +def processConfig(config) { + // set defaults for arguments + config.arguments = + (config.arguments ?: []).collect{_processArgument(it)} + + // set defaults for argument_group arguments + config.argument_groups = + (config.argument_groups ?: []).collect{grp -> + grp.arguments = (grp.arguments ?: []).collect{_processArgument(it)} + grp + } + + // create combined arguments list + config.allArguments = + config.arguments + + config.argument_groups.collectMany{it.arguments} + + // add missing argument groups (based on Functionality::allArgumentGroups()) + def argGroups = config.argument_groups + if (argGroups.any{it.name.toLowerCase() == "arguments"}) { + argGroups = argGroups.collect{ grp -> + if (grp.name.toLowerCase() == "arguments") { + grp = grp + [ + arguments: grp.arguments + config.arguments + ] + } + grp + } + } else { + argGroups = argGroups + [ + name: "Arguments", + arguments: config.arguments + ] + } + config.allArgumentGroups = argGroups + + config +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/config/readConfig.nf' + +def readConfig(file) { + def config = readYaml(file ?: moduleDir.resolve("config.vsh.yaml")) + processConfig(config) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/_resolveSiblingIfNotAbsolute.nf' +/** + * Resolve a path relative to the current file. + * + * @param str The path to resolve, as a String. + * @param parentPath The path to resolve relative to, as a Path. + * + * @return The path that may have been resovled, as a Path. + */ +def _resolveSiblingIfNotAbsolute(str, parentPath) { + if (str !instanceof String) { + return str + } + if (!_stringIsAbsolutePath(str)) { + return parentPath.resolveSibling(str) + } else { + return file(str, hidden: true) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/_stringIsAbsolutePath.nf' +/** + * Check whether a path as a string is absolute. + * + * In the past, we tried using `file(., relative: true).isAbsolute()`, + * but the 'relative' option was added in 22.10.0. + * + * @param path The path to check, as a String. + * + * @return Whether the path is absolute, as a boolean. + */ +def _stringIsAbsolutePath(path) { + def _resolve_URL_PROTOCOL = ~/^([a-zA-Z][a-zA-Z0-9]*:)?\\/.+/ + + assert path instanceof String + return _resolve_URL_PROTOCOL.matcher(path).matches() +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/collectTraces.nf' +class CustomTraceObserver implements nextflow.trace.TraceObserver { + List traces + + CustomTraceObserver(List traces) { + this.traces = traces + } + + @Override + void onProcessComplete(nextflow.processor.TaskHandler handler, nextflow.trace.TraceRecord trace) { + def trace2 = trace.store.clone() + trace2.script = null + traces.add(trace2) + } + + @Override + void onProcessCached(nextflow.processor.TaskHandler handler, nextflow.trace.TraceRecord trace) { + def trace2 = trace.store.clone() + trace2.script = null + traces.add(trace2) + } +} + +def collectTraces() { + def traces = Collections.synchronizedList([]) + + // add custom trace observer which stores traces in the traces object + session.observers.add(new CustomTraceObserver(traces)) + + traces +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/deepClone.nf' +/** + * Performs a deep clone of the given object. + * @param x an object + */ +def deepClone(x) { + iterateMap(x, {it instanceof Cloneable ? it.clone() : it}) +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/getPublishDir.nf' +def getPublishDir() { + return params.containsKey("publish_dir") ? params.publish_dir : + params.containsKey("publishDir") ? params.publishDir : + null +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/getRootDir.nf' + +// Recurse upwards until we find a '.build.yaml' file +def _findBuildYamlFile(pathPossiblySymlink) { + def path = pathPossiblySymlink.toRealPath() + def child = path.resolve(".build.yaml") + if (java.nio.file.Files.isDirectory(path) && java.nio.file.Files.exists(child)) { + return child + } else { + def parent = path.getParent() + if (parent == null) { + return null + } else { + return _findBuildYamlFile(parent) + } + } +} + +// get the root of the target folder +def getRootDir() { + def dir = _findBuildYamlFile(meta.resources_dir) + assert dir != null: "Could not find .build.yaml in the folder structure" + dir.getParent() +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/iterateMap.nf' +/** + * Recursively apply a function over the leaves of an object. + * @param obj The object to iterate over. + * @param fun The function to apply to each value. + * @return The object with the function applied to each value. + */ +def iterateMap(obj, fun) { + if (obj instanceof List && obj !instanceof String) { + return obj.collect{item -> + iterateMap(item, fun) + } + } else if (obj instanceof Map) { + return obj.collectEntries{key, item -> + [key.toString(), iterateMap(item, fun)] + } + } else { + return fun(obj) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/functions/niceView.nf' +/** + * A view for printing the event of each channel as a YAML blob. + * This is useful for debugging. + */ +def niceView() { + workflow niceViewWf { + take: input + main: + output = input + | view{toYamlBlob(it)} + emit: output + } + return niceViewWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readCsv.nf' + +def readCsv(file_path) { + def output = [] + def inputFile = file_path !instanceof Path ? file(file_path, hidden: true) : file_path + + // todo: allow escaped quotes in string + // todo: allow single quotes? + def splitRegex = java.util.regex.Pattern.compile(''',(?=(?:[^"]*"[^"]*")*[^"]*$)''') + def removeQuote = java.util.regex.Pattern.compile('''"(.*)"''') + + def br = java.nio.file.Files.newBufferedReader(inputFile) + + def row = -1 + def header = null + while (br.ready() && header == null) { + def line = br.readLine() + row++ + if (!line.startsWith("#")) { + header = splitRegex.split(line, -1).collect{field -> + m = removeQuote.matcher(field) + m.find() ? m.replaceFirst('$1') : field + } + } + } + assert header != null: "CSV file should contain a header" + + while (br.ready()) { + def line = br.readLine() + row++ + if (line == null) { + br.close() + break + } + + if (!line.startsWith("#")) { + def predata = splitRegex.split(line, -1) + def data = predata.collect{field -> + if (field == "") { + return null + } + def m = removeQuote.matcher(field) + if (m.find()) { + return m.replaceFirst('$1') + } else { + return field + } + } + assert header.size() == data.size(): "Row $row should contain the same number as fields as the header" + + def dataMap = [header, data].transpose().collectEntries().findAll{it.value != null} + output.add(dataMap) + } + } + + output +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readJson.nf' +def readJson(file_path) { + def inputFile = file_path !instanceof Path ? file(file_path, hidden: true) : file_path + def jsonSlurper = new groovy.json.JsonSlurper() + jsonSlurper.parse(inputFile) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readJsonBlob.nf' +def readJsonBlob(str) { + def jsonSlurper = new groovy.json.JsonSlurper() + jsonSlurper.parseText(str) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readTaggedYaml.nf' +// Custom constructor to modify how certain objects are parsed from YAML +class CustomConstructor extends org.yaml.snakeyaml.constructor.Constructor { + Path root + + class ConstructPath extends org.yaml.snakeyaml.constructor.AbstractConstruct { + public Object construct(org.yaml.snakeyaml.nodes.Node node) { + String filename = (String) constructScalar(node); + if (root != null) { + return root.resolve(filename); + } + return java.nio.file.Paths.get(filename); + } + } + + CustomConstructor(org.yaml.snakeyaml.LoaderOptions options, Path root) { + super(options) + this.root = root + // Handling !file tag and parse it back to a File type + this.yamlConstructors.put(new org.yaml.snakeyaml.nodes.Tag("!file"), new ConstructPath()) + } +} + +def readTaggedYaml(Path path) { + def options = new org.yaml.snakeyaml.LoaderOptions() + def constructor = new CustomConstructor(options, path.getParent()) + def yaml = new org.yaml.snakeyaml.Yaml(constructor) + return yaml.load(path.text) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readYaml.nf' +def readYaml(file_path) { + def inputFile = file_path !instanceof Path ? file(file_path, hidden: true) : file_path + def yamlSlurper = new org.yaml.snakeyaml.Yaml() + yamlSlurper.load(inputFile) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/readYamlBlob.nf' +def readYamlBlob(str) { + def yamlSlurper = new org.yaml.snakeyaml.Yaml() + yamlSlurper.load(str) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/toJsonBlob.nf' +String toJsonBlob(data) { + return groovy.json.JsonOutput.toJson(data) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/toTaggedYamlBlob.nf' +// Custom representer to modify how certain objects are represented in YAML +class CustomRepresenter extends org.yaml.snakeyaml.representer.Representer { + Path relativizer + + class RepresentPath implements org.yaml.snakeyaml.representer.Represent { + public String getFileName(Object obj) { + if (obj instanceof File) { + obj = ((File) obj).toPath(); + } + if (obj !instanceof Path) { + throw new IllegalArgumentException("Object: " + obj + " is not a Path or File"); + } + def path = (Path) obj; + + if (relativizer != null) { + return relativizer.relativize(path).toString() + } else { + return path.toString() + } + } + + public org.yaml.snakeyaml.nodes.Node representData(Object data) { + String filename = getFileName(data); + def tag = new org.yaml.snakeyaml.nodes.Tag("!file"); + return representScalar(tag, filename); + } + } + CustomRepresenter(org.yaml.snakeyaml.DumperOptions options, Path relativizer) { + super(options) + this.relativizer = relativizer + this.representers.put(sun.nio.fs.UnixPath, new RepresentPath()) + this.representers.put(Path, new RepresentPath()) + this.representers.put(File, new RepresentPath()) + } +} + +String toTaggedYamlBlob(data) { + return toRelativeTaggedYamlBlob(data, null) +} +String toRelativeTaggedYamlBlob(data, Path relativizer) { + def options = new org.yaml.snakeyaml.DumperOptions() + options.setDefaultFlowStyle(org.yaml.snakeyaml.DumperOptions.FlowStyle.BLOCK) + def representer = new CustomRepresenter(options, relativizer) + def yaml = new org.yaml.snakeyaml.Yaml(representer, options) + return yaml.dump(data) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/toYamlBlob.nf' +String toYamlBlob(data) { + def options = new org.yaml.snakeyaml.DumperOptions() + options.setDefaultFlowStyle(org.yaml.snakeyaml.DumperOptions.FlowStyle.BLOCK) + options.setPrettyFlow(true) + def yaml = new org.yaml.snakeyaml.Yaml(options) + def cleanData = iterateMap(data, { it instanceof Path ? it.toString() : it }) + return yaml.dump(cleanData) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/writeJson.nf' +void writeJson(data, file) { + assert data: "writeJson: data should not be null" + assert file: "writeJson: file should not be null" + file.write(toJsonBlob(data)) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/readwrite/writeYaml.nf' +void writeYaml(data, file) { + assert data: "writeYaml: data should not be null" + assert file: "writeYaml: file should not be null" + file.write(toYamlBlob(data)) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/findStates.nf' +def findStates(Map params, Map config) { + def auto_config = deepClone(config) + def auto_params = deepClone(params) + + auto_config = auto_config.clone() + // override arguments + auto_config.argument_groups = [] + auto_config.arguments = [ + [ + type: "string", + name: "--id", + description: "A dummy identifier", + required: false + ], + [ + type: "file", + name: "--input_states", + example: "/path/to/input/directory/**/state.yaml", + description: "Path to input directory containing the datasets to be integrated.", + required: true, + multiple: true, + multiple_sep: ";" + ], + [ + type: "string", + name: "--filter", + example: "foo/.*/state.yaml", + description: "Regex to filter state files by path.", + required: false + ], + // to do: make this a yaml blob? + [ + type: "string", + name: "--rename_keys", + example: ["newKey1:oldKey1", "newKey2:oldKey2"], + description: "Rename keys in the detected input files. This is useful if the input files do not match the set of input arguments of the workflow.", + required: false, + multiple: true, + multiple_sep: ";" + ], + [ + type: "string", + name: "--settings", + example: '{"output_dataset": "dataset.h5ad", "k": 10}', + description: "Global arguments as a JSON glob to be passed to all components.", + required: false + ] + ] + if (!(auto_params.containsKey("id"))) { + auto_params["id"] = "auto" + } + + // run auto config through processConfig once more + auto_config = processConfig(auto_config) + + workflow findStatesWf { + helpMessage(auto_config) + + output_ch = + channelFromParams(auto_params, auto_config) + | flatMap { autoId, args -> + + def globalSettings = args.settings ? readYamlBlob(args.settings) : [:] + + // look for state files in input dir + def stateFiles = args.input_states + + // filter state files by regex + if (args.filter) { + stateFiles = stateFiles.findAll{ stateFile -> + def stateFileStr = stateFile.toString() + def matcher = stateFileStr =~ args.filter + matcher.matches()} + } + + // read in states + def states = stateFiles.collect { stateFile -> + def state_ = readTaggedYaml(stateFile) + [state_.id, state_] + } + + // construct renameMap + if (args.rename_keys) { + def renameMap = args.rename_keys.collectEntries{renameString -> + def split = renameString.split(";") + assert split.size() == 2: "Argument 'rename_keys' should be of the form 'newKey:oldKey,newKey:oldKey'" + split + } + + // rename keys in state, only let states through which have all keys + // also add global settings + states = states.collectMany{id, state -> + def newState = [:] + + for (key in renameMap.keySet()) { + def origKey = renameMap[key] + if (!(state.containsKey(origKey))) { + return [] + } + newState[key] = state[origKey] + } + + [[id, globalSettings + newState]] + } + } + + states + } + emit: + output_ch + } + + return findStatesWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/joinStates.nf' +def joinStates(Closure apply_) { + workflow joinStatesWf { + take: input_ch + main: + output_ch = input_ch + | toSortedList + | filter{ it.size() > 0 } + | map{ tups -> + def ids = tups.collect{it[0]} + def states = tups.collect{it[1]} + apply_(ids, states) + } + + emit: output_ch + } + return joinStatesWf +} +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/publishStates.nf' +def collectFiles(obj) { + if (obj instanceof java.io.File || obj instanceof Path) { + return [obj] + } else if (obj instanceof List && obj !instanceof String) { + return obj.collectMany{item -> + collectFiles(item) + } + } else if (obj instanceof Map) { + return obj.collectMany{key, item -> + collectFiles(item) + } + } else { + return [] + } +} + +/** + * Recurse through a state and collect all input files and their target output filenames. + * @param obj The state to recurse through. + * @param prefix The prefix to prepend to the output filenames. + */ +def collectInputOutputPaths(obj, prefix) { + if (obj instanceof File || obj instanceof Path) { + def path = obj instanceof Path ? obj : obj.toPath() + def ext = path.getFileName().toString().find("\\.[^\\.]+\$") ?: "" + def newFilename = prefix + ext + return [[obj, newFilename]] + } else if (obj instanceof List && obj !instanceof String) { + return obj.withIndex().collectMany{item, ix -> + collectInputOutputPaths(item, prefix + "_" + ix) + } + } else if (obj instanceof Map) { + return obj.collectMany{key, item -> + collectInputOutputPaths(item, prefix + "." + key) + } + } else { + return [] + } +} + +def publishStates(Map args) { + def key_ = args.get("key") + def yamlTemplate_ = args.get("output_state", args.get("outputState", '$id.$key.state.yaml')) + + assert key_ != null : "publishStates: key must be specified" + + workflow publishStatesWf { + take: input_ch + main: + input_ch + | map { tup -> + def id_ = tup[0] + def state_ = tup[1] + + // the input files and the target output filenames + def inputoutputFilenames_ = collectInputOutputPaths(state_, id_ + "." + key_).transpose() + def inputFiles_ = inputoutputFilenames_[0] + def outputFilenames_ = inputoutputFilenames_[1] + + def yamlFilename = yamlTemplate_ + .replaceAll('\\$id', id_) + .replaceAll('\\$key', key_) + + // TODO: do the pathnames in state_ match up with the outputFilenames_? + + // convert state to yaml blob + def yamlBlob_ = toRelativeTaggedYamlBlob([id: id_] + state_, java.nio.file.Paths.get(yamlFilename)) + + [id_, yamlBlob_, yamlFilename, inputFiles_, outputFilenames_] + } + | publishStatesProc + emit: input_ch + } + return publishStatesWf +} +process publishStatesProc { + // todo: check publishpath? + publishDir path: "${getPublishDir()}/", mode: "copy" + tag "$id" + input: + tuple val(id), val(yamlBlob), val(yamlFile), path(inputFiles, stageAs: "_inputfile?/*"), val(outputFiles) + output: + tuple val(id), path{[yamlFile] + outputFiles} + script: + def copyCommands = [ + inputFiles instanceof List ? inputFiles : [inputFiles], + outputFiles instanceof List ? outputFiles : [outputFiles] + ] + .transpose() + .collectMany{infile, outfile -> + if (infile.toString() != outfile.toString()) { + [ + "[ -d \"\$(dirname '${outfile.toString()}')\" ] || mkdir -p \"\$(dirname '${outfile.toString()}')\"", + "cp -r '${infile.toString()}' '${outfile.toString()}'" + ] + } else { + // no need to copy if infile is the same as outfile + [] + } + } + """ +mkdir -p "\$(dirname '${yamlFile}')" +echo "Storing state as yaml" +echo '${yamlBlob}' > '${yamlFile}' +echo "Copying output files to destination folder" +${copyCommands.join("\n ")} +""" +} + + +// this assumes that the state contains no other values other than those specified in the config +def publishStatesByConfig(Map args) { + def config = args.get("config") + assert config != null : "publishStatesByConfig: config must be specified" + + def key_ = args.get("key", config.name) + assert key_ != null : "publishStatesByConfig: key must be specified" + + workflow publishStatesSimpleWf { + take: input_ch + main: + input_ch + | map { tup -> + def id_ = tup[0] + def state_ = tup[1] // e.g. [output: new File("myoutput.h5ad"), k: 10] + def origState_ = tup[2] // e.g. [output: '$id.$key.foo.h5ad'] + + // TODO: allow overriding the state.yaml template + // TODO TODO: if auto.publish == "state", add output_state as an argument + def yamlTemplate = params.containsKey("output_state") ? params.output_state : '$id.$key.state.yaml' + def yamlFilename = yamlTemplate + .replaceAll('\\$id', id_) + .replaceAll('\\$key', key_) + def yamlDir = java.nio.file.Paths.get(yamlFilename).getParent() + + // the processed state is a list of [key, value, inputPath, outputFilename] tuples, where + // - key is a String + // - value is any object that can be serialized to a Yaml (so a String/Integer/Long/Double/Boolean, a List, a Map, or a Path) + // - inputPath is a List[Path] + // - outputFilename is a List[String] + // - (key, value) are the tuples that will be saved to the state.yaml file + // - (inputPath, outputFilename) are the files that will be copied from src to dest (relative to the state.yaml) + def processedState = + config.allArguments + .findAll { it.direction == "output" } + .collectMany { par -> + def plainName_ = par.plainName + // if the state does not contain the key, it's an + // optional argument for which the component did + // not generate any output + if (!state_.containsKey(plainName_)) { + return [] + } + def value = state_[plainName_] + // if the parameter is not a file, it should be stored + // in the state as-is, but is not something that needs + // to be copied from the source path to the dest path + if (par.type != "file") { + return [[key: plainName_, value: value, inputPath: [], outputFilename: []]] + } + // if the orig state does not contain this filename, + // it's an optional argument for which the user specified + // that it should not be returned as a state + if (!origState_.containsKey(plainName_)) { + return [] + } + def filenameTemplate = origState_[plainName_] + // if the pararameter is multiple: true, fetch the template + if (par.multiple && filenameTemplate instanceof List) { + filenameTemplate = filenameTemplate[0] + } + // instantiate the template + def filename = filenameTemplate + .replaceAll('\\$id', id_) + .replaceAll('\\$key', key_) + if (par.multiple) { + // if the parameter is multiple: true, the filename + // should contain a wildcard '*' that is replaced with + // the index of the file + assert filename.contains("*") : "Module '${key_}' id '${id_}': Multiple output files specified, but no wildcard '*' in the filename: ${filename}" + def outputPerFile = value.withIndex().collect{ val, ix -> + def filename_ix = filename.replace("*", ix.toString()) + def value_ = java.nio.file.Paths.get(filename_ix) + // if id contains a slash + if (yamlDir != null) { + value_ = yamlDir.relativize(value_) + } + def inputPath = val instanceof File ? val.toPath() : val + [value: value_, inputPath: inputPath, outputFilename: filename_ix] + } + def transposedOutputs = ["value", "inputPath", "outputFilename"].collectEntries{ key -> + [key, outputPerFile.collect{dic -> dic[key]}] + } + return [[key: plainName_] + transposedOutputs] + } else { + def value_ = java.nio.file.Paths.get(filename) + // if id contains a slash + if (yamlDir != null) { + value_ = yamlDir.relativize(value_) + } + def inputPath = value instanceof File ? value.toPath() : value + return [[key: plainName_, value: value_, inputPath: [inputPath], outputFilename: [filename]]] + } + } + + def updatedState_ = processedState.collectEntries{[it.key, it.value]} + def inputPaths = processedState.collectMany{it.inputPath} + def outputFilenames = processedState.collectMany{it.outputFilename} + + // convert state to yaml blob + def yamlBlob_ = toTaggedYamlBlob([id: id_] + updatedState_) + + [id_, yamlBlob_, yamlFilename, inputPaths, outputFilenames] + } + | publishStatesProc + emit: input_ch + } + return publishStatesSimpleWf +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/states/setState.nf' +def setState(fun) { + assert fun instanceof Closure || fun instanceof Map || fun instanceof List : + "Error in setState: Expected process argument to be a Closure, a Map, or a List. Found: class ${fun.getClass()}" + + // if fun is a List, convert to map + if (fun instanceof List) { + // check whether fun is a list[string] + assert fun.every{it instanceof CharSequence} : "Error in setState: argument is a List, but not all elements are Strings" + fun = fun.collectEntries{[it, it]} + } + + // if fun is a map, convert to closure + if (fun instanceof Map) { + // check whether fun is a map[string, string] + assert fun.values().every{it instanceof CharSequence} : "Error in setState: argument is a Map, but not all values are Strings" + assert fun.keySet().every{it instanceof CharSequence} : "Error in setState: argument is a Map, but not all keys are Strings" + def funMap = fun.clone() + // turn the map into a closure to be used later on + fun = { id_, state_ -> + assert state_ instanceof Map : "Error in setState: the state is not a Map" + funMap.collectMany{newkey, origkey -> + if (state_.containsKey(origkey)) { + [[newkey, state_[origkey]]] + } else { + [] + } + }.collectEntries() + } + } + + map { tup -> + def id = tup[0] + def state = tup[1] + def unfilteredState = fun(id, state) + def newState = unfilteredState.findAll{key, val -> val != null} + [id, newState] + tup.drop(2) + } +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/processAuto.nf' +// TODO: unit test processAuto +def processAuto(Map auto) { + // remove null values + auto = auto.findAll{k, v -> v != null} + + // check for unexpected keys + def expectedKeys = ["simplifyInput", "simplifyOutput", "transcript", "publish"] + def unexpectedKeys = auto.keySet() - expectedKeys + assert unexpectedKeys.isEmpty(), "unexpected keys in auto: '${unexpectedKeys.join("', '")}'" + + // check auto.simplifyInput + assert auto.simplifyInput instanceof Boolean, "auto.simplifyInput must be a boolean" + + // check auto.simplifyOutput + assert auto.simplifyOutput instanceof Boolean, "auto.simplifyOutput must be a boolean" + + // check auto.transcript + assert auto.transcript instanceof Boolean, "auto.transcript must be a boolean" + + // check auto.publish + assert auto.publish instanceof Boolean || auto.publish == "state", "auto.publish must be a boolean or 'state'" + + return auto.subMap(expectedKeys) +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/processDirectives.nf' +def assertMapKeys(map, expectedKeys, requiredKeys, mapName) { + assert map instanceof Map : "Expected argument '$mapName' to be a Map. Found: class ${map.getClass()}" + map.forEach { key, val -> + assert key in expectedKeys : "Unexpected key '$key' in ${mapName ? mapName + " " : ""}map" + } + requiredKeys.forEach { requiredKey -> + assert map.containsKey(requiredKey) : "Missing required key '$key' in ${mapName ? mapName + " " : ""}map" + } +} + +// TODO: unit test processDirectives +def processDirectives(Map drctv) { + // remove null values + drctv = drctv.findAll{k, v -> v != null} + + // check for unexpected keys + def expectedKeys = [ + "accelerator", "afterScript", "beforeScript", "cache", "conda", "container", "containerOptions", "cpus", "disk", "echo", "errorStrategy", "executor", "machineType", "maxErrors", "maxForks", "maxRetries", "memory", "module", "penv", "pod", "publishDir", "queue", "label", "scratch", "storeDir", "stageInMode", "stageOutMode", "tag", "time" + ] + def unexpectedKeys = drctv.keySet() - expectedKeys + assert unexpectedKeys.isEmpty() : "Unexpected keys in process directive: '${unexpectedKeys.join("', '")}'" + + /* DIRECTIVE accelerator + accepted examples: + - [ limit: 4, type: "nvidia-tesla-k80" ] + */ + if (drctv.containsKey("accelerator")) { + assertMapKeys(drctv["accelerator"], ["type", "limit", "request", "runtime"], [], "accelerator") + } + + /* DIRECTIVE afterScript + accepted examples: + - "source /cluster/bin/cleanup" + */ + if (drctv.containsKey("afterScript")) { + assert drctv["afterScript"] instanceof CharSequence + } + + /* DIRECTIVE beforeScript + accepted examples: + - "source /cluster/bin/setup" + */ + if (drctv.containsKey("beforeScript")) { + assert drctv["beforeScript"] instanceof CharSequence + } + + /* DIRECTIVE cache + accepted examples: + - true + - false + - "deep" + - "lenient" + */ + if (drctv.containsKey("cache")) { + assert drctv["cache"] instanceof CharSequence || drctv["cache"] instanceof Boolean + if (drctv["cache"] instanceof CharSequence) { + assert drctv["cache"] in ["deep", "lenient"] : "Unexpected value for cache" + } + } + + /* DIRECTIVE conda + accepted examples: + - "bwa=0.7.15" + - "bwa=0.7.15 fastqc=0.11.5" + - ["bwa=0.7.15", "fastqc=0.11.5"] + */ + if (drctv.containsKey("conda")) { + if (drctv["conda"] instanceof List) { + drctv["conda"] = drctv["conda"].join(" ") + } + assert drctv["conda"] instanceof CharSequence + } + + /* DIRECTIVE container + accepted examples: + - "foo/bar:tag" + - [ registry: "reg", image: "im", tag: "ta" ] + is transformed to "reg/im:ta" + - [ image: "im" ] + is transformed to "im:latest" + */ + if (drctv.containsKey("container")) { + assert drctv["container"] instanceof Map || drctv["container"] instanceof CharSequence + if (drctv["container"] instanceof Map) { + def m = drctv["container"] + assertMapKeys(m, [ "registry", "image", "tag" ], ["image"], "container") + def part1 = + System.getenv('OVERRIDE_CONTAINER_REGISTRY') ? System.getenv('OVERRIDE_CONTAINER_REGISTRY') + "/" : + params.containsKey("override_container_registry") ? params["override_container_registry"] + "/" : // todo: remove? + m.registry ? m.registry + "/" : + "" + def part2 = m.image + def part3 = m.tag ? ":" + m.tag : ":latest" + drctv["container"] = part1 + part2 + part3 + } + } + + /* DIRECTIVE containerOptions + accepted examples: + - "--foo bar" + - ["--foo bar", "-f b"] + */ + if (drctv.containsKey("containerOptions")) { + if (drctv["containerOptions"] instanceof List) { + drctv["containerOptions"] = drctv["containerOptions"].join(" ") + } + assert drctv["containerOptions"] instanceof CharSequence + } + + /* DIRECTIVE cpus + accepted examples: + - 1 + - 10 + */ + if (drctv.containsKey("cpus")) { + assert drctv["cpus"] instanceof Integer + } + + /* DIRECTIVE disk + accepted examples: + - "1 GB" + - "2TB" + - "3.2KB" + - "10.B" + */ + if (drctv.containsKey("disk")) { + assert drctv["disk"] instanceof CharSequence + // assert drctv["disk"].matches("[0-9]+(\\.[0-9]*)? *[KMGTPEZY]?B") + // ^ does not allow closures + } + + /* DIRECTIVE echo + accepted examples: + - true + - false + */ + if (drctv.containsKey("echo")) { + assert drctv["echo"] instanceof Boolean + } + + /* DIRECTIVE errorStrategy + accepted examples: + - "terminate" + - "finish" + */ + if (drctv.containsKey("errorStrategy")) { + assert drctv["errorStrategy"] instanceof CharSequence + assert drctv["errorStrategy"] in ["terminate", "finish", "ignore", "retry"] : "Unexpected value for errorStrategy" + } + + /* DIRECTIVE executor + accepted examples: + - "local" + - "sge" + */ + if (drctv.containsKey("executor")) { + assert drctv["executor"] instanceof CharSequence + assert drctv["executor"] in ["local", "sge", "uge", "lsf", "slurm", "pbs", "pbspro", "moab", "condor", "nqsii", "ignite", "k8s", "awsbatch", "google-pipelines"] : "Unexpected value for executor" + } + + /* DIRECTIVE machineType + accepted examples: + - "n1-highmem-8" + */ + if (drctv.containsKey("machineType")) { + assert drctv["machineType"] instanceof CharSequence + } + + /* DIRECTIVE maxErrors + accepted examples: + - 1 + - 3 + */ + if (drctv.containsKey("maxErrors")) { + assert drctv["maxErrors"] instanceof Integer + } + + /* DIRECTIVE maxForks + accepted examples: + - 1 + - 3 + */ + if (drctv.containsKey("maxForks")) { + assert drctv["maxForks"] instanceof Integer + } + + /* DIRECTIVE maxRetries + accepted examples: + - 1 + - 3 + */ + if (drctv.containsKey("maxRetries")) { + assert drctv["maxRetries"] instanceof Integer + } + + /* DIRECTIVE memory + accepted examples: + - "1 GB" + - "2TB" + - "3.2KB" + - "10.B" + */ + if (drctv.containsKey("memory")) { + assert drctv["memory"] instanceof CharSequence + // assert drctv["memory"].matches("[0-9]+(\\.[0-9]*)? *[KMGTPEZY]?B") + // ^ does not allow closures + } + + /* DIRECTIVE module + accepted examples: + - "ncbi-blast/2.2.27" + - "ncbi-blast/2.2.27:t_coffee/10.0" + - ["ncbi-blast/2.2.27", "t_coffee/10.0"] + */ + if (drctv.containsKey("module")) { + if (drctv["module"] instanceof List) { + drctv["module"] = drctv["module"].join(":") + } + assert drctv["module"] instanceof CharSequence + } + + /* DIRECTIVE penv + accepted examples: + - "smp" + */ + if (drctv.containsKey("penv")) { + assert drctv["penv"] instanceof CharSequence + } + + /* DIRECTIVE pod + accepted examples: + - [ label: "key", value: "val" ] + - [ annotation: "key", value: "val" ] + - [ env: "key", value: "val" ] + - [ [label: "l", value: "v"], [env: "e", value: "v"]] + */ + if (drctv.containsKey("pod")) { + if (drctv["pod"] instanceof Map) { + drctv["pod"] = [ drctv["pod"] ] + } + assert drctv["pod"] instanceof List + drctv["pod"].forEach { pod -> + assert pod instanceof Map + // TODO: should more checks be added? + // See https://www.nextflow.io/docs/latest/process.html?highlight=directives#pod + // e.g. does it contain 'label' and 'value', or 'annotation' and 'value', or ...? + } + } + + /* DIRECTIVE publishDir + accepted examples: + - [] + - [ [ path: "foo", enabled: true ], [ path: "bar", enabled: false ] ] + - "/path/to/dir" + is transformed to [[ path: "/path/to/dir" ]] + - [ path: "/path/to/dir", mode: "cache" ] + is transformed to [[ path: "/path/to/dir", mode: "cache" ]] + */ + // TODO: should we also look at params["publishDir"]? + if (drctv.containsKey("publishDir")) { + def pblsh = drctv["publishDir"] + + // check different options + assert pblsh instanceof List || pblsh instanceof Map || pblsh instanceof CharSequence + + // turn into list if not already so + // for some reason, 'if (!pblsh instanceof List) pblsh = [ pblsh ]' doesn't work. + pblsh = pblsh instanceof List ? pblsh : [ pblsh ] + + // check elements of publishDir + pblsh = pblsh.collect{ elem -> + // turn into map if not already so + elem = elem instanceof CharSequence ? [ path: elem ] : elem + + // check types and keys + assert elem instanceof Map : "Expected publish argument '$elem' to be a String or a Map. Found: class ${elem.getClass()}" + assertMapKeys(elem, [ "path", "mode", "overwrite", "pattern", "saveAs", "enabled" ], ["path"], "publishDir") + + // check elements in map + assert elem.containsKey("path") + assert elem["path"] instanceof CharSequence + if (elem.containsKey("mode")) { + assert elem["mode"] instanceof CharSequence + assert elem["mode"] in [ "symlink", "rellink", "link", "copy", "copyNoFollow", "move" ] + } + if (elem.containsKey("overwrite")) { + assert elem["overwrite"] instanceof Boolean + } + if (elem.containsKey("pattern")) { + assert elem["pattern"] instanceof CharSequence + } + if (elem.containsKey("saveAs")) { + assert elem["saveAs"] instanceof CharSequence //: "saveAs as a Closure is currently not supported. Surround your closure with single quotes to get the desired effect. Example: '\{ foo \}'" + } + if (elem.containsKey("enabled")) { + assert elem["enabled"] instanceof Boolean + } + + // return final result + elem + } + // store final directive + drctv["publishDir"] = pblsh + } + + /* DIRECTIVE queue + accepted examples: + - "long" + - "short,long" + - ["short", "long"] + */ + if (drctv.containsKey("queue")) { + if (drctv["queue"] instanceof List) { + drctv["queue"] = drctv["queue"].join(",") + } + assert drctv["queue"] instanceof CharSequence + } + + /* DIRECTIVE label + accepted examples: + - "big_mem" + - "big_cpu" + - ["big_mem", "big_cpu"] + */ + if (drctv.containsKey("label")) { + if (drctv["label"] instanceof CharSequence) { + drctv["label"] = [ drctv["label"] ] + } + assert drctv["label"] instanceof List + drctv["label"].forEach { label -> + assert label instanceof CharSequence + // assert label.matches("[a-zA-Z0-9]([a-zA-Z0-9_]*[a-zA-Z0-9])?") + // ^ does not allow closures + } + } + + /* DIRECTIVE scratch + accepted examples: + - true + - "/path/to/scratch" + - '$MY_PATH_TO_SCRATCH' + - "ram-disk" + */ + if (drctv.containsKey("scratch")) { + assert drctv["scratch"] == true || drctv["scratch"] instanceof CharSequence + } + + /* DIRECTIVE storeDir + accepted examples: + - "/path/to/storeDir" + */ + if (drctv.containsKey("storeDir")) { + assert drctv["storeDir"] instanceof CharSequence + } + + /* DIRECTIVE stageInMode + accepted examples: + - "copy" + - "link" + */ + if (drctv.containsKey("stageInMode")) { + assert drctv["stageInMode"] instanceof CharSequence + assert drctv["stageInMode"] in ["copy", "link", "symlink", "rellink"] + } + + /* DIRECTIVE stageOutMode + accepted examples: + - "copy" + - "link" + */ + if (drctv.containsKey("stageOutMode")) { + assert drctv["stageOutMode"] instanceof CharSequence + assert drctv["stageOutMode"] in ["copy", "move", "rsync"] + } + + /* DIRECTIVE tag + accepted examples: + - "foo" + - '$id' + */ + if (drctv.containsKey("tag")) { + assert drctv["tag"] instanceof CharSequence + } + + /* DIRECTIVE time + accepted examples: + - "1h" + - "2days" + - "1day 6hours 3minutes 30seconds" + */ + if (drctv.containsKey("time")) { + assert drctv["time"] instanceof CharSequence + // todo: validation regex? + } + + return drctv +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/processWorkflowArgs.nf' +def processWorkflowArgs(Map args, Map defaultWfArgs, Map meta) { + // override defaults with args + def workflowArgs = defaultWfArgs + args + + // check whether 'key' exists + assert workflowArgs.containsKey("key") : "Error in module '${meta.config.name}': key is a required argument" + + // if 'key' is a closure, apply it to the original key + if (workflowArgs["key"] instanceof Closure) { + workflowArgs["key"] = workflowArgs["key"](meta.config.name) + } + def key = workflowArgs["key"] + assert key instanceof CharSequence : "Expected process argument 'key' to be a String. Found: class ${key.getClass()}" + assert key ==~ /^[a-zA-Z_]\w*$/ : "Error in module '$key': Expected process argument 'key' to consist of only letters, digits or underscores. Found: ${key}" + + // check for any unexpected keys + def expectedKeys = ["key", "directives", "auto", "map", "mapId", "mapData", "mapPassthrough", "filter", "runIf", "fromState", "toState", "args", "renameKeys", "debug"] + def unexpectedKeys = workflowArgs.keySet() - expectedKeys + assert unexpectedKeys.isEmpty() : "Error in module '$key': unexpected arguments to the '.run()' function: '${unexpectedKeys.join("', '")}'" + + // check whether directives exists and apply defaults + assert workflowArgs.containsKey("directives") : "Error in module '$key': directives is a required argument" + assert workflowArgs["directives"] instanceof Map : "Error in module '$key': Expected process argument 'directives' to be a Map. Found: class ${workflowArgs['directives'].getClass()}" + workflowArgs["directives"] = processDirectives(defaultWfArgs.directives + workflowArgs["directives"]) + + // check whether directives exists and apply defaults + assert workflowArgs.containsKey("auto") : "Error in module '$key': auto is a required argument" + assert workflowArgs["auto"] instanceof Map : "Error in module '$key': Expected process argument 'auto' to be a Map. Found: class ${workflowArgs['auto'].getClass()}" + workflowArgs["auto"] = processAuto(defaultWfArgs.auto + workflowArgs["auto"]) + + // auto define publish, if so desired + if (workflowArgs.auto.publish == true && (workflowArgs.directives.publishDir != null ? workflowArgs.directives.publishDir : [:]).isEmpty()) { + // can't assert at this level thanks to the no_publish profile + // assert params.containsKey("publishDir") || params.containsKey("publish_dir") : + // "Error in module '${workflowArgs['key']}': if auto.publish is true, params.publish_dir needs to be defined.\n" + + // " Example: params.publish_dir = \"./output/\"" + def publishDir = getPublishDir() + + if (publishDir != null) { + workflowArgs.directives.publishDir = [[ + path: publishDir, + saveAs: "{ it.startsWith('.') ? null : it }", // don't publish hidden files, by default + mode: "copy" + ]] + } + } + + // auto define transcript, if so desired + if (workflowArgs.auto.transcript == true) { + // can't assert at this level thanks to the no_publish profile + // assert params.containsKey("transcriptsDir") || params.containsKey("transcripts_dir") || params.containsKey("publishDir") || params.containsKey("publish_dir") : + // "Error in module '${workflowArgs['key']}': if auto.transcript is true, either params.transcripts_dir or params.publish_dir needs to be defined.\n" + + // " Example: params.transcripts_dir = \"./transcripts/\"" + def transcriptsDir = + params.containsKey("transcripts_dir") ? params.transcripts_dir : + params.containsKey("transcriptsDir") ? params.transcriptsDir : + params.containsKey("publish_dir") ? params.publish_dir + "/_transcripts" : + params.containsKey("publishDir") ? params.publishDir + "/_transcripts" : + null + if (transcriptsDir != null) { + def timestamp = nextflow.Nextflow.getSession().getWorkflowMetadata().start.format('yyyy-MM-dd_HH-mm-ss') + def transcriptsPublishDir = [ + path: "$transcriptsDir/$timestamp/\${task.process.replaceAll(':', '-')}/\${id}/", + saveAs: "{ it.startsWith('.') ? it.replaceAll('^.', '') : null }", + mode: "copy" + ] + def publishDirs = workflowArgs.directives.publishDir != null ? workflowArgs.directives.publishDir : null ? workflowArgs.directives.publishDir : [] + workflowArgs.directives.publishDir = publishDirs + transcriptsPublishDir + } + } + + // if this is a stubrun, remove certain directives? + if (workflow.stubRun) { + workflowArgs.directives.keySet().removeAll(["publishDir", "cpus", "memory", "label"]) + } + + for (nam in ["map", "mapId", "mapData", "mapPassthrough", "filter", "runIf"]) { + if (workflowArgs.containsKey(nam) && workflowArgs[nam]) { + assert workflowArgs[nam] instanceof Closure : "Error in module '$key': Expected process argument '$nam' to be null or a Closure. Found: class ${workflowArgs[nam].getClass()}" + } + } + + // TODO: should functions like 'map', 'mapId', 'mapData', 'mapPassthrough' be deprecated as well? + for (nam in ["map", "mapData", "mapPassthrough", "renameKeys"]) { + if (workflowArgs.containsKey(nam) && workflowArgs[nam] != null) { + log.warn "module '$key': workflow argument '$nam' is deprecated and will be removed in Viash 0.9.0. Please use 'fromState' and 'toState' instead." + } + } + + // check fromState + workflowArgs["fromState"] = _processFromState(workflowArgs.get("fromState"), key, meta.config) + + // check toState + workflowArgs["toState"] = _processToState(workflowArgs.get("toState"), key, meta.config) + + // return output + return workflowArgs +} + +def _processFromState(fromState, key_, config_) { + assert fromState == null || fromState instanceof Closure || fromState instanceof Map || fromState instanceof List : + "Error in module '$key_': Expected process argument 'fromState' to be null, a Closure, a Map, or a List. Found: class ${fromState.getClass()}" + if (fromState == null) { + return null + } + + // if fromState is a List, convert to map + if (fromState instanceof List) { + // check whether fromstate is a list[string] + assert fromState.every{it instanceof CharSequence} : "Error in module '$key_': fromState is a List, but not all elements are Strings" + fromState = fromState.collectEntries{[it, it]} + } + + // if fromState is a map, convert to closure + if (fromState instanceof Map) { + // check whether fromstate is a map[string, string] + assert fromState.values().every{it instanceof CharSequence} : "Error in module '$key_': fromState is a Map, but not all values are Strings" + assert fromState.keySet().every{it instanceof CharSequence} : "Error in module '$key_': fromState is a Map, but not all keys are Strings" + def fromStateMap = fromState.clone() + def requiredInputNames = meta.config.allArguments.findAll{it.required && it.direction == "Input"}.collect{it.plainName} + // turn the map into a closure to be used later on + fromState = { it -> + def state = it[1] + assert state instanceof Map : "Error in module '$key_': the state is not a Map" + def data = fromStateMap.collectMany{newkey, origkey -> + // check whether newkey corresponds to a required argument + if (state.containsKey(origkey)) { + [[newkey, state[origkey]]] + } else if (!requiredInputNames.contains(origkey)) { + [] + } else { + throw new Exception("Error in module '$key_': fromState key '$origkey' not found in current state") + } + }.collectEntries() + data + } + } + + return fromState +} + +def _processToState(toState, key_, config_) { + if (toState == null) { + toState = { tup -> tup[1] } + } + + // toState should be a closure, map[string, string], or list[string] + assert toState instanceof Closure || toState instanceof Map || toState instanceof List : + "Error in module '$key_': Expected process argument 'toState' to be a Closure, a Map, or a List. Found: class ${toState.getClass()}" + + // if toState is a List, convert to map + if (toState instanceof List) { + // check whether toState is a list[string] + assert toState.every{it instanceof CharSequence} : "Error in module '$key_': toState is a List, but not all elements are Strings" + toState = toState.collectEntries{[it, it]} + } + + // if toState is a map, convert to closure + if (toState instanceof Map) { + // check whether toState is a map[string, string] + assert toState.values().every{it instanceof CharSequence} : "Error in module '$key_': toState is a Map, but not all values are Strings" + assert toState.keySet().every{it instanceof CharSequence} : "Error in module '$key_': toState is a Map, but not all keys are Strings" + def toStateMap = toState.clone() + def requiredOutputNames = config_.allArguments.findAll{it.required && it.direction == "Output"}.collect{it.plainName} + // turn the map into a closure to be used later on + toState = { it -> + def output = it[1] + def state = it[2] + assert output instanceof Map : "Error in module '$key_': the output is not a Map" + assert state instanceof Map : "Error in module '$key_': the state is not a Map" + def extraEntries = toStateMap.collectMany{newkey, origkey -> + // check whether newkey corresponds to a required argument + if (output.containsKey(origkey)) { + [[newkey, output[origkey]]] + } else if (!requiredOutputNames.contains(origkey)) { + [] + } else { + throw new Exception("Error in module '$key_': toState key '$origkey' not found in current output") + } + }.collectEntries() + state + extraEntries + } + } + + return toState +} + +// helper file: 'src/main/resources/io/viash/runners/nextflow/workflowFactory/workflowFactory.nf' +def _debug(workflowArgs, debugKey) { + if (workflowArgs.debug) { + view { "process '${workflowArgs.key}' $debugKey tuple: $it" } + } else { + map { it } + } +} + +// depends on: innerWorkflowFactory +def workflowFactory(Map args, Map defaultWfArgs, Map meta) { + def workflowArgs = processWorkflowArgs(args, defaultWfArgs, meta) + def key_ = workflowArgs["key"] + + workflow workflowInstance { + take: input_ + + main: + def chModified = input_ + | checkUniqueIds([:]) + | _debug(workflowArgs, "input") + | map { tuple -> + tuple = deepClone(tuple) + + if (workflowArgs.map) { + tuple = workflowArgs.map(tuple) + } + if (workflowArgs.mapId) { + tuple[0] = workflowArgs.mapId(tuple[0]) + } + if (workflowArgs.mapData) { + tuple[1] = workflowArgs.mapData(tuple[1]) + } + if (workflowArgs.mapPassthrough) { + tuple = tuple.take(2) + workflowArgs.mapPassthrough(tuple.drop(2)) + } + + // check tuple + assert tuple instanceof List : + "Error in module '${key_}': element in channel should be a tuple [id, data, ...otherargs...]\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Expected class: List. Found: tuple.getClass() is ${tuple.getClass()}" + assert tuple.size() >= 2 : + "Error in module '${key_}': expected length of tuple in input channel to be two or greater.\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Found: tuple.size() == ${tuple.size()}" + + // check id field + if (tuple[0] instanceof GString) { + tuple[0] = tuple[0].toString() + } + assert tuple[0] instanceof CharSequence : + "Error in module '${key_}': first element of tuple in channel should be a String\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Found: ${tuple[0]}" + + // match file to input file + if (workflowArgs.auto.simplifyInput && (tuple[1] instanceof Path || tuple[1] instanceof List)) { + def inputFiles = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "input" } + + assert inputFiles.size() == 1 : + "Error in module '${key_}' id '${tuple[0]}'.\n" + + " Anonymous file inputs are only allowed when the process has exactly one file input.\n" + + " Expected: inputFiles.size() == 1. Found: inputFiles.size() is ${inputFiles.size()}" + + tuple[1] = [[ inputFiles[0].plainName, tuple[1] ]].collectEntries() + } + + // check data field + assert tuple[1] instanceof Map : + "Error in module '${key_}' id '${tuple[0]}': second element of tuple in channel should be a Map\n" + + " Example: [\"id\", [input: file('foo.txt'), arg: 10]].\n" + + " Expected class: Map. Found: tuple[1].getClass() is ${tuple[1].getClass()}" + + // rename keys of data field in tuple + if (workflowArgs.renameKeys) { + assert workflowArgs.renameKeys instanceof Map : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Example: renameKeys: ['new_key': 'old_key'].\n" + + " Expected class: Map. Found: renameKeys.getClass() is ${workflowArgs.renameKeys.getClass()}" + assert tuple[1] instanceof Map : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Expected class: Map. Found: tuple[1].getClass() is ${tuple[1].getClass()}" + + // TODO: allow renameKeys to be a function? + workflowArgs.renameKeys.each { newKey, oldKey -> + assert newKey instanceof CharSequence : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Example: renameKeys: ['new_key': 'old_key'].\n" + + " Expected class of newKey: String. Found: newKey.getClass() is ${newKey.getClass()}" + assert oldKey instanceof CharSequence : + "Error renaming data keys in module '${key_}' id '${tuple[0]}'.\n" + + " Example: renameKeys: ['new_key': 'old_key'].\n" + + " Expected class of oldKey: String. Found: oldKey.getClass() is ${oldKey.getClass()}" + assert tuple[1].containsKey(oldKey) : + "Error renaming data keys in module '${key}' id '${tuple[0]}'.\n" + + " Key '$oldKey' is missing in the data map. tuple[1].keySet() is '${tuple[1].keySet()}'" + tuple[1].put(newKey, tuple[1][oldKey]) + } + tuple[1].keySet().removeAll(workflowArgs.renameKeys.collect{ newKey, oldKey -> oldKey }) + } + tuple + } + + def chModifiedFiltered = workflowArgs.filter ? + chModified | filter{workflowArgs.filter(it)} : + chModified + + def chRun = null + def chPassthrough = null + if (workflowArgs.runIf) { + def runIfBranch = chModifiedFiltered.branch{ tup -> + run: workflowArgs.runIf(tup[0], tup[1]) + passthrough: true + } + chRun = runIfBranch.run + chPassthrough = runIfBranch.passthrough + } else { + chRun = chModifiedFiltered + chPassthrough = Channel.empty() + } + + def chArgs = workflowArgs.fromState ? + chRun | map{ + def new_data = workflowArgs.fromState(it.take(2)) + [it[0], new_data] + } : + chRun | map {tup -> tup.take(2)} + + // fill in defaults + def chArgsWithDefaults = chArgs + | map { tuple -> + def id_ = tuple[0] + def data_ = tuple[1] + + // TODO: could move fromState to here + + // fetch default params from functionality + def defaultArgs = meta.config.allArguments + .findAll { it.containsKey("default") } + .collectEntries { [ it.plainName, it.default ] } + + // fetch overrides in params + def paramArgs = meta.config.allArguments + .findAll { par -> + def argKey = key_ + "__" + par.plainName + params.containsKey(argKey) + } + .collectEntries { [ it.plainName, params[key_ + "__" + it.plainName] ] } + + // fetch overrides in data + def dataArgs = meta.config.allArguments + .findAll { data_.containsKey(it.plainName) } + .collectEntries { [ it.plainName, data_[it.plainName] ] } + + // combine params + def combinedArgs = defaultArgs + paramArgs + workflowArgs.args + dataArgs + + // remove arguments with explicit null values + combinedArgs + .removeAll{_, val -> val == null || val == "viash_no_value" || val == "force_null"} + + combinedArgs = _processInputValues(combinedArgs, meta.config, id_, key_) + + [id_, combinedArgs] + tuple.drop(2) + } + + // TODO: move some of the _meta.join_id wrangling to the safeJoin() function. + def chInitialOutput = chArgsWithDefaults + | _debug(workflowArgs, "processed") + // run workflow + | innerWorkflowFactory(workflowArgs) + // check output tuple + | map { id_, output_ -> + + // see if output map contains metadata + def meta_ = + output_ instanceof Map && output_.containsKey("_meta") ? + output_["_meta"] : + [:] + def join_id = meta_.join_id ?: id_ + + // remove metadata + output_ = output_.findAll{k, v -> k != "_meta"} + + // check value types + output_ = _processOutputValues(output_, meta.config, id_, key_) + + // simplify output if need be + if (workflowArgs.auto.simplifyOutput && output_.size() == 1) { + output_ = output_.values()[0] + } + + [join_id, id_, output_] + } + // | view{"chInitialOutput: ${it.take(3)}"} + + // join the output [prev_id, new_id, output] with the previous state [prev_id, state, ...] + def chNewState = safeJoin(chInitialOutput, chModifiedFiltered, key_) + // input tuple format: [join_id, id, output, prev_state, ...] + // output tuple format: [join_id, id, new_state, ...] + | map{ tup -> + def new_state = workflowArgs.toState(tup.drop(1).take(3)) + tup.take(2) + [new_state] + tup.drop(4) + } + + if (workflowArgs.auto.publish == "state") { + def chPublish = chNewState + // input tuple format: [join_id, id, new_state, ...] + // output tuple format: [join_id, id, new_state] + | map{ tup -> + tup.take(3) + } + + safeJoin(chPublish, chArgsWithDefaults, key_) + // input tuple format: [join_id, id, new_state, orig_state, ...] + // output tuple format: [id, new_state, orig_state] + | map { tup -> + tup.drop(1).take(3) + } + | publishStatesByConfig(key: key_, config: meta.config) + } + + // remove join_id and meta + chReturn = chNewState + | map { tup -> + // input tuple format: [join_id, id, new_state, ...] + // output tuple format: [id, new_state, ...] + tup.drop(1) + } + | _debug(workflowArgs, "output") + | concat(chPassthrough) + + emit: chReturn + } + + def wf = workflowInstance.cloneWithName(key_) + + // add factory function + wf.metaClass.run = { runArgs -> + workflowFactory(runArgs, workflowArgs, meta) + } + // add config to module for later introspection + wf.metaClass.config = meta.config + + return wf +} + +nextflow.enable.dsl=2 + +// START COMPONENT-SPECIFIC CODE + +// create meta object +meta = [ + "resources_dir": moduleDir.toRealPath().normalize(), + "config": processConfig(readJsonBlob('''{ + "name" : "star_genome_generate", + "namespace" : "star", + "version" : "v0.1.0", + "argument_groups" : [ + { + "name" : "Input", + "arguments" : [ + { + "type" : "file", + "name" : "--genomeFastaFiles", + "description" : "Path(s) to the fasta files with the genome sequences, separated by spaces. These files should be plain text FASTA files, they *cannot* be zipped.\n", + "must_exist" : true, + "create_parent" : true, + "required" : true, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--sjdbGTFfile", + "description" : "Path to the GTF file with annotations", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--sjdbOverhang", + "description" : "Length of the donor/acceptor sequence on each side of the junctions, ideally = (mate_length - 1)", + "example" : [ + 100 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--sjdbGTFchrPrefix", + "description" : "Prefix for chromosome names in a GTF file (e.g. 'chr' for using ENSMEBL annotations with UCSC genomes)", + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--sjdbGTFfeatureExon", + "description" : "Feature type in GTF file to be used as exons for building transcripts", + "example" : [ + "exon" + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--sjdbGTFtagExonParentTranscript", + "description" : "GTF attribute name for parent transcript ID (default \\"transcript_id\\" works for GTF files)", + "example" : [ + "transcript_id" + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--sjdbGTFtagExonParentGene", + "description" : "GTF attribute name for parent gene ID (default \\"gene_id\\" works for GTF files)", + "example" : [ + "gene_id" + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--sjdbGTFtagExonParentGeneName", + "description" : "GTF attribute name for parent gene name", + "example" : [ + "gene_name" + ], + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--sjdbGTFtagExonParentGeneType", + "description" : "GTF attribute name for parent gene type", + "example" : [ + "gene_type", + "gene_biotype" + ], + "required" : false, + "direction" : "input", + "multiple" : true, + "multiple_sep" : ";" + }, + { + "type" : "long", + "name" : "--limitGenomeGenerateRAM", + "description" : "Maximum available RAM (bytes) for genome generation", + "example" : [ + 31000000000 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--genomeSAindexNbases", + "description" : "Length (bases) of the SA pre-indexing string. Typically between 10 and 15. Longer strings will use much more memory, but allow faster searches. For small genomes, this parameter must be scaled down to min(14, log2(GenomeLength)/2 - 1).", + "example" : [ + 14 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--genomeChrBinNbits", + "description" : "Defined as log2(chrBin), where chrBin is the size of the bins for genome storage. Each chromosome will occupy an integer number of bins. For a genome with large number of contigs, it is recommended to scale this parameter as min(18, log2[max(GenomeLength/NumberOfReferences,ReadLength)]).", + "example" : [ + 18 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--genomeSAsparseD", + "description" : "Suffux array sparsity, i.e. distance between indices. Use bigger numbers to decrease needed RAM at the cost of mapping speed reduction.", + "example" : [ + 1 + ], + "required" : false, + "min" : 0, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "integer", + "name" : "--genomeSuffixLengthMax", + "description" : "Maximum length of the suffixes, has to be longer than read length. Use -1 for infinite length.", + "example" : [ + -1 + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "string", + "name" : "--genomeTransformType", + "description" : "Type of genome transformation\n None ... no transformation\n Haploid ... replace reference alleles with alternative alleles from VCF file (e.g. consensus allele)\n Diploid ... create two haplotypes for each chromosome listed in VCF file, for genotypes 1|2, assumes perfect phasing (e.g. personal genome)\n", + "example" : [ + "None" + ], + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--genomeTransformVCF", + "description" : "path to VCF file for genome transformation", + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + } + ] + }, + { + "name" : "Output", + "arguments" : [ + { + "type" : "file", + "name" : "--index", + "description" : "STAR index directory.", + "default" : [ + "STAR_index" + ], + "must_exist" : true, + "create_parent" : true, + "required" : true, + "direction" : "output", + "multiple" : false, + "multiple_sep" : ";" + } + ] + } + ], + "resources" : [ + { + "type" : "bash_script", + "path" : "script.sh", + "is_executable" : true + } + ], + "description" : "Create index for STAR\n", + "test_resources" : [ + { + "type" : "bash_script", + "path" : "test.sh", + "is_executable" : true + } + ], + "status" : "enabled", + "requirements" : { + "commands" : [ + "ps" + ] + }, + "keywords" : [ + "genome", + "index", + "align" + ], + "license" : "MIT", + "references" : { + "doi" : [ + "10.1093/bioinformatics/bts635" + ] + }, + "links" : { + "repository" : "https://github.com/alexdobin/STAR", + "documentation" : "https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf" + }, + "runners" : [ + { + "type" : "executable", + "id" : "executable", + "docker_setup_strategy" : "ifneedbepullelsecachedbuild" + }, + { + "type" : "nextflow", + "id" : "nextflow", + "directives" : { + "tag" : "$id" + }, + "auto" : { + "simplifyInput" : true, + "simplifyOutput" : false, + "transcript" : false, + "publish" : false + }, + "config" : { + "labels" : { + "mem1gb" : "memory = 1000000000.B", + "mem2gb" : "memory = 2000000000.B", + "mem5gb" : "memory = 5000000000.B", + "mem10gb" : "memory = 10000000000.B", + "mem20gb" : "memory = 20000000000.B", + "mem50gb" : "memory = 50000000000.B", + "mem100gb" : "memory = 100000000000.B", + "mem200gb" : "memory = 200000000000.B", + "mem500gb" : "memory = 500000000000.B", + "mem1tb" : "memory = 1000000000000.B", + "mem2tb" : "memory = 2000000000000.B", + "mem5tb" : "memory = 5000000000000.B", + "mem10tb" : "memory = 10000000000000.B", + "mem20tb" : "memory = 20000000000000.B", + "mem50tb" : "memory = 50000000000000.B", + "mem100tb" : "memory = 100000000000000.B", + "mem200tb" : "memory = 200000000000000.B", + "mem500tb" : "memory = 500000000000000.B", + "mem1gib" : "memory = 1073741824.B", + "mem2gib" : "memory = 2147483648.B", + "mem4gib" : "memory = 4294967296.B", + "mem8gib" : "memory = 8589934592.B", + "mem16gib" : "memory = 17179869184.B", + "mem32gib" : "memory = 34359738368.B", + "mem64gib" : "memory = 68719476736.B", + "mem128gib" : "memory = 137438953472.B", + "mem256gib" : "memory = 274877906944.B", + "mem512gib" : "memory = 549755813888.B", + "mem1tib" : "memory = 1099511627776.B", + "mem2tib" : "memory = 2199023255552.B", + "mem4tib" : "memory = 4398046511104.B", + "mem8tib" : "memory = 8796093022208.B", + "mem16tib" : "memory = 17592186044416.B", + "mem32tib" : "memory = 35184372088832.B", + "mem64tib" : "memory = 70368744177664.B", + "mem128tib" : "memory = 140737488355328.B", + "mem256tib" : "memory = 281474976710656.B", + "mem512tib" : "memory = 562949953421312.B", + "cpu1" : "cpus = 1", + "cpu2" : "cpus = 2", + "cpu5" : "cpus = 5", + "cpu10" : "cpus = 10", + "cpu20" : "cpus = 20", + "cpu50" : "cpus = 50", + "cpu100" : "cpus = 100", + "cpu200" : "cpus = 200", + "cpu500" : "cpus = 500", + "cpu1000" : "cpus = 1000" + } + }, + "debug" : false, + "container" : "docker" + } + ], + "engines" : [ + { + "type" : "docker", + "id" : "docker", + "image" : "ubuntu:22.04", + "target_registry" : "images.viash-hub.com", + "target_tag" : "v0.1.0", + "namespace_separator" : "/", + "setup" : [ + { + "type" : "docker", + "run" : [ + "apt-get update && \\\\\n apt-get install -y --no-install-recommends ${PACKAGES} && \\\\\n cd /tmp && \\\\\n wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip && \\\\\n unzip ${STAR_VERSION}.zip && \\\\\n cd STAR-${STAR_VERSION}/source && \\\\\n make STARstatic CXXFLAGS_SIMD=-std=c++11 && \\\\\n cp STAR /usr/local/bin && \\\\\n cd / && \\\\\n rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip && \\\\\n apt-get --purge autoremove -y ${PACKAGES} && \\\\\n apt-get clean\n" + ], + "env" : [ + "STAR_VERSION 2.7.11b", + "PACKAGES gcc g++ make wget zlib1g-dev unzip xxd" + ] + }, + { + "type" : "docker", + "run" : [ + "STAR --version | sed 's#\\\\(.*\\\\)#star: \\"\\\\1\\"#' > /var/software_versions.txt\n" + ] + } + ] + }, + { + "type" : "native", + "id" : "native" + } + ], + "build_info" : { + "config" : "/workdir/root/repo/src/star/star_genome_generate/config.vsh.yaml", + "runner" : "nextflow", + "engine" : "docker|native", + "output" : "target/nextflow/star/star_genome_generate", + "viash_version" : "0.9.0-RC6", + "git_commit" : "b84b29747d0635f2ac83ea63b496be9a9edb6724", + "git_remote" : "https://github.com/viash-hub/biobox" + }, + "package_config" : { + "name" : "biobox", + "version" : "v0.1.0", + "description" : "A collection of bioinformatics tools for working with sequence data.\n", + "viash_version" : "0.9.0-RC6", + "source" : "src", + "target" : "target", + "config_mods" : [ + ".requirements.commands := ['ps']\n", + ".engines += { type: \\"native\\" }", + ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", + ".engines[.type == 'docker'].target_tag := 'v0.1.0'" + ], + "keywords" : [ + "bioinformatics", + "modules", + "sequencing" + ], + "license" : "MIT", + "organization" : "vsh", + "links" : { + "repository" : "https://github.com/viash-hub/biobox", + "issue_tracker" : "https://github.com/viash-hub/biobox/issues" + } + } +}''')) +] + +// resolve dependencies dependencies (if any) + + +// inner workflow +// inner workflow hook +def innerWorkflowFactory(args) { + def rawScript = '''set -e +tempscript=".viash_script.sh" +cat > "$tempscript" << VIASHMAIN +#!/bin/bash + +set -e + +## VIASH START +# The following code has been auto-generated by Viash. +$( if [ ! -z ${VIASH_PAR_GENOMEFASTAFILES+x} ]; then echo "${VIASH_PAR_GENOMEFASTAFILES}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeFastaFiles='&'#" ; else echo "# par_genomeFastaFiles="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFFILE+x} ]; then echo "${VIASH_PAR_SJDBGTFFILE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFfile='&'#" ; else echo "# par_sjdbGTFfile="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBOVERHANG+x} ]; then echo "${VIASH_PAR_SJDBOVERHANG}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbOverhang='&'#" ; else echo "# par_sjdbOverhang="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFCHRPREFIX+x} ]; then echo "${VIASH_PAR_SJDBGTFCHRPREFIX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFchrPrefix='&'#" ; else echo "# par_sjdbGTFchrPrefix="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFFEATUREEXON+x} ]; then echo "${VIASH_PAR_SJDBGTFFEATUREEXON}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFfeatureExon='&'#" ; else echo "# par_sjdbGTFfeatureExon="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFtagExonParentTranscript='&'#" ; else echo "# par_sjdbGTFtagExonParentTranscript="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENE+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTGENE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFtagExonParentGene='&'#" ; else echo "# par_sjdbGTFtagExonParentGene="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFtagExonParentGeneName='&'#" ; else echo "# par_sjdbGTFtagExonParentGeneName="; fi ) +$( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE+x} ]; then echo "${VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_sjdbGTFtagExonParentGeneType='&'#" ; else echo "# par_sjdbGTFtagExonParentGeneType="; fi ) +$( if [ ! -z ${VIASH_PAR_LIMITGENOMEGENERATERAM+x} ]; then echo "${VIASH_PAR_LIMITGENOMEGENERATERAM}" | sed "s#'#'\\"'\\"'#g;s#.*#par_limitGenomeGenerateRAM='&'#" ; else echo "# par_limitGenomeGenerateRAM="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMESAINDEXNBASES+x} ]; then echo "${VIASH_PAR_GENOMESAINDEXNBASES}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeSAindexNbases='&'#" ; else echo "# par_genomeSAindexNbases="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMECHRBINNBITS+x} ]; then echo "${VIASH_PAR_GENOMECHRBINNBITS}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeChrBinNbits='&'#" ; else echo "# par_genomeChrBinNbits="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMESASPARSED+x} ]; then echo "${VIASH_PAR_GENOMESASPARSED}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeSAsparseD='&'#" ; else echo "# par_genomeSAsparseD="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMESUFFIXLENGTHMAX+x} ]; then echo "${VIASH_PAR_GENOMESUFFIXLENGTHMAX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeSuffixLengthMax='&'#" ; else echo "# par_genomeSuffixLengthMax="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMETRANSFORMTYPE+x} ]; then echo "${VIASH_PAR_GENOMETRANSFORMTYPE}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeTransformType='&'#" ; else echo "# par_genomeTransformType="; fi ) +$( if [ ! -z ${VIASH_PAR_GENOMETRANSFORMVCF+x} ]; then echo "${VIASH_PAR_GENOMETRANSFORMVCF}" | sed "s#'#'\\"'\\"'#g;s#.*#par_genomeTransformVCF='&'#" ; else echo "# par_genomeTransformVCF="; fi ) +$( if [ ! -z ${VIASH_PAR_INDEX+x} ]; then echo "${VIASH_PAR_INDEX}" | sed "s#'#'\\"'\\"'#g;s#.*#par_index='&'#" ; else echo "# par_index="; fi ) +$( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) +$( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) +$( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) +$( if [ ! -z ${VIASH_META_EXECUTABLE+x} ]; then echo "${VIASH_META_EXECUTABLE}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_executable='&'#" ; else echo "# meta_executable="; fi ) +$( if [ ! -z ${VIASH_META_CONFIG+x} ]; then echo "${VIASH_META_CONFIG}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_config='&'#" ; else echo "# meta_config="; fi ) +$( if [ ! -z ${VIASH_META_TEMP_DIR+x} ]; then echo "${VIASH_META_TEMP_DIR}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_temp_dir='&'#" ; else echo "# meta_temp_dir="; fi ) +$( if [ ! -z ${VIASH_META_CPUS+x} ]; then echo "${VIASH_META_CPUS}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_cpus='&'#" ; else echo "# meta_cpus="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_B+x} ]; then echo "${VIASH_META_MEMORY_B}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_b='&'#" ; else echo "# meta_memory_b="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KB+x} ]; then echo "${VIASH_META_MEMORY_KB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_kb='&'#" ; else echo "# meta_memory_kb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MB+x} ]; then echo "${VIASH_META_MEMORY_MB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_mb='&'#" ; else echo "# meta_memory_mb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GB+x} ]; then echo "${VIASH_META_MEMORY_GB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_gb='&'#" ; else echo "# meta_memory_gb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TB+x} ]; then echo "${VIASH_META_MEMORY_TB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_tb='&'#" ; else echo "# meta_memory_tb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PB+x} ]; then echo "${VIASH_META_MEMORY_PB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_pb='&'#" ; else echo "# meta_memory_pb="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_KIB+x} ]; then echo "${VIASH_META_MEMORY_KIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_kib='&'#" ; else echo "# meta_memory_kib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_MIB+x} ]; then echo "${VIASH_META_MEMORY_MIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_mib='&'#" ; else echo "# meta_memory_mib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_GIB+x} ]; then echo "${VIASH_META_MEMORY_GIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_gib='&'#" ; else echo "# meta_memory_gib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_tib='&'#" ; else echo "# meta_memory_tib="; fi ) +$( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi ) + +## VIASH END + +mkdir -p \\$par_index + +STAR \\\\ + --runMode genomeGenerate \\\\ + --genomeDir \\$par_index \\\\ + --genomeFastaFiles \\$par_genomeFastaFiles \\\\ + \\${meta_cpus:+--runThreadN "\\${meta_cpus}"} \\\\ + \\${par_sjdbGTFfile:+--sjdbGTFfile "\\${par_sjdbGTFfile}"} \\\\ + \\${par_sjdbOverhang:+--sjdbOverhang "\\${par_sjdbOverhang}"} \\\\ + \\${par_genomeSAindexNbases:+--genomeSAindexNbases "\\${par_genomeSAindexNbases}"} \\\\ + \\${par_sjdbGTFchrPrefix:+--sjdbGTFchrPrefix "\\${par_sjdbGTFchrPrefix}"} \\\\ + \\${par_sjdbGTFfeatureExon:+--sjdbGTFfeatureExon "\\${par_sjdbGTFfeatureExon}"} \\\\ + \\${par_sjdbGTFtagExonParentTranscript:+--sjdbGTFtagExonParentTranscript "\\${par_sjdbGTFtagExonParentTranscript}"} \\\\ + \\${par_sjdbGTFtagExonParentGene:+--sjdbGTFtagExonParentGene "\\${par_sjdbGTFtagExonParentGene}"} \\\\ + \\${par_sjdbGTFtagExonParentGeneName:+--sjdbGTFtagExonParentGeneName "\\${par_sjdbGTFtagExonParentGeneName}"} \\\\ + \\${par_sjdbGTFtagExonParentGeneType:+--sjdbGTFtagExonParentGeneType "\\${sjdbGTFtagExonParentGeneType}"} \\\\ + \\${par_limitGenomeGenerateRAM:+--limitGenomeGenerateRAM "\\${par_limitGenomeGenerateRAM}"} \\\\ + \\${par_genomeChrBinNbits:+--genomeChrBinNbits "\\${par_genomeChrBinNbits}"} \\\\ + \\${par_genomeSAsparseD:+--genomeSAsparseD "\\${par_genomeSAsparseD}"} \\\\ + \\${par_genomeSuffixLengthMax:+--genomeSuffixLengthMax "\\${par_genomeSuffixLengthMax}"} \\\\ + \\${par_genomeTransformType:+--genomeTransformType "\\${par_genomeTransformType}"} \\\\ + \\${par_genomeTransformVCF:+--genomeTransformVCF "\\${par_genomeTransformVCF}"} \\\\ +VIASHMAIN +bash "$tempscript" +''' + + return vdsl3WorkflowFactory(args, meta, rawScript) +} + + + +/** + * Generate a workflow for VDSL3 modules. + * + * This function is called by the workflowFactory() function. + * + * Input channel: [id, input_map] + * Output channel: [id, output_map] + * + * Internally, this workflow will convert the input channel + * to a format which the Nextflow module will be able to handle. + */ +def vdsl3WorkflowFactory(Map args, Map meta, String rawScript) { + def key = args["key"] + def processObj = null + + workflow processWf { + take: input_ + main: + + if (processObj == null) { + processObj = _vdsl3ProcessFactory(args, meta, rawScript) + } + + output_ = input_ + | map { tuple -> + def id = tuple[0] + def data_ = tuple[1] + + if (workflow.stubRun) { + // add id if missing + data_ = [id: 'stub'] + data_ + } + + // process input files separately + def inputPaths = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "input" } + .collect { par -> + def val = data_.containsKey(par.plainName) ? data_[par.plainName] : [] + def inputFiles = [] + if (val == null) { + inputFiles = [] + } else if (val instanceof List) { + inputFiles = val + } else if (val instanceof Path) { + inputFiles = [ val ] + } else { + inputFiles = [] + } + if (!workflow.stubRun) { + // throw error when an input file doesn't exist + inputFiles.each{ file -> + assert file.exists() : + "Error in module '${key}' id '${id}' argument '${par.plainName}'.\n" + + " Required input file does not exist.\n" + + " Path: '$file'.\n" + + " Expected input file to exist" + } + } + inputFiles + } + + // remove input files + def argsExclInputFiles = meta.config.allArguments + .findAll { (it.type != "file" || it.direction != "input") && data_.containsKey(it.plainName) } + .collectEntries { par -> + def parName = par.plainName + def val = data_[parName] + if (par.multiple && val instanceof Collection) { + val = val.join(par.multiple_sep) + } + if (par.direction == "output" && par.type == "file") { + val = val.replaceAll('\\$id', id).replaceAll('\\$key', key) + } + [parName, val] + } + + [ id ] + inputPaths + [ argsExclInputFiles, meta.resources_dir ] + } + | processObj + | map { output -> + def outputFiles = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" } + .indexed() + .collectEntries{ index, par -> + def out = output[index + 1] + // strip dummy '.exitcode' file from output (see nextflow-io/nextflow#2678) + if (!out instanceof List || out.size() <= 1) { + if (par.multiple) { + out = [] + } else { + assert !par.required : + "Error in module '${key}' id '${output[0]}' argument '${par.plainName}'.\n" + + " Required output file is missing" + out = null + } + } else if (out.size() == 2 && !par.multiple) { + out = out[1] + } else { + out = out.drop(1) + } + [ par.plainName, out ] + } + + // drop null outputs + outputFiles.removeAll{it.value == null} + + [ output[0], outputFiles ] + } + emit: output_ + } + + return processWf +} + +// depends on: session? +def _vdsl3ProcessFactory(Map workflowArgs, Map meta, String rawScript) { + // autodetect process key + def wfKey = workflowArgs["key"] + def procKeyPrefix = "${wfKey}_process" + def scriptMeta = nextflow.script.ScriptMeta.current() + def existing = scriptMeta.getProcessNames().findAll{it.startsWith(procKeyPrefix)} + def numbers = existing.collect{it.replace(procKeyPrefix, "0").toInteger()} + def newNumber = (numbers + [-1]).max() + 1 + + def procKey = newNumber == 0 ? procKeyPrefix : "$procKeyPrefix$newNumber" + + if (newNumber > 0) { + log.warn "Key for module '${wfKey}' is duplicated.\n", + "If you run a component multiple times in the same workflow,\n" + + "it's recommended you set a unique key for every call,\n" + + "for example: ${wfKey}.run(key: \"foo\")." + } + + // subset directives and convert to list of tuples + def drctv = workflowArgs.directives + + // TODO: unit test the two commands below + // convert publish array into tags + def valueToStr = { val -> + // ignore closures + if (val instanceof CharSequence) { + if (!val.matches('^[{].*[}]$')) { + '"' + val + '"' + } else { + val + } + } else if (val instanceof List) { + "[" + val.collect{valueToStr(it)}.join(", ") + "]" + } else if (val instanceof Map) { + "[" + val.collect{k, v -> k + ": " + valueToStr(v)}.join(", ") + "]" + } else { + val.inspect() + } + } + + // multiple entries allowed: label, publishdir + def drctvStrs = drctv.collect { key, value -> + if (key in ["label", "publishDir"]) { + value.collect{ val -> + if (val instanceof Map) { + "\n$key " + val.collect{ k, v -> k + ": " + valueToStr(v) }.join(", ") + } else if (val == null) { + "" + } else { + "\n$key " + valueToStr(val) + } + }.join() + } else if (value instanceof Map) { + "\n$key " + value.collect{ k, v -> k + ": " + valueToStr(v) }.join(", ") + } else { + "\n$key " + valueToStr(value) + } + }.join() + + def inputPaths = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "input" } + .collect { ', path(viash_par_' + it.plainName + ', stageAs: "_viash_par/' + it.plainName + '_?/*")' } + .join() + + def outputPaths = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" } + .collect { par -> + // insert dummy into every output (see nextflow-io/nextflow#2678) + if (!par.multiple) { + ', path{[".exitcode", args.' + par.plainName + ']}' + } else { + ', path{[".exitcode"] + args.' + par.plainName + '}' + } + } + .join() + + // TODO: move this functionality somewhere else? + if (workflowArgs.auto.transcript) { + outputPaths = outputPaths + ', path{[".exitcode", ".command*"]}' + } else { + outputPaths = outputPaths + ', path{[".exitcode"]}' + } + + // create dirs for output files (based on BashWrapper.createParentFiles) + def createParentStr = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" && it.create_parent } + .collect { par -> + "\${ args.containsKey(\"${par.plainName}\") ? \"mkdir_parent \\\"\" + (args[\"${par.plainName}\"] instanceof String ? args[\"${par.plainName}\"] : args[\"${par.plainName}\"].join('\" \"')) + \"\\\"\" : \"\" }" + } + .join("\n") + + // construct inputFileExports + def inputFileExports = meta.config.allArguments + .findAll { it.type == "file" && it.direction.toLowerCase() == "input" } + .collect { par -> + def viash_par_contents = "(viash_par_${par.plainName} instanceof List ? viash_par_${par.plainName}.join(\"${par.multiple_sep}\") : viash_par_${par.plainName})" + "\n\${viash_par_${par.plainName}.empty ? \"\" : \"export VIASH_PAR_${par.plainName.toUpperCase()}=\\\"\" + ${viash_par_contents} + \"\\\"\"}" + } + + // NOTE: if using docker, use /tmp instead of tmpDir! + def tmpDir = java.nio.file.Paths.get( + System.getenv('NXF_TEMP') ?: + System.getenv('VIASH_TEMP') ?: + System.getenv('VIASH_TMPDIR') ?: + System.getenv('VIASH_TEMPDIR') ?: + System.getenv('VIASH_TMP') ?: + System.getenv('TEMP') ?: + System.getenv('TMPDIR') ?: + System.getenv('TEMPDIR') ?: + System.getenv('TMP') ?: + '/tmp' + ).toAbsolutePath() + + // construct stub + def stub = meta.config.allArguments + .findAll { it.type == "file" && it.direction == "output" } + .collect { par -> + "\${ args.containsKey(\"${par.plainName}\") ? \"touch2 \\\"\" + (args[\"${par.plainName}\"] instanceof String ? args[\"${par.plainName}\"].replace(\"_*\", \"_0\") : args[\"${par.plainName}\"].join('\" \"')) + \"\\\"\" : \"\" }" + } + .join("\n") + + // escape script + def escapedScript = rawScript.replace('\\', '\\\\').replace('$', '\\$').replace('"""', '\\"\\"\\"') + + // publishdir assert + def assertStr = (workflowArgs.auto.publish == true) || workflowArgs.auto.transcript ? + """\nassert task.publishDir.size() > 0: "if auto.publish is true, params.publish_dir needs to be defined.\\n Example: --publish_dir './output/'" """ : + "" + + // generate process string + def procStr = + """nextflow.enable.dsl=2 + | + |process $procKey {$drctvStrs + |input: + | tuple val(id)$inputPaths, val(args), path(resourcesDir, stageAs: ".viash_meta_resources") + |output: + | tuple val("\$id")$outputPaths, optional: true + |stub: + |\"\"\" + |touch2() { mkdir -p "\\\$(dirname "\\\$1")" && touch "\\\$1" ; } + |$stub + |\"\"\" + |script:$assertStr + |def escapeText = { s -> s.toString().replaceAll('([`"])', '\\\\\\\\\$1') } + |def parInject = args + | .findAll{key, value -> value != null} + | .collect{key, value -> "export VIASH_PAR_\${key.toUpperCase()}=\\\"\${escapeText(value)}\\\""} + | .join("\\n") + |\"\"\" + |# meta exports + |export VIASH_META_RESOURCES_DIR="\${resourcesDir}" + |export VIASH_META_TEMP_DIR="${['docker', 'podman', 'charliecloud'].any{ it == workflow.containerEngine } ? '/tmp' : tmpDir}" + |export VIASH_META_NAME="${meta.config.name}" + |# export VIASH_META_EXECUTABLE="\\\$VIASH_META_RESOURCES_DIR/\\\$VIASH_META_NAME" + |export VIASH_META_CONFIG="\\\$VIASH_META_RESOURCES_DIR/.config.vsh.yaml" + |\${task.cpus ? "export VIASH_META_CPUS=\$task.cpus" : "" } + |\${task.memory?.bytes != null ? "export VIASH_META_MEMORY_B=\$task.memory.bytes" : "" } + |if [ ! -z \\\${VIASH_META_MEMORY_B+x} ]; then + | export VIASH_META_MEMORY_KB=\\\$(( (\\\$VIASH_META_MEMORY_B+999) / 1000 )) + | export VIASH_META_MEMORY_MB=\\\$(( (\\\$VIASH_META_MEMORY_KB+999) / 1000 )) + | export VIASH_META_MEMORY_GB=\\\$(( (\\\$VIASH_META_MEMORY_MB+999) / 1000 )) + | export VIASH_META_MEMORY_TB=\\\$(( (\\\$VIASH_META_MEMORY_GB+999) / 1000 )) + | export VIASH_META_MEMORY_PB=\\\$(( (\\\$VIASH_META_MEMORY_TB+999) / 1000 )) + | export VIASH_META_MEMORY_KIB=\\\$(( (\\\$VIASH_META_MEMORY_B+1023) / 1024 )) + | export VIASH_META_MEMORY_MIB=\\\$(( (\\\$VIASH_META_MEMORY_KIB+1023) / 1024 )) + | export VIASH_META_MEMORY_GIB=\\\$(( (\\\$VIASH_META_MEMORY_MIB+1023) / 1024 )) + | export VIASH_META_MEMORY_TIB=\\\$(( (\\\$VIASH_META_MEMORY_GIB+1023) / 1024 )) + | export VIASH_META_MEMORY_PIB=\\\$(( (\\\$VIASH_META_MEMORY_TIB+1023) / 1024 )) + |fi + | + |# meta synonyms + |export VIASH_TEMP="\\\$VIASH_META_TEMP_DIR" + |export TEMP_DIR="\\\$VIASH_META_TEMP_DIR" + | + |# create output dirs if need be + |function mkdir_parent { + | for file in "\\\$@"; do + | mkdir -p "\\\$(dirname "\\\$file")" + | done + |} + |$createParentStr + | + |# argument exports${inputFileExports.join()} + |\$parInject + | + |# process script + |${escapedScript} + |\"\"\" + |} + |""".stripMargin() + + // TODO: print on debug + // if (workflowArgs.debug == true) { + // println("######################\n$procStr\n######################") + // } + + // write process to temp file + def tempFile = java.nio.file.Files.createTempFile("viash-process-${procKey}-", ".nf") + addShutdownHook { java.nio.file.Files.deleteIfExists(tempFile) } + tempFile.text = procStr + + // create process from temp file + def binding = new nextflow.script.ScriptBinding([:]) + def session = nextflow.Nextflow.getSession() + def parser = new nextflow.script.ScriptParser(session) + .setModule(true) + .setBinding(binding) + def moduleScript = parser.runScript(tempFile) + .getScript() + + // register module in meta + def module = new nextflow.script.IncludeDef.Module(name: procKey) + scriptMeta.addModule(moduleScript, module.name, module.alias) + + // retrieve and return process from meta + return scriptMeta.getProcess(procKey) +} + +// defaults +meta["defaults"] = [ + // key to be used to trace the process and determine output names + key: null, + + // fixed arguments to be passed to script + args: [:], + + // default directives + directives: readJsonBlob('''{ + "container" : { + "registry" : "images.viash-hub.com", + "image" : "vsh/biobox/star/star_genome_generate", + "tag" : "v0.1.0" + }, + "tag" : "$id" +}'''), + + // auto settings + auto: readJsonBlob('''{ + "simplifyInput" : true, + "simplifyOutput" : false, + "transcript" : false, + "publish" : false +}'''), + + // Apply a map over the incoming tuple + // Example: `{ tup -> [ tup[0], [input: tup[1].output] ] + tup.drop(2) }` + map: null, + + // Apply a map over the ID element of a tuple (i.e. the first element) + // Example: `{ id -> id + "_foo" }` + mapId: null, + + // Apply a map over the data element of a tuple (i.e. the second element) + // Example: `{ data -> [ input: data.output ] }` + mapData: null, + + // Apply a map over the passthrough elements of a tuple (i.e. the tuple excl. the first two elements) + // Example: `{ pt -> pt.drop(1) }` + mapPassthrough: null, + + // Filter the channel + // Example: `{ tup -> tup[0] == "foo" }` + filter: null, + + // Choose whether or not to run the component on the tuple if the condition is true. + // Otherwise, the tuple will be passed through. + // Example: `{ tup -> tup[0] != "skip_this" }` + runIf: null, + + // Rename keys in the data field of the tuple (i.e. the second element) + // Will likely be deprecated in favour of `fromState`. + // Example: `[ "new_key": "old_key" ]` + renameKeys: null, + + // Fetch data from the state and pass it to the module without altering the current state. + // + // `fromState` should be `null`, `List[String]`, `Map[String, String]` or a function. + // + // - If it is `null`, the state will be passed to the module as is. + // - If it is a `List[String]`, the data will be the values of the state at the given keys. + // - If it is a `Map[String, String]`, the data will be the values of the state at the given keys, with the keys renamed according to the map. + // - If it is a function, the tuple (`[id, state]`) in the channel will be passed to the function, and the result will be used as the data. + // + // Example: `{ id, state -> [input: state.fastq_file] }` + // Default: `null` + fromState: null, + + // Determine how the state should be updated after the module has been run. + // + // `toState` should be `null`, `List[String]`, `Map[String, String]` or a function. + // + // - If it is `null`, the state will be replaced with the output of the module. + // - If it is a `List[String]`, the state will be updated with the values of the data at the given keys. + // - If it is a `Map[String, String]`, the state will be updated with the values of the data at the given keys, with the keys renamed according to the map. + // - If it is a function, a tuple (`[id, output, state]`) will be passed to the function, and the result will be used as the new state. + // + // Example: `{ id, output, state -> state + [counts: state.output] }` + // Default: `{ id, output, state -> output }` + toState: null, + + // Whether or not to print debug messages + // Default: `false` + debug: false +] + +// initialise default workflow +meta["workflow"] = workflowFactory([key: meta.config.name], meta.defaults, meta) + +// add workflow to environment +nextflow.script.ScriptMeta.current().addDefinition(meta.workflow) + +// anonymous workflow for running this module as a standalone +workflow { + // add id argument if it's not already in the config + // TODO: deep copy + def newConfig = deepClone(meta.config) + def newParams = deepClone(params) + + def argsContainsId = newConfig.allArguments.any{it.plainName == "id"} + if (!argsContainsId) { + def idArg = [ + 'name': '--id', + 'required': false, + 'type': 'string', + 'description': 'A unique id for every entry.', + 'multiple': false + ] + newConfig.arguments.add(0, idArg) + newConfig = processConfig(newConfig) + } + if (!newParams.containsKey("id")) { + newParams.id = "run" + } + + helpMessage(newConfig) + + channelFromParams(newParams, newConfig) + // make sure id is not in the state if id is not in the args + | map {id, state -> + if (!argsContainsId) { + [id, state.findAll{k, v -> k != "id"}] + } else { + [id, state] + } + } + | meta.workflow.run( + auto: [ publish: "state" ] + ) +} + +// END COMPONENT-SPECIFIC CODE diff --git a/target/nextflow/bgzip/nextflow.config b/target/nextflow/star/star_genome_generate/nextflow.config similarity index 97% rename from target/nextflow/bgzip/nextflow.config rename to target/nextflow/star/star_genome_generate/nextflow.config index 28497c31..fb480fdd 100644 --- a/target/nextflow/bgzip/nextflow.config +++ b/target/nextflow/star/star_genome_generate/nextflow.config @@ -1,9 +1,9 @@ manifest { - name = 'bgzip' + name = 'star/star_genome_generate' mainScript = 'main.nf' nextflowVersion = '!>=20.12.1-edge' - version = 'v0.1' - description = 'Block compression/decompression utility' + version = 'v0.1.0' + description = 'Create index for STAR\n' } process.container = 'nextflow/bash:latest' diff --git a/target/nextflow/star/star_genome_generate/nextflow_schema.json b/target/nextflow/star/star_genome_generate/nextflow_schema.json new file mode 100644 index 00000000..cef80fdf --- /dev/null +++ b/target/nextflow/star/star_genome_generate/nextflow_schema.json @@ -0,0 +1,245 @@ +{ +"$schema": "http://json-schema.org/draft-07/schema", +"title": "star_genome_generate", +"description": "Create index for STAR\n", +"type": "object", +"definitions": { + + + + "input" : { + "title": "Input", + "type": "object", + "description": "No description", + "properties": { + + + "genomeFastaFiles": { + "type": + "string", + "description": "Type: List of `file`, required, multiple_sep: `\";\"`. Path(s) to the fasta files with the genome sequences, separated by spaces", + "help_text": "Type: List of `file`, required, multiple_sep: `\";\"`. Path(s) to the fasta files with the genome sequences, separated by spaces. These files should be plain text FASTA files, they *cannot* be zipped.\n" + + } + + + , + "sjdbGTFfile": { + "type": + "string", + "description": "Type: `file`. Path to the GTF file with annotations", + "help_text": "Type: `file`. Path to the GTF file with annotations" + + } + + + , + "sjdbOverhang": { + "type": + "integer", + "description": "Type: `integer`, example: `100`. Length of the donor/acceptor sequence on each side of the junctions, ideally = (mate_length - 1)", + "help_text": "Type: `integer`, example: `100`. Length of the donor/acceptor sequence on each side of the junctions, ideally = (mate_length - 1)" + + } + + + , + "sjdbGTFchrPrefix": { + "type": + "string", + "description": "Type: `string`. Prefix for chromosome names in a GTF file (e", + "help_text": "Type: `string`. Prefix for chromosome names in a GTF file (e.g. \u0027chr\u0027 for using ENSMEBL annotations with UCSC genomes)" + + } + + + , + "sjdbGTFfeatureExon": { + "type": + "string", + "description": "Type: `string`, example: `exon`. Feature type in GTF file to be used as exons for building transcripts", + "help_text": "Type: `string`, example: `exon`. Feature type in GTF file to be used as exons for building transcripts" + + } + + + , + "sjdbGTFtagExonParentTranscript": { + "type": + "string", + "description": "Type: `string`, example: `transcript_id`. GTF attribute name for parent transcript ID (default \"transcript_id\" works for GTF files)", + "help_text": "Type: `string`, example: `transcript_id`. GTF attribute name for parent transcript ID (default \"transcript_id\" works for GTF files)" + + } + + + , + "sjdbGTFtagExonParentGene": { + "type": + "string", + "description": "Type: `string`, example: `gene_id`. GTF attribute name for parent gene ID (default \"gene_id\" works for GTF files)", + "help_text": "Type: `string`, example: `gene_id`. GTF attribute name for parent gene ID (default \"gene_id\" works for GTF files)" + + } + + + , + "sjdbGTFtagExonParentGeneName": { + "type": + "string", + "description": "Type: List of `string`, example: `gene_name`, multiple_sep: `\";\"`. GTF attribute name for parent gene name", + "help_text": "Type: List of `string`, example: `gene_name`, multiple_sep: `\";\"`. GTF attribute name for parent gene name" + + } + + + , + "sjdbGTFtagExonParentGeneType": { + "type": + "string", + "description": "Type: List of `string`, example: `gene_type;gene_biotype`, multiple_sep: `\";\"`. GTF attribute name for parent gene type", + "help_text": "Type: List of `string`, example: `gene_type;gene_biotype`, multiple_sep: `\";\"`. GTF attribute name for parent gene type" + + } + + + , + "limitGenomeGenerateRAM": { + "type": + "string", + "description": "Type: `long`, example: `31000000000`. Maximum available RAM (bytes) for genome generation", + "help_text": "Type: `long`, example: `31000000000`. Maximum available RAM (bytes) for genome generation" + + } + + + , + "genomeSAindexNbases": { + "type": + "integer", + "description": "Type: `integer`, example: `14`. Length (bases) of the SA pre-indexing string", + "help_text": "Type: `integer`, example: `14`. Length (bases) of the SA pre-indexing string. Typically between 10 and 15. Longer strings will use much more memory, but allow faster searches. For small genomes, this parameter must be scaled down to min(14, log2(GenomeLength)/2 - 1)." + + } + + + , + "genomeChrBinNbits": { + "type": + "integer", + "description": "Type: `integer`, example: `18`. Defined as log2(chrBin), where chrBin is the size of the bins for genome storage", + "help_text": "Type: `integer`, example: `18`. Defined as log2(chrBin), where chrBin is the size of the bins for genome storage. Each chromosome will occupy an integer number of bins. For a genome with large number of contigs, it is recommended to scale this parameter as min(18, log2[max(GenomeLength/NumberOfReferences,ReadLength)])." + + } + + + , + "genomeSAsparseD": { + "type": + "integer", + "description": "Type: `integer`, example: `1`. Suffux array sparsity, i", + "help_text": "Type: `integer`, example: `1`. Suffux array sparsity, i.e. distance between indices. Use bigger numbers to decrease needed RAM at the cost of mapping speed reduction." + + } + + + , + "genomeSuffixLengthMax": { + "type": + "integer", + "description": "Type: `integer`, example: `-1`. Maximum length of the suffixes, has to be longer than read length", + "help_text": "Type: `integer`, example: `-1`. Maximum length of the suffixes, has to be longer than read length. Use -1 for infinite length." + + } + + + , + "genomeTransformType": { + "type": + "string", + "description": "Type: `string`, example: `None`. Type of genome transformation\n None ", + "help_text": "Type: `string`, example: `None`. Type of genome transformation\n None ... no transformation\n Haploid ... replace reference alleles with alternative alleles from VCF file (e.g. consensus allele)\n Diploid ... create two haplotypes for each chromosome listed in VCF file, for genotypes 1|2, assumes perfect phasing (e.g. personal genome)\n" + + } + + + , + "genomeTransformVCF": { + "type": + "string", + "description": "Type: `file`. path to VCF file for genome transformation", + "help_text": "Type: `file`. path to VCF file for genome transformation" + + } + + +} +}, + + + "output" : { + "title": "Output", + "type": "object", + "description": "No description", + "properties": { + + + "index": { + "type": + "string", + "description": "Type: `file`, required, default: `$id.$key.index.index`. STAR index directory", + "help_text": "Type: `file`, required, default: `$id.$key.index.index`. STAR index directory." + , + "default": "$id.$key.index.index" + } + + +} +}, + + + "nextflow input-output arguments" : { + "title": "Nextflow input-output arguments", + "type": "object", + "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.", + "properties": { + + + "publish_dir": { + "type": + "string", + "description": "Type: `string`, required, example: `output/`. Path to an output directory", + "help_text": "Type: `string`, required, example: `output/`. Path to an output directory." + + } + + + , + "param_list": { + "type": + "string", + "description": "Type: `string`, example: `my_params.yaml`. Allows inputting multiple parameter sets to initialise a Nextflow channel", + "help_text": "Type: `string`, example: `my_params.yaml`. Allows inputting multiple parameter sets to initialise a Nextflow channel. A `param_list` can either be a list of maps, a csv file, a json file, a yaml file, or simply a yaml blob.\n\n* A list of maps (as-is) where the keys of each map corresponds to the arguments of the pipeline. Example: in a `nextflow.config` file: `param_list: [ [\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027], [\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027] ]`.\n* A csv file should have column names which correspond to the different arguments of this pipeline. Example: `--param_list data.csv` with columns `id,input`.\n* A json or a yaml file should be a list of maps, each of which has keys corresponding to the arguments of the pipeline. Example: `--param_list data.json` with contents `[ {\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027}, {\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027} ]`.\n* A yaml blob can also be passed directly as a string. Example: `--param_list \"[ {\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027}, {\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027} ]\"`.\n\nWhen passing a csv, json or yaml file, relative path names are relativized to the location of the parameter file. No relativation is performed when `param_list` is a list of maps (as-is) or a yaml blob.", + "hidden": true + + } + + +} +} +}, +"allOf": [ + + { + "$ref": "#/definitions/input" + }, + + { + "$ref": "#/definitions/output" + }, + + { + "$ref": "#/definitions/nextflow input-output arguments" + } +] +}