diff --git a/.github/filters.yml b/.github/filters.yml index fa37f990..b05842e8 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -96,6 +96,14 @@ bwa_mem: - software/bwa/mem/** - tests/software/bwa/mem/** +bwamem2_index: + - software/bwamem2/index/** + - tests/software/bwamem2/index/** + +bwamem2_mem: + - software/bwamem2/mem/** + - tests/software/bwamem2/mem/** + cat_fastq: - software/cat/fastq/** - tests/software/cat/fastq/** @@ -144,6 +152,10 @@ minimap2_align: - software/minimap2/align/** - tests/software/minimap2/align/** +mosdepth: + - software/mosdepth/** + - tests/software/mosdepth/** + multiqc: - software/fastqc/** - software/multiqc/** diff --git a/software/bwamem2/index/functions.nf b/software/bwamem2/index/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/bwamem2/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/bwamem2/index/main.nf b/software/bwamem2/index/main.nf new file mode 100644 index 00000000..dce96899 --- /dev/null +++ b/software/bwamem2/index/main.nf @@ -0,0 +1,35 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process BWAMEM2_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::bwa-mem2=2.1=he513fc3_0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bwa-mem2:2.1--he513fc3_0" + } else { + container "quay.io/biocontainers/bwa-mem2:2.1--he513fc3_0" + } + + input: + path fasta + + output: + path "bwamem2" , emit: index + path "*.version.txt", emit: version + + script: + def software = getSoftwareName(task.process) + """ + mkdir bwamem2 + bwa-mem2 index $options.args $fasta -p bwamem2/${fasta} + echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt + """ +} diff --git a/software/bwamem2/index/meta.yml b/software/bwamem2/index/meta.yml new file mode 100644 index 00000000..70780902 --- /dev/null +++ b/software/bwamem2/index/meta.yml @@ -0,0 +1,50 @@ +name: bwamem2_index +description: Create BWA-mem2 index for reference genome +keywords: + - index + - fasta + - genome + - reference +tools: + - bwa: + description: | + BWA-mem2 is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: https://github.com/bwa-mem2/bwa-mem2 + documentation: https://github.com/bwa-mem2/bwa-mem2#usage +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 + - 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 + description: Input genome fasta file +output: + - index: + type: file + description: BWA genome index files + pattern: "*.{0132,amb,ann,bwt.2bit.64,pac}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@maxulysse" diff --git a/software/bwamem2/mem/functions.nf b/software/bwamem2/mem/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/bwamem2/mem/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/bwamem2/mem/main.nf b/software/bwamem2/mem/main.nf new file mode 100644 index 00000000..05702a3c --- /dev/null +++ b/software/bwamem2/mem/main.nf @@ -0,0 +1,46 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process BWAMEM2_MEM { + 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::bwa-mem2=2.1=he513fc3_0 bioconda::samtools=1.11=h6270b1f_0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:e6f0d20c9d78572ddbbf00d8767ee6ff865edd4e-0" + } else { + container "quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:e6f0d20c9d78572ddbbf00d8767ee6ff865edd4e-0" + } + + input: + tuple val(meta), path(reads) + path index + + output: + tuple val(meta), path("*.bam"), emit: bam + path "*.version.txt" , emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def read_group = meta.read_group ? "-R ${meta.read_group}" : "" + """ + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + + bwa-mem2 mem \\ + $options.args \\ + $read_group \\ + -t $task.cpus \\ + \$INDEX \\ + $reads \\ + | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam - + + echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt + """ +} diff --git a/software/bwamem2/mem/meta.yml b/software/bwamem2/mem/meta.yml new file mode 100644 index 00000000..7d59b9b4 --- /dev/null +++ b/software/bwamem2/mem/meta.yml @@ -0,0 +1,65 @@ +name: bwamem2_mem +description: Performs fastq alignment to a fasta reference using BWA +keywords: + - mem + - bwa + - alignment + - map + - fastq + - bam + - sam +tools: + - bwa: + description: | + BWA is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bio-bwa.sourceforge.net/ + documentation: http://www.htslib.org/doc/samtools.html + 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 + - 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: + - 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: BWA genome index files + pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" +output: + - bam: + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@maxulysse" diff --git a/software/mosdepth/functions.nf b/software/mosdepth/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/mosdepth/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/mosdepth/main.nf b/software/mosdepth/main.nf new file mode 100644 index 00000000..cce90848 --- /dev/null +++ b/software/mosdepth/main.nf @@ -0,0 +1,48 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process MOSDEPTH { + tag "$meta.id" + label 'process_medium' + 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::mosdepth=0.3.1' : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mosdepth:0.3.1--ha7ba039_0" + } else { + container "quay.io/biocontainers/mosdepth:0.3.1--ha7ba039_0" + } + + input: + tuple val(meta), path(bam), path(bai) + path bed + val window_size + + output: + tuple val(meta), path('*.global.dist.txt') , emit: global_txt + tuple val(meta), path('*.region.dist.txt') , emit: regions_txt + tuple val(meta), path('*.summary.txt') , emit: summary_txt + tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed + tuple val(meta), path('*.per-base.bed.gz.csi'), emit: per_base_csi + tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed + tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi + path '*.version.txt' , emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def interval = window_size ? "--by ${window_size}" : "--by ${bed}" + """ + mosdepth \\ + $interval \\ + $options.args \\ + $prefix \\ + $bam + echo \$(mosdepth --version 2>&1) | sed 's/^.*mosdepth //; s/ .*\$//' > ${software}.version.txt + """ +} diff --git a/software/mosdepth/meta.yml b/software/mosdepth/meta.yml new file mode 100644 index 00000000..7a822894 --- /dev/null +++ b/software/mosdepth/meta.yml @@ -0,0 +1,97 @@ +name: mosdepth +description: Calculates genome-wide sequencing coverage. +keywords: + - mosdepth + - bam + - cram + - coverage +tools: + - mosdepth: + description: | + Fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing. + documentation: https://github.com/brentp/mosdepth + doi: 10.1093/bioinformatics/btx699 +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 + - 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: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Input BAM/CRAM file + pattern: "*.{bam,cram}" + - bai: + type: file + description: Index for BAM/CRAM file + pattern: "*.{bai,crai}" + - bed: + type: file + description: BED file with intersected intervals + pattern: "*.{bed}" + - window_size: + type: integer + description: Window size + pattern: "[0-9]+" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - global_txt: + type: file + description: Text file with global cumulative coverage distribution + pattern: "*.{global.dist.txt}" + - regions_txt: + type: file + description: Text file with region cumulative coverage distribution + pattern: "*.{region.dist.txt}" + - summary_txt: + type: file + description: Text file with summary mean depths per chromosome and regions + pattern: "*.{summary.txt}" + - per_base_bed: + type: file + description: BED file with per-base coverage + pattern: "*.{per-base.bed.gz}" + - per_base_csi: + type: file + description: Index file for BED file with per-base coverage + pattern: "*.{per-base.bed.gz.csi}" + - regions_bed: + type: file + description: BED file with per-region coverage + pattern: "*.{regions.bed.gz}" + - regions_csi: + type: file + description: Index file for BED file with per-region coverage + pattern: "*.{regions.bed.gz.csi}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/tests/data/dummy/dummy_file.txt b/tests/data/dummy/dummy_file.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.0123 b/tests/data/index/E_coli/bwamem2/NC_010473.fa.0123 new file mode 100644 index 00000000..a51298f8 Binary files /dev/null and b/tests/data/index/E_coli/bwamem2/NC_010473.fa.0123 differ diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.amb b/tests/data/index/E_coli/bwamem2/NC_010473.fa.amb new file mode 100644 index 00000000..7355c4ea --- /dev/null +++ b/tests/data/index/E_coli/bwamem2/NC_010473.fa.amb @@ -0,0 +1,3 @@ +4686137 1 2 +20895 1 Y +142347 1 R diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.ann b/tests/data/index/E_coli/bwamem2/NC_010473.fa.ann new file mode 100644 index 00000000..ddfe94ec --- /dev/null +++ b/tests/data/index/E_coli/bwamem2/NC_010473.fa.ann @@ -0,0 +1,3 @@ +4686137 1 11 +0 gi|170079663|ref|NC_010473.1| Escherichia coli str. K-12 substr. DH10B, complete genome +0 4686137 2 diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.bwt.2bit.64 b/tests/data/index/E_coli/bwamem2/NC_010473.fa.bwt.2bit.64 new file mode 100644 index 00000000..12ca5419 Binary files /dev/null and b/tests/data/index/E_coli/bwamem2/NC_010473.fa.bwt.2bit.64 differ diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.pac b/tests/data/index/E_coli/bwamem2/NC_010473.fa.pac new file mode 100644 index 00000000..3aebd5a6 Binary files /dev/null and b/tests/data/index/E_coli/bwamem2/NC_010473.fa.pac differ diff --git a/tests/software/bwamem2/index/main.nf b/tests/software/bwamem2/index/main.nf new file mode 100644 index 00000000..2c6085a6 --- /dev/null +++ b/tests/software/bwamem2/index/main.nf @@ -0,0 +1,9 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWAMEM2_INDEX } from '../../../../software/bwamem2/index/main.nf' addParams( options: [:] ) + +workflow test_bwamem2_index { + BWAMEM2_INDEX ( file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ) +} \ No newline at end of file diff --git a/tests/software/bwamem2/index/test.yml b/tests/software/bwamem2/index/test.yml new file mode 100644 index 00000000..b7ccf304 --- /dev/null +++ b/tests/software/bwamem2/index/test.yml @@ -0,0 +1,16 @@ +- name: bwamem2 index + command: nextflow run ./tests/software/bwamem2/index -entry test_bwamem2_index -c tests/config/nextflow.config + tags: + - bwamem2 + - bwamem2_index + files: + - path: output/bwamem2/bwamem2/NC_010473.fa.0123 + md5sum: e112e4d2fd893fb939d306b27ece9de5 + - path: output/bwamem2/bwamem2/NC_010473.fa.amb + md5sum: 942a990ae872f1c0b8d72dda2db405d5 + - path: output/bwamem2/bwamem2/NC_010473.fa.ann + md5sum: ebf1a0279cf5b8d7f1a8cb855a3a3705 + - path: output/bwamem2/bwamem2/NC_010473.fa.bwt.2bit.64 + md5sum: f0154573be12440aee294b726cd88c86 + - path: output/bwamem2/bwamem2/NC_010473.fa.pac + md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad diff --git a/tests/software/bwamem2/mem/main.nf b/tests/software/bwamem2/mem/main.nf new file mode 100644 index 00000000..0bba591b --- /dev/null +++ b/tests/software/bwamem2/mem/main.nf @@ -0,0 +1,36 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWAMEM2_MEM } from '../../../../software/bwamem2/mem/main.nf' addParams( options: [:] ) + +/* + * Test with single-end data + */ +workflow test_bwamem2_mem_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) ] ] + + BWAMEM2_MEM ( + input, + file("${launchDir}/tests/data/index/E_coli/bwamem2/", checkIfExists: true) + ) +} + +/* + * Test with paired-end data + */ +workflow test_bwamem2_mem_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) ] ] + + BWAMEM2_MEM ( + input, + file("${launchDir}/tests/data/index/E_coli/bwamem2/", checkIfExists: true) + ) +} diff --git a/tests/software/bwamem2/mem/test.yml b/tests/software/bwamem2/mem/test.yml new file mode 100644 index 00000000..6eeb6b14 --- /dev/null +++ b/tests/software/bwamem2/mem/test.yml @@ -0,0 +1,19 @@ +- name: bwamem2 mem single-end + command: nextflow run ./tests/software/bwamem2/mem -entry test_bwamem2_mem_single_end -c tests/config/nextflow.config + tags: + - bwamem2 + - bwamem2_mem + - bwamem2_mem_single_end + files: + - path: output/bwamem2/test.bam + md5sum: 354acd3b7033a2d4ee69452df18c0a4d + +- name: bwamem2 mem paired-end + command: nextflow run ./tests/software/bwamem2/mem -entry test_bwamem2_mem_paired_end -c tests/config/nextflow.config + tags: + - bwamem2 + - bwamem2_mem + - bwamem2_mem_paired_end + files: + - path: output/bwamem2/test.bam + md5sum: 26187528a7bde13a2a9e9dd549b9bcd0 diff --git a/tests/software/mosdepth/main.nf b/tests/software/mosdepth/main.nf new file mode 100644 index 00000000..5001fa78 --- /dev/null +++ b/tests/software/mosdepth/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MOSDEPTH } from '../../../software/mosdepth/main.nf' addParams( options: [:] ) + +workflow test_mosdepth { + + input = [ [ id:'test', single_end:true ], + [ file("${launchDir}/tests/data/bam/test.paired_end.sorted.bam", checkIfExists: true) ], + [ file("${launchDir}/tests/data/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) ] ] + dummy = [ file("${launchDir}/tests/data/dummy/dummy_file.txt", checkIfExists: true) ] + + window_size = 100 + + MOSDEPTH ( input, dummy, window_size ) +} diff --git a/tests/software/mosdepth/test.yml b/tests/software/mosdepth/test.yml new file mode 100644 index 00000000..26b83e0a --- /dev/null +++ b/tests/software/mosdepth/test.yml @@ -0,0 +1,19 @@ +- name: mosdepth + command: nextflow run ./tests/software/mosdepth -entry test_mosdepth -c tests/config/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.per-base.bed.gz + md5sum: 4965936f5a7502cff93286c0324e41ff + - path: output/mosdepth/test.regions.bed.gz + md5sum: 6997da219218fa57484572c3a2963dd6 + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: feed5da1defda07b6eaebcf497581115 + - path: output/mosdepth/test.mosdepth.region.dist.txt + md5sum: f1f89c14bab380f44e95b09f676d0c52 + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: 239d156c9008dc59c7f0138f6b0ba300 + - path: output/mosdepth/test.regions.bed.gz.csi + md5sum: a1c982f3e2a97f529ad5780d32010c32 + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 5a92dee6e87136a65c7973260f229852