diff --git a/software/cnvkit/main.nf b/software/cnvkit/main.nf index 828015f6..dee6051d 100755 --- a/software/cnvkit/main.nf +++ b/software/cnvkit/main.nf @@ -2,7 +2,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) process CNVKIT { tag "$meta.id" @@ -20,8 +20,8 @@ process CNVKIT { input: tuple val(meta), path(tumourbam), path(normalbam) - path fasta - path targetfile + path fasta + path targetfile output: tuple val(meta), path("*.bed"), emit: bed @@ -32,15 +32,15 @@ process CNVKIT { script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" """ - cnvkit.py batch \\ + cnvkit.py \\ + batch \\ $tumourbam \\ --normal $normalbam\\ --fasta $fasta \\ --targets $targetfile \\ $options.args - cnvkit.py version | sed -e "s/cnvkit v//g" > ${software}.version.txt + echo \$(cnvkit.py version) | sed -e "s/cnvkit v//g" > ${software}.version.txt """ } diff --git a/software/gatk4/applybqsr/main.nf b/software/gatk4/applybqsr/main.nf index abc6e270..19b8c3d6 100644 --- a/software/gatk4/applybqsr/main.nf +++ b/software/gatk4/applybqsr/main.nf @@ -20,10 +20,10 @@ process GATK4_APPLYBQSR { input: tuple val(meta), path(bam), path(bai), path(bqsr_table) - path fasta - path fastaidx - path dict - path intervalsBed + path fasta + path fastaidx + path dict + path intervals output: tuple val(meta), path("*.bam"), emit: bam @@ -32,17 +32,16 @@ process GATK4_APPLYBQSR { script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def intervalsCommand = intervalsBed ? "-L ${intervalsBed}" : "" - + def interval = intervals ? "-L ${intervals}" : "" """ gatk ApplyBQSR \\ -R $fasta \\ -I $bam \\ --bqsr-recal-file $bqsr_table \\ - $intervalsCommand \\ + $interval \\ -O ${prefix}.bam \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/baserecalibrator/main.nf b/software/gatk4/baserecalibrator/main.nf index 31ffbd20..4e2730f2 100644 --- a/software/gatk4/baserecalibrator/main.nf +++ b/software/gatk4/baserecalibrator/main.nf @@ -45,6 +45,6 @@ process GATK4_BASERECALIBRATOR { $options.args \ -O ${prefix}.table - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/bedtointervallist/main.nf b/software/gatk4/bedtointervallist/main.nf index 284f2dfc..6d98e1d6 100644 --- a/software/gatk4/bedtointervallist/main.nf +++ b/software/gatk4/bedtointervallist/main.nf @@ -28,7 +28,7 @@ process GATK4_BEDTOINTERVALLIST { script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk BedToIntervalList \\ -I $bed \\ @@ -36,6 +36,6 @@ process GATK4_BEDTOINTERVALLIST { -O ${prefix}.interval_list \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/createsequencedictionary/main.nf b/software/gatk4/createsequencedictionary/main.nf index 6997fb5f..3cf5543a 100644 --- a/software/gatk4/createsequencedictionary/main.nf +++ b/software/gatk4/createsequencedictionary/main.nf @@ -40,6 +40,6 @@ process GATK4_CREATESEQUENCEDICTIONARY { --URI $fasta \\ $options.args - echo \$(gatk CreateSequenceDictionary --version 2>&1) | sed 's/^.*(GATK) v//; s/ HTSJDK.*\$//' > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/fastqtosam/main.nf b/software/gatk4/fastqtosam/main.nf index 12c99185..e00f34f5 100644 --- a/software/gatk4/fastqtosam/main.nf +++ b/software/gatk4/fastqtosam/main.nf @@ -35,6 +35,7 @@ process GATK4_FASTQTOSAM { -O ${prefix}.bam \\ -SM $prefix \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/haplotypecaller/main.nf b/software/gatk4/haplotypecaller/main.nf index edcdb962..c451de7f 100644 --- a/software/gatk4/haplotypecaller/main.nf +++ b/software/gatk4/haplotypecaller/main.nf @@ -47,6 +47,6 @@ process GATK4_HAPLOTYPECALLER { -O ${prefix}.vcf.gz \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/intervallisttools/main.nf b/software/gatk4/intervallisttools/main.nf index ec65e02c..b2486eac 100644 --- a/software/gatk4/intervallisttools/main.nf +++ b/software/gatk4/intervallisttools/main.nf @@ -33,10 +33,10 @@ process GATK4_INTERVALLISTTOOLS { mkdir ${prefix}_split gatk \\ - IntervalListTools \\ - -I ${interval_list} \\ - -O ${prefix}_split \\ - $options.args + IntervalListTools \\ + -I ${interval_list} \\ + -O ${prefix}_split \\ + $options.args python3 < ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/markduplicates/main.nf b/software/gatk4/markduplicates/main.nf index d6ecbdbe..6df2a47c 100644 --- a/software/gatk4/markduplicates/main.nf +++ b/software/gatk4/markduplicates/main.nf @@ -39,6 +39,6 @@ process GATK4_MARKDUPLICATES { --OUTPUT ${prefix}.bam \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/mergebamalignment/main.nf b/software/gatk4/mergebamalignment/main.nf index 5cf5fa06..b65f4653 100644 --- a/software/gatk4/mergebamalignment/main.nf +++ b/software/gatk4/mergebamalignment/main.nf @@ -2,7 +2,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) process GATK4_MERGEBAMALIGNMENT { tag "$meta.id" @@ -20,25 +20,25 @@ process GATK4_MERGEBAMALIGNMENT { input: tuple val(meta), path(aligned) - path unmapped - path fasta - path dict + path unmapped + path fasta + path dict output: - tuple val(meta), path('*.merged.bam'), emit: bam - path '*.version.txt' , emit: version + 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 prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk MergeBamAlignment \\ ALIGNED=$aligned \\ UNMAPPED=$unmapped \\ R=$fasta \\ - O=${prefix}.merged.bam \\ + O=${prefix}.bam \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/mergevcfs/main.nf b/software/gatk4/mergevcfs/main.nf index 5c07a31a..9feb8187 100644 --- a/software/gatk4/mergevcfs/main.nf +++ b/software/gatk4/mergevcfs/main.nf @@ -20,16 +20,17 @@ process GATK4_MERGEVCFS { input: tuple val(meta), path(vcfs) - path(ref_dict) - val use_ref_dict + path ref_dict + val use_ref_dict output: - tuple val(meta), path('*.vcf.gz') , emit: vcf - path '*.version.txt' , emit: version + tuple val(meta), path('*.vcf.gz'), emit: vcf + path '*.version.txt' , emit: version script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + // Make list of VCFs to merge def input = "" for (vcf in vcfs) { @@ -39,10 +40,10 @@ process GATK4_MERGEVCFS { """ gatk MergeVcfs \\ $input \\ - O=${prefix}.merged.vcf.gz \\ + O=${prefix}.vcf.gz \\ $ref \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/revertsam/main.nf b/software/gatk4/revertsam/main.nf index b1a4fcec..a3bf3004 100644 --- a/software/gatk4/revertsam/main.nf +++ b/software/gatk4/revertsam/main.nf @@ -22,18 +22,18 @@ process GATK4_REVERTSAM { tuple val(meta), path(bam) output: - tuple val(meta), path('*.bam') , emit: bam - path '*.version.txt' , emit: version + 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 prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk RevertSam \\ I=$bam \\ O=${prefix}.reverted.bam \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/samtofastq/main.nf b/software/gatk4/samtofastq/main.nf index cfd1e2c6..00d5d359 100644 --- a/software/gatk4/samtofastq/main.nf +++ b/software/gatk4/samtofastq/main.nf @@ -22,19 +22,19 @@ process GATK4_SAMTOFASTQ { tuple val(meta), path(bam) output: - tuple val(meta), path('*.fastq.gz') , emit: fastq - path '*.version.txt' , emit: version + tuple val(meta), path('*.fastq.gz'), emit: fastq + path '*.version.txt' , emit: version script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" - def output = meta.single_end ? "FASTQ=${prefix}.fastq.gz" : "FASTQ=${prefix}_1.fastq.gz SECOND_END_FASTQ=${prefix}_2.fastq.gz" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def output = meta.single_end ? "FASTQ=${prefix}.fastq.gz" : "FASTQ=${prefix}_1.fastq.gz SECOND_END_FASTQ=${prefix}_2.fastq.gz" """ gatk SamToFastq \\ I=$bam \\ $output \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/splitncigarreads/main.nf b/software/gatk4/splitncigarreads/main.nf index 706087fc..5c7a6ca8 100644 --- a/software/gatk4/splitncigarreads/main.nf +++ b/software/gatk4/splitncigarreads/main.nf @@ -23,19 +23,19 @@ process GATK4_SPLITNCIGARREADS { tuple path(fasta), path(fai), path(dict) output: - tuple val(meta), path('*.split_cigar.bam'), emit: bam - path '*.version.txt' , emit: version + 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 prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk SplitNCigarReads \\ -R $fasta \\ -I $bam \\ - -O ${prefix}.split_cigar.bam \\ + -O ${prefix}.bam \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/gatk4/variantfiltration/main.nf b/software/gatk4/variantfiltration/main.nf index 7a269c88..82593d18 100644 --- a/software/gatk4/variantfiltration/main.nf +++ b/software/gatk4/variantfiltration/main.nf @@ -2,7 +2,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) process GATK4_VARIANTFILTRATION { tag "$meta.id" @@ -20,9 +20,9 @@ process GATK4_VARIANTFILTRATION { input: tuple val(meta), path(vcf) - path fasta - path fai - path dict + path fasta + path fai + path dict output: tuple val(meta), path("*.vcf"), emit: vcf @@ -39,6 +39,6 @@ process GATK4_VARIANTFILTRATION { -O ${prefix}.vcf \\ $options.args - gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/kraken2/run/functions.nf b/software/kraken2/kraken2/functions.nf similarity index 100% rename from software/kraken2/run/functions.nf rename to software/kraken2/kraken2/functions.nf diff --git a/software/kraken2/run/main.nf b/software/kraken2/kraken2/main.nf similarity index 96% rename from software/kraken2/run/main.nf rename to software/kraken2/kraken2/main.nf index 455883b5..ea0b72fd 100644 --- a/software/kraken2/run/main.nf +++ b/software/kraken2/kraken2/main.nf @@ -2,9 +2,9 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) -process KRAKEN2_RUN { +process KRAKEN2_KRAKEN2 { tag "$meta.id" label 'process_high' publishDir "${params.outdir}", diff --git a/software/kraken2/kraken2/meta.yml b/software/kraken2/kraken2/meta.yml new file mode 100644 index 00000000..cb1ec0de --- /dev/null +++ b/software/kraken2/kraken2/meta.yml @@ -0,0 +1,59 @@ +name: kraken2_kraken2 +description: Classifies metagenomic sequence data +keywords: + - classify + - metagenomics + - fastq + - db +tools: + - kraken2: + description: | + Kraken2 is a taxonomic sequence classifier that assigns taxonomic labels to sequence reads + homepage: https://ccb.jhu.edu/software/kraken2/ + documentation: https://github.com/DerrickWood/kraken2/wiki/Manual + doi: 10.1186/s13059-019-1891-0 +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. + - db: + type: directory + description: Kraken2 database +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - classified: + type: file + description: | + Reads classified to belong to any of the taxa + on the Kraken2 database. + pattern: "*{fastq.gz}" + - unclassified: + type: file + description: | + Reads not classified to belong to any of the taxa + on the Kraken2 database. + pattern: "*{fastq.gz}" + - txt: + type: file + description: | + Kraken2 report containing stats about classified + and not classifed reads. + pattern: "*.{report.txt}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/software/kraken2/run/meta.yml b/software/kraken2/run/meta.yml deleted file mode 100644 index 453c05a9..00000000 --- a/software/kraken2/run/meta.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: kraken2_run -description: Classifies metagenomic sequence data -keywords: - - classify - - metagenomics - - fastq - - db -tools: - - kraken2: - description: | - Kraken2 is a taxonomic sequence classifier that assigns taxonomic labels to sequence reads - homepage: https://ccb.jhu.edu/software/kraken2/ - documentation: https://github.com/DerrickWood/kraken2/wiki/Manual - doi: 10.1186/s13059-019-1891-0 -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. - - db: - type: directory - description: Kraken2 database -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - classified: - type: file - description: | - Reads classified to belong to any of the taxa - on the Kraken2 database. - pattern: "*{fastq.gz}" - - unclassified: - type: file - description: | - Reads not classified to belong to any of the taxa - on the Kraken2 database. - pattern: "*{fastq.gz}" - - txt: - type: file - description: | - Kraken2 report containing stats about classified - and not classifed reads. - pattern: "*.{report.txt}" - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" -authors: - - "@joseespinosa" - - "@drpatelh" diff --git a/software/minia/main.nf b/software/minia/main.nf index 1e128199..9ae79ede 100644 --- a/software/minia/main.nf +++ b/software/minia/main.nf @@ -2,7 +2,8 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) + process MINIA { tag "$meta.id" label 'process_high' @@ -36,6 +37,7 @@ process MINIA { -nb-cores $task.cpus \\ -in input_files.txt \\ -out $prefix + echo \$(minia --version 2>&1) | sed 's/^.*Minia version //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/nanolyse/main.nf b/software/nanolyse/main.nf index 8fa6ef49..0abad6cb 100644 --- a/software/nanolyse/main.nf +++ b/software/nanolyse/main.nf @@ -2,7 +2,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) process NANOLYSE { tag "$meta.id" @@ -20,7 +20,7 @@ process NANOLYSE { input: tuple val(meta), path(fastq) - path fasta + path fasta output: tuple val(meta), path("*.fastq.gz"), emit: fastq @@ -29,7 +29,7 @@ process NANOLYSE { script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gunzip -c $fastq | NanoLyse -r $fasta | gzip > ${prefix}.fastq.gz mv NanoLyse.log ${prefix}.nanolyse.log diff --git a/software/pangolin/main.nf b/software/pangolin/main.nf index 4efd103f..7be9311c 100644 --- a/software/pangolin/main.nf +++ b/software/pangolin/main.nf @@ -27,7 +27,7 @@ process PANGOLIN { script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pangolin \\ $fasta\\ @@ -35,6 +35,6 @@ process PANGOLIN { --threads $task.cpus \\ $options.args - pangolin --version | sed "s/pangolin //g" > ${software}.version.txt + echo \$(pangolin --version) | sed "s/pangolin //g" > ${software}.version.txt """ } diff --git a/software/strelka/germline/main.nf b/software/strelka/germline/main.nf index 62c18811..48f795b0 100644 --- a/software/strelka/germline/main.nf +++ b/software/strelka/germline/main.nf @@ -25,30 +25,29 @@ process STRELKA_GERMLINE { path target_bed output: - tuple val(meta), path("*_variants.vcf.gz") , emit: vcf - tuple val(meta), path("*_variants.vcf.gz.tbi"), emit: vcf_tbi - tuple val(meta), path("*_genome.vcf.gz") , emit: genome_vcf - tuple val(meta), path("*_genome.vcf.gz.tbi") , emit: genome_vcf_tbi - path "*.version.txt" , emit: version + tuple val(meta), path("*variants.vcf.gz") , emit: vcf + tuple val(meta), path("*variants.vcf.gz.tbi"), emit: vcf_tbi + tuple val(meta), path("*genome.vcf.gz") , emit: genome_vcf + tuple val(meta), path("*genome.vcf.gz.tbi") , emit: genome_vcf_tbi + path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) - def ioptions = initOptions(options) - def prefix = ioptions.suffix ? "strelka_${meta.id}${ioptions.suffix}" : "strelka_${meta.id}" - def options_strelka = params.target_bed ? "--exome --callRegions ${target_bed}" : "" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def regions = params.target_bed ? "--exome --callRegions ${target_bed}" : "" """ configureStrelkaGermlineWorkflow.py \\ --bam $bam \\ --referenceFasta $fasta \\ - $options_strelka \\ + $regions \\ $options.args \\ --runDir strelka python strelka/runWorkflow.py -m local -j $task.cpus - mv strelka/results/variants/genome.*.vcf.gz ${prefix}_genome.vcf.gz - mv strelka/results/variants/genome.*.vcf.gz.tbi ${prefix}_genome.vcf.gz.tbi - mv strelka/results/variants/variants.vcf.gz ${prefix}_variants.vcf.gz - mv strelka/results/variants/variants.vcf.gz.tbi ${prefix}_variants.vcf.gz.tbi + mv strelka/results/variants/genome.*.vcf.gz ${prefix}.genome.vcf.gz + mv strelka/results/variants/genome.*.vcf.gz.tbi ${prefix}.genome.vcf.gz.tbi + mv strelka/results/variants/variants.vcf.gz ${prefix}.variants.vcf.gz + mv strelka/results/variants/variants.vcf.gz.tbi ${prefix}.variants.vcf.gz.tbi echo configureStrelkaGermlineWorkflow.py --version &> ${software}.version.txt #2>&1 """ diff --git a/software/stringtie/merge/main.nf b/software/stringtie/merge/main.nf index 5f5a1a55..3c88d494 100644 --- a/software/stringtie/merge/main.nf +++ b/software/stringtie/merge/main.nf @@ -2,13 +2,13 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) process STRINGTIE_MERGE { label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['']) } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) } // Note: 2.7X indices incompatible with AWS iGenomes. conda (params.enable_conda ? "bioconda::stringtie=2.1.4" : null) @@ -19,11 +19,11 @@ process STRINGTIE_MERGE { } input: - path stringtie_gtf - path annotation_gtf + path stringtie_gtf + path annotation_gtf output: - path "stringtie.merged.gtf" , emit: merged_gtf + path "stringtie.merged.gtf", emit: gtf script: """ diff --git a/software/tiddit/sv/main.nf b/software/tiddit/sv/main.nf index 6eeb92d4..bd42f7d1 100644 --- a/software/tiddit/sv/main.nf +++ b/software/tiddit/sv/main.nf @@ -20,25 +20,25 @@ process TIDDIT_SV { input: tuple val(meta), path(bam) - path fasta - path fai + path fasta + path fai output: - tuple val(meta), path("*.vcf"), emit: vcf - tuple val(meta), path("*.ploidy.tab"), emit: ploidy + tuple val(meta), path("*.vcf") , emit: vcf + tuple val(meta), path("*.ploidy.tab") , emit: ploidy tuple val(meta), path("*.signals.tab"), emit: signals - path "*.version.txt", emit: version + path "*.version.txt" , emit: version script: - def software = getSoftwareName(task.process) - def output = options.suffix ? "${meta.id}.${options.suffix}" : "${meta.id}" + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def reference = fasta == "dummy_file.txt" ? "--ref $fasta" : "" """ tiddit \\ --sv $options.args \\ --bam $bam \\ $reference \\ - -o $output + -o $prefix echo \$(tiddit -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt """ diff --git a/software/ucsc/bed12tobigbed/main.nf b/software/ucsc/bed12tobigbed/main.nf index a396f85a..407379fd 100644 --- a/software/ucsc/bed12tobigbed/main.nf +++ b/software/ucsc/bed12tobigbed/main.nf @@ -2,7 +2,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(params.options) +options = initOptions(params.options) def VERSION = '377' @@ -36,6 +36,7 @@ process UCSC_BED12TOBIGBED { $bed \\ $sizes \\ ${prefix}.bigBed + echo $VERSION > ${software}.version.txt """ } diff --git a/software/ucsc/bed12tobigbed/meta.yml b/software/ucsc/bed12tobigbed/meta.yml new file mode 100755 index 00000000..7541eb2d --- /dev/null +++ b/software/ucsc/bed12tobigbed/meta.yml @@ -0,0 +1,46 @@ +name: ucsc_bed12tobigbed +description: Convert file from bed12 to bigBed format +keywords: + - bed12 + - bigbed +tools: + - ucsc: + description: Convert file from bed12 to bigBed format + homepage: None + documentation: None + tool_dev_url: None + doi: "" + licence: ["varies; see http://genome.ucsc.edu/license"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: bed12 file + pattern: "*.{bed,bed12}" + - sizes: + type: file + description: chromosome sizes file + pattern: "*.{sizes}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" + - bigbed: + type: file + description: bigBed file + pattern: "*.{bigBed}" + +authors: + - "@drpatelh" diff --git a/software/ucsc/bedgraphtobigwig/meta.yml b/software/ucsc/bedgraphtobigwig/meta.yml new file mode 100755 index 00000000..31365f48 --- /dev/null +++ b/software/ucsc/bedgraphtobigwig/meta.yml @@ -0,0 +1,46 @@ +name: ucsc_bedgraphtobigwig +description: Convert a bedGraph file to bigWig format. +keywords: + - bedgraph + - bigwig +tools: + - ucsc: + description: Convert a bedGraph file to bigWig format. + homepage: None + documentation: None + tool_dev_url: None + doi: "" + licence: ["varies; see http://genome.ucsc.edu/license"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bedgraph: + type: file + description: bedGraph file + pattern: "*.{bedGraph}" + - sizes: + type: file + description: chromosome sizes file + pattern: "*.{sizes}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" + - bigwig: + type: file + description: bigWig file + pattern: "*.{bigWig}" + +authors: + - "@drpatelh" diff --git a/tests/config/pytest_software.yml b/tests/config/pytest_software.yml index 00e6f54b..7986259f 100644 --- a/tests/config/pytest_software.yml +++ b/tests/config/pytest_software.yml @@ -385,10 +385,10 @@ kallistobustools/ref: - software/kallistobustools/ref/** - tests/software/kallistobustools/ref/** -kraken2/run: - - software/kraken2/run/** +kraken2/kraken2: + - software/kraken2/kraken2/** - software/untar/** - - tests/software/kraken2/run/** + - tests/software/kraken2/kraken2/** last/dotplot: - software/last/dotplot/** diff --git a/tests/software/cnvkit/test.yml b/tests/software/cnvkit/test.yml index dbfbee33..5bc7bd57 100755 --- a/tests/software/cnvkit/test.yml +++ b/tests/software/cnvkit/test.yml @@ -4,24 +4,24 @@ - cnvkit files: - path: output/cnvkit/baits.target.bed - md5sum: 26d25ff2d6c45b6d92169b3559c6acdb + md5sum: 26d25ff2d6c45b6d92169b3559c6acdb - path: output/cnvkit/baits.antitarget.bed md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/cnvkit/reference.cnn md5sum: ac99c1ad8b917b96ae15119146c91ab9 - - path: output/cnvkit/test_paired_end.sorted.targetcoverage.cnn + - path: output/cnvkit/test.paired_end.sorted.targetcoverage.cnn md5sum: 3fe80b6013ffc3e9968345e810158215 - - path: output/cnvkit/test_paired_end.sorted.antitargetcoverage.cnn + - path: output/cnvkit/test.paired_end.sorted.antitargetcoverage.cnn md5sum: 203caf8cef6935bb50b4138097955cb8 - - path: output/cnvkit/test_single_end.sorted.targetcoverage.cnn + - path: output/cnvkit/test.single_end.sorted.targetcoverage.cnn md5sum: aa8a018b1d4d1e688c9f9f6ae01bf4d7 - - path: output/cnvkit/test_single_end.sorted.antitargetcoverage.cnn + - path: output/cnvkit/test.single_end.sorted.antitargetcoverage.cnn md5sum: 203caf8cef6935bb50b4138097955cb8 - - path: output/cnvkit/test_paired_end.sorted.cnr + - path: output/cnvkit/test.paired_end.sorted.cnr md5sum: 7e37d73ab604dbc3fe4ebb56aca9bdc3 - - path: output/cnvkit/test_paired_end.sorted.cns - md5sum: 060af1aa637ed51812af19bcce24fcfe - - path: output/cnvkit/test_paired_end.sorted.bintest.cns + - path: output/cnvkit/test.paired_end.sorted.cns + md5sum: 060af1aa637ed51812af19bcce24fcfe + - path: output/cnvkit/test.paired_end.sorted.bintest.cns md5sum: 6544d979475def8a9f69ba42a985668d - - path: output/cnvkit/test_paired_end.sorted.call.cns + - path: output/cnvkit/test.paired_end.sorted.call.cns md5sum: f2ca59b4d50b0c317adc526c1b99b622 diff --git a/tests/software/gatk4/applybqsr/test.yml b/tests/software/gatk4/applybqsr/test.yml index c391a6ad..e1f1dcdc 100644 --- a/tests/software/gatk4/applybqsr/test.yml +++ b/tests/software/gatk4/applybqsr/test.yml @@ -5,7 +5,7 @@ - gatk4/applybqsr files: - path: output/gatk4/test.bam - md5sum: 139a5ffc7601ce3cfa7a896cd381542a + md5sum: dac716c394db5e83c12b44355c098ca7 - name: gatk4 applybqsr test_gatk4_applybqsr_intervals command: nextflow run tests/software/gatk4/applybqsr -entry test_gatk4_applybqsr_intervals -c tests/config/nextflow.config @@ -14,4 +14,4 @@ - gatk4/applybqsr files: - path: output/gatk4/test.bam - md5sum: 5b1f6fa2525124c281f71e5a76d28482 + md5sum: 400441dbe5344658580ba0a24ba57069 diff --git a/tests/software/gatk4/markduplicates/test.yml b/tests/software/gatk4/markduplicates/test.yml index 816ab5ec..76f9ccb1 100644 --- a/tests/software/gatk4/markduplicates/test.yml +++ b/tests/software/gatk4/markduplicates/test.yml @@ -5,4 +5,4 @@ - gatk4/markduplicates files: - path: output/gatk4/test.bam - md5sum: b58d47345e3ce5825c0641c9d6e6cb7a + md5sum: 3b6facab3afbacfa08a7a975efbd2c6b diff --git a/tests/software/gatk4/mergebamalignment/test.yml b/tests/software/gatk4/mergebamalignment/test.yml index 852f57a5..7b1305b7 100644 --- a/tests/software/gatk4/mergebamalignment/test.yml +++ b/tests/software/gatk4/mergebamalignment/test.yml @@ -4,5 +4,5 @@ - gatk4 - gatk4/mergebamalignment files: - - path: output/gatk4/test.merged.bam + - path: output/gatk4/test.bam md5sum: bd4a5e2ea916826aadebb5878333e26f diff --git a/tests/software/gatk4/mergevcfs/test.yml b/tests/software/gatk4/mergevcfs/test.yml index 99e167b4..5ffbb89c 100644 --- a/tests/software/gatk4/mergevcfs/test.yml +++ b/tests/software/gatk4/mergevcfs/test.yml @@ -4,7 +4,7 @@ - gatk4/mergevcfs - gatk4 files: - - path: output/gatk4/test.merged.vcf.gz + - path: output/gatk4/test.vcf.gz md5sum: ff48f175e26db2d4b2957762f6d1c715 - name: gatk4 mergevcfs test_gatk4_mergevcfs_refdict @@ -13,5 +13,5 @@ - gatk4/mergevcfs - gatk4 files: - - path: output/gatk4/test.merged.vcf.gz + - path: output/gatk4/test.vcf.gz md5sum: ff48f175e26db2d4b2957762f6d1c715 diff --git a/tests/software/gatk4/splitncigarreads/test.yml b/tests/software/gatk4/splitncigarreads/test.yml index c20f28ef..9169a51c 100644 --- a/tests/software/gatk4/splitncigarreads/test.yml +++ b/tests/software/gatk4/splitncigarreads/test.yml @@ -4,5 +4,5 @@ - gatk4 - gatk4/splitncigarreads files: - - path: output/gatk4/test.split_cigar.bam - md5sum: a8473bd4abc7b13751fc51b92531da4c + - path: output/gatk4/test.bam + md5sum: 900af0f67749d5ffac961354178ecb29 diff --git a/tests/software/kraken2/run/main.nf b/tests/software/kraken2/kraken2/main.nf similarity index 65% rename from tests/software/kraken2/run/main.nf rename to tests/software/kraken2/kraken2/main.nf index 751ca1a9..ba331b46 100644 --- a/tests/software/kraken2/run/main.nf +++ b/tests/software/kraken2/kraken2/main.nf @@ -2,20 +2,20 @@ nextflow.enable.dsl = 2 -include { UNTAR } from '../../../../software/untar/main.nf' addParams( options: [:] ) -include { KRAKEN2_RUN } from '../../../../software/kraken2/run/main.nf' addParams( options: [:] ) +include { UNTAR } from '../../../../software/untar/main.nf' addParams( options: [:] ) +include { KRAKEN2_KRAKEN2 } from '../../../../software/kraken2/kraken2/main.nf' addParams( options: [:] ) -workflow test_kraken2_run_single_end { +workflow test_kraken2_kraken2_single_end { input = [ [ id:'test', single_end:true ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] ] db = file(params.test_data['sarscov2']['genome']['kraken2_tar_gz'], checkIfExists: true) UNTAR ( db ) - KRAKEN2_RUN ( input, UNTAR.out.untar ) + KRAKEN2_KRAKEN2 ( input, UNTAR.out.untar ) } -workflow test_kraken2_run_paired_end { +workflow test_kraken2_kraken2_paired_end { input = [ [ id:'test', single_end:false ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] @@ -23,5 +23,5 @@ workflow test_kraken2_run_paired_end { db = file(params.test_data['sarscov2']['genome']['kraken2_tar_gz'], checkIfExists: true) UNTAR ( db ) - KRAKEN2_RUN ( input, UNTAR.out.untar ) + KRAKEN2_KRAKEN2 ( input, UNTAR.out.untar ) } diff --git a/tests/software/kraken2/run/test.yml b/tests/software/kraken2/kraken2/test.yml similarity index 66% rename from tests/software/kraken2/run/test.yml rename to tests/software/kraken2/kraken2/test.yml index e0886c93..8a3c6bf4 100644 --- a/tests/software/kraken2/run/test.yml +++ b/tests/software/kraken2/kraken2/test.yml @@ -1,8 +1,8 @@ -- name: kraken2 run single-end - command: nextflow run ./tests/software/kraken2/run -entry test_kraken2_run_single_end -c tests/config/nextflow.config +- name: kraken2 kraken2 single-end + command: nextflow run ./tests/software/kraken2/kraken2 -entry test_kraken2_kraken2_single_end -c tests/config/nextflow.config tags: - kraken2 - - kraken2/run + - kraken2/kraken2 files: - path: output/kraken2/test.classified.fastq.gz should_exist: true @@ -11,11 +11,11 @@ - path: output/kraken2/test.kraken2.report.txt md5sum: 4227755fe40478b8d7dc8634b489761e -- name: kraken2 run paired-end - command: nextflow run ./tests/software/kraken2/run -entry test_kraken2_run_paired_end -c tests/config/nextflow.config +- name: kraken2 kraken2 paired-end + command: nextflow run ./tests/software/kraken2/kraken2 -entry test_kraken2_kraken2_paired_end -c tests/config/nextflow.config tags: - kraken2 - - kraken2/run + - kraken2/kraken2 files: - path: output/kraken2/test.classified_1.fastq.gz should_exist: true diff --git a/tests/software/nanolyse/main.nf b/tests/software/nanolyse/main.nf index 88071dde..8a1676ce 100644 --- a/tests/software/nanolyse/main.nf +++ b/tests/software/nanolyse/main.nf @@ -2,23 +2,15 @@ nextflow.enable.dsl = 2 -include { NANOLYSE } from '../../../software/nanolyse/main.nf' addParams( options: [suffix: 'clean'] ) - -process GET_NANOLYSE_FASTA { - output: - path "*fasta.gz", emit: fasta - - script: - """ - wget https://github.com/wdecoster/nanolyse/raw/master/reference/lambda.fasta.gz - """ -} +include { NANOLYSE } from '../../../software/nanolyse/main.nf' addParams( options: [suffix: '.clean'] ) workflow test_nanolyse { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true)] - ] + input = [ + [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true)] + ] - GET_NANOLYSE_FASTA() - NANOLYSE ( input, GET_NANOLYSE_FASTA.out.fasta ) + fasta = file("https://github.com/wdecoster/nanolyse/raw/master/reference/lambda.fasta.gz", checkIfExists: true) + + NANOLYSE ( input, fasta ) } diff --git a/tests/software/strelka/germline/main.nf b/tests/software/strelka/germline/main.nf index 2994525e..54a20db7 100644 --- a/tests/software/strelka/germline/main.nf +++ b/tests/software/strelka/germline/main.nf @@ -5,25 +5,29 @@ nextflow.enable.dsl = 2 include { STRELKA_GERMLINE } from '../../../../software/strelka/germline/main.nf' addParams( options: [:] ) workflow test_strelka_germline { - input = [ [ id:'test'], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam.bai", checkIfExists: true) - ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) + input = [ + [ id:'test'], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) targets = [] STRELKA_GERMLINE ( input, fasta, fai, targets ) } workflow test_strelka_germline_target_bed { - input = [ [ id:'test'], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam.bai", checkIfExists: true) - ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) - targets = file("${launchDir}/tests/data/genomics/sarscov2/genome/bed/test.bed", checkIfExists: true) + input = [ + [ id:'test'], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + targets = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) STRELKA_GERMLINE ( input, fasta, fai, targets ) } diff --git a/tests/software/strelka/germline/test.yml b/tests/software/strelka/germline/test.yml index 43b95e54..e4ad2203 100644 --- a/tests/software/strelka/germline/test.yml +++ b/tests/software/strelka/germline/test.yml @@ -1,22 +1,20 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml strelka/germline - name: strelka germline command: nextflow run ./tests/software/strelka/germline -entry test_strelka_germline -c tests/config/nextflow.config tags: - strelka - strelka/germline files: - - path: output/strelka/strelka_test_variants.vcf.gz - - path: output/strelka/strelka_test_variants.vcf.gz.tbi - - path: output/strelka/strelka_test_genome.vcf.gz - - path: output/strelka/strelka_test_genome.vcf.gz.tbi + - path: output/strelka/test.variants.vcf.gz + - path: output/strelka/test.variants.vcf.gz.tbi + - path: output/strelka/test.genome.vcf.gz + - path: output/strelka/test.genome.vcf.gz.tbi - name: strelka germline target bed command: nextflow run ./tests/software/strelka/germline -entry test_strelka_germline_target_bed -c tests/config/nextflow.config tags: - strelka - strelka/germline files: - - path: output/strelka/strelka_test_variants.vcf.gz - - path: output/strelka/strelka_test_variants.vcf.gz.tbi - - path: output/strelka/strelka_test_genome.vcf.gz - - path: output/strelka/strelka_test_genome.vcf.gz.tbi + - path: output/strelka/test.variants.vcf.gz + - path: output/strelka/test.variants.vcf.gz.tbi + - path: output/strelka/test.genome.vcf.gz + - path: output/strelka/test.genome.vcf.gz.tbi diff --git a/tests/software/tiddit/sv/main.nf b/tests/software/tiddit/sv/main.nf index a43f9cd2..da1fc6a1 100644 --- a/tests/software/tiddit/sv/main.nf +++ b/tests/software/tiddit/sv/main.nf @@ -5,9 +5,11 @@ nextflow.enable.dsl = 2 include { TIDDIT_SV } from '../../../../software/tiddit/sv/main.nf' addParams( options: [:] ) workflow test_tiddit_sv { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] - ] + input = [ + [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) @@ -15,9 +17,10 @@ workflow test_tiddit_sv { } workflow test_tiddit_sv_no_ref { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] - ] + input = [ + [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + ] TIDDIT_SV ( input, [], [] ) } diff --git a/tests/software/tiddit/sv/test.yml b/tests/software/tiddit/sv/test.yml index dbe89475..daea004c 100644 --- a/tests/software/tiddit/sv/test.yml +++ b/tests/software/tiddit/sv/test.yml @@ -7,9 +7,8 @@ - path: output/tiddit/test.ploidy.tab md5sum: 45e050b0e204f0a5a3a99627cc440eaa - path: output/tiddit/test.signals.tab - md5sum: 25408a43dbdd01c08e33a6d670f2bb84 + md5sum: dab4b2fec4ddf8eb1c23005b0770150e - path: output/tiddit/test.vcf - should_exist: true - name: tiddit sv no ref command: nextflow run ./tests/software/tiddit/sv -entry test_tiddit_sv_no_ref -c tests/config/nextflow.config @@ -20,6 +19,5 @@ - path: output/tiddit/test.ploidy.tab md5sum: 45e050b0e204f0a5a3a99627cc440eaa - path: output/tiddit/test.signals.tab - md5sum: 25408a43dbdd01c08e33a6d670f2bb84 + md5sum: dab4b2fec4ddf8eb1c23005b0770150e - path: output/tiddit/test.vcf - should_exist: true