From 508761e05c04c47e7b3557c8b654032e69d212d3 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Tue, 8 Dec 2020 12:57:00 +0100 Subject: [PATCH 01/25] Added bowtie index and align modules --- software/bowtie/align/functions.nf | 59 ++++++++++++++++++++++++++++++ software/bowtie/align/main.nf | 40 ++++++++++++++++++++ software/bowtie/align/meta.yml | 0 software/bowtie/index/functions.nf | 59 ++++++++++++++++++++++++++++++ software/bowtie/index/main.nf | 32 ++++++++++++++++ software/bowtie/index/meta.yml | 0 6 files changed, 190 insertions(+) create mode 100644 software/bowtie/align/functions.nf create mode 100644 software/bowtie/align/main.nf create mode 100644 software/bowtie/align/meta.yml create mode 100644 software/bowtie/index/functions.nf create mode 100644 software/bowtie/index/main.nf create mode 100644 software/bowtie/index/meta.yml diff --git a/software/bowtie/align/functions.nf b/software/bowtie/align/functions.nf new file mode 100644 index 00000000..b3ac3801 --- /dev/null +++ b/software/bowtie/align/functions.nf @@ -0,0 +1,59 @@ +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf new file mode 100644 index 00000000..18ee4705 --- /dev/null +++ b/software/bowtie/align/main.nf @@ -0,0 +1,40 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process BOWTIE_ALIGN { + tag "$meta.id" + label 'process_high' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + + conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null) + container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1" + + input: + tuple val(meta), path(reads) + path index + path gtf + + output: + tuple val(meta), path("*.sam") , emit: sam + tuple val(meta), path("*.out") , emit: log + path "bowtie.version.txt" , emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + index_array = index.collect() + index = index_array[0].baseName - ~/.\d$/ + """ + bowtie $options.args \\ + --threads $task.cpus \\ + ${index} \\ + -q ${reads} \\ + --un ${prefix}.unAl > ${prefix}.sam 2> ${prefix}.out + bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt + """ +} \ No newline at end of file diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml new file mode 100644 index 00000000..e69de29b diff --git a/software/bowtie/index/functions.nf b/software/bowtie/index/functions.nf new file mode 100644 index 00000000..b3ac3801 --- /dev/null +++ b/software/bowtie/index/functions.nf @@ -0,0 +1,59 @@ +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf new file mode 100644 index 00000000..36f88451 --- /dev/null +++ b/software/bowtie/index/main.nf @@ -0,0 +1,32 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process BOWTIE_INDEX { + tag "$fasta" + label 'process_high' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } + + conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null) + container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1" + + + input: + path fasta + path gtf + + output: + path "*.index*" , emit: index + path "*.version.txt" , emit: version + + script: + def software = getSoftwareName(task.process) + """ + bowtie-build --threads $task.cpus ${fasta} ${fasta.baseName}.index + bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt + """ +} \ No newline at end of file diff --git a/software/bowtie/index/meta.yml b/software/bowtie/index/meta.yml new file mode 100644 index 00000000..e69de29b From 9d67da2b2ccbbc2fb44daa23421022e6a38ea45c Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Tue, 8 Dec 2020 13:40:32 +0100 Subject: [PATCH 02/25] added module yml files --- software/bowtie/align/main.nf | 1 - software/bowtie/align/meta.yml | 57 ++++++++++++++++++++++++++++++++++ software/bowtie/index/main.nf | 1 - software/bowtie/index/meta.yml | 46 +++++++++++++++++++++++++++ tests/software/bowtie/main.nf | 26 ++++++++++++++++ tests/software/bowtie/test.yml | 32 +++++++++++++++++++ 6 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 tests/software/bowtie/main.nf create mode 100644 tests/software/bowtie/test.yml diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 18ee4705..3885ecbe 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -17,7 +17,6 @@ process BOWTIE_ALIGN { input: tuple val(meta), path(reads) path index - path gtf output: tuple val(meta), path("*.sam") , emit: sam diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index e69de29b..5b604289 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -0,0 +1,57 @@ +name: bowtie_align +description: Align reads to a reference genome using bowtie +keywords: + - align + - fasta + - genome + - reference +tools: + - bowtie: + description: | + bowtie is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bowtie-bio.sourceforge.net/index.shtml + documentation: http://bowtie-bio.sourceforge.net/manual.shtml + arxiv: arXiv:1303.3997 +params: + - outdir: + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` + - publish_dir_mode: + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. + - enable_conda: + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - index: + type: file + description: Bowtie genome index files + pattern: "*.ebwt" +output: + - index: + type: file + description: Bowtie genome index files + pattern: "*.ebwt" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@kevinmenden" diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index 36f88451..553651d5 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -17,7 +17,6 @@ process BOWTIE_INDEX { input: path fasta - path gtf output: path "*.index*" , emit: index diff --git a/software/bowtie/index/meta.yml b/software/bowtie/index/meta.yml index e69de29b..0a8c23f7 100644 --- a/software/bowtie/index/meta.yml +++ b/software/bowtie/index/meta.yml @@ -0,0 +1,46 @@ +name: bowtie_index +description: Create bowtie index for reference genome +keywords: + - index + - fasta + - genome + - reference +tools: + - bowtie: + description: | + bowtie is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bowtie-bio.sourceforge.net/index.shtml + documentation: http://bowtie-bio.sourceforge.net/manual.shtml + arxiv: arXiv:1303.3997 +params: + - outdir: + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` + - publish_dir_mode: + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. + - enable_conda: + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive +input: + - fasta: + type: file + description: Input genome fasta file +output: + - index: + type: file + description: Bowtie genome index files + pattern: "*.ebwt" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@kevinmenden" diff --git a/tests/software/bowtie/main.nf b/tests/software/bowtie/main.nf new file mode 100644 index 00000000..1f6a54ff --- /dev/null +++ b/tests/software/bowtie/main.nf @@ -0,0 +1,26 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BOWTIE_INDEX } from '../../../software/bowtie/index/main.nf' addParams( options: [:] ) +include { BOWTIE_ALIGN } from '../../../software/bowtie/align/main.nf' addParams( options: [:] ) + + + +workflow test_bowtie_index { + fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + BOWTIE_INDEX ( fasta ) +} + +workflow test_bowtie_alignment_single_end { + + fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + BOWTIE_INDEX ( fasta ) +} + + def input = [] + input = [ [ id:'test', single_end:true ], // meta map + [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] + BOWTIE_ALIGN ( input, BOWTIE_INDEX.index ) +} + diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml new file mode 100644 index 00000000..f1bd09fd --- /dev/null +++ b/tests/software/bowtie/test.yml @@ -0,0 +1,32 @@ +- name: Run bowtie index + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_index -c tests/config/nextflow.config + tags: + - bwa + - bwa_index + files: + - path: output/bwa/NC_010473.fa.amb + md5sum: 942a990ae872f1c0b8d72dda2db405d5 + - path: output/bwa/NC_010473.fa.bwt + md5sum: 7301b52e2ecb893d429a49fa692447ae + - path: output/bwa/NC_010473.fa.pac + md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad + - path: output/bwa/NC_010473.fa.sa + md5sum: a47dcc92e750e2f16fbd979b8ff9538e + +- name: Run bwa mem single-end + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_single_end -c tests/config/nextflow.config + tags: + - bwa + - bwa_mem + files: + - path: output/test_single_end/test.bam + md5sum: 3ee21210bac387e0335008146e4728bc + +- name: Run bwa mem paired-end + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_paired_end -c tests/config/nextflow.config + tags: + - bwa + - bwa_mem + files: + - path: output/test_paired_end/test.bam + md5sum: 510d8acc6448c07cdacce8e64ec0904c From 6660a597a3b19ee0f0e7fbe32540b4d77e60b034 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Tue, 8 Dec 2020 13:59:14 +0100 Subject: [PATCH 03/25] added tests for bowtie module --- tests/software/bowtie/main.nf | 3 +- tests/software/bowtie/test.yml | 60 ++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/tests/software/bowtie/main.nf b/tests/software/bowtie/main.nf index 1f6a54ff..8a64cd34 100644 --- a/tests/software/bowtie/main.nf +++ b/tests/software/bowtie/main.nf @@ -16,11 +16,10 @@ workflow test_bowtie_alignment_single_end { fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) BOWTIE_INDEX ( fasta ) -} def input = [] input = [ [ id:'test', single_end:true ], // meta map [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] - BOWTIE_ALIGN ( input, BOWTIE_INDEX.index ) + BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index ) } diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index f1bd09fd..13b7b1fd 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -1,32 +1,42 @@ - name: Run bowtie index - command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_index -c tests/config/nextflow.config + command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_index -c tests/config/nextflow.config tags: - - bwa - - bwa_index + - bowtie + - bowtie_index files: - - path: output/bwa/NC_010473.fa.amb - md5sum: 942a990ae872f1c0b8d72dda2db405d5 - - path: output/bwa/NC_010473.fa.bwt - md5sum: 7301b52e2ecb893d429a49fa692447ae - - path: output/bwa/NC_010473.fa.pac - md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad - - path: output/bwa/NC_010473.fa.sa - md5sum: a47dcc92e750e2f16fbd979b8ff9538e + - path: output/bowtie/NC_010473.index.1.ebwt + md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c + - path: output/bowtie/NC_010473.index.2.ebwt + md5sum: bfd10c5319c6a0dbc540fd789254a5dd + - path: output/bowtie/NC_010473.index.3.ebwt + md5sum: cd201e81724f3099131aec16ef2cc53b + - path: output/bowtie/NC_010473.index.4.ebwt + md5sum: bbb9d6d21ad765d135f95290204e8433 + - path: output/bowtie/NC_010473.index.rev.1.ebwt + md5sum: 44f719c2fe42e1f35d54e798775846d1 + - path: output/bowtie/NC_010473.index.rev.2.ebwt + md5sum: f3c398bba5158f4039334a932d79c051 -- name: Run bwa mem single-end - command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_single_end -c tests/config/nextflow.config +- name: Run bowtie index and align signle-end + command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_alignment_single_end -c tests/config/nextflow.config tags: - - bwa - - bwa_mem + - bowtie + - bwa_align files: - - path: output/test_single_end/test.bam - md5sum: 3ee21210bac387e0335008146e4728bc + - path: output/bowtie/NC_010473.index.1.ebwt + md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c + - path: output/bowtie/NC_010473.index.2.ebwt + md5sum: bfd10c5319c6a0dbc540fd789254a5dd + - path: output/bowtie/NC_010473.index.3.ebwt + md5sum: cd201e81724f3099131aec16ef2cc53b + - path: output/bowtie/NC_010473.index.4.ebwt + md5sum: bbb9d6d21ad765d135f95290204e8433 + - path: output/bowtie/NC_010473.index.rev.1.ebwt + md5sum: 44f719c2fe42e1f35d54e798775846d1 + - path: output/bowtie/NC_010473.index.rev.2.ebwt + md5sum: f3c398bba5158f4039334a932d79c051 + - path: output/bowtie/test.out + md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe + - path: output/bowtie/test.sam + md5sum: acdb36ea915ac2ac71b69a0b704d9d8a -- name: Run bwa mem paired-end - command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_paired_end -c tests/config/nextflow.config - tags: - - bwa - - bwa_mem - files: - - path: output/test_paired_end/test.bam - md5sum: 510d8acc6448c07cdacce8e64ec0904c From 73530e8df73af05d91b463bfb0863a4673e438be Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Tue, 8 Dec 2020 14:13:30 +0100 Subject: [PATCH 04/25] added bowtie index test github workflow --- .github/workflows/bowtie_index.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/bowtie_index.yml diff --git a/.github/workflows/bowtie_index.yml b/.github/workflows/bowtie_index.yml new file mode 100644 index 00000000..80ff13c9 --- /dev/null +++ b/.github/workflows/bowtie_index.yml @@ -0,0 +1,36 @@ +name: bowtie_index +on: + push: + paths: + - software/bowtie/index/** + - .github/workflows/bowtie_index.yml + - tests/software/bowtie/** + pull_request: + paths: + - software/bowtie/index/** + - .github/workflows/bowtie_index.yml + - tests/software/bowtie/** + +jobs: + ci_test: + runs-on: ubuntu-latest + env: + NXF_ANSI_LOG: false + steps: + - uses: actions/checkout@v2 + + - name: Install Nextflow + run: | + export NXF_VER="20.07.1" + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip pytest-workflow + + # Test the module + - run: pytest --tag bowtie_index --symlink --wt 2 From fee0707af1d3450780aa33f9d730f8f949fae10a Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Tue, 8 Dec 2020 14:19:34 +0100 Subject: [PATCH 05/25] added bowtie_align workflow test --- .github/workflows/bowtie_align.yml | 38 ++++++++++++++++++++++++++++++ tests/software/bowtie/test.yml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/bowtie_align.yml diff --git a/.github/workflows/bowtie_align.yml b/.github/workflows/bowtie_align.yml new file mode 100644 index 00000000..796b3389 --- /dev/null +++ b/.github/workflows/bowtie_align.yml @@ -0,0 +1,38 @@ +name: bowtie_align +on: + push: + paths: + - software/bowtie/align/** + - software/bowtie/index/** + - .github/workflows/bowtie_align.yml + - tests/software/bowtie/** + pull_request: + paths: + - software/bowtie/align/** + - software/bowtie/index/** + - .github/workflows/bowtie_align.yml + - tests/software/bowtie/** + +jobs: + ci_test: + runs-on: ubuntu-latest + env: + NXF_ANSI_LOG: false + steps: + - uses: actions/checkout@v2 + + - name: Install Nextflow + run: | + export NXF_VER="20.07.1" + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip pytest-workflow + + # Test the module + - run: pytest --tag bowtie_align --symlink --wt 2 diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index 13b7b1fd..fb58b089 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -21,7 +21,7 @@ command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_alignment_single_end -c tests/config/nextflow.config tags: - bowtie - - bwa_align + - bowtie_align files: - path: output/bowtie/NC_010473.index.1.ebwt md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c From 560a6a578ba0b06521b05bcb8478a0b71f55c88b Mon Sep 17 00:00:00 2001 From: Kevin Menden Date: Wed, 9 Dec 2020 15:45:05 +0100 Subject: [PATCH 06/25] Apply suggestions from code review Co-authored-by: Harshil Patel --- software/bowtie/align/main.nf | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 3885ecbe..d2a00831 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -19,21 +19,24 @@ process BOWTIE_ALIGN { path index output: - tuple val(meta), path("*.sam") , emit: sam - tuple val(meta), path("*.out") , emit: log + tuple val(meta), path("*.sam"), emit: sam + tuple val(meta), path("*.out"), emit: log path "bowtie.version.txt" , emit: version script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - index_array = index.collect() - index = index_array[0].baseName - ~/.\d$/ + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : '' """ - bowtie $options.args \\ - --threads $task.cpus \\ - ${index} \\ - -q ${reads} \\ - --un ${prefix}.unAl > ${prefix}.sam 2> ${prefix}.out + INDEX=`find -L ./ -name "*.1.ebwt" | sed 's/.1.ebwt//'` + bowtie \\ + --threads $task.cpus \\ + $options.args \\ + $INDEX \\ + -q ${reads} \\ + $unaligned \\ + > ${prefix}.sam 2> ${prefix}.out + bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt """ -} \ No newline at end of file +} From cc72028d3de786900f711a6749c6f21027314ffb Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Wed, 9 Dec 2020 15:58:56 +0100 Subject: [PATCH 07/25] output index as directory --- software/bowtie/align/main.nf | 2 +- software/bowtie/align/meta.yml | 9 ++++++--- software/bowtie/index/main.nf | 7 ++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index d2a00831..30e5a55a 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -21,7 +21,7 @@ process BOWTIE_ALIGN { output: tuple val(meta), path("*.sam"), emit: sam tuple val(meta), path("*.out"), emit: log - path "bowtie.version.txt" , emit: version + path "bowtie.version.txt", emit: version script: def software = getSoftwareName(task.process) diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index 5b604289..fc18a2c9 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -29,6 +29,9 @@ params: description: | Run the module with Conda using the software specified via the `conda` directive + - save_unaligned: + type: boolean + description: Save unaligned reads input: - meta: type: map @@ -45,10 +48,10 @@ input: description: Bowtie genome index files pattern: "*.ebwt" output: - - index: + - sam: type: file - description: Bowtie genome index files - pattern: "*.ebwt" + description: Output SAM file containing read alignments + pattern: "*.{sam}" - version: type: file description: File containing software version diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index 553651d5..5a0e18e5 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -19,13 +19,14 @@ process BOWTIE_INDEX { path fasta output: - path "*.index*" , emit: index - path "*.version.txt" , emit: version + path "bowtie", emit: index + path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) """ - bowtie-build --threads $task.cpus ${fasta} ${fasta.baseName}.index + mkdir bowtie + bowtie-build --threads $task.cpus ${fasta} bowtie/${fasta.baseName}.index bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt """ } \ No newline at end of file From 42020ce5ac45c30603e926a33cd9d4ace725e842 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Wed, 9 Dec 2020 16:39:05 +0100 Subject: [PATCH 08/25] added tests for bowtie paired-end alignment; resolved index bug --- software/bowtie/align/main.nf | 6 +++--- tests/software/bowtie/main.nf | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 30e5a55a..c35508d2 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -28,13 +28,13 @@ process BOWTIE_ALIGN { def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : '' """ - INDEX=`find -L ./ -name "*.1.ebwt" | sed 's/.1.ebwt//'` + INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'` bowtie \\ --threads $task.cpus \\ $options.args \\ - $INDEX \\ + \$INDEX \\ -q ${reads} \\ - $unaligned \\ + $unaligned \\ > ${prefix}.sam 2> ${prefix}.out bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt diff --git a/tests/software/bowtie/main.nf b/tests/software/bowtie/main.nf index 8a64cd34..b5668bd1 100644 --- a/tests/software/bowtie/main.nf +++ b/tests/software/bowtie/main.nf @@ -23,3 +23,14 @@ workflow test_bowtie_alignment_single_end { BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index ) } +workflow test_bowtie_alignment_paired_end { + fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + BOWTIE_INDEX ( fasta ) + + def input = [] + input = [ [ id:'test', single_end:false ], // meta map + [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] + BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index ) +} + From 0d7c8276b73fb07be1dde82ac115f5769687b7ca Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Wed, 9 Dec 2020 16:54:11 +0100 Subject: [PATCH 09/25] added test yml and md5s --- tests/software/bowtie/test.yml | 48 +++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index fb58b089..02ec5e50 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -4,17 +4,17 @@ - bowtie - bowtie_index files: - - path: output/bowtie/NC_010473.index.1.ebwt + - path: output/bowtie/bowtie/NC_010473.index.1.ebwt md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c - - path: output/bowtie/NC_010473.index.2.ebwt + - path: output/bowtie/bowtie/NC_010473.index.2.ebwt md5sum: bfd10c5319c6a0dbc540fd789254a5dd - - path: output/bowtie/NC_010473.index.3.ebwt + - path: output/bowtie/bowtie/NC_010473.index.3.ebwt md5sum: cd201e81724f3099131aec16ef2cc53b - - path: output/bowtie/NC_010473.index.4.ebwt + - path: output/bowtie/bowtie/NC_010473.index.4.ebwt md5sum: bbb9d6d21ad765d135f95290204e8433 - - path: output/bowtie/NC_010473.index.rev.1.ebwt + - path: output/bowtie/bowtie/NC_010473.index.rev.1.ebwt md5sum: 44f719c2fe42e1f35d54e798775846d1 - - path: output/bowtie/NC_010473.index.rev.2.ebwt + - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - name: Run bowtie index and align signle-end @@ -23,20 +23,44 @@ - bowtie - bowtie_align files: - - path: output/bowtie/NC_010473.index.1.ebwt + - path: output/bowtie/bowtie/NC_010473.index.1.ebwt md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c - - path: output/bowtie/NC_010473.index.2.ebwt + - path: output/bowtie/bowtie/NC_010473.index.2.ebwt md5sum: bfd10c5319c6a0dbc540fd789254a5dd - - path: output/bowtie/NC_010473.index.3.ebwt + - path: output/bowtie/bowtie/NC_010473.index.3.ebwt md5sum: cd201e81724f3099131aec16ef2cc53b - - path: output/bowtie/NC_010473.index.4.ebwt + - path: output/bowtie/bowtie/NC_010473.index.4.ebwt md5sum: bbb9d6d21ad765d135f95290204e8433 - - path: output/bowtie/NC_010473.index.rev.1.ebwt + - path: output/bowtie/bowtie/NC_010473.index.rev.1.ebwt md5sum: 44f719c2fe42e1f35d54e798775846d1 - - path: output/bowtie/NC_010473.index.rev.2.ebwt + - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - path: output/bowtie/test.out md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe - path: output/bowtie/test.sam md5sum: acdb36ea915ac2ac71b69a0b704d9d8a + +- name: Run bowtie index and align paired_end + command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_alignment_paired_end -c tests/config/nextflow.config + tags: + - bowtie + - bowtie_align + files: + - path: output/bowtie/bowtie/NC_010473.index.1.ebwt + md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c + - path: output/bowtie/bowtie/NC_010473.index.2.ebwt + md5sum: bfd10c5319c6a0dbc540fd789254a5dd + - path: output/bowtie/bowtie/NC_010473.index.3.ebwt + md5sum: cd201e81724f3099131aec16ef2cc53b + - path: output/bowtie/bowtie/NC_010473.index.4.ebwt + md5sum: bbb9d6d21ad765d135f95290204e8433 + - path: output/bowtie/bowtie/NC_010473.index.rev.1.ebwt + md5sum: 44f719c2fe42e1f35d54e798775846d1 + - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt + md5sum: f3c398bba5158f4039334a932d79c051 + - path: output/bowtie/test.out + md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe + - path: output/bowtie/test.sam + md5sum: d41d8cd98f00b204e9800998ecf8427e + From f35850bf14f312a14f1edc60d9cb861b09527b83 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Wed, 16 Dec 2020 11:02:58 +0100 Subject: [PATCH 10/25] bowtie bam output --- software/bowtie/align/main.nf | 18 +++++++++++------- tests/software/bowtie/main.nf | 8 +++----- tests/software/bowtie/test.yml | 12 ++++++------ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index c35508d2..6a7ea8d8 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -11,15 +11,15 @@ process BOWTIE_ALIGN { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null) - container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1" + conda (params.enable_conda ? "bioconda::bowtie=1.3.0 bioconda::samtools=1.10" : null) + container "quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0" input: tuple val(meta), path(reads) path index output: - tuple val(meta), path("*.sam"), emit: sam + tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.out"), emit: log path "bowtie.version.txt", emit: version @@ -27,15 +27,19 @@ process BOWTIE_ALIGN { def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : '' + def endedness = meta.single_end ? "$reads" : "-1 ${reads[0]} -2 ${reads[1]}" """ INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'` bowtie \\ --threads $task.cpus \\ - $options.args \\ - \$INDEX \\ - -q ${reads} \\ + --sam \\ + -x \$INDEX \\ + -q \\ $unaligned \\ - > ${prefix}.sam 2> ${prefix}.out + $options.args \\ + $endedness \\ + 2> ${prefix}.out \\ + | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt """ diff --git a/tests/software/bowtie/main.nf b/tests/software/bowtie/main.nf index b5668bd1..6b4e24e6 100644 --- a/tests/software/bowtie/main.nf +++ b/tests/software/bowtie/main.nf @@ -5,8 +5,6 @@ nextflow.enable.dsl = 2 include { BOWTIE_INDEX } from '../../../software/bowtie/index/main.nf' addParams( options: [:] ) include { BOWTIE_ALIGN } from '../../../software/bowtie/align/main.nf' addParams( options: [:] ) - - workflow test_bowtie_index { fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) BOWTIE_INDEX ( fasta ) @@ -19,7 +17,7 @@ workflow test_bowtie_alignment_single_end { def input = [] input = [ [ id:'test', single_end:true ], // meta map - [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] + [ file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true) ] ] BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index ) } @@ -29,8 +27,8 @@ workflow test_bowtie_alignment_paired_end { def input = [] input = [ [ id:'test', single_end:false ], // meta map - [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), - file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] + [ file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R2.fastq.gz", checkIfExists: true) ] ] BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index ) } diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index 02ec5e50..6a28578d 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -36,9 +36,9 @@ - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - path: output/bowtie/test.out - md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe - - path: output/bowtie/test.sam - md5sum: acdb36ea915ac2ac71b69a0b704d9d8a + md5sum: a81cb18024616415a6cec3108a36fccd + - path: output/bowtie/test.bam + md5sum: 8179c68a819accbc9137dc881736106f - name: Run bowtie index and align paired_end @@ -60,7 +60,7 @@ - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - path: output/bowtie/test.out - md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe - - path: output/bowtie/test.sam - md5sum: d41d8cd98f00b204e9800998ecf8427e + md5sum: a23e9a2a76e949aeb3693bcfae41a615 + - path: output/bowtie/test.bam + md5sum: 9ce5aebf37128f4bb1d24e9548e22009 From d75cb751119dce05534ae7c8321e7eeec98f5e05 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Thu, 17 Dec 2020 07:33:44 +0100 Subject: [PATCH 11/25] added singularity; edge NXF version --- .github/workflows/bowtie_align.yml | 10 +++++++--- .github/workflows/bowtie_index.yml | 11 ++++++++--- software/bowtie/align/main.nf | 8 ++++++-- software/bowtie/align/meta.yml | 5 +++++ software/bowtie/index/main.nf | 9 ++++++--- software/bowtie/index/meta.yml | 5 +++++ 6 files changed, 37 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bowtie_align.yml b/.github/workflows/bowtie_align.yml index 796b3389..e3b645c8 100644 --- a/.github/workflows/bowtie_align.yml +++ b/.github/workflows/bowtie_align.yml @@ -16,16 +16,20 @@ on: jobs: ci_test: runs-on: ubuntu-latest + strategy: + matrix: + nxf_version: [20.11.0-edge] env: NXF_ANSI_LOG: false steps: - uses: actions/checkout@v2 - name: Install Nextflow + env: + NXF_VER: ${{ matrix.nxf_version }} run: | - export NXF_VER="20.07.1" - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ - name: Set up Python uses: actions/setup-python@v2 diff --git a/.github/workflows/bowtie_index.yml b/.github/workflows/bowtie_index.yml index 80ff13c9..9f5aa8ac 100644 --- a/.github/workflows/bowtie_index.yml +++ b/.github/workflows/bowtie_index.yml @@ -14,16 +14,21 @@ on: jobs: ci_test: runs-on: ubuntu-latest + strategy: + matrix: + nxf_version: [20.11.0-edge] env: NXF_ANSI_LOG: false steps: - uses: actions/checkout@v2 - name: Install Nextflow + env: + NXF_VER: ${{ matrix.nxf_version }} run: | - export NXF_VER="20.07.1" - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + - name: Set up Python uses: actions/setup-python@v2 diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 6a7ea8d8..58906d61 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -11,8 +11,12 @@ process BOWTIE_ALIGN { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bowtie=1.3.0 bioconda::samtools=1.10" : null) - container "quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0" + conda (params.enable_conda ? "bioconda::bowtie=1.3.0 bioconda::samtools=1.10" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0" + } else { + container "quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0" + } input: tuple val(meta), path(reads) diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index fc18a2c9..633ef56a 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -29,6 +29,11 @@ params: description: | Run the module with Conda using the software specified via the `conda` directive + - singularity_pull_docker_container: + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. - save_unaligned: type: boolean description: Save unaligned reads diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index 5a0e18e5..1a3801b6 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -11,9 +11,12 @@ process BOWTIE_INDEX { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null) - container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1" - + conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bowtie:1.3.0--py38hed8969a_1" + } else { + container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1" + } input: path fasta diff --git a/software/bowtie/index/meta.yml b/software/bowtie/index/meta.yml index 0a8c23f7..db781a0a 100644 --- a/software/bowtie/index/meta.yml +++ b/software/bowtie/index/meta.yml @@ -29,6 +29,11 @@ params: description: | Run the module with Conda using the software specified via the `conda` directive + - singularity_pull_docker_container: + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. input: - fasta: type: file From 8d3fc30eb3d6d649f376f886c6f835186e06663e Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Thu, 17 Dec 2020 07:39:34 +0100 Subject: [PATCH 12/25] fixed yml formatting --- .github/workflows/bowtie_align.yml | 6 +-- .github/workflows/bowtie_index.yml | 67 +++++++++++++++--------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/.github/workflows/bowtie_align.yml b/.github/workflows/bowtie_align.yml index e3b645c8..8b9a19fe 100644 --- a/.github/workflows/bowtie_align.yml +++ b/.github/workflows/bowtie_align.yml @@ -26,10 +26,10 @@ jobs: - name: Install Nextflow env: - NXF_VER: ${{ matrix.nxf_version }} + NXF_VER: ${{ matrix.nxf_version }} run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ - name: Set up Python uses: actions/setup-python@v2 diff --git a/.github/workflows/bowtie_index.yml b/.github/workflows/bowtie_index.yml index 9f5aa8ac..291d04f5 100644 --- a/.github/workflows/bowtie_index.yml +++ b/.github/workflows/bowtie_index.yml @@ -1,41 +1,40 @@ name: bowtie_index on: - push: - paths: - - software/bowtie/index/** - - .github/workflows/bowtie_index.yml - - tests/software/bowtie/** - pull_request: - paths: - - software/bowtie/index/** - - .github/workflows/bowtie_index.yml - - tests/software/bowtie/** + push: + paths: + - software/bowtie/index/** + - .github/workflows/bowtie_index.yml + - tests/software/bowtie/** + pull_request: + paths: + - software/bowtie/index/** + - .github/workflows/bowtie_index.yml + - tests/software/bowtie/** jobs: - ci_test: - runs-on: ubuntu-latest - strategy: - matrix: - nxf_version: [20.11.0-edge] + ci_test: + runs-on: ubuntu-latest + strategy: + matrix: + nxf_version: [20.11.0-edge] + env: + NXF_ANSI_LOG: false + steps: + - uses: actions/checkout@v2 + + - name: Install Nextflow env: - NXF_ANSI_LOG: false - steps: - - uses: actions/checkout@v2 + NXF_VER: ${{ matrix.nxf_version }} + run: | + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ - - name: Install Nextflow - env: - NXF_VER: ${{ matrix.nxf_version }} - run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip pytest-workflow - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Install dependencies - run: python -m pip install --upgrade pip pytest-workflow - - # Test the module - - run: pytest --tag bowtie_index --symlink --wt 2 + # Test the module + - run: pytest --tag bowtie_index --symlink --wt 2 From 57ab6dbcbf6e891c08133130c337cade188aefd8 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Thu, 17 Dec 2020 10:24:48 +0100 Subject: [PATCH 13/25] groovy formatting --- software/bowtie/align/main.nf | 18 +++++++++--------- software/bowtie/index/main.nf | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 58906d61..4271d33a 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -11,21 +11,21 @@ process BOWTIE_ALIGN { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bowtie=1.3.0 bioconda::samtools=1.10" : null) + conda (params.enable_conda ? 'bioconda::bowtie=1.3.0 bioconda::samtools=1.10' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0" + container 'https://depot.galaxyproject.org/singularity/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0' } else { - container "quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0" + container 'quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0' } input: tuple val(meta), path(reads) path index - + output: - tuple val(meta), path("*.bam"), emit: bam - tuple val(meta), path("*.out"), emit: log - path "bowtie.version.txt", emit: version + tuple val(meta), path('*.bam'), emit: bam + tuple val(meta), path('*.out'), emit: log + path 'bowtie.version.txt', emit: version script: def software = getSoftwareName(task.process) @@ -39,10 +39,10 @@ process BOWTIE_ALIGN { --sam \\ -x \$INDEX \\ -q \\ - $unaligned \\ + $unaligned \\ $options.args \\ $endedness \\ - 2> ${prefix}.out \\ + 2> ${prefix}.out \\ | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index 1a3801b6..38f1c289 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -11,19 +11,19 @@ process BOWTIE_INDEX { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null) + conda (params.enable_conda ? 'bioconda::bowtie=1.3.0' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bowtie:1.3.0--py38hed8969a_1" + container 'https://depot.galaxyproject.org/singularity/bowtie:1.3.0--py38hed8969a_1' } else { - container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1" + container 'quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1' } input: path fasta output: - path "bowtie", emit: index - path "*.version.txt", emit: version + path 'bowtie', emit: index + path '*.version.txt', emit: version script: def software = getSoftwareName(task.process) @@ -32,4 +32,4 @@ process BOWTIE_INDEX { bowtie-build --threads $task.cpus ${fasta} bowtie/${fasta.baseName}.index bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt """ -} \ No newline at end of file +} From 41329b89820c92c63bdf1212e4df3935137aac05 Mon Sep 17 00:00:00 2001 From: Kevin Menden Date: Fri, 18 Dec 2020 08:16:18 +0100 Subject: [PATCH 14/25] Apply suggestions from code review Co-authored-by: Harshil Patel --- software/bowtie/align/main.nf | 4 ++-- software/bowtie/index/main.nf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 4271d33a..03bfd6e7 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -25,7 +25,7 @@ process BOWTIE_ALIGN { output: tuple val(meta), path('*.bam'), emit: bam tuple val(meta), path('*.out'), emit: log - path 'bowtie.version.txt', emit: version + path '*.version.txt' , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,6 @@ process BOWTIE_ALIGN { 2> ${prefix}.out \\ | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - - bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt + echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index 38f1c289..8b982bcf 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -29,7 +29,7 @@ process BOWTIE_INDEX { def software = getSoftwareName(task.process) """ mkdir bowtie - bowtie-build --threads $task.cpus ${fasta} bowtie/${fasta.baseName}.index - bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt + bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName} + echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt """ } From dc4108fd9b9d2982d84d24a7f765e5c5a0d3364d Mon Sep 17 00:00:00 2001 From: Kevin Menden Date: Fri, 18 Dec 2020 09:13:35 +0100 Subject: [PATCH 15/25] Update software/bowtie/align/meta.yml Co-authored-by: Harshil Patel --- software/bowtie/align/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index 633ef56a..50f5e8d0 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -53,7 +53,7 @@ input: description: Bowtie genome index files pattern: "*.ebwt" output: - - sam: + - bam: type: file description: Output SAM file containing read alignments pattern: "*.{sam}" From a7f1ff29d7baf10417efc22dbc8de52dc8700ccc Mon Sep 17 00:00:00 2001 From: Kevin Menden Date: Fri, 18 Dec 2020 09:13:42 +0100 Subject: [PATCH 16/25] Update software/bowtie/align/meta.yml Co-authored-by: Harshil Patel --- software/bowtie/align/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index 50f5e8d0..b6909b61 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -56,7 +56,7 @@ output: - bam: type: file description: Output SAM file containing read alignments - pattern: "*.{sam}" + pattern: "*.{bam}" - version: type: file description: File containing software version From 7805d25cc56190ac1ad88f0634fb32458cbc4379 Mon Sep 17 00:00:00 2001 From: Kevin Menden Date: Fri, 18 Dec 2020 09:13:48 +0100 Subject: [PATCH 17/25] Update software/bowtie/align/meta.yml Co-authored-by: Harshil Patel --- software/bowtie/align/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index b6909b61..72f7c0b5 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -55,7 +55,7 @@ input: output: - bam: type: file - description: Output SAM file containing read alignments + description: Output BAM file containing read alignments pattern: "*.{bam}" - version: type: file From f840325eadf2c9853ca6b02f3c8a4d48cccc3ff4 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 09:14:40 +0100 Subject: [PATCH 18/25] added unaligned output --- software/bowtie/align/main.nf | 11 +++++ software/bowtie/align/meta.yml | 88 ++++++++++++++++++---------------- 2 files changed, 57 insertions(+), 42 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 03bfd6e7..43425ca5 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -26,6 +26,8 @@ process BOWTIE_ALIGN { tuple val(meta), path('*.bam'), emit: bam tuple val(meta), path('*.out'), emit: log path '*.version.txt' , emit: version + tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq + path 'test.txt', emit: test script: def software = getSoftwareName(task.process) @@ -45,6 +47,15 @@ process BOWTIE_ALIGN { 2> ${prefix}.out \\ | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - + touch test.txt + if [ -f ${prefix}.unmapped.fastq ]; then + gzip ${prefix}.unmapped.fastq + fi + if [ -f ${prefix}.unmapped_1.fastq ]; then + gzip ${prefix}.unmapped_1.fastq + gzip ${prefix}.unmapped_2.fastq + fi + echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/bowtie/align/meta.yml b/software/bowtie/align/meta.yml index 633ef56a..b7dbdb83 100644 --- a/software/bowtie/align/meta.yml +++ b/software/bowtie/align/meta.yml @@ -7,59 +7,63 @@ keywords: - reference tools: - bowtie: - description: | - bowtie is a software package for mapping DNA sequences against - a large reference genome, such as the human genome. - homepage: http://bowtie-bio.sourceforge.net/index.shtml - documentation: http://bowtie-bio.sourceforge.net/manual.shtml - arxiv: arXiv:1303.3997 + description: | + bowtie is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bowtie-bio.sourceforge.net/index.shtml + documentation: http://bowtie-bio.sourceforge.net/manual.shtml + arxiv: arXiv:1303.3997 params: - outdir: - type: string - description: | - The pipeline's output directory. By default, the module will - output files into `$params.outdir/` + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` - publish_dir_mode: - type: string - description: | - Value for the Nextflow `publishDir` mode parameter. - Available: symlink, rellink, link, copy, copyNoFollow, move. + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. - enable_conda: - type: boolean - description: | - Run the module with Conda using the software specified - via the `conda` directive + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive - singularity_pull_docker_container: - type: boolean - description: | - Instead of directly downloading Singularity images for use with Singularity, - force the workflow to pull and convert Docker containers instead. + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. - save_unaligned: - type: boolean - description: Save unaligned reads + type: boolean + description: Save unaligned reads input: - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - reads: - type: file - description: | - List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. - index: - type: file - description: Bowtie genome index files - pattern: "*.ebwt" + type: file + description: Bowtie genome index files + pattern: "*.ebwt" output: - - sam: - type: file - description: Output SAM file containing read alignments - pattern: "*.{sam}" + - bam: + type: file + description: Output SAM file containing read alignments + pattern: "*.{bam}" - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" + type: file + description: File containing software version + pattern: "*.{version.txt}" + - fastq: + type: file + description: Unaligned FastQ files + pattern: "*.fastq.gz" authors: - "@kevinmenden" From 0eb20c14bf17d47419111dd5ebce7071dcf39569 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 09:20:35 +0100 Subject: [PATCH 19/25] fixed unaligned output --- software/bowtie/align/main.nf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/software/bowtie/align/main.nf b/software/bowtie/align/main.nf index 43425ca5..de9e8b3d 100644 --- a/software/bowtie/align/main.nf +++ b/software/bowtie/align/main.nf @@ -27,12 +27,11 @@ process BOWTIE_ALIGN { tuple val(meta), path('*.out'), emit: log path '*.version.txt' , emit: version tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq - path 'test.txt', emit: test script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : '' + def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped.fastq" : '' def endedness = meta.single_end ? "$reads" : "-1 ${reads[0]} -2 ${reads[1]}" """ INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'` @@ -47,7 +46,6 @@ process BOWTIE_ALIGN { 2> ${prefix}.out \\ | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - - touch test.txt if [ -f ${prefix}.unmapped.fastq ]; then gzip ${prefix}.unmapped.fastq fi From 07f0a2476a4729166cc623cfef1e7b8d295c182e Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 09:50:05 +0100 Subject: [PATCH 20/25] fixed linting errors --- software/bowtie/align/functions.nf | 3 +- software/bowtie/index/functions.nf | 3 +- software/bowtie/index/meta.yml | 60 +++++++++++++++--------------- tests/software/bowtie/test.yml | 6 +-- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/software/bowtie/align/functions.nf b/software/bowtie/align/functions.nf index b3ac3801..55d5271c 100644 --- a/software/bowtie/align/functions.nf +++ b/software/bowtie/align/functions.nf @@ -1,3 +1,4 @@ + /* * ----------------------------------------------------- * Utility functions used in nf-core DSL2 module files @@ -56,4 +57,4 @@ def saveFiles(Map args) { return "${getPathFromList(path_list)}/$args.filename" } } -} +} \ No newline at end of file diff --git a/software/bowtie/index/functions.nf b/software/bowtie/index/functions.nf index b3ac3801..55d5271c 100644 --- a/software/bowtie/index/functions.nf +++ b/software/bowtie/index/functions.nf @@ -1,3 +1,4 @@ + /* * ----------------------------------------------------- * Utility functions used in nf-core DSL2 module files @@ -56,4 +57,4 @@ def saveFiles(Map args) { return "${getPathFromList(path_list)}/$args.filename" } } -} +} \ No newline at end of file diff --git a/software/bowtie/index/meta.yml b/software/bowtie/index/meta.yml index db781a0a..e5296b05 100644 --- a/software/bowtie/index/meta.yml +++ b/software/bowtie/index/meta.yml @@ -7,45 +7,45 @@ keywords: - reference tools: - bowtie: - description: | - bowtie is a software package for mapping DNA sequences against - a large reference genome, such as the human genome. - homepage: http://bowtie-bio.sourceforge.net/index.shtml - documentation: http://bowtie-bio.sourceforge.net/manual.shtml - arxiv: arXiv:1303.3997 + description: | + bowtie is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bowtie-bio.sourceforge.net/index.shtml + documentation: http://bowtie-bio.sourceforge.net/manual.shtml + arxiv: arXiv:1303.3997 params: - outdir: - type: string - description: | - The pipeline's output directory. By default, the module will - output files into `$params.outdir/` + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` - publish_dir_mode: - type: string - description: | - Value for the Nextflow `publishDir` mode parameter. - Available: symlink, rellink, link, copy, copyNoFollow, move. + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. - enable_conda: - type: boolean - description: | - Run the module with Conda using the software specified - via the `conda` directive + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive - singularity_pull_docker_container: - type: boolean - description: | - Instead of directly downloading Singularity images for use with Singularity, - force the workflow to pull and convert Docker containers instead. + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. input: - fasta: - type: file - description: Input genome fasta file + type: file + description: Input genome fasta file output: - index: - type: file - description: Bowtie genome index files - pattern: "*.ebwt" + type: file + description: Bowtie genome index files + pattern: "*.ebwt" - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" + type: file + description: File containing software version + pattern: "*.{version.txt}" authors: - "@kevinmenden" diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index 6a28578d..8d6404bc 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -17,7 +17,7 @@ - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 -- name: Run bowtie index and align signle-end +- name: Run bowtie index and align single-end command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_alignment_single_end -c tests/config/nextflow.config tags: - bowtie @@ -40,8 +40,7 @@ - path: output/bowtie/test.bam md5sum: 8179c68a819accbc9137dc881736106f - -- name: Run bowtie index and align paired_end +- name: Run bowtie index and align paired-end command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_alignment_paired_end -c tests/config/nextflow.config tags: - bowtie @@ -63,4 +62,3 @@ md5sum: a23e9a2a76e949aeb3693bcfae41a615 - path: output/bowtie/test.bam md5sum: 9ce5aebf37128f4bb1d24e9548e22009 - From 0be13edc52acbc27131da6a24e76f139c776ecb6 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 09:52:38 +0100 Subject: [PATCH 21/25] next try at editorconfig --- software/bowtie/align/functions.nf | 2 +- software/bowtie/index/functions.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/software/bowtie/align/functions.nf b/software/bowtie/align/functions.nf index 55d5271c..f237d7f0 100644 --- a/software/bowtie/align/functions.nf +++ b/software/bowtie/align/functions.nf @@ -57,4 +57,4 @@ def saveFiles(Map args) { return "${getPathFromList(path_list)}/$args.filename" } } -} \ No newline at end of file +} diff --git a/software/bowtie/index/functions.nf b/software/bowtie/index/functions.nf index 55d5271c..f237d7f0 100644 --- a/software/bowtie/index/functions.nf +++ b/software/bowtie/index/functions.nf @@ -57,4 +57,4 @@ def saveFiles(Map args) { return "${getPathFromList(path_list)}/$args.filename" } } -} \ No newline at end of file +} From 299a3fa07e751da60680d1efad9f87f6d9e7fb88 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 10:58:37 +0100 Subject: [PATCH 22/25] adding .index back --- software/bowtie/index/main.nf | 2 +- tests/software/bowtie/main.nf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index 8b982bcf..b0156381 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -29,7 +29,7 @@ process BOWTIE_INDEX { def software = getSoftwareName(task.process) """ mkdir bowtie - bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName} + bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName}.index echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/tests/software/bowtie/main.nf b/tests/software/bowtie/main.nf index 6b4e24e6..c496a619 100644 --- a/tests/software/bowtie/main.nf +++ b/tests/software/bowtie/main.nf @@ -31,4 +31,3 @@ workflow test_bowtie_alignment_paired_end { file("${launchDir}/tests/data/fastq/rna/test_R2.fastq.gz", checkIfExists: true) ] ] BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index ) } - From db0b631906d16561036434c00c775890f2d5a55d Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 11:06:02 +0100 Subject: [PATCH 23/25] removed index from test output --- software/bowtie/index/main.nf | 2 +- tests/software/bowtie/test.yml | 36 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/software/bowtie/index/main.nf b/software/bowtie/index/main.nf index b0156381..8b982bcf 100644 --- a/software/bowtie/index/main.nf +++ b/software/bowtie/index/main.nf @@ -29,7 +29,7 @@ process BOWTIE_INDEX { def software = getSoftwareName(task.process) """ mkdir bowtie - bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName}.index + bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName} echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index 8d6404bc..188b8119 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -4,17 +4,17 @@ - bowtie - bowtie_index files: - - path: output/bowtie/bowtie/NC_010473.index.1.ebwt + - path: output/bowtie/bowtie/NC_010473.1.ebwt md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c - - path: output/bowtie/bowtie/NC_010473.index.2.ebwt + - path: output/bowtie/bowtie/NC_010473.2.ebwt md5sum: bfd10c5319c6a0dbc540fd789254a5dd - - path: output/bowtie/bowtie/NC_010473.index.3.ebwt + - path: output/bowtie/bowtie/NC_010473.3.ebwt md5sum: cd201e81724f3099131aec16ef2cc53b - - path: output/bowtie/bowtie/NC_010473.index.4.ebwt + - path: output/bowtie/bowtie/NC_010473.4.ebwt md5sum: bbb9d6d21ad765d135f95290204e8433 - - path: output/bowtie/bowtie/NC_010473.index.rev.1.ebwt + - path: output/bowtie/bowtie/NC_010473.rev.1.ebwt md5sum: 44f719c2fe42e1f35d54e798775846d1 - - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt + - path: output/bowtie/bowtie/NC_010473.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - name: Run bowtie index and align single-end @@ -23,17 +23,17 @@ - bowtie - bowtie_align files: - - path: output/bowtie/bowtie/NC_010473.index.1.ebwt + - path: output/bowtie/bowtie/NC_010473.1.ebwt md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c - - path: output/bowtie/bowtie/NC_010473.index.2.ebwt + - path: output/bowtie/bowtie/NC_010473.2.ebwt md5sum: bfd10c5319c6a0dbc540fd789254a5dd - - path: output/bowtie/bowtie/NC_010473.index.3.ebwt + - path: output/bowtie/bowtie/NC_010473.3.ebwt md5sum: cd201e81724f3099131aec16ef2cc53b - - path: output/bowtie/bowtie/NC_010473.index.4.ebwt + - path: output/bowtie/bowtie/NC_010473.4.ebwt md5sum: bbb9d6d21ad765d135f95290204e8433 - - path: output/bowtie/bowtie/NC_010473.index.rev.1.ebwt + - path: output/bowtie/bowtie/NC_010473.rev.1.ebwt md5sum: 44f719c2fe42e1f35d54e798775846d1 - - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt + - path: output/bowtie/bowtie/NC_010473.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - path: output/bowtie/test.out md5sum: a81cb18024616415a6cec3108a36fccd @@ -46,17 +46,17 @@ - bowtie - bowtie_align files: - - path: output/bowtie/bowtie/NC_010473.index.1.ebwt + - path: output/bowtie/bowtie/NC_010473.1.ebwt md5sum: 90f0b7aa5bbaeaaa999839ac13ad203c - - path: output/bowtie/bowtie/NC_010473.index.2.ebwt + - path: output/bowtie/bowtie/NC_010473.2.ebwt md5sum: bfd10c5319c6a0dbc540fd789254a5dd - - path: output/bowtie/bowtie/NC_010473.index.3.ebwt + - path: output/bowtie/bowtie/NC_010473.3.ebwt md5sum: cd201e81724f3099131aec16ef2cc53b - - path: output/bowtie/bowtie/NC_010473.index.4.ebwt + - path: output/bowtie/bowtie/NC_010473.4.ebwt md5sum: bbb9d6d21ad765d135f95290204e8433 - - path: output/bowtie/bowtie/NC_010473.index.rev.1.ebwt + - path: output/bowtie/bowtie/NC_010473.rev.1.ebwt md5sum: 44f719c2fe42e1f35d54e798775846d1 - - path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt + - path: output/bowtie/bowtie/NC_010473.rev.2.ebwt md5sum: f3c398bba5158f4039334a932d79c051 - path: output/bowtie/test.out md5sum: a23e9a2a76e949aeb3693bcfae41a615 From 32f6191ff31d40df5c565fe367b1c1f844d85da8 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 11:11:19 +0100 Subject: [PATCH 24/25] editorconfig --- software/bowtie/align/functions.nf | 120 ++++++++++++++--------------- software/bowtie/index/functions.nf | 120 ++++++++++++++--------------- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/software/bowtie/align/functions.nf b/software/bowtie/align/functions.nf index f237d7f0..6f3b4b29 100644 --- a/software/bowtie/align/functions.nf +++ b/software/bowtie/align/functions.nf @@ -1,60 +1,60 @@ - -/* - * ----------------------------------------------------- - * Utility functions used in nf-core DSL2 module files - * ----------------------------------------------------- - */ - -/* - * Extract name of software tool from process name using $task.process - */ -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -/* - * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules - */ -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.publish_by_id = args.publish_by_id ?: false - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -/* - * Tidy up and join elements of a list to return a path string - */ -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -/* - * Function to save/publish module results - */ -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_id) { - path_list.add(args.publish_id) - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} + +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", '') } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/bowtie/index/functions.nf b/software/bowtie/index/functions.nf index f237d7f0..6f3b4b29 100644 --- a/software/bowtie/index/functions.nf +++ b/software/bowtie/index/functions.nf @@ -1,60 +1,60 @@ - -/* - * ----------------------------------------------------- - * Utility functions used in nf-core DSL2 module files - * ----------------------------------------------------- - */ - -/* - * Extract name of software tool from process name using $task.process - */ -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -/* - * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules - */ -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.publish_by_id = args.publish_by_id ?: false - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -/* - * Tidy up and join elements of a list to return a path string - */ -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -/* - * Function to save/publish module results - */ -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_id) { - path_list.add(args.publish_id) - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} + +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", '') } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} From 8f75bac67e70b49c272c9436e0157098f71b139e Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 18 Dec 2020 11:16:58 +0100 Subject: [PATCH 25/25] update test.bam md5sums --- tests/software/bowtie/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/software/bowtie/test.yml b/tests/software/bowtie/test.yml index 188b8119..229165ac 100644 --- a/tests/software/bowtie/test.yml +++ b/tests/software/bowtie/test.yml @@ -38,7 +38,7 @@ - path: output/bowtie/test.out md5sum: a81cb18024616415a6cec3108a36fccd - path: output/bowtie/test.bam - md5sum: 8179c68a819accbc9137dc881736106f + md5sum: 9feed8a55d4b5e600dcc577768ef07fc - name: Run bowtie index and align paired-end command: nextflow run ./tests/software/bowtie -profile docker -entry test_bowtie_alignment_paired_end -c tests/config/nextflow.config @@ -61,4 +61,4 @@ - path: output/bowtie/test.out md5sum: a23e9a2a76e949aeb3693bcfae41a615 - path: output/bowtie/test.bam - md5sum: 9ce5aebf37128f4bb1d24e9548e22009 + md5sum: cf6a6381aa504e8342638ff3b509721e