diff --git a/.github/filters.yml b/.github/filters.yml index bfc93d0d..0e450743 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -34,6 +34,10 @@ bedtools_genomecov: - software/bedtools/genomecov/** - tests/software/bedtools/genomecov/** +bedtools_getfasta: + - software/bedtools/getfasta/** + - tests/software/bedtools/getfasta/** + bedtools_intersect: - software/bedtools/intersect/** - tests/software/bedtools/intersect/** @@ -88,6 +92,10 @@ bwa_mem: - software/bwa/mem/** - tests/software/bwa/mem/** +cat_fastq: + - software/cat/fastq/** + - tests/software/cat/fastq/** + cutadapt: - software/cutadapt/** - tests/software/cutadapt/** diff --git a/software/bandage/image/main.nf b/software/bandage/image/main.nf index 7f311746..57b5f23f 100644 --- a/software/bandage/image/main.nf +++ b/software/bandage/image/main.nf @@ -11,7 +11,7 @@ process BANDAGE_IMAGE { 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::bandage=0.8.1' : null) + conda (params.enable_conda ? 'bioconda::bandage=0.8.1=hc9558a2_2' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bandage:0.8.1--hc9558a2_2" } else { diff --git a/software/bcftools/bgzip/main.nf b/software/bcftools/bgzip/main.nf index cb29c2b2..3e6e72e6 100644 --- a/software/bcftools/bgzip/main.nf +++ b/software/bcftools/bgzip/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_BGZIP { 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::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/consensus/main.nf b/software/bcftools/consensus/main.nf index c74d21d0..1e640542 100644 --- a/software/bcftools/consensus/main.nf +++ b/software/bcftools/consensus/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_CONSENSUS { 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::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/filter/main.nf b/software/bcftools/filter/main.nf index c86166a5..3299def9 100644 --- a/software/bcftools/filter/main.nf +++ b/software/bcftools/filter/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_FILTER { 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::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/isec/main.nf b/software/bcftools/isec/main.nf index e4d4962f..8f5a608f 100644 --- a/software/bcftools/isec/main.nf +++ b/software/bcftools/isec/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_ISEC { 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::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bcftools/stats/main.nf b/software/bcftools/stats/main.nf index 4b1bfaf4..ffb9a468 100644 --- a/software/bcftools/stats/main.nf +++ b/software/bcftools/stats/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_STATS { 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::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { @@ -21,8 +21,8 @@ process BCFTOOLS_STATS { tuple val(meta), path(vcf) output: - tuple val(meta), path("*.txt"), emit: stats - path "*.version.txt" , emit: version + tuple val(meta), path("*stats.txt"), emit: stats + path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) diff --git a/software/bcftools/stats/meta.yml b/software/bcftools/stats/meta.yml index fd8319e6..75ed50f4 100644 --- a/software/bcftools/stats/meta.yml +++ b/software/bcftools/stats/meta.yml @@ -52,7 +52,7 @@ output: - stats: type: file description: Text output file containing stats - pattern: "*.{txt}" + pattern: "*_{stats.txt}" - version: type: file description: File containing software version diff --git a/software/bcftools/tabix/main.nf b/software/bcftools/tabix/main.nf index 3e5bba50..c1799bc3 100644 --- a/software/bcftools/tabix/main.nf +++ b/software/bcftools/tabix/main.nf @@ -10,7 +10,7 @@ process BCFTOOLS_TABIX { 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::bcftools=1.11" : null) + conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" } else { diff --git a/software/bedtools/getfasta/functions.nf b/software/bedtools/getfasta/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/bedtools/getfasta/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/bedtools/getfasta/main.nf b/software/bedtools/getfasta/main.nf new file mode 100644 index 00000000..b60c04e9 --- /dev/null +++ b/software/bedtools/getfasta/main.nf @@ -0,0 +1,42 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process BEDTOOLS_GETFASTA { + tag "$bed" + 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:'') } + + conda (params.enable_conda ? "bioconda::bedtools=2.30.0=hc088bd4_0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" + } else { + container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" + } + + input: + path bed + path fasta + + output: + path "*.fa" , emit: fasta + path "*.version.txt", emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${bed.baseName}${options.suffix}" : "${bed.baseName}" + """ + bedtools \\ + getfasta \\ + $options.args \\ + -fi $fasta \\ + -bed $bed \\ + -fo ${prefix}.fa + + bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + """ +} diff --git a/software/bedtools/getfasta/meta.yml b/software/bedtools/getfasta/meta.yml new file mode 100644 index 00000000..692b7028 --- /dev/null +++ b/software/bedtools/getfasta/meta.yml @@ -0,0 +1,54 @@ +name: bedtools_getfasta +description: extract sequences in a FASTA file based on intervals defined in a feature file. +keywords: + - bed + - fasta + - getfasta +tools: + - bedtools: + description: | + A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. + documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html +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: + - bed: + type: file + description: Bed feature file + pattern: "*.{bed}" + - fasta: + type: file + description: Input fasta file + pattern: "*.{fa,fasta}" + +output: + - fasta: + type: file + description: Output fasta file with extracted sequences + pattern: "*.{fa}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/software/bedtools/maskfasta/main.nf b/software/bedtools/maskfasta/main.nf index ccd93df7..1051a80e 100644 --- a/software/bedtools/maskfasta/main.nf +++ b/software/bedtools/maskfasta/main.nf @@ -11,7 +11,7 @@ process BEDTOOLS_MASKFASTA { 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::bedtools=2.30.0" : null) + conda (params.enable_conda ? "bioconda::bedtools=2.30.0=hc088bd4_0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" } else { diff --git a/software/blast/blastn/main.nf b/software/blast/blastn/main.nf index ec02f609..5a021331 100644 --- a/software/blast/blastn/main.nf +++ b/software/blast/blastn/main.nf @@ -11,7 +11,7 @@ process BLAST_BLASTN { 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::blast=2.10.1' : null) + conda (params.enable_conda ? 'bioconda::blast=2.10.1=pl526he19e7b1_3' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container 'https://depot.galaxyproject.org/singularity/blast:2.10.1--pl526he19e7b1_3' } else { diff --git a/software/blast/makeblastdb/main.nf b/software/blast/makeblastdb/main.nf index c79b99da..f3f9cc25 100644 --- a/software/blast/makeblastdb/main.nf +++ b/software/blast/makeblastdb/main.nf @@ -11,7 +11,7 @@ process BLAST_MAKEBLASTDB { 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::blast=2.10.1' : null) + conda (params.enable_conda ? 'bioconda::blast=2.10.1=pl526he19e7b1_3' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container 'https://depot.galaxyproject.org/singularity/blast:2.10.1--pl526he19e7b1_3' } else { diff --git a/software/bwa/index/main.nf b/software/bwa/index/main.nf index ec525e2c..7afcf50a 100644 --- a/software/bwa/index/main.nf +++ b/software/bwa/index/main.nf @@ -22,13 +22,14 @@ process BWA_INDEX { path fasta output: - path "${fasta}.*" , emit: index + path "bwa" , emit: index path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) """ - bwa index $options.args $fasta + mkdir bwa + bwa index $options.args $fasta -p bwa/${fasta.baseName} echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ } diff --git a/software/bwa/mem/main.nf b/software/bwa/mem/main.nf index 2f2d42c1..92f4de3b 100644 --- a/software/bwa/mem/main.nf +++ b/software/bwa/mem/main.nf @@ -21,7 +21,6 @@ process BWA_MEM { input: tuple val(meta), path(reads) path index - path fasta output: tuple val(meta), path("*.bam"), emit: bam @@ -32,13 +31,15 @@ process BWA_MEM { 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 mem \\ $options.args \\ $read_group \\ -t $task.cpus \\ - $fasta \\ + \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt """ diff --git a/software/bwa/mem/meta.yml b/software/bwa/mem/meta.yml index de61798b..2e44951c 100644 --- a/software/bwa/mem/meta.yml +++ b/software/bwa/mem/meta.yml @@ -51,10 +51,7 @@ input: - index: type: file description: BWA genome index files - pattern: "*.{amb,ann,bwt,pac,sa}" - - fasta: - type: file - description: Input genome fasta file + pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" output: - bam: type: file diff --git a/software/cat/fastq/functions.nf b/software/cat/fastq/functions.nf new file mode 100644 index 00000000..d25eea86 --- /dev/null +++ b/software/cat/fastq/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/cat/fastq/main.nf b/software/cat/fastq/main.nf new file mode 100644 index 00000000..44a06bb8 --- /dev/null +++ b/software/cat/fastq/main.nf @@ -0,0 +1,46 @@ +// Import generic module functions +include { initOptions; saveFiles } from './functions' + +params.options = [:] +def options = initOptions(params.options) + +process CAT_FASTQ { + tag "$meta.id" + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'merged_fastq', publish_id:meta.id) } + + conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" + } else { + container "biocontainers/biocontainers:v1.2.0_cv1" + } + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.merged.fastq.gz"), emit: reads + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def readList = reads.collect{ it.toString() } + if (meta.single_end) { + if (readList.size > 1) { + """ + cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz + """ + } + } else { + if (readList.size > 2) { + def read1 = [] + def read2 = [] + readList.eachWithIndex{ v, ix -> ( ix & 1 ? read2 : read1 ) << v } + """ + cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz + cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz + """ + } + } +} diff --git a/software/cat/fastq/meta.yml b/software/cat/fastq/meta.yml new file mode 100644 index 00000000..eda6dff7 --- /dev/null +++ b/software/cat/fastq/meta.yml @@ -0,0 +1,55 @@ +name: cat_fastq +description: Concatenates fastq files +keywords: + - fastq + - concatenate +tools: + - cat: + description: | + The cat utility reads files sequentially, writing them to the standard output. + documentation: https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html +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: + input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: list + description: | + List of input FastQ files to be concatenated. +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Merged fastq file + pattern: "*.{merged.fastq.gz}" +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/software/gunzip/main.nf b/software/gunzip/main.nf index 20f6467d..b9647a4a 100644 --- a/software/gunzip/main.nf +++ b/software/gunzip/main.nf @@ -10,7 +10,7 @@ process GUNZIP { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "conda-forge::sed=4.7" : null) + conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" } else { diff --git a/software/pangolin/main.nf b/software/pangolin/main.nf index ad1decb2..02d53551 100644 --- a/software/pangolin/main.nf +++ b/software/pangolin/main.nf @@ -11,19 +11,19 @@ process PANGOLIN { 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::pangolin=2.1.7=py_0' : null) + conda (params.enable_conda ? 'bioconda::pangolin=2.2.1=py_0 bioconda::pangolearn=2021.02.05=pyh3252c3a_0' : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/pangolin:2.1.7--py_0' + container 'https://depot.galaxyproject.org/singularity/pangolin:2.2.1--py_0' } else { - container 'quay.io/biocontainers/pangolin:2.1.7--py_0' + container 'quay.io/biocontainers/pangolin:2.2.1--py_0' } input: tuple val(meta), path(fasta) output: - tuple val(meta), path('*.lineage_report.csv'), emit: report - path '*.version.txt' , emit: version + tuple val(meta), path('*.csv'), emit: report + path '*.version.txt' , emit: version script: def software = getSoftwareName(task.process) @@ -31,7 +31,7 @@ process PANGOLIN { """ pangolin \\ $fasta\\ - --outfile ${prefix}.lineage_report.csv \\ + --outfile ${prefix}.pangolin.csv \\ $options.args pangolin --version | sed "s/pangolin //g" > ${software}.version.txt diff --git a/software/pangolin/meta.yml b/software/pangolin/meta.yml index 51fcca63..82e157d9 100644 --- a/software/pangolin/meta.yml +++ b/software/pangolin/meta.yml @@ -1,57 +1,54 @@ name: pangolin description: Phylogenetic Assignment of Named Global Outbreak LINeages keywords: - - covid - - pangolin - - lineage + - covid + - pangolin + - lineage tools: - - star: - description: | - Phylogenetic Assignment of Named Global Outbreak LINeages - homepage: https://github.com/cov-lineages/pangolin#pangolearn-description - manual: https://github.com/cov-lineages/pangolin#pangolearn-description + - star: + description: | + Phylogenetic Assignment of Named Global Outbreak LINeages + homepage: https://github.com/cov-lineages/pangolin#pangolearn-description + manual: https://github.com/cov-lineages/pangolin#pangolearn-description 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. - + - 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 - - fasta: - type: file - description: | - The genome assembly to be evaluated - + - meta: + type: map + description: | + Groovy Map containing sample information + - fasta: + type: file + description: | + The genome assembly to be evaluated output: - - report: - type: file - description: The lineage report - pattern: "{prefix}.lineage_report.csv" - - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" - + - report: + type: file + description: Pangolin lineage report + pattern: "*.{csv}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" authors: - - "@kevinmenden" + - "@kevinmenden" + - "@drpatelh" diff --git a/software/stringtie/main.nf b/software/stringtie/main.nf index e624354b..1d69bb50 100644 --- a/software/stringtie/main.nf +++ b/software/stringtie/main.nf @@ -25,7 +25,7 @@ process STRINGTIE { output: tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf - tuple val(meta), path("*.txt") , emit: abundance + tuple val(meta), path("*.abundance.txt") , emit: abundance tuple val(meta), path("*.ballgown") , emit: ballgown path "*.version.txt" , emit: version @@ -45,7 +45,7 @@ process STRINGTIE { $strandedness \\ -G $gtf \\ -o ${prefix}.transcripts.gtf \\ - -A ${prefix}.gene_abundance.txt \\ + -A ${prefix}.gene.abundance.txt \\ -C ${prefix}.coverage.gtf \\ -b ${prefix}.ballgown \\ $options.args diff --git a/software/untar/main.nf b/software/untar/main.nf index 8912fb0b..62596ef6 100644 --- a/software/untar/main.nf +++ b/software/untar/main.nf @@ -10,7 +10,7 @@ process UNTAR { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda (params.enable_conda ? "conda-forge::sed=4.7" : null) + conda (params.enable_conda ? "conda-forge::sed=4.7=h1bed415_1000" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" } else { diff --git a/tests/software/bedtools/getfasta/main.nf b/tests/software/bedtools/getfasta/main.nf new file mode 100644 index 00000000..aba2f8e4 --- /dev/null +++ b/tests/software/bedtools/getfasta/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BEDTOOLS_GETFASTA } from '../../../../software/bedtools/getfasta/main.nf' addParams( options: [:] ) + +workflow test_bedtools_getfasta { + def bed = [ file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] + def fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] + + BEDTOOLS_GETFASTA ( bed, fasta ) +} diff --git a/tests/software/bedtools/getfasta/test.yml b/tests/software/bedtools/getfasta/test.yml new file mode 100644 index 00000000..c4b3ae77 --- /dev/null +++ b/tests/software/bedtools/getfasta/test.yml @@ -0,0 +1,8 @@ +- name: bedtools getfasta + command: nextflow run ./tests/software/bedtools/getfasta -entry test_bedtools_getfasta -c tests/config/nextflow.config + tags: + - bedtools + - bedtools_getfasta + files: + - path: output/bedtools/C.fa + md5sum: 2257190c8d9fc6f177a518440cf1f3f3 diff --git a/tests/software/bedtools/maskfasta/main.nf b/tests/software/bedtools/maskfasta/main.nf index 11901636..c8f8797b 100644 --- a/tests/software/bedtools/maskfasta/main.nf +++ b/tests/software/bedtools/maskfasta/main.nf @@ -5,10 +5,9 @@ nextflow.enable.dsl = 2 include { BEDTOOLS_MASKFASTA } from '../../../../software/bedtools/maskfasta/main.nf' addParams( options: [:] ) workflow test_bedtools_maskfasta { - def input,fasta = [] - bed = [ [ id:'test'], - file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] - fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] + def bed = [ [ id:'test'], + file("${launchDir}/tests/data/bed/C.bed", checkIfExists: true) ] + def fasta = [ file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ] BEDTOOLS_MASKFASTA( bed, fasta ) } diff --git a/tests/software/bwa/index/test.yml b/tests/software/bwa/index/test.yml index 89fe3f87..0e7decdf 100644 --- a/tests/software/bwa/index/test.yml +++ b/tests/software/bwa/index/test.yml @@ -4,11 +4,11 @@ - bwa - bwa_index files: - - path: output/bwa/NC_010473.fa.amb + - path: output/bwa/bwa/NC_010473.amb md5sum: 942a990ae872f1c0b8d72dda2db405d5 - - path: output/bwa/NC_010473.fa.bwt + - path: output/bwa/bwa/NC_010473.bwt md5sum: 7301b52e2ecb893d429a49fa692447ae - - path: output/bwa/NC_010473.fa.pac + - path: output/bwa/bwa/NC_010473.pac md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad - - path: output/bwa/NC_010473.fa.sa - md5sum: a47dcc92e750e2f16fbd979b8ff9538e \ No newline at end of file + - path: output/bwa/bwa/NC_010473.sa + md5sum: a47dcc92e750e2f16fbd979b8ff9538e diff --git a/tests/software/bwa/mem/main.nf b/tests/software/bwa/mem/main.nf index 748b8e9f..0b62099c 100644 --- a/tests/software/bwa/mem/main.nf +++ b/tests/software/bwa/mem/main.nf @@ -15,8 +15,7 @@ workflow test_bwa_mem_single_end { BWA_MEM ( input, - file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + file("${launchDir}/tests/data/index/E_coli/bwa/", checkIfExists: true) ) } @@ -32,7 +31,6 @@ workflow test_bwa_mem_paired_end { BWA_MEM ( input, - file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + file("${launchDir}/tests/data/index/E_coli/bwa/", checkIfExists: true) ) } diff --git a/tests/software/bwa/mem/test.yml b/tests/software/bwa/mem/test.yml index decf2e44..b4c2f4f8 100644 --- a/tests/software/bwa/mem/test.yml +++ b/tests/software/bwa/mem/test.yml @@ -6,7 +6,7 @@ - bwa_mem_single_end files: - path: output/bwa/test.bam - md5sum: 3ee21210bac387e0335008146e4728bc + md5sum: 52e81e5bd523d0b27fe533b21a0d80f5 - name: bwa mem paired-end command: nextflow run ./tests/software/bwa/mem -entry test_bwa_mem_paired_end -c tests/config/nextflow.config @@ -16,4 +16,4 @@ - bwa_mem_paired_end files: - path: output/bwa/test.bam - md5sum: 510d8acc6448c07cdacce8e64ec0904c + md5sum: 86d82fdb68ed384c656cfc62a253052f diff --git a/tests/software/cat/fastq/main.nf b/tests/software/cat/fastq/main.nf new file mode 100644 index 00000000..24d203c1 --- /dev/null +++ b/tests/software/cat/fastq/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CAT_FASTQ } from '../../../../software/cat/fastq/main.nf' addParams( options: [:] ) + +workflow test_cat_fastq_single_end { + + def input = [] + input = [ [ id:'test', single_end:true ], // meta map + [ file("${launchDir}/tests/data/fastq/rna/test_R1_val_1.fq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true) ]] + + CAT_FASTQ ( input ) +} + +workflow test_cat_fastq_paired_end { + + def input = [] + input = [ [ id:'test', single_end:false ], // meta map + [ file("${launchDir}/tests/data/fastq/rna/test_R1_val_1.fq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/rna/test_R2_val_2.fq.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) ]] + + CAT_FASTQ ( input ) +} diff --git a/tests/software/cat/fastq/test.yml b/tests/software/cat/fastq/test.yml new file mode 100644 index 00000000..b2235b6c --- /dev/null +++ b/tests/software/cat/fastq/test.yml @@ -0,0 +1,21 @@ +- name: cat fastq single-end + command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_single_end -c tests/config/nextflow.config + tags: + - cat + - cat_fastq + - cat_fastqc_single_end + files: + - path: output/merged_fastq/test.merged.fastq.gz + md5sum: 7f753b793e5b0872758b1574db84d767 + +- name: cat fastq fastqc_paired_end + command: nextflow run ./tests/software/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config + tags: + - cat + - cat_fastq + - cat_fastqc_paired_end + files: + - path: output/merged_fastq/test_1.merged.fastq.gz + md5sum: 7f753b793e5b0872758b1574db84d767 + - path: output/merged_fastq/test_2.merged.fastq.gz + md5sum: c71ff917e002b1e852916a021d52921d diff --git a/tests/software/pangolin/main.nf b/tests/software/pangolin/main.nf index 455c1996..b407398f 100644 --- a/tests/software/pangolin/main.nf +++ b/tests/software/pangolin/main.nf @@ -2,11 +2,11 @@ nextflow.enable.dsl = 2 -include { PANGOLIN } from '../../../software/pangolin/main.nf' addParams(options: [:]) +include { PANGOLIN } from '../../../software/pangolin/main.nf' addParams( options: [:] ) workflow test_pangolin { input = [ [ id:'test' ], // meta map [ file("${launchDir}/tests/data/fasta/sarscov2/GCA_011545545.1_ASM1154554v1_genomic.fna", checkIfExists: true) ] ] - PANGOLIN( input ) + PANGOLIN ( input ) } diff --git a/tests/software/pangolin/test.yml b/tests/software/pangolin/test.yml index c50b4245..198ede93 100644 --- a/tests/software/pangolin/test.yml +++ b/tests/software/pangolin/test.yml @@ -3,5 +3,5 @@ tags: - pangolin files: - - path: ./output/pangolin/test.lineage_report.csv - md5sum: a7423586a536a58f14fb4553f92b225e + - path: ./output/pangolin/test.pangolin.csv + md5sum: 097669de1843e27f4529d6db8bbed97b