diff --git a/assets/schema_input.json b/assets/schema_input.json index 01995282..b59a5e91 100755 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -13,7 +13,14 @@ "errorMessage": "Assembly level must be provided" }, "assem_version": { - "anyOf": [{ "type": "string" }, { "type": "integer" }], + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], "errorMessage": "Assembly version must be provided" }, "sample_id": { @@ -41,7 +48,11 @@ }, "map_order": { "type": "string", - "errorMessage": "Map order" + "errorMessage": "Map order", + "enum": [ + "length", + "unsorted" + ] }, "assem_reads": { "type": "object", @@ -49,7 +60,12 @@ "read_type": { "type": "string", "errorMessage": "Long read data type", - "enum": ["hifi", "clr", "ont", "illumina"] + "enum": [ + "hifi", + "clr", + "ont", + "illumina" + ] }, "read_data": { "type": "array", @@ -77,7 +93,10 @@ "hic_aligner": { "type": "string", "errorMessage": "HiC Aligner - minimap2 (default), bwamem2", - "enum": ["minimap2", "bwamem2"] + "enum": [ + "minimap2", + "bwamem2" + ] } } }, diff --git a/modules/local/assign/ancestral/main.nf b/modules/local/assign/ancestral/main.nf index c42711cd..cdfa184d 100755 --- a/modules/local/assign/ancestral/main.nf +++ b/modules/local/assign/ancestral/main.nf @@ -1,5 +1,5 @@ process ASSIGN_ANCESTRAL { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "conda-forge::python=3.9" diff --git a/modules/local/bamtobed/sort/main.nf b/modules/local/bamtobed/sort/main.nf index c9d73306..9a48f0ea 100755 --- a/modules/local/bamtobed/sort/main.nf +++ b/modules/local/bamtobed/sort/main.nf @@ -1,5 +1,5 @@ process BAMTOBED_SORT { - tag "$meta.id" + tag "${meta.id}" label "process_high" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? diff --git a/modules/local/cram/filter_align_bwamem2_fixmate_sort/main.nf b/modules/local/cram/filter_align_bwamem2_fixmate_sort/main.nf index cb772826..25c90f37 100755 --- a/modules/local/cram/filter_align_bwamem2_fixmate_sort/main.nf +++ b/modules/local/cram/filter_align_bwamem2_fixmate_sort/main.nf @@ -1,5 +1,5 @@ process CRAM_FILTER_ALIGN_BWAMEM2_FIXMATE_SORT { - tag "$meta.id" + tag "${meta.id}" label "process_high" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? diff --git a/modules/local/cram/filter_minimap2_filter5end_fixmate_sort/main.nf b/modules/local/cram/filter_minimap2_filter5end_fixmate_sort/main.nf index 36799c72..1ab4f368 100755 --- a/modules/local/cram/filter_minimap2_filter5end_fixmate_sort/main.nf +++ b/modules/local/cram/filter_minimap2_filter5end_fixmate_sort/main.nf @@ -1,5 +1,5 @@ process CRAM_FILTER_MINIMAP2_FILTER5END_FIXMATE_SORT { - tag "$meta.id" + tag "${meta.id}" label "process_high" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? diff --git a/modules/local/extract/ancestral/main.nf b/modules/local/extract/ancestral/main.nf index 23806814..edb62de0 100755 --- a/modules/local/extract/ancestral/main.nf +++ b/modules/local/extract/ancestral/main.nf @@ -1,5 +1,5 @@ process EXTRACT_ANCESTRAL { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "conda-forge::python=3.9" diff --git a/modules/local/extract/repeat/main.nf b/modules/local/extract/repeat/main.nf index 85fe9c93..e928496b 100755 --- a/modules/local/extract/repeat/main.nf +++ b/modules/local/extract/repeat/main.nf @@ -1,5 +1,5 @@ process EXTRACT_REPEAT { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "conda-forge::perl=5.26.2" @@ -8,38 +8,25 @@ process EXTRACT_REPEAT { 'biocontainers/perl:5.26.2' }" input: - tuple val( meta ), path( file ) + tuple val(meta), path(file) output: tuple val( meta ), path( "*.bed" ) , emit: bed - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('extract_repeat.pl'), val("1.0.0"), topic: versions, emit: versions_extractrepeat + tuple val("${task.process}"), val('perl'), eval("perl --version | sed -n 's/.*(v\\([0-9.]\\+\\)).*/\\1/p'"), topic: versions, emit: versions_perl when: task.ext.when == null || task.ext.when script: - def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = "1.0" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def prefix = task.ext.prefix ?: "${meta.id}" """ extract_repeat.pl $file > ${prefix}_repeats.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - extract_repeat.pl: $VERSION - END_VERSIONS """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = "1.0" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}_repeats.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - extract_repeat.pl: $VERSION - END_VERSIONS """ } diff --git a/modules/local/find/half_coverage/main.nf b/modules/local/find/half_coverage/main.nf index 0b4612d3..4b5c2ce0 100755 --- a/modules/local/find/half_coverage/main.nf +++ b/modules/local/find/half_coverage/main.nf @@ -14,7 +14,8 @@ process FIND_HALF_COVERAGE { output: tuple val(meta), path("*.bed") , emit: bed - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('findHalfcoverage.py'), eval("findHalfcoverage.py --version | sed 's/^.*.py //'"), topic: versions, emit: versions_findhalfcoverage + tuple val("${task.process}"), val('python'), eval("python --version | sed 's/^Python //'"), topic: versions, emit: versions_python when: task.ext.when == null || task.ext.when @@ -23,23 +24,11 @@ process FIND_HALF_COVERAGE { def prefix = task.ext.prefix ?: "halfcoverage" """ findHalfcoverage.py -c $bedfile -m $my_genome -d $depthgraph > ${prefix}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') - findHalfcoverage.py: \$(findHalfcoverage.py --version | cut -d' ' -f2) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "halfcoverage" """ touch ${prefix}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') - findHalfcoverage.py: \$(findHalfcoverage.py --version | cut -d' ' -f2) - END_VERSIONS """ } diff --git a/modules/local/get/paired_contact_bed/main.nf b/modules/local/get/paired_contact_bed/main.nf index 57b0b6a9..07f49c8c 100755 --- a/modules/local/get/paired_contact_bed/main.nf +++ b/modules/local/get/paired_contact_bed/main.nf @@ -1,5 +1,5 @@ process GET_PAIRED_CONTACT_BED { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "conda-forge::coreutils=9.1" diff --git a/modules/local/graph/overall_coverage/main.nf b/modules/local/graph/overall_coverage/main.nf index 1864b91e..00851ff5 100755 --- a/modules/local/graph/overall_coverage/main.nf +++ b/modules/local/graph/overall_coverage/main.nf @@ -1,5 +1,5 @@ process GRAPH_OVERALL_COVERAGE { - tag "$meta.id" + tag "${meta.id}" label "process_single" conda "conda-forge::perl=5.26.2" @@ -12,7 +12,8 @@ process GRAPH_OVERALL_COVERAGE { output: tuple val(meta), path("*.part") , emit: part - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('graph_overall_coverage.pl'), eval("graph_overall_coverage.pl --version"), topic: versions, emit: versions_graph_overall_coverage + tuple val("${task.process}"), val('perl'), eval("perl --version | sed -n 's/.*(v\\([0-9.]\\+\\)).*/\\1/p'"), topic: versions, emit: versions_perl when: task.ext.when == null || task.ext.when @@ -21,23 +22,11 @@ process GRAPH_OVERALL_COVERAGE { def prefix = task.ext.prefix ?: "${meta.id}" """ graph_overall_coverage.pl $bed > ${prefix}.part - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - graph_overall_coverage.pl: \$(graph_overall_coverage.pl --version) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.part - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - graph_overall_coverage.pl: \$(graph_overall_coverage.pl --version) - END_VERSIONS """ } diff --git a/modules/local/makecmap/cmap2bed/main.nf b/modules/local/makecmap/cmap2bed/main.nf index f1e7147c..fec84017 100755 --- a/modules/local/makecmap/cmap2bed/main.nf +++ b/modules/local/makecmap/cmap2bed/main.nf @@ -1,5 +1,5 @@ process MAKECMAP_CMAP2BED { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "conda-forge::python=3.9" @@ -13,7 +13,8 @@ process MAKECMAP_CMAP2BED { output: tuple val(meta), path("*.bed"), emit: bedfile - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('cmap2bed.py'), eval("cmap2bed.py --version | sed 's/^.*.py //'"), topic: versions, emit: versions_cmap2bed + tuple val("${task.process}"), val('python'), eval("python --version | sed 's/^Python //'"), topic: versions, emit: versions_python when: task.ext.when == null || task.ext.when @@ -23,23 +24,11 @@ process MAKECMAP_CMAP2BED { """ grep -v '#' $cmap > ${prefix}_${enzyme}_edited.cmap cmap2bed.py -t ${prefix}_${enzyme}_edited.cmap -z $enzyme | sort -k1,1 -k2,2n > ${enzyme}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') - cmap2bed.py: \$(cmap2bed.py --version | cut -d' ' -f2) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}_${enzyme}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') - cmap2bed.py: \$(cmap2bed.py --version | cut -d' ' -f2) - END_VERSIONS """ } diff --git a/modules/local/makecmap/fa2cmapmulticolor/main.nf b/modules/local/makecmap/fa2cmapmulticolor/main.nf index ef641ef4..f8d46dc9 100755 --- a/modules/local/makecmap/fa2cmapmulticolor/main.nf +++ b/modules/local/makecmap/fa2cmapmulticolor/main.nf @@ -1,5 +1,5 @@ process MAKECMAP_FA2CMAPMULTICOLOR { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "conda-forge::perl=5.26.2" @@ -14,7 +14,8 @@ process MAKECMAP_FA2CMAPMULTICOLOR { output: tuple val(meta), path("*.cmap"), emit: cmap path("*key.txt") , emit: cmapkey - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('fa2cmap_multi_color.pl'), eval("fa2cmap_multi_color.pl -v"), topic: versions, emit: versions_fa2cmap_multi_color + tuple val("${task.process}"), val('perl'), eval("perl --version | sed -n 's/.*(v\\([0-9.]\\+\\)).*/\\1/p'"), topic: versions, emit: versions_perl when: task.ext.when == null || task.ext.when @@ -23,22 +24,10 @@ process MAKECMAP_FA2CMAPMULTICOLOR { def args = task.ext.args ?: '' """ fa2cmap_multi_color.pl -i $fasta -e $enzyme 1 $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - fa2cmap_multi_color.pl: \$(fa2cmap_multi_color.pl -v) - END_VERSIONS """ stub: """ touch ${enzyme}_key.cmap - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - fa2cmap_multi_color.pl: \$(fa2cmap_multi_color.pl -v) - END_VERSIONS """ } diff --git a/modules/local/makecmap/renamecmapids/main.nf b/modules/local/makecmap/renamecmapids/main.nf index ce398b2e..43bd87a9 100755 --- a/modules/local/makecmap/renamecmapids/main.nf +++ b/modules/local/makecmap/renamecmapids/main.nf @@ -1,5 +1,5 @@ process MAKECMAP_RENAMECMAPIDS { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "conda-forge::perl=5.26.2" @@ -13,7 +13,8 @@ process MAKECMAP_RENAMECMAPIDS { output: tuple val(meta), path("*.cmap"), emit: renamedcmap - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('rename_cmapids.pl'), eval("rename_cmapids.pl -version"), topic: versions, emit: versions_renamedcmap + tuple val("${task.process}"), val('perl'), eval("perl --version | sed -n 's/.*(v\\([0-9.]\\+\\)).*/\\1/p'"), topic: versions, emit: versions_perl when: task.ext.when == null || task.ext.when @@ -24,23 +25,11 @@ process MAKECMAP_RENAMECMAPIDS { """ rename_cmapids.pl -cmapfile $cmap -idx_key $keys $args > ${prefix}_EDITED.cmap - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - rename_cmapids.pl: \$(rename_cmapids.pl -version) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}_EDITED.cmap - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - rename_cmapids.pl: \$(rename_cmapids.pl -version) - END_VERSIONS """ } diff --git a/modules/local/pretext/graph/main.nf b/modules/local/pretext/graph/main.nf index 1a8e36b7..2c5f0be9 100644 --- a/modules/local/pretext/graph/main.nf +++ b/modules/local/pretext/graph/main.nf @@ -1,5 +1,5 @@ process PRETEXT_GRAPH { - tag "$meta.id" + tag "${meta.id}" label 'process_single' container "quay.io/sanger-tol/pretext:0.0.9-yy5-c2" diff --git a/modules/local/selfcomp/alignmentblocks/main.nf b/modules/local/selfcomp/alignmentblocks/main.nf index 419a7b42..fcd5cd61 100755 --- a/modules/local/selfcomp/alignmentblocks/main.nf +++ b/modules/local/selfcomp/alignmentblocks/main.nf @@ -1,5 +1,5 @@ process SELFCOMP_ALIGNMENTBLOCKS { - tag "$meta.id" + tag "${meta.id}" label "process_medium" conda "conda-forge::python=3.9" @@ -25,7 +25,7 @@ process SELFCOMP_ALIGNMENTBLOCKS { cat <<-END_VERSIONS > versions.yml "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') + python: \$(echo \$(python --version 2>&1) | sed 's/^Python //') pandas: \$(echo \$(pandas: python -c "import pandas as pd; print(pd.__version__)")) pybedtools: \$(echo \$(pybedtools: python -c "import pybedtools as pb; print(pb.__version__)")) build_alignment_block.py: \$(build_alignment_block.py --version | cut -d' ' -f2) diff --git a/modules/local/selfcomp/mapids/main.nf b/modules/local/selfcomp/mapids/main.nf index f3d41243..205aeb2e 100755 --- a/modules/local/selfcomp/mapids/main.nf +++ b/modules/local/selfcomp/mapids/main.nf @@ -1,5 +1,5 @@ process SELFCOMP_MAPIDS { - tag "$meta.id" + tag "${meta.id}" label "process_medium" conda "conda-forge::python=3.9" @@ -25,7 +25,7 @@ process SELFCOMP_MAPIDS { cat <<-END_VERSIONS > versions.yml "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') + python: \$(echo \$(python --version 2>&1) | sed 's/^Python //') mapids.py: \$(mapids.py --version | cut -d' ' -f2) END_VERSIONS """ diff --git a/modules/local/selfcomp/mummer2bed/main.nf b/modules/local/selfcomp/mummer2bed/main.nf index bbc060bd..d0b38efe 100755 --- a/modules/local/selfcomp/mummer2bed/main.nf +++ b/modules/local/selfcomp/mummer2bed/main.nf @@ -1,5 +1,5 @@ process SELFCOMP_MUMMER2BED { - tag "$meta.id" + tag "${meta.id}" label "process_medium" conda "conda-forge::python=3.9" @@ -12,7 +12,9 @@ process SELFCOMP_MUMMER2BED { output: tuple val(meta), path("*.bed"), emit: bedfile - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('mummer2bed.py'), eval("mummer2bed.py --version | cut -d' ' -f2"), topic: versions, emit: versions_mummer2bed + tuple val("${task.process}"), val('python'), eval("python --version 2>&1 | sed 's/^Python //'"), topic: versions, emit: versions_python + when: task.ext.when == null || task.ext.when @@ -23,23 +25,11 @@ process SELFCOMP_MUMMER2BED { """ mummer2bed.py $args -i $mummerfile -l 0 > ${prefix}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') - mummer2bed.py: \$(mummer2bed.py --version | cut -d' ' -f2) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - python: \$(echo \$(python --version 2>&1) | sed 's/^.*python //; s/Using.*\$//') - mummer2bed.py: \$(mapids.py --version | cut -d' ' -f2) - END_VERSIONS """ } diff --git a/modules/local/selfcomp/splitfasta/main.nf b/modules/local/selfcomp/splitfasta/main.nf index 75999b80..14d7840a 100755 --- a/modules/local/selfcomp/splitfasta/main.nf +++ b/modules/local/selfcomp/splitfasta/main.nf @@ -1,5 +1,5 @@ process SELFCOMP_SPLITFASTA { - tag "$meta.id" + tag "${meta.id}" label "process_single" conda "conda-forge::perl-bioperl=1.7.8-1" @@ -13,7 +13,9 @@ process SELFCOMP_SPLITFASTA { output: tuple val(meta), path("*.fa"), emit: fa path("*.agp") , emit: agp - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('split_genomes_for_ensembl.pl'), eval("split_genomes_for_ensembl.pl --version"), topic: versions, emit: versions_split_genomes_for_ensembl + tuple val("${task.process}"), val('perl'), eval("perl --version | sed -n 's/.*(v\\([0-9.]\\+\\)).*/\\1/p'"), topic: versions, emit: versions_perl + tuple val("${task.process}"), val('perl-bioperl'), val("1.7.8-1"), topic: versions, emit: versions_perlbioperl when: task.ext.when == null || task.ext.when @@ -23,13 +25,6 @@ process SELFCOMP_SPLITFASTA { def VERSION = "1.7.8-1" """ split_genomes_for_ensembl.pl $fasta ${prefix}_windowed.fa ${prefix}_split.agp - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - perl-bioperl: $VERSION - split_genomes_for_ensembl.pl: \$(split_genomes_for_ensembl.pl --version) - END_VERSIONS """ stub: @@ -38,12 +33,5 @@ process SELFCOMP_SPLITFASTA { """ touch ${prefix}_split.agp touch ${prefix}_split.fa - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - perl: \$(echo \$(perl --version 2>&1) | sed 's/^.*perl //; s/Using.*\$//') - perl-bioperl: $VERSION - split_genomes_for_ensembl.pl: \$(split_genomes_for_ensembl.pl --version) - END_VERSIONS """ } diff --git a/subworkflows/local/generate_genome/main.nf b/subworkflows/local/generate_genome/main.nf index f9ca7f54..eef5a104 100755 --- a/subworkflows/local/generate_genome/main.nf +++ b/subworkflows/local/generate_genome/main.nf @@ -3,8 +3,8 @@ // // SUBWORKFLOW IMPORT BLOCK // -include { GENERATE_UNSORTED_GENOME } from '../generate_unsorted_genome/main' -include { GENERATE_SORTED_GENOME } from '../generate_sorted_genome/main' +include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' +include { GNU_SORT } from '../../../modules/nf-core/gnu/sort' workflow GENERATE_GENOME { take: @@ -12,9 +12,6 @@ workflow GENERATE_GENOME { map_order // Channel: val main: - ch_genomesize = channel.empty() - ch_genome_fai = channel.empty() - // // MODULE: GENERATE INDEX OF REFERENCE @@ -25,39 +22,43 @@ workflow GENERATE_GENOME { .map{ ref_meta, ref, map_order_input -> tuple( [ id: ref_meta.id, - map_order :map_order_input + map_order: map_order_input ], ref ) } - .branch{ meta, _ref -> - sorted : meta.map_order == "length" - unsorted : meta.map_order != "length" - } - .set{ch_genomesize_input} + .set{ ch_genomesize_input } + + + // + // MODULE: INDEX THE INPUT FASTA + // + SAMTOOLS_FAIDX ( + ch_genomesize_input.map { meta, file -> [meta, file, []]}, + true // get sizes + ) // - // SUBWORKFLOW: GENERATE CHROMOSOME SIZES FILE RANKED BY LENGTH (DEFINED BY USER) + // MODULE: SORT THE INPUT FASTA FAI FOR LENGTH // - GENERATE_SORTED_GENOME ( - ch_genomesize_input.sorted + GNU_SORT ( + SAMTOOLS_FAIDX.out.sizes.filter { meta, _ref -> meta.map_order == "length" } ) - ch_genomesize = GENERATE_SORTED_GENOME.out.genomesize - ch_genome_fai = GENERATE_SORTED_GENOME.out.ref_index // - // SUBWORKFLOW: GENERATE UNSORTED CHROMOSOME SIZES FILE (DEFINED BY USER) + // LOGIC: IF length IS THE MAP ORDER, OUTPUT THE + // SORTED LENGTHS ELSE OUTPUT THE FAI // - GENERATE_UNSORTED_GENOME ( - ch_genomesize_input.unsorted + output = GNU_SORT.out.sorted.mix( + SAMTOOLS_FAIDX.out.sizes.filter{ meta, _ref -> + meta.map_order != "length" + } ) - ch_genomesize = ch_genomesize.mix( GENERATE_UNSORTED_GENOME.out.genomesize ) - ch_genome_fai = ch_genome_fai.mix( GENERATE_UNSORTED_GENOME.out.ref_index ) emit: - dot_genome = ch_genomesize - ref_index = ch_genome_fai + dot_genome = output + ref_index = SAMTOOLS_FAIDX.out.fai ref = reference_file } diff --git a/subworkflows/local/generate_sorted_genome/main.nf b/subworkflows/local/generate_sorted_genome/main.nf deleted file mode 100755 index 5d13f2f8..00000000 --- a/subworkflows/local/generate_sorted_genome/main.nf +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env nextflow - -// -// MODULE IMPORT BLOCK -// -include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' -include { GNU_SORT } from '../../../modules/nf-core/gnu/sort' - -workflow GENERATE_SORTED_GENOME { - take: - reference_file // Channel: path(file) - - main: - - reference_file - .map { ref_meta, ref -> - tuple( ref_meta, ref, [] ) - } - .set { ch_faidx_input } - - - // - // MODULE: INDEX THE INPUT FASTA - // - SAMTOOLS_FAIDX ( - ch_faidx_input, - true // get sizes - ) - - SAMTOOLS_FAIDX.out.sizes - .view{"SIZES: $it"} - - // - // MODULE: SORT THE SIZES FILE - // - GNU_SORT ( - SAMTOOLS_FAIDX.out.sizes - ) - - - // - // LOGIC: RENAME THE SORTED SIZES FILE - // - // GNU_SORT.out.sorted - // .map { meta, sizes -> - // tuple( - // meta, - // file(sizes).copyTo("${meta.id}.sorted.genome") - // ) - // } - // .set { ch_sizes } - - emit: - genomesize = GNU_SORT.out.sorted - ref_index = SAMTOOLS_FAIDX.out.fai -} diff --git a/subworkflows/local/generate_unsorted_genome/main.nf b/subworkflows/local/generate_unsorted_genome/main.nf deleted file mode 100755 index 1213941e..00000000 --- a/subworkflows/local/generate_unsorted_genome/main.nf +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env nextflow - -// -// MODULE IMPORT BLOCK -// -include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' - -workflow GENERATE_UNSORTED_GENOME { - take: - reference_file // Channel: path(file) - - main: - - reference_file - .map { ref_meta, ref -> - tuple( ref_meta, ref, [] ) - } - .set { ch_faidx_input } - - - // - // MODULE: INDEX THE INPUT FASTA - // - SAMTOOLS_FAIDX ( - ch_faidx_input, - true // get sizes - ) - - - // - // LOGIC: RENAME THE SORTED SIZES FILE - // - SAMTOOLS_FAIDX.out.sizes - .map { meta, sizes -> - tuple( - meta, - file(sizes).moveTo("${meta.id}.unsorted.genome") - ) - } - .set { ch_sizes } - - - emit: - genomesize = ch_sizes - ref_index = SAMTOOLS_FAIDX.out.fai -} diff --git a/subworkflows/local/insilico_digest/main.nf b/subworkflows/local/insilico_digest/main.nf index 641ee21e..84905a1d 100755 --- a/subworkflows/local/insilico_digest/main.nf +++ b/subworkflows/local/insilico_digest/main.nf @@ -54,7 +54,6 @@ workflow INSILICO_DIGEST { fa2c_input.fasta, fa2c_input.enzyme ) - ch_versions = ch_versions.mix(MAKECMAP_FA2CMAPMULTICOLOR.out.versions) // // LOGIC: CREATES A TUPLE CONTAINING THE CMAP AND ORIGINAL GENOMIC LOCATIONS @@ -95,7 +94,6 @@ workflow INSILICO_DIGEST { ch_join.cmap, ch_join.key_file ) - ch_versions = ch_versions.mix(MAKECMAP_RENAMECMAPIDS.out.versions) MAKECMAP_RENAMECMAPIDS.out.renamedcmap .multiMap { meta, file -> @@ -112,7 +110,6 @@ workflow INSILICO_DIGEST { ch_renamedcmap.full, ch_renamedcmap.sample ) - ch_versions = ch_versions.mix(MAKECMAP_CMAP2BED.out.versions) MAKECMAP_CMAP2BED.out.bedfile .combine(sizefile) diff --git a/subworkflows/local/read_coverage/main.nf b/subworkflows/local/read_coverage/main.nf index 2aefbbf0..505439d7 100755 --- a/subworkflows/local/read_coverage/main.nf +++ b/subworkflows/local/read_coverage/main.nf @@ -35,6 +35,7 @@ workflow READ_COVERAGE { .flatten() .set { ch_reads_path } + // // LOGIC: PREPARE FOR MINIMAP2, USING READ_TYPE AS FILTER TO DEFINE THE MAPPING METHOD, CHECK YAML_INPUT.NF // @@ -70,6 +71,7 @@ workflow READ_COVERAGE { } .set { minimap_input } + // // PROCESS: MINIMAP ALIGNMENT // @@ -84,6 +86,7 @@ workflow READ_COVERAGE { ) ch_beds = MINIMAP2_ALIGN.out.bed + ch_beds .map { _meta, file -> tuple( file ) @@ -97,6 +100,7 @@ workflow READ_COVERAGE { } .set { collected_files_for_merge } + // // MODULE: MERGE ALL OUTPUT BEDS // @@ -104,18 +108,19 @@ workflow READ_COVERAGE { collected_files_for_merge ) + // // MODULE: SORT THE MERGED BED FILE INTO CHROMOSOME-LOCATION ORDER // GNU_SORT_BED( CAT_CAT.out.file_out ) - ch_sorted_bed = GNU_SORT_BED.out.sorted + // // LOGIC: PREPARING Genome2Cov INPUT // - ch_sorted_bed + GNU_SORT_BED.out.sorted .combine( dot_genome ) .multiMap { meta, file, _my_genome_meta, my_genome -> input_tuple : tuple ( @@ -140,6 +145,7 @@ workflow READ_COVERAGE { false ) + // // LOGIC: BED2BIGWIG TAKES SORTED COVERAGE BED FILE // @@ -148,6 +154,7 @@ workflow READ_COVERAGE { ) ch_sorted_covbed = GNU_SORT_COVBED.out.sorted + // // MODULE: get_minmax_punches // @@ -156,6 +163,7 @@ workflow READ_COVERAGE { ) ch_versions = ch_versions.mix(GET_MIN_MAX_PUNCHES.out.versions) + // // MODULE: get_minmax_punches // @@ -163,6 +171,7 @@ workflow READ_COVERAGE { GET_MIN_MAX_PUNCHES.out.max ) + // // MODULE: get_minmax_punches // @@ -170,13 +179,14 @@ workflow READ_COVERAGE { GET_MIN_MAX_PUNCHES.out.min ) + // // MODULE: GENERATE DEPTHGRAPH // GRAPH_OVERALL_COVERAGE( ch_sorted_covbed ) - ch_versions = ch_versions.mix(GRAPH_OVERALL_COVERAGE.out.versions) + // // LOGIC: PREPARING FIND_HALF_COVERAGE INPUT @@ -191,6 +201,7 @@ workflow READ_COVERAGE { } .set { halfcov_input } + // // MODULE: FIND REGIONS OF HALF COVERAGE // @@ -199,7 +210,7 @@ workflow READ_COVERAGE { halfcov_input.genome_file, halfcov_input.depthgraph_file ) - ch_versions = ch_versions.mix(FIND_HALF_COVERAGE.out.versions) + // // LOGIC: PREPARING NORMAL COVERAGE INPUT @@ -213,6 +224,7 @@ workflow READ_COVERAGE { } .set { bed2bw_normal_input } + // // MODULE: CONVERT BEDGRAPH TO BIGWIG FOR NORMAL COVERAGE // diff --git a/subworkflows/local/repeat_density/main.nf b/subworkflows/local/repeat_density/main.nf index 55d5c0e7..f9ce7b0e 100755 --- a/subworkflows/local/repeat_density/main.nf +++ b/subworkflows/local/repeat_density/main.nf @@ -25,7 +25,6 @@ workflow REPEAT_DENSITY { dot_genome main: - ch_versions = channel.empty() // // MODULE: MARK UP THE REPEAT REGIONS OF THE REFERENCE GENOME // @@ -47,7 +46,7 @@ workflow REPEAT_DENSITY { EXTRACT_REPEAT( WINDOWMASKER_USTAT.out.intervals ) - ch_versions = ch_versions.mix( EXTRACT_REPEAT.out.versions ) + // // MODULE: CREATE WINDOWS FROM .GENOME FILE @@ -56,6 +55,7 @@ workflow REPEAT_DENSITY { dot_genome ) + // // LOGIC: COMBINE TWO CHANNELS AND OUTPUT tuple(meta, windows_file, repeat_file) // @@ -70,6 +70,7 @@ workflow REPEAT_DENSITY { } .set { intervals } + // // MODULE: GENERATES THE REPEAT FILE FROM THE WINDOW FILE AND GENOME FILE // @@ -78,6 +79,7 @@ workflow REPEAT_DENSITY { dot_genome ) + // // MODULE: FIXES IDS FOR REPEATS // @@ -87,12 +89,13 @@ workflow REPEAT_DENSITY { false ) + // // MODULE: SORTS THE ABOVE BED FILES // GNU_SORT_A ( GAWK_RENAME_IDS.out.output // Intersect file - ) + ) GNU_SORT_B ( dot_genome // Genome file - Will not run unless genome file is sorted to @@ -102,6 +105,7 @@ workflow REPEAT_DENSITY { BEDTOOLS_MAKEWINDOWS.out.bed // Windows file ) + // // MODULE: ADDS 4TH COLUMN TO BED FILE USED IN THE REPEAT DENSITY GRAPH // @@ -111,6 +115,7 @@ workflow REPEAT_DENSITY { false ) + // // MODULE: TABIX AND GZIP THE REPEAT DENSITY BED FILE FOR JBROWSE // @@ -118,6 +123,7 @@ workflow REPEAT_DENSITY { GAWK_REFORMAT_INTERSECT.out.output ) + // // LOGIC: COMBINES THE REFORMATTED INTERSECT FILE AND WINDOWS FILE CHANNELS AND SORTS INTO // tuple(intersect_meta, windows file, intersect file) @@ -133,6 +139,7 @@ workflow REPEAT_DENSITY { } .set { for_mapping } + // // MODULE: MAPS THE REPEATS AGAINST THE REFERENCE GENOME // @@ -141,6 +148,7 @@ workflow REPEAT_DENSITY { GNU_SORT_B.out.sorted ) + // // MODULE: REPLACES . WITH 0 IN MAPPED FILE // @@ -150,6 +158,7 @@ workflow REPEAT_DENSITY { false ) + // // MODULE: CONVERTS GENOME FILE AND BED INTO A BIGWIG FILE // @@ -161,5 +170,4 @@ workflow REPEAT_DENSITY { emit: repeat_density = UCSC_BEDGRAPHTOBIGWIG.out.bigwig bed_gz_tbi = TABIX_BGZIPTABIX.out.gz_index - versions = ch_versions } diff --git a/subworkflows/local/selfcomp/main.nf b/subworkflows/local/selfcomp/main.nf index b1eb870e..7cbef2c0 100755 --- a/subworkflows/local/selfcomp/main.nf +++ b/subworkflows/local/selfcomp/main.nf @@ -35,7 +35,6 @@ workflow SELFCOMP { SELFCOMP_SPLITFASTA( reference_tuple ) - ch_versions = ch_versions.mix( SELFCOMP_SPLITFASTA.out.versions ) // @@ -165,7 +164,6 @@ workflow SELFCOMP { SELFCOMP_MUMMER2BED( CAT_CAT.out.file_out ) - ch_versions = ch_versions.mix( SELFCOMP_MUMMER2BED.out.versions ) // diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index fe0c8097..bf1ff2db 100755 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -54,8 +54,8 @@ "bwa-mem2": null }, "EXTRACT_REPEAT": { - "perl": "5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi Copyright 1987-2018, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using \"man perl\" or \"perldoc perl\". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.", - "extract_repeat.pl": 1.0 + "extract_repeat.pl": "1.0.0", + "perl": "5.26.2" }, "EXTRACT_TELOMERE": { "coreutils": 9.1 @@ -64,8 +64,8 @@ "fastk": 1.2 }, "FIND_HALF_COVERAGE": { - "python": "Python 3.9.1", - "findHalfcoverage.py": 1.0 + "findHalfcoverage.py": 1.0, + "python": "3.9.1" }, "FIND_TELOMERE_REGIONS": { "find_telomere": null @@ -126,19 +126,19 @@ "coreutils": 9.5 }, "GRAPH_OVERALL_COVERAGE": { - "perl": "5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi Copyright 1987-2018, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using \"man perl\" or \"perldoc perl\". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.", - "graph_overall_coverage.pl": 1.0 + "graph_overall_coverage.pl": 1.0, + "perl": "5.26.2" }, "MAKECMAP_CMAP2BED": { - "python": "Python 3.9.1", - "cmap2bed.py": 1.0 + "cmap2bed.py": 1.0, + "python": "3.9.1" }, "MAKECMAP_FA2CMAPMULTICOLOR": { - "perl": "5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi Copyright 1987-2018, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using \"man perl\" or \"perldoc perl\". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.", - "fa2cmap_multi_color.pl": "fa2cmap_multi_color.pl 7821 2018-08-09 17:30:15Z twang" + "fa2cmap_multi_color.pl": "fa2cmap_multi_color.pl 7821 2018-08-09 17:30:15Z twang", + "perl": "5.26.2" }, "MAKECMAP_RENAMECMAPIDS": { - "perl": "5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi Copyright 1987-2018, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using \"man perl\" or \"perldoc perl\". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.", + "perl": "5.26.2", "rename_cmapids.pl": 1.0 }, "MERQURYFK_MERQURYFK": { @@ -181,22 +181,22 @@ "samtools": "1.22.1" }, "SELFCOMP_ALIGNMENTBLOCKS": { - "python": "Python 3.10.8", + "python": "3.10.8", "pandas": null, "pybedtools": null, "build_alignment_block.py": 1.0 }, "SELFCOMP_MAPIDS": { - "python": "Python 3.9.1", + "python": "3.9.1", "mapids.py": 1.0 }, "SELFCOMP_MUMMER2BED": { - "python": "Python 3.9.1", - "mummer2bed.py": 1.0 + "mummer2bed.py": 1.0, + "python": "3.9.1" }, "SELFCOMP_SPLITFASTA": { - "perl": "5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-thread-multi Copyright 1987-2021, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using \"man perl\" or \"perldoc perl\". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.", "perl-bioperl": "1.7.8-1", + "perl": "5.32.1", "split_genomes_for_ensembl.pl": 1.0 }, "SEQKIT_SPLIT_QUERY": { @@ -314,4 +314,4 @@ }, "timestamp": "2026-02-20T12:56:48.026565957" } -} \ No newline at end of file +} diff --git a/workflows/treeval.nf b/workflows/treeval.nf index 4d7d4f4b..b8dc5cf4 100755 --- a/workflows/treeval.nf +++ b/workflows/treeval.nf @@ -213,7 +213,6 @@ workflow TREEVAL { ch_upper_ref, GENERATE_GENOME.out.dot_genome ) - ch_versions = ch_versions.mix( REPEAT_DENSITY.out.versions ) ch_repeat_density = REPEAT_DENSITY.out.repeat_density } else { ch_repeat_density = channel.of([[],[]])