diff --git a/modules.json b/modules.json index 6830ce56..32d0ca5c 100644 --- a/modules.json +++ b/modules.json @@ -45,11 +45,6 @@ "git_sha": "72e277acfd9e61a9f1368eafb4a9e83f5bcaa9f5", "installed_by": ["modules"] }, - "samtools/faidx": { - "branch": "master", - "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", - "installed_by": ["modules"] - }, "samtools/flagstat": { "branch": "master", "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", diff --git a/modules/local/blobtk_depth.nf b/modules/local/blobtk_depth.nf index 1d96340f..721ae1d7 100644 --- a/modules/local/blobtk_depth.nf +++ b/modules/local/blobtk_depth.nf @@ -8,7 +8,7 @@ process BLOBTK_DEPTH { container "docker.io/genomehubs/blobtk:0.6.5" input: - tuple val(meta), path(cram), path(bai) + tuple val(meta), path(bam), path(bai) output: tuple val(meta), path('*.coverage.bedGraph') , emit: bedgraph @@ -22,7 +22,7 @@ process BLOBTK_DEPTH { def prefix = task.ext.prefix ?: "${meta.id}" """ blobtk depth \\ - -c ${cram} \\ + -b ${bam} \\ $args \\ -O ${prefix}.coverage.bedGraph \\ diff --git a/modules/local/change_name.nf b/modules/local/change_name.nf index 2136e2da..a6aba96b 100644 --- a/modules/local/change_name.nf +++ b/modules/local/change_name.nf @@ -1,43 +1,26 @@ process CHANGE_NAME { tag "$meta.id" - label 'process_single' - - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'docker.io/ubuntu:20.04' }" + executor 'local' input: tuple val(meta), path(file) output: tuple val(meta), path("*.${file.extension}"), emit: file - path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when script: - def VERSION = "9.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. def prefix = task.ext.prefix ?: "${meta.id}" def new_fn = "${prefix}.${file.extension}" """ - ln -s ${file} ${new_fn} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - coreutils: $VERSION - END_VERSIONS + ln -sf ${file} ${new_fn} """ stub: - def VERSION = "9.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${new_fn} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - coreutils: $VERSION - END_VERSIONS """ } diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml deleted file mode 100644 index 62054fc9..00000000 --- a/modules/nf-core/samtools/faidx/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: - - conda-forge - - bioconda -dependencies: - - bioconda::htslib=1.21 - - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf deleted file mode 100644 index 28c0a81c..00000000 --- a/modules/nf-core/samtools/faidx/main.nf +++ /dev/null @@ -1,50 +0,0 @@ -process SAMTOOLS_FAIDX { - tag "$fasta" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : - 'biocontainers/samtools:1.21--h50ea8bc_0' }" - - input: - tuple val(meta), path(fasta) - tuple val(meta2), path(fai) - - output: - tuple val(meta), path ("*.{fa,fasta}") , emit: fa , optional: true - tuple val(meta), path ("*.fai") , emit: fai, optional: true - tuple val(meta), path ("*.gzi") , emit: gzi, optional: true - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - """ - samtools \\ - faidx \\ - $fasta \\ - $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS - """ - - stub: - def match = (task.ext.args =~ /-o(?:utput)?\s(.*)\s?/).findAll() - def fastacmd = match[0] ? "touch ${match[0][1]}" : '' - """ - ${fastacmd} - touch ${fasta}.fai - - cat <<-END_VERSIONS > versions.yml - - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS - """ -} diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml deleted file mode 100644 index 6721b2cb..00000000 --- a/modules/nf-core/samtools/faidx/meta.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: samtools_faidx -description: Index FASTA file -keywords: - - index - - fasta - - faidx -tools: - - samtools: - description: | - SAMtools is a set of utilities for interacting with and post-processing - short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. - These files are generated as output by short read aligners like BWA. - homepage: http://www.htslib.org/ - documentation: http://www.htslib.org/doc/samtools.html - doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] - identifier: biotools:samtools -input: - - - meta: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fasta: - type: file - description: FASTA file - pattern: "*.{fa,fasta}" - - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fai: - type: file - description: FASTA index file - pattern: "*.{fai}" -output: - - fa: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.{fa,fasta}": - type: file - description: FASTA file - pattern: "*.{fa}" - - fai: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.fai": - type: file - description: FASTA index file - pattern: "*.{fai}" - - gzi: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.gzi": - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@drpatelh" - - "@ewels" - - "@phue" -maintainers: - - "@drpatelh" - - "@ewels" - - "@phue" diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test b/modules/nf-core/samtools/faidx/tests/main.nf.test deleted file mode 100644 index 17244ef2..00000000 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test +++ /dev/null @@ -1,122 +0,0 @@ -nextflow_process { - - name "Test Process SAMTOOLS_FAIDX" - script "../main.nf" - process "SAMTOOLS_FAIDX" - - tag "modules" - tag "modules_nfcore" - tag "samtools" - tag "samtools/faidx" - - test("test_samtools_faidx") { - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - - input[1] = [[],[]] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_faidx_bgzip") { - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)] - - input[1] = [[],[]] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_faidx_fasta") { - - config "./nextflow.config" - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - - input[1] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_faidx_stub_fasta") { - - config "./nextflow2.config" - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - - input[1] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_faidx_stub_fai") { - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - - input[1] = [[],[]] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } -} \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap deleted file mode 100644 index 1bbb3ec2..00000000 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap +++ /dev/null @@ -1,249 +0,0 @@ -{ - "test_samtools_faidx": { - "content": [ - { - "0": [ - - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ], - "fa": [ - - ], - "fai": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "gzi": [ - - ], - "versions": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T07:57:47.450887871" - }, - "test_samtools_faidx_bgzip": { - "content": [ - { - "0": [ - - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" - ] - ], - "3": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ], - "fa": [ - - ], - "fai": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "gzi": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" - ] - ], - "versions": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T07:58:04.804905659" - }, - "test_samtools_faidx_fasta": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ], - "fa": [ - [ - { - "id": "test", - "single_end": false - }, - "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" - ] - ], - "fai": [ - - ], - "gzi": [ - - ], - "versions": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T07:58:23.831268154" - }, - "test_samtools_faidx_stub_fasta": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "extract.fa:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ], - "fa": [ - [ - { - "id": "test", - "single_end": false - }, - "extract.fa:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "fai": [ - - ], - "gzi": [ - - ], - "versions": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T07:58:35.600243706" - }, - "test_samtools_faidx_stub_fai": { - "content": [ - { - "0": [ - - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ], - "fa": [ - - ], - "fai": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "gzi": [ - - ], - "versions": [ - "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T07:58:54.705460167" - } -} \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/tests/nextflow.config b/modules/nf-core/samtools/faidx/tests/nextflow.config deleted file mode 100644 index f76a3ba0..00000000 --- a/modules/nf-core/samtools/faidx/tests/nextflow.config +++ /dev/null @@ -1,7 +0,0 @@ -process { - - withName: SAMTOOLS_FAIDX { - ext.args = 'MT192765.1 -o extract.fa' - } - -} diff --git a/modules/nf-core/samtools/faidx/tests/nextflow2.config b/modules/nf-core/samtools/faidx/tests/nextflow2.config deleted file mode 100644 index 33ebbd5d..00000000 --- a/modules/nf-core/samtools/faidx/tests/nextflow2.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - - withName: SAMTOOLS_FAIDX { - ext.args = '-o extract.fa' - } -} diff --git a/modules/nf-core/samtools/faidx/tests/tags.yml b/modules/nf-core/samtools/faidx/tests/tags.yml deleted file mode 100644 index e4a83948..00000000 --- a/modules/nf-core/samtools/faidx/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -samtools/faidx: - - modules/nf-core/samtools/faidx/** diff --git a/subworkflows/local/convert_stats.nf b/subworkflows/local/convert_stats.nf index 8e7267e7..cc32345d 100644 --- a/subworkflows/local/convert_stats.nf +++ b/subworkflows/local/convert_stats.nf @@ -23,7 +23,7 @@ workflow CONVERT_STATS { take: bam // channel: [ val(meta), /path/to/bam, /path/to/bai ] fasta // channel: [ val(meta), /path/to/fasta ] - ch_header + header // channel: /path/to/header.sam main: ch_versions = Channel.empty() @@ -46,14 +46,13 @@ workflow CONVERT_STATS { run_crumble: meta.datatype == "hic" || meta.datatype == "illumina" || meta.datatype == "pacbio" no_crumble: true } - | set { ch_bams } + | set { crumble_selector } - CRUMBLE ( ch_bams.run_crumble, [], [] ) + CRUMBLE ( crumble_selector.run_crumble, [], [] ) ch_versions = ch_versions.mix( CRUMBLE.out.versions ) - // Convert BAM to CRAM CRUMBLE.out.bam - | mix( ch_bams.no_crumble ) + | mix( crumble_selector.no_crumble ) | map { meta, bam -> [meta, bam, []] } | set { ch_bams_for_conversion } @@ -89,7 +88,6 @@ workflow CONVERT_STATS { ch_bams_to_index = ch_bams_for_conversion.map{ it -> [it[0], it[1]]} // Change name of BAM files to final name for publishing ch_bam = CHANGE_NAME ( ch_bams_to_index ).file - ch_versions = ch_versions.mix( CHANGE_NAME.out.versions.first() ) // Reindex BAM SAMTOOLS_INDEX ( ch_bam ) @@ -106,8 +104,8 @@ workflow CONVERT_STATS { // Optionally insert params.header information to bams if ( params.header ) { - ch_bam = SAMTOOLS_REHEADER_BAM ( ch_bam, ch_header.first() ).bam - ch_cram = SAMTOOLS_REHEADER_CRAM ( ch_cram, ch_header.first() ).bam + ch_bam = SAMTOOLS_REHEADER_BAM ( ch_bam, header.first() ).bam + ch_cram = SAMTOOLS_REHEADER_CRAM ( ch_cram, header.first() ).cram ch_versions = ch_versions.mix ( SAMTOOLS_REHEADER_BAM.out.versions ) .mix ( SAMTOOLS_REHEADER_CRAM.out.versions ) }