diff --git a/.github/actions/nf-test-action/action.yml b/.github/actions/nf-test-action/action.yml new file mode 100644 index 00000000000..4dd6df48919 --- /dev/null +++ b/.github/actions/nf-test-action/action.yml @@ -0,0 +1,83 @@ +name: "nf-test Action" +description: "Runs nf-test with common setup steps" +inputs: + path: + description: "Path to test" + required: true + profile: + description: "Profile to use" + required: true + +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "17" + + - name: Setup Nextflow + uses: nf-core/setup-nextflow@v2 + + - name: Set up Python + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 + with: + python-version: "3.11" + + - name: Install nf-test + uses: nf-core/setup-nf-test@v1 + with: + version: "0.9.2" + install-pdiff: true + + - name: Setup apptainer + if: contains(inputs.profile, 'singularity') + uses: eWaterCycle/setup-apptainer@main + + - name: Set up Singularity + if: contains(inputs.profile, 'singularity') + shell: bash + run: | + mkdir -p $NXF_SINGULARITY_CACHEDIR + mkdir -p $NXF_SINGULARITY_LIBRARYDIR + + - name: Conda setup + if: ${{inputs.profile == 'conda'}} + uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3 + with: + auto-update-conda: true + conda-solver: libmamba + conda-remove-defaults: true + + # Set up secrets + - name: Set up nextflow secrets + if: env.SENTIEON_ENCRYPTION_KEY != '' && env.SENTIEON_LICENSE_MESSAGE != '' + shell: bash + run: | + nextflow secrets set SENTIEON_AUTH_DATA $(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE") + + - name: Run nf-test + shell: bash + env: + SENTIEON_LICSRVR_IP: ${{ env.SENTIEON_LICSRVR_IP }} + SENTIEON_AUTH_MECH: "GitHub Actions - token" + run: | + NFT_WORKDIR=~ \ + nf-test test \ + --profile=${{ inputs.profile }} \ + --tap=test.tap \ + --verbose \ + ${{ inputs.path }} + - uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 + if: ${{ inputs.path != '' }} + with: + path: >- + test.tap + + - name: Clean up + if: always() + shell: bash + run: | + sudo rm -rf /home/ubuntu/tests/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c22ed82bed..0ff73656067 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,8 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 + with: + python-version: "3.11" - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 # FIXME Flip this off once we get to less than a couple hundred. Adding # this so it will only run against changed files. It'll make it much @@ -86,8 +88,7 @@ jobs: with: fetch-depth: 2 # To retrieve the preceding commit. - # TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented - - uses: mirpedrol/paths-filter@main + - uses: dorny/paths-filter@v3 id: filter with: filters: "tests/config/pytest_modules.yml" @@ -135,6 +136,7 @@ jobs: - name: debug run: | + echo ${{ steps.filter.outputs.components }} echo ${{ steps.outputs.outputs.modules }} echo ${{ steps.outputs.outputs.subworkflows }} @@ -441,6 +443,7 @@ jobs: miniconda-version: "latest" channels: conda-forge,bioconda python-version: ${{ matrix.python-version }} + conda-remove-defaults: true - name: Conda setup run: | @@ -485,7 +488,7 @@ jobs: !${{ github.workspace }}/.singularity nf-test: - runs-on: ${{ github.event.inputs.runners || 'ubuntu-latest' }} + runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} name: nf-test needs: [nf-test-changes] if: ( needs.nf-test-changes.outputs.paths != '[]' ) @@ -670,233 +673,47 @@ jobs: env: NXF_ANSI_LOG: false - NFTEST_VER: "0.9.0" - SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} - SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 - with: - distribution: "temurin" - java-version: "17" - - name: Setup Nextflow - uses: nf-core/setup-nextflow@v2 - - - name: Install nf-test - uses: nf-core/setup-nf-test@v1 - with: - version: ${{ env.NFTEST_VER }} - - - name: Setup apptainer - if: matrix.profile == 'singularity' - uses: eWaterCycle/setup-apptainer@main - - - name: Set up Singularity - if: matrix.profile == 'singularity' - run: | - mkdir -p $NXF_SINGULARITY_CACHEDIR - mkdir -p $NXF_SINGULARITY_LIBRARYDIR - - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 - with: - python-version: "3.11" - - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 - id: cache-pip-pdiff - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-pdiff - restore-keys: | - ${{ runner.os }}-pip-pdiff - - - name: Install Python dependencies - run: python -m pip install --upgrade pip pdiff cryptography - - - name: Set up miniconda - if: matrix.profile == 'conda' - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3 - with: - miniconda-version: "latest" - auto-update-conda: true - channels: conda-forge,bioconda - - - name: Conda setup - if: matrix.profile == 'conda' - run: | - conda clean -a - conda install -n base conda-libmamba-solver - conda config --set solver libmamba - echo $(realpath $CONDA)/condabin >> $GITHUB_PATH - echo $(realpath python) >> $GITHUB_PATH - - # Set up secrets - - name: Set up nextflow secrets - # TODO Only run if the tag includes `sentieon` - if: env.SENTIEON_ENCRYPTION_KEY != null && env.SENTIEON_LICENSE_MESSAGE != null - run: | - nextflow secrets set SENTIEON_AUTH_DATA $(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "${{ secrets.SENTIEON_ENCRYPTION_KEY }}" --message "${{ secrets.SENTIEON_LICENSE_MESSAGE }}") - - # Test the module - - name: Run nf-test - if: ${{ matrix.path != '' }} - env: - NFT_DIFF: "pdiff" - NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2" - SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }} - SENTIEON_AUTH_MECH: "GitHub Actions - token" - run: | - # use "docker_self_hosted" if it runs on self-hosted runner and matrix.profile=docker - if [ "${{ matrix.profile }}" == "docker" ]; then - PROFILE="docker_self_hosted" - else - PROFILE=${{ matrix.profile }} - fi - - NFT_WORKDIR=~ \ - nf-test test \ - --profile=${{ matrix.profile }} \ - --tap=test.tap \ - --verbose \ - ${{ matrix.path }} - - - uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 - if: ${{ matrix.path != '' }} + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 + - name: Run nf-test Action + uses: ./.github/actions/nf-test-action with: - path: >- - test.tap - - - name: Clean up - if: always() - run: | - sudo rm -rf /home/ubuntu/tests/ + path: ${{ matrix.path }} + profile: ${{ matrix.profile }} nf-test-gpu: - runs-on: ${{ github.event.inputs.runners || 'gpu' }} - name: nf-test with GPUs + runs-on: "gpu" + name: nf-test-gpu needs: [nf-test-changes] - if: ( needs.nf-test-changes.outputs.paths != '[]' ) + if: ( needs.nf-test-changes.outputs.paths != '[]' && contains(needs.nf-test-changes.outputs.paths, 'modules/nf-core/parabricks') ) strategy: fail-fast: false matrix: - path: ["${{ fromJson(needs.nf-test-changes.outputs.paths) }}"] - profile: [conda, docker_self_hosted, singularity] include: - path: modules/nf-core/parabricks/applybqsr + profile: [docker_self_hosted, singularity] - path: modules/nf-core/parabricks/fq2bam - # - path: modules/nf-core/parabricks/fq2bammeth excluded - tackle in different PR - exclude: - - profile: conda - path: modules/nf-core/parabricks/fq2bam - - profile: conda - path: modules/nf-core/parabricks/fq2bammeth - - profile: conda - path: modules/nf-core/parabricks/applybqsr + profile: [docker_self_hosted, singularity] + - path: modules/nf-core/parabricks/fq2bammeth + profile: [docker_self_hosted, singularity] env: NXF_ANSI_LOG: false - NFTEST_VER: "0.9.0" - SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} - SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 - with: - distribution: "temurin" - java-version: "17" - - name: Setup Nextflow - uses: nf-core/setup-nextflow@v2 - - - name: Install nf-test - uses: nf-core/setup-nf-test@v1 - with: - version: ${{ env.NFTEST_VER }} - - - name: Setup apptainer - if: matrix.profile == 'singularity' - uses: eWaterCycle/setup-apptainer@main - - - name: Set up Singularity - if: matrix.profile == 'singularity' - run: | - mkdir -p $NXF_SINGULARITY_CACHEDIR - mkdir -p $NXF_SINGULARITY_LIBRARYDIR - - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 - with: - python-version: "3.11" - - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 - id: cache-pip-pdiff - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-pdiff - restore-keys: | - ${{ runner.os }}-pip-pdiff - - - name: Install Python dependencies - run: python -m pip install --upgrade pip pdiff cryptography - - - name: Set up miniconda - if: matrix.profile == 'conda' - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3 - with: - miniconda-version: "latest" - auto-update-conda: true - channels: conda-forge,bioconda - - - name: Conda setup - if: matrix.profile == 'conda' - run: | - conda clean -a - conda install -n base conda-libmamba-solver - conda config --set solver libmamba - echo $(realpath $CONDA)/condabin >> $GITHUB_PATH - echo $(realpath python) >> $GITHUB_PATH - - # Set up secrets - - name: Set up nextflow secrets - # TODO Only run if the tag includes `sentieon` - if: env.SENTIEON_ENCRYPTION_KEY != null && env.SENTIEON_LICENSE_MESSAGE != null - run: | - nextflow secrets set SENTIEON_AUTH_DATA $(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "${{ secrets.SENTIEON_ENCRYPTION_KEY }}" --message "${{ secrets.SENTIEON_LICENSE_MESSAGE }}") - # Test the module - - name: Run nf-test - if: ${{ matrix.path != '' }} + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 + - name: Run nf-test Action + uses: ./.github/actions/nf-test-action env: - NFT_DIFF: "pdiff" - NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2" + SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} + SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }} SENTIEON_AUTH_MECH: "GitHub Actions - token" - run: | - # use "docker_self_hosted" if it runs on self-hosted runner and matrix.profile=docker - if [ "${{ matrix.profile }}" == "docker" ]; then - PROFILE="docker_self_hosted" - else - PROFILE=${{ matrix.profile }} - fi - - NFT_WORKDIR=~ \ - nf-test test \ - --profile=${{ matrix.profile }},gpu \ - --tap=test.tap \ - --verbose \ - ${{ matrix.path }} - - - uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 - if: ${{ matrix.path != '' }} with: - path: >- - test.tap - - - name: Clean up - if: always() - run: | - sudo rm -rf /home/ubuntu/tests/ + path: ${{ matrix.path }} + profile: ${{ matrix.profile }},gpu confirm-pass: runs-on: ubuntu-latest @@ -910,6 +727,7 @@ jobs: pytest, nf-test-changes, nf-test, + nf-test-gpu, ] if: always() steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d9bf144771..b97fd79f3a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@3.2.5 + - prettier@3.3.3 - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.29.4 hooks: diff --git a/modules/nf-core/fastqc/meta.yml b/modules/nf-core/fastqc/meta.yml index 4827da7af24..2b2e62b8aea 100644 --- a/modules/nf-core/fastqc/meta.yml +++ b/modules/nf-core/fastqc/meta.yml @@ -11,6 +11,7 @@ tools: FastQC gives general quality metrics about your reads. It provides information about the quality score distribution across your reads, the per base sequence content (%A/C/G/T). + You get information about adapter contamination and other overrepresented sequences. homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ diff --git a/modules/nf-core/trgt/genotype/environment.yml b/modules/nf-core/trgt/genotype/environment.yml new file mode 100644 index 00000000000..721e0df3d5f --- /dev/null +++ b/modules/nf-core/trgt/genotype/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::trgt=1.2.0" diff --git a/modules/nf-core/trgt/genotype/main.nf b/modules/nf-core/trgt/genotype/main.nf new file mode 100644 index 00000000000..3fa0b7b4e59 --- /dev/null +++ b/modules/nf-core/trgt/genotype/main.nf @@ -0,0 +1,56 @@ +process TRGT_GENOTYPE { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/trgt:1.2.0--h9ee0642_0': + 'biocontainers/trgt:1.2.0--h9ee0642_0' }" + + input: + tuple val(meta) , path(bam), path(bai), val(karyotype) + tuple val(meta2), path(fasta) + tuple val(meta3), path(fai) + tuple val(meta4), path(repeats) + + output: + tuple val(meta), path("*.vcf.gz") , emit: vcf + tuple val(meta), path("*.spanning.bam"), emit: bam , optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def karyo = karyotype ? "--karyotype ${karyotype}" : "" + """ + trgt genotype \\ + $args \\ + --genome ${fasta} \\ + --reads ${bam} \\ + --repeats ${repeats} \\ + ${karyo} \\ + --threads ${task.cpus} \\ + --output-prefix ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + trgt: \$(trgt --version |& sed '1!d ; s/trgt //') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.spanning.bam + echo "" | gzip > ${prefix}.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + trgt: \$(trgt --version |& sed '1!d ; s/trgt //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/trgt/genotype/meta.yml b/modules/nf-core/trgt/genotype/meta.yml new file mode 100644 index 00000000000..bd17e4cae82 --- /dev/null +++ b/modules/nf-core/trgt/genotype/meta.yml @@ -0,0 +1,98 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "trgt_genotype" +description: Tandem repeat genotyping from PacBio HiFi data +keywords: + - repeat expansion + - pacbio + - genomics +tools: + - "trgt": + description: "Tandem repeat genotyping and visualization from PacBio HiFi data" + homepage: "https://github.com/PacificBiosciences/trgt" + documentation: "https://github.com/PacificBiosciences/trgt/blob/main/docs/tutorial.md" + tool_dev_url: "https://github.com/PacificBiosciences/trgt" + doi: "10.1038/s41587-023-02057-3" + licence: + ["Pacific Biosciences Software License (https://github.com/PacificBiosciences/trgt/blob/main/LICENSE.md)"] + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - bam: + type: file + description: Sorted BAM file + pattern: "*.bam" + - bai: + type: file + description: "Index of the BAM file" + pattern: "*.bam" + - karyotype: + type: string + description: "Karyotype of the sample. Either XX or XY. Defaults to XX if not given" + enum: + - XX + - XY + - - meta2: + type: map + description: | + Groovy map containing reference information + e.g. `[ id: 'genome' ]` + - fasta: + type: file + description: "FASTA reference file" + pattern: "*.{fasta,fa,fna}" + - - meta3: + type: map + description: | + Groovy map containing reference information + e.g. `[ id: 'genome' ]` + - fai: + type: file + description: "Index for FASTA file" + pattern: "*.fai" + - - meta4: + type: map + description: | + Groovy map containing repeat information + e.g. `[ id: 'repeats' ]` + - repeats: + type: file + description: "BED file with repeat coordinates" + pattern: "*.bed" + +output: + - vcf: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - "*.vcf.gz": + type: file + description: "VCF file with repeat genotypes" + pattern: "*.vcf.gz" + - bam: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - "*.spanning.bam": + type: file + description: BAM file with pieces of reads aligning to repeats + pattern: "*.spanning.bam" + - versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@Schmytzi" + - "@fellen31" +maintainers: + - "@Schmytzi" diff --git a/modules/nf-core/trgt/genotype/tests/main.nf.test b/modules/nf-core/trgt/genotype/tests/main.nf.test new file mode 100644 index 00000000000..d93a2e9603c --- /dev/null +++ b/modules/nf-core/trgt/genotype/tests/main.nf.test @@ -0,0 +1,154 @@ +// nf-core modules test trgt +nextflow_process { + + name "Test Process TRGT_GENOTYPE" + script "../main.nf" + process "TRGT_GENOTYPE" + + tag "modules" + tag "modules_nfcore" + tag "trgt" + tag "trgt/genotype" + tag "samtools/faidx" + tag "gunzip" + + setup { + run("GUNZIP"){ + script "../../../gunzip/main.nf" + process { + """ + input[0] = [ + [ id : 'chr22' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true) + ] + """ + } + } + run("SAMTOOLS_FAIDX"){ + script "../../../samtools/faidx/main.nf" + process { + """ + input[0] = GUNZIP.out.gunzip + input[1] = [[],[]] + """ + } + } + } + + test("homo sapiens - [bam,bai,XX], [fa,fai], bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), + 'XX' + ] + input[1] = GUNZIP.out.gunzip + input[2] = SAMTOOLS_FAIDX.out.fai + input[3] = Channel.of('chr22\t18890357\t18890451\tID=TEST;MOTIFS=AT;STRUC=(AT)n') + .collectFile(name : 'repeats.bed', newLine: false) + .map { file -> [ [ id : 'chr22' ], file ] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo sapiens - [bam,bai,[]], [fa,fai], bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = GUNZIP.out.gunzip + input[2] = SAMTOOLS_FAIDX.out.fai + input[3] = Channel.of('chr22\t18890357\t18890451\tID=TEST;MOTIFS=AT;STRUC=(AT)n') + .collectFile(name : 'repeats.bed', newLine: false) + .map { file -> [ [ id : 'chr22' ], file ] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo sapiens - [bam,bai,XX], [fa,fai], bed - stub") { + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), + 'XX' + ] + input[1] = GUNZIP.out.gunzip + input[2] = SAMTOOLS_FAIDX.out.fai + input[3] = Channel.of('chr22\t18890357\t18890451\tID=TEST;MOTIFS=AT;STRUC=(AT)n') + .collectFile(name : 'repeats.bed', newLine: false) + .map { file -> [ [ id : 'chr22' ], file ] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo sapiens - [bam,bai,[]], [fa,fai], bed - stub") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = GUNZIP.out.gunzip + input[2] = SAMTOOLS_FAIDX.out.fai + input[3] = Channel.of('chr22\t18890357\t18890451\tID=TEST;MOTIFS=AT;STRUC=(AT)n') + .collectFile(name : 'repeats.bed', newLine: false) + .map { file -> [ [ id : 'chr22' ], file ] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } +} diff --git a/modules/nf-core/trgt/genotype/tests/main.nf.test.snap b/modules/nf-core/trgt/genotype/tests/main.nf.test.snap new file mode 100644 index 00000000000..9e50fb81eb3 --- /dev/null +++ b/modules/nf-core/trgt/genotype/tests/main.nf.test.snap @@ -0,0 +1,198 @@ +{ + "homo sapiens - [bam,bai,XX], [fa,fai], bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,4e5b6028e3ea3d06829ca18af1cc492e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,645a2c199d04aaf733ce84247f0b0f37" + ] + ], + "2": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,645a2c199d04aaf733ce84247f0b0f37" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,4e5b6028e3ea3d06829ca18af1cc492e" + ] + ], + "versions": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-15T16:07:55.029938504" + }, + "homo sapiens - [bam,bai,[]], [fa,fai], bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,0337e3287dcc71728c36c185dae7738f" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,8d6d1bf813109870692d2f20d59399e7" + ] + ], + "2": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,8d6d1bf813109870692d2f20d59399e7" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,0337e3287dcc71728c36c185dae7738f" + ] + ], + "versions": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-15T16:08:33.937952067" + }, + "homo sapiens - [bam,bai,XX], [fa,fai], bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-15T16:16:39.197756426" + }, + "homo sapiens - [bam,bai,[]], [fa,fai], bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,0337e3287dcc71728c36c185dae7738f" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,8d6d1bf813109870692d2f20d59399e7" + ] + ], + "2": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.spanning.bam:md5,8d6d1bf813109870692d2f20d59399e7" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,0337e3287dcc71728c36c185dae7738f" + ] + ], + "versions": [ + "versions.yml:md5,b773615cf974b094032306822d32017b" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-11-15T16:08:07.631383773" + } +} \ No newline at end of file diff --git a/modules/nf-core/wittyer/Dockerfile b/modules/nf-core/wittyer/Dockerfile index fbf732f32bd..5d1236d5985 100644 --- a/modules/nf-core/wittyer/Dockerfile +++ b/modules/nf-core/wittyer/Dockerfile @@ -1,12 +1,12 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0@sha256:6df1177e48b55272316d08f19cb383483af82aca5cdc67a76c414bc200847624 as builder +FROM mcr.microsoft.com/dotnet/sdk:9.0@sha256:7d24e90a392e88eb56093e4eb325ff883ad609382a55d42f17fd557b997022ca as builder +ADD https://github.com/Illumina/witty.er.git#v0.5.2 /src WORKDIR /src -COPY . /src RUN cd Wittyer \ && dotnet publish -f net6.0 -r linux-x64 -c Release -o /output \ && chmod +x /output/Wittyer -FROM mcr.microsoft.com/dotnet/runtime:6.0@sha256:437cda84bdce26ce074d88b63abeec567c7226d73e8b911605077468e1d5c8d5 +FROM mcr.microsoft.com/dotnet/runtime:9.0@sha256:1e5eb0ed94ca96a34a914456db80e48bd1bb7bc3e3c8eda5e2c3d89c153c3081 LABEL git_repository=https://git.illumina.com/DASTE/Ilmn.Das.App.Wittyer.git WORKDIR /opt/Wittyer diff --git a/modules/nf-core/wittyer/main.nf b/modules/nf-core/wittyer/main.nf index 5cee35c8fd8..da0f7efbbd9 100644 --- a/modules/nf-core/wittyer/main.nf +++ b/modules/nf-core/wittyer/main.nf @@ -2,7 +2,7 @@ process WITTYER { tag "$meta.id" label 'process_single' - container "nf-core/wittyer:0.5.2.0" + container "nf-core/modules/wittyer:4c55c27c711b558f" // Exit if running this module with -profile conda / -profile mamba if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { diff --git a/subworkflows/nf-core/fastq_align_dedup_bismark/main.nf b/subworkflows/nf-core/fastq_align_dedup_bismark/main.nf new file mode 100644 index 00000000000..1497e5adda8 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_dedup_bismark/main.nf @@ -0,0 +1,153 @@ +include { BISMARK_ALIGN } from '../../../modules/nf-core/bismark/align/main' +include { BISMARK_DEDUPLICATE } from '../../../modules/nf-core/bismark/deduplicate/main' +include { BISMARK_METHYLATIONEXTRACTOR } from '../../../modules/nf-core/bismark/methylationextractor/main' +include { BISMARK_COVERAGE2CYTOSINE } from '../../../modules/nf-core/bismark/coverage2cytosine/main' +include { BISMARK_REPORT } from '../../../modules/nf-core/bismark/report/main' +include { BISMARK_SUMMARY } from '../../../modules/nf-core/bismark/summary/main' +include { SAMTOOLS_SORT as SAMTOOLS_SORT_DEDUPLICATED } from '../../../modules/nf-core/samtools/sort/main' +include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_DEDUPLICATED } from '../../../modules/nf-core/samtools/index/main' + +workflow FASTQ_ALIGN_DEDUP_BISMARK { + + take: + ch_reads // channel: [ val(meta), [ reads ] ] + ch_fasta // channel: [ val(meta), [ fasta ] ] + ch_bismark_index // channel: [ val(meta), [ bismark index ] ] + skip_deduplication // boolean: whether to deduplicate alignments + cytosine_report // boolean: whether the run coverage2cytosine + + main: + ch_versions = Channel.empty() + ch_coverage2cytosine_coverage = Channel.empty() + ch_coverage2cytosine_report = Channel.empty() + ch_coverage2cytosine_summary = Channel.empty() + ch_methylation_bedgraph = Channel.empty() + ch_methylation_calls = Channel.empty() + ch_methylation_coverage = Channel.empty() + ch_methylation_report = Channel.empty() + ch_methylation_mbias = Channel.empty() + ch_bismark_report = Channel.empty() + ch_bismark_summary = Channel.empty() + ch_multiqc_files = Channel.empty() + + /* + * Align with bismark + */ + BISMARK_ALIGN ( + ch_reads, + ch_fasta, + ch_bismark_index + ) + ch_versions = ch_versions.mix(BISMARK_ALIGN.out.versions) + + if (skip_deduplication) { + alignments = BISMARK_ALIGN.out.bam + alignment_reports = BISMARK_ALIGN.out.report.map{ meta, report -> [ meta, report, [] ] } + } else { + /* + * Run deduplicate_bismark + */ + BISMARK_DEDUPLICATE ( + BISMARK_ALIGN.out.bam + ) + alignments = BISMARK_DEDUPLICATE.out.bam + alignment_reports = BISMARK_ALIGN.out.report.join(BISMARK_DEDUPLICATE.out.report) + ch_versions = ch_versions.mix(BISMARK_DEDUPLICATE.out.versions) + } + + /* + * Run bismark_methylation_extractor + */ + BISMARK_METHYLATIONEXTRACTOR ( + alignments, + ch_bismark_index + ) + ch_methylation_bedgraph = BISMARK_METHYLATIONEXTRACTOR.out.bedgraph + ch_methylation_calls = BISMARK_METHYLATIONEXTRACTOR.out.methylation_calls + ch_methylation_coverage = BISMARK_METHYLATIONEXTRACTOR.out.coverage + ch_methylation_report = BISMARK_METHYLATIONEXTRACTOR.out.report + ch_methylation_mbias = BISMARK_METHYLATIONEXTRACTOR.out.mbias + ch_versions = ch_versions.mix(BISMARK_METHYLATIONEXTRACTOR.out.versions) + + /* + * Run bismark coverage2cytosine + */ + if (cytosine_report) { + BISMARK_COVERAGE2CYTOSINE ( + BISMARK_METHYLATIONEXTRACTOR.out.coverage, + ch_fasta, + ch_bismark_index + ) + ch_coverage2cytosine_coverage = BISMARK_COVERAGE2CYTOSINE.out.coverage + ch_coverage2cytosine_report = BISMARK_COVERAGE2CYTOSINE.out.report + ch_coverage2cytosine_summary = BISMARK_COVERAGE2CYTOSINE.out.summary + ch_versions = ch_versions.mix(BISMARK_COVERAGE2CYTOSINE.out.versions) + } + + /* + * Generate bismark sample reports + */ + BISMARK_REPORT ( + alignment_reports + .join(ch_methylation_report) + .join(ch_methylation_mbias) + ) + ch_bismark_report = BISMARK_REPORT.out.report + ch_versions = ch_versions.mix(BISMARK_REPORT.out.versions) + + /* + * Generate bismark summary report + */ + BISMARK_SUMMARY ( + BISMARK_ALIGN.out.bam.collect{ meta, bam -> bam.name }, + alignment_reports.collect{ meta, align_report, dedup_report -> align_report }, + alignment_reports.collect{ meta, align_report, dedup_report -> dedup_report }.ifEmpty([]), + BISMARK_METHYLATIONEXTRACTOR.out.report.collect{ meta, report -> report }, + BISMARK_METHYLATIONEXTRACTOR.out.mbias.collect{ meta, mbias -> mbias } + ) + ch_bismark_summary = BISMARK_SUMMARY.out.summary + ch_versions = ch_versions.mix(BISMARK_SUMMARY.out.versions) + + /* + * MODULE: Run samtools sort on dedup bam + */ + SAMTOOLS_SORT_DEDUPLICATED ( + alignments, + [[:],[]] // [ [meta], [fasta]] + ) + ch_versions = ch_versions.mix(SAMTOOLS_SORT_DEDUPLICATED.out.versions) + + /* + * MODULE: Run samtools index on dedup bam + */ + SAMTOOLS_INDEX_DEDUPLICATED ( + SAMTOOLS_SORT_DEDUPLICATED.out.bam + ) + ch_versions = ch_versions.mix(SAMTOOLS_INDEX_DEDUPLICATED.out.versions) + + /* + * Collect MultiQC inputs + */ + ch_multiqc_files = BISMARK_SUMMARY.out.summary + .mix(alignment_reports.collect{ meta, align_report, dedup_report -> align_report }) + .mix(alignment_reports.collect{ meta, align_report, dedup_report -> dedup_report }) + .mix(BISMARK_METHYLATIONEXTRACTOR.out.report.collect{ meta, report -> report }) + .mix(BISMARK_METHYLATIONEXTRACTOR.out.mbias.collect{ meta, mbias -> mbias }) + .mix(BISMARK_REPORT.out.report.collect{ meta, report -> report }) + + emit: + dedup_bam = SAMTOOLS_SORT_DEDUPLICATED.out.bam // channel: [ val(meta), [ bam ] ] + dedup_bam_index = SAMTOOLS_INDEX_DEDUPLICATED.out.bai // channel: [ val(meta), [ bai ] ] + coverage2cytosine_coverage = ch_coverage2cytosine_coverage // channel: [ val(meta), [ coverage ] ] + coverage2cytosine_report = ch_coverage2cytosine_report // channel: [ val(meta), [ report ] ] + coverage2cytosine_summary = ch_coverage2cytosine_summary // channel: [ val(meta), [ summary ] ] + methylation_bedgraph = ch_methylation_bedgraph // channel: [ val(meta), [ bedgraph ] ] + methylation_calls = ch_methylation_calls // channel: [ val(meta), [ methylation_calls ] ] + methylation_coverage = ch_methylation_coverage // channel: [ val(meta), [ coverage ] ] + methylation_report = ch_methylation_report // channel: [ val(meta), [ report ] ] + methylation_mbias = ch_methylation_mbias // channel: [ val(meta), [ mbias ] ] + bismark_report = ch_bismark_report // channel: [ val(meta), [ report ] ] + bismark_summary = ch_bismark_summary // channel: [ val(meta), [ summary ] ] + multiqc = ch_multiqc_files // path: *{html,txt} + versions = ch_versions // path: *.version.txt +} diff --git a/subworkflows/nf-core/fastq_align_dedup_bismark/meta.yml b/subworkflows/nf-core/fastq_align_dedup_bismark/meta.yml new file mode 100644 index 00000000000..4f3aa80b946 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_dedup_bismark/meta.yml @@ -0,0 +1,136 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "fastq_align_dedup_bismark" +description: Align BS-Seq reads to a reference genome using bismark, deduplicate and sort +keywords: + - bismark + - 3-letter genome + - map + - methylation + - 5mC + - methylseq + - bisulphite + - bisulfite + - bam +components: + - bismark/align + - samtools/sort + - samtools/index + - bismark/deduplicate + - bismark/methylationextractor + - bismark/coverage2cytosine + - bismark/report + - bismark/summary +input: + - ch_reads: + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + Structure: [ val(meta), [ path(reads) ] ] + pattern: "*.{fastq,fastq.gz}" + - ch_fasta: + type: file + description: | + Structure: [ val(meta), path(fasta) ] + pattern: "*.{fa,fa.gz}" + - ch_index: + description: | + Bismark genome index files + Structure: [ val(meta), path(index) ] + pattern: "BismarkIndex" + - skip_deduplication: + type: boolean + description: | + Skip deduplication of aligned reads + - cytosine_report: + type: boolean + description: | + Produce coverage2cytosine reports that relates methylation calls back to genomic cytosine contexts +output: + - dedup_bam: + type: file + description: | + Channel containing deduplicated BAM files. + Structure: [ val(meta), path(bam) ] + pattern: "*.bam" + - dedup_bam_index: + type: file + description: | + Channel containing deduplicated BAM index files. + Structure: [ val(meta), path(bam.bai) ] + pattern: "*.bai" + - coverage2cytosine_coverage: + type: file + description: | + Channel containing coverage information from coverage2cytosine. + Structure: [ val(meta), path(coverage.txt) ] + pattern: "*.cov.gz" + - coverage2cytosine_report: + type: file + description: | + Channel containing report from coverage2cytosine summarizing cytosine methylation coverage. + Structure: [ val(meta), path(report.txt) ] + pattern: "*report.txt.gz" + - coverage2cytosine_summary: + type: file + description: | + Channel containing summary information from coverage2cytosine. + Structure: [ val(meta), path(summary.txt) ] + pattern: "*cytosine_context_summary.txt" + - methylation_bedgraph: + type: file + description: | + Channel containing methylation data in bedGraph format. + Structure: [ val(meta), path(methylation.bedgraph) ] + pattern: "*.bedGraph.gz" + - methylation_calls: + type: file + description: | + Channel containing methylation call data. + Structure: [ val(meta), path(calls.txt) ] + pattern: "*.txt.gz" + - methylation_coverage: + type: file + description: | + Channel containing methylation coverage data. + Structure: [ val(meta), path(coverage.txt) ] + pattern: "*.cov.gz" + - methylation_report: + type: file + description: | + Channel containing methylation report detailing methylation patterns. + Structure: [ val(meta), path(report.txt) ] + pattern: "*_splitting_report.txt" + - methylation_mbias: + type: file + description: | + Channel containing M-bias report showing methylation bias across read positions. + Structure: [ val(meta), path(mbias.txt) ] + pattern: "*.M-bias.txt" + - bismark_report: + type: file + description: | + Channel containing Bismark report with mapping and methylation statistics. + Structure: [ val(meta), path(bismark_report.txt) ] + pattern: "*report.{html,txt}" + - bismark_summary: + type: file + description: | + Channel containing Bismark summary report. + Structure: [ val(meta), path(bismark_summary.txt) ] + pattern: "*report.{html,txt}" + - multiqc: + type: file + description: | + Channel containing MultiQC report aggregating results across samples. + Structure: [ val(meta), path(multiqc_report.html) ] + pattern: "*.html" + - versions: + type: file + description: | + File containing software versions. + Structure: [ path(versions.yml) ] + pattern: "versions.yml" +authors: + - "@sateeshperi" +maintainers: + - "@sateeshperi" diff --git a/subworkflows/nf-core/fastq_align_dedup_bismark/tests/main.nf.test b/subworkflows/nf-core/fastq_align_dedup_bismark/tests/main.nf.test new file mode 100644 index 00000000000..f30c4344449 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_dedup_bismark/tests/main.nf.test @@ -0,0 +1,336 @@ +nextflow_workflow { + + name "Test Subworkflow FASTQ_ALIGN_DEDUP_BISMARK" + script "../main.nf" + workflow "FASTQ_ALIGN_DEDUP_BISMARK" + config "./nextflow.config" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_align_dedup_bismark" + tag "bismark/align" + tag "samtools/sort" + tag "samtools/index" + tag "bismark/deduplicate" + tag "bismark/methylationextractor" + tag "bismark/coverage2cytosine" + tag "bismark/report" + tag "bismark/summary" + tag "untar" + + setup { + run("UNTAR", alias: "BOWTIE2") { + script "../../../../modules/nf-core/untar/main.nf" + process { + """ + input[0] = [ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/Bowtie2_Index.tar.gz', checkIfExists: true) + ] + """ + } + } + + run("UNTAR", alias: "HISAT2") { + script "../../../../modules/nf-core/untar/main.nf" + process { + """ + input[0] = [ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/Hisat2_Index.tar.gz', checkIfExists: true) + ] + """ + } + } + } + + test("Params: bismark | default") { + + when { + params { + aligner = "bismark" + cytosine_report = false + skip_deduplication = false + } + + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ]) + input[1] = Channel.of([ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = BOWTIE2.out.untar + input[3] = params.skip_deduplication + input[4] = params.cytosine_report + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.dedup.collect { bam(it[1]).getReadsMD5() }, + workflow.out.dedup_bam_index.collect { meta, bai -> file(bai).name }, + workflow.out.coverage2cytosine_coverage, + workflow.out.coverage2cytosine_report, + workflow.out.coverage2cytosine_summary, + workflow.out.methylation_bedgraph, + workflow.out.methylation_calls, + workflow.out.methylation_coverage, + workflow.out.methylation_report, + workflow.out.methylation_mbias, + workflow.out.bismark_report.collect { meta, report -> file(report).name }, + workflow.out.bismark_summary[0][1], + workflow.out.multiqc.flatten().collect { path -> file(path).name }, + workflow.out.versions + ).match() } + ) + } + } + + test("Params: bismark | skip_deduplication") { + + when { + params { + aligner = "bismark" + skip_deduplication = true + } + + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ]) + input[1] = Channel.of([ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = BOWTIE2.out.untar + input[3] = params.skip_deduplication + input[4] = params.cytosine_report + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.dedup.collect { bam(it[1]).getReadsMD5() }, + workflow.out.dedup_bam_index.collect { meta, bai -> file(bai).name }, + workflow.out.coverage2cytosine_coverage, + workflow.out.coverage2cytosine_report, + workflow.out.coverage2cytosine_summary, + workflow.out.methylation_bedgraph, + workflow.out.methylation_calls, + workflow.out.methylation_coverage, + workflow.out.methylation_report, + workflow.out.methylation_mbias, + workflow.out.bismark_report.collect { meta, report -> file(report).name }, + workflow.out.bismark_summary[0][1], + workflow.out.multiqc.flatten().collect { path -> file(path).name }, + workflow.out.versions + ).match() } + ) + } + } + + test("Params: bismark | cytosine_report") { + + when { + params { + aligner = "bismark" + cytosine_report = true + } + + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ]) + input[1] = Channel.of([ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = BOWTIE2.out.untar + input[3] = params.skip_deduplication + input[4] = params.cytosine_report + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.dedup.collect { bam(it[1]).getReadsMD5() }, + workflow.out.dedup_bam_index.collect { meta, bai -> file(bai).name }, + workflow.out.coverage2cytosine_coverage, + workflow.out.coverage2cytosine_report, + workflow.out.coverage2cytosine_summary, + workflow.out.methylation_bedgraph, + workflow.out.methylation_calls, + workflow.out.methylation_coverage, + workflow.out.methylation_report, + workflow.out.methylation_mbias, + workflow.out.bismark_report.collect { meta, report -> file(report).name }, + workflow.out.bismark_summary[0][1], + workflow.out.multiqc.flatten().collect { path -> file(path).name }, + workflow.out.versions + ).match() } + ) + } + } + + test("Params: bismark_hisat | default") { + + when { + params { + aligner = "bismark_hisat" + cytosine_report = false + skip_deduplication = false + } + + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ]) + input[1] = Channel.of([ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = HISAT2.out.untar + input[3] = params.skip_deduplication + input[4] = params.cytosine_report + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.dedup.collect { bam(it[1]).getReadsMD5() }, + workflow.out.dedup_bam_index.collect { meta, bai -> file(bai).name }, + workflow.out.coverage2cytosine_coverage, + workflow.out.coverage2cytosine_report, + workflow.out.coverage2cytosine_summary, + workflow.out.methylation_bedgraph, + workflow.out.methylation_calls, + workflow.out.methylation_coverage, + workflow.out.methylation_report, + workflow.out.methylation_mbias, + workflow.out.bismark_report.collect { meta, report -> file(report).name }, + workflow.out.bismark_summary[0][1], + workflow.out.multiqc.flatten().collect { path -> file(path).name }, + workflow.out.versions + ).match() } + ) + } + } + + test("Params: bismark_hisat | skip_deduplication") { + + when { + params { + aligner = "bismark_hisat" + skip_deduplication = true + } + + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ]) + input[1] = Channel.of([ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = HISAT2.out.untar + input[3] = params.skip_deduplication + input[4] = params.cytosine_report + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.dedup.collect { bam(it[1]).getReadsMD5() }, + workflow.out.dedup_bam_index.collect { meta, bai -> file(bai).name }, + workflow.out.coverage2cytosine_coverage, + workflow.out.coverage2cytosine_report, + workflow.out.coverage2cytosine_summary, + workflow.out.methylation_bedgraph, + workflow.out.methylation_calls, + workflow.out.methylation_coverage, + workflow.out.methylation_report, + workflow.out.methylation_mbias, + workflow.out.bismark_report.collect { meta, report -> file(report).name }, + workflow.out.bismark_summary[0][1], + workflow.out.multiqc.flatten().collect { path -> file(path).name }, + workflow.out.versions + ).match() } + ) + } + } + + test("Params: bismark_hisat | cytosine_report") { + + when { + params { + aligner = "bismark_hisat" + cytosine_report = true + } + + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ]) + input[1] = Channel.of([ + [:], + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = HISAT2.out.untar + input[3] = params.skip_deduplication + input[4] = params.cytosine_report + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.dedup.collect { bam(it[1]).getReadsMD5() }, + workflow.out.dedup_bam_index.collect { meta, bai -> file(bai).name }, + workflow.out.coverage2cytosine_coverage, + workflow.out.coverage2cytosine_report, + workflow.out.coverage2cytosine_summary, + workflow.out.methylation_bedgraph, + workflow.out.methylation_calls, + workflow.out.methylation_coverage, + workflow.out.methylation_report, + workflow.out.methylation_mbias, + workflow.out.bismark_report.collect { meta, report -> file(report).name }, + workflow.out.bismark_summary[0][1], + workflow.out.multiqc.flatten().collect { path -> file(path).name }, + workflow.out.versions + ).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_align_dedup_bismark/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_dedup_bismark/tests/main.nf.test.snap new file mode 100644 index 00000000000..b8f199fb126 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_dedup_bismark/tests/main.nf.test.snap @@ -0,0 +1,612 @@ +{ + "Params: bismark | skip_deduplication": { + "content": [ + [ + + ], + [ + "test.sorted.bam.bai" + ], + [ + + ], + [ + + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.bedGraph.gz:md5,6896f135c70e2f4944cb43260a687c6c" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "CHG_OB_SRR389222_sub1_bismark_bt2.txt.gz:md5,11ae58ebe6513375468ebe63a521d6e3", + "CHG_OT_SRR389222_sub1_bismark_bt2.txt.gz:md5,d0754aef3f7066881bdee1adf72b4bd1", + "CHH_OB_SRR389222_sub1_bismark_bt2.txt.gz:md5,12e9e4ebf59e6b23fb52f4872f534251", + "CHH_OT_SRR389222_sub1_bismark_bt2.txt.gz:md5,b800b59b0987650ac6eb4d2eb25451ad", + "CpG_OB_SRR389222_sub1_bismark_bt2.txt.gz:md5,21d614f45ecf703117550cb2eebfa3d5", + "CpG_OT_SRR389222_sub1_bismark_bt2.txt.gz:md5,8bbe9103623f502908e81cc573754524" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.bismark.cov.gz:md5,4e31b9a432731c75a604c89cb9d471ad" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2_splitting_report.txt:md5,d1bc9da2811d0f20981d01c3b1f4c925" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.M-bias.txt:md5,d1083f305a444487fe977362a0174159" + ] + ], + [ + "SRR389222_sub1_bismark_bt2_SE_report.html" + ], + "bismark_summary_report.txt:md5,13f7305cf7003f54e0eba22f3590889a", + [ + "SRR389222_sub1_bismark_bt2.M-bias.txt", + "SRR389222_sub1_bismark_bt2_SE_report.html", + "SRR389222_sub1_bismark_bt2_SE_report.txt", + "SRR389222_sub1_bismark_bt2_splitting_report.txt", + "bismark_summary_report.html", + "bismark_summary_report.txt" + ], + [ + "versions.yml:md5,46e043d0037e7446544ae1e25b65536c", + "versions.yml:md5,6c516cc03aa69228e503c540ee3794aa", + "versions.yml:md5,6f2f867f534bb0ae0ffbdc52d036afce", + "versions.yml:md5,9b480db277eebeb6265cbd003553c22c", + "versions.yml:md5,aa64d431e6cfc5ffcbd5012a76b0c1a3", + "versions.yml:md5,df1a6bcb24960ee4a22a2cc914c65272" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-15T15:19:32.095795684" + }, + "Params: bismark | default": { + "content": [ + [ + + ], + [ + "test.sorted.bam.bai" + ], + [ + + ], + [ + + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated.bedGraph.gz:md5,5d7312489e51ca88e1ce1f689db93a64" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "CHG_OB_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,5c177e6f00dfc6e2335a55c6b70efa0c", + "CHG_OT_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,5362d479358f644fe2c17cfe02f310f8", + "CHH_OB_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,9469ac28e4369032b855ce1a794a56a4", + "CHH_OT_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,d7628ac941d3fea97297a8dfcfb7aed1", + "CpG_OB_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,f0404fc1fc18c7ff58e8766b405239ed", + "CpG_OT_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,67d04d843e9e1abc8643bc25b27a9ff5" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated.bismark.cov.gz:md5,eb0d3f96ed97c5d12afeeb49c234849d" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated_splitting_report.txt:md5,ec268cc572b8bcfea0959b47c7510f05" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated.M-bias.txt:md5,290ebfeca4da7809cf9adfe60bab1b29" + ] + ], + [ + "SRR389222_sub1_bismark_bt2_SE_report.html" + ], + "bismark_summary_report.txt:md5,46f54eec58516c027e20bc9bdcaaae14", + [ + "SRR389222_sub1_bismark_bt2.deduplicated.M-bias.txt", + "SRR389222_sub1_bismark_bt2.deduplicated_splitting_report.txt", + "SRR389222_sub1_bismark_bt2.deduplication_report.txt", + "SRR389222_sub1_bismark_bt2_SE_report.html", + "SRR389222_sub1_bismark_bt2_SE_report.txt", + "bismark_summary_report.html", + "bismark_summary_report.txt" + ], + [ + "versions.yml:md5,46e043d0037e7446544ae1e25b65536c", + "versions.yml:md5,6c516cc03aa69228e503c540ee3794aa", + "versions.yml:md5,6f2f867f534bb0ae0ffbdc52d036afce", + "versions.yml:md5,9b480db277eebeb6265cbd003553c22c", + "versions.yml:md5,a675051417ba65700b5db32d98aa65b6", + "versions.yml:md5,aa64d431e6cfc5ffcbd5012a76b0c1a3", + "versions.yml:md5,df1a6bcb24960ee4a22a2cc914c65272" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-15T15:18:51.250132036" + }, + "Params: bismark | cytosine_report": { + "content": [ + [ + + ], + [ + "test.sorted.bam.bai" + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.CpG_report.txt.gz:md5,33af7ef6af01da4f1e12457ff1d782c6" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.cytosine_context_summary.txt:md5,0e8c65559470bc64c42dbd0278a531de" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated.bedGraph.gz:md5,5d7312489e51ca88e1ce1f689db93a64" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "CHG_OB_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,5c177e6f00dfc6e2335a55c6b70efa0c", + "CHG_OT_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,5362d479358f644fe2c17cfe02f310f8", + "CHH_OB_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,9469ac28e4369032b855ce1a794a56a4", + "CHH_OT_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,d7628ac941d3fea97297a8dfcfb7aed1", + "CpG_OB_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,f0404fc1fc18c7ff58e8766b405239ed", + "CpG_OT_SRR389222_sub1_bismark_bt2.deduplicated.txt.gz:md5,67d04d843e9e1abc8643bc25b27a9ff5" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated.bismark.cov.gz:md5,eb0d3f96ed97c5d12afeeb49c234849d" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated_splitting_report.txt:md5,ec268cc572b8bcfea0959b47c7510f05" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_bt2.deduplicated.M-bias.txt:md5,290ebfeca4da7809cf9adfe60bab1b29" + ] + ], + [ + "SRR389222_sub1_bismark_bt2_SE_report.html" + ], + "bismark_summary_report.txt:md5,46f54eec58516c027e20bc9bdcaaae14", + [ + "SRR389222_sub1_bismark_bt2.deduplicated.M-bias.txt", + "SRR389222_sub1_bismark_bt2.deduplicated_splitting_report.txt", + "SRR389222_sub1_bismark_bt2.deduplication_report.txt", + "SRR389222_sub1_bismark_bt2_SE_report.html", + "SRR389222_sub1_bismark_bt2_SE_report.txt", + "bismark_summary_report.html", + "bismark_summary_report.txt" + ], + [ + "versions.yml:md5,46e043d0037e7446544ae1e25b65536c", + "versions.yml:md5,6c516cc03aa69228e503c540ee3794aa", + "versions.yml:md5,6f2f867f534bb0ae0ffbdc52d036afce", + "versions.yml:md5,9b480db277eebeb6265cbd003553c22c", + "versions.yml:md5,a675051417ba65700b5db32d98aa65b6", + "versions.yml:md5,aa64d431e6cfc5ffcbd5012a76b0c1a3", + "versions.yml:md5,df1a6bcb24960ee4a22a2cc914c65272", + "versions.yml:md5,eb23ca81cb3427b8c5a8a9a93def4882" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-15T15:20:14.052464546" + }, + "Params: bismark_hisat | cytosine_report": { + "content": [ + [ + + ], + [ + "test.sorted.bam.bai" + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.CpG_report.txt.gz:md5,d05837f07e4866f007d1f25166376b10" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.cytosine_context_summary.txt:md5,c2e99c47feb351c6666990bec7d1a9bd" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated.bedGraph.gz:md5,1f1b14f7be535e6098ece13ea1406bfc" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "CHG_OB_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,5c177e6f00dfc6e2335a55c6b70efa0c", + "CHG_OT_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,138bccceb9ae71ecdae6828fd8fc327f", + "CHH_OB_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,9469ac28e4369032b855ce1a794a56a4", + "CHH_OT_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,f1acfc10c9f9ffb80f2a7a947a210ad7", + "CpG_OB_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,f0404fc1fc18c7ff58e8766b405239ed", + "CpG_OT_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,75b9acaf689411154f906bcfa7264abf" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated.bismark.cov.gz:md5,ec4a2575b47822ef478b3bda35c70590" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated_splitting_report.txt:md5,eaee004ea3fffb9b8aaf968f41f9f903" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated.M-bias.txt:md5,82b760a6824f55f6732297374d77a6ec" + ] + ], + [ + "SRR389222_sub1_bismark_hisat2_SE_report.html" + ], + "bismark_summary_report.txt:md5,762c303acee29bfffef35b3d9e04d153", + [ + "SRR389222_sub1_bismark_hisat2.deduplicated.M-bias.txt", + "SRR389222_sub1_bismark_hisat2.deduplicated_splitting_report.txt", + "SRR389222_sub1_bismark_hisat2.deduplication_report.txt", + "SRR389222_sub1_bismark_hisat2_SE_report.html", + "SRR389222_sub1_bismark_hisat2_SE_report.txt", + "bismark_summary_report.html", + "bismark_summary_report.txt" + ], + [ + "versions.yml:md5,46e043d0037e7446544ae1e25b65536c", + "versions.yml:md5,6c516cc03aa69228e503c540ee3794aa", + "versions.yml:md5,6f2f867f534bb0ae0ffbdc52d036afce", + "versions.yml:md5,9b480db277eebeb6265cbd003553c22c", + "versions.yml:md5,a675051417ba65700b5db32d98aa65b6", + "versions.yml:md5,aa64d431e6cfc5ffcbd5012a76b0c1a3", + "versions.yml:md5,df1a6bcb24960ee4a22a2cc914c65272", + "versions.yml:md5,eb23ca81cb3427b8c5a8a9a93def4882" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-15T15:22:14.454171707" + }, + "Params: bismark_hisat | default": { + "content": [ + [ + + ], + [ + "test.sorted.bam.bai" + ], + [ + + ], + [ + + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated.bedGraph.gz:md5,1f1b14f7be535e6098ece13ea1406bfc" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "CHG_OB_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,5c177e6f00dfc6e2335a55c6b70efa0c", + "CHG_OT_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,138bccceb9ae71ecdae6828fd8fc327f", + "CHH_OB_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,9469ac28e4369032b855ce1a794a56a4", + "CHH_OT_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,f1acfc10c9f9ffb80f2a7a947a210ad7", + "CpG_OB_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,f0404fc1fc18c7ff58e8766b405239ed", + "CpG_OT_SRR389222_sub1_bismark_hisat2.deduplicated.txt.gz:md5,75b9acaf689411154f906bcfa7264abf" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated.bismark.cov.gz:md5,ec4a2575b47822ef478b3bda35c70590" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated_splitting_report.txt:md5,eaee004ea3fffb9b8aaf968f41f9f903" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.deduplicated.M-bias.txt:md5,82b760a6824f55f6732297374d77a6ec" + ] + ], + [ + "SRR389222_sub1_bismark_hisat2_SE_report.html" + ], + "bismark_summary_report.txt:md5,762c303acee29bfffef35b3d9e04d153", + [ + "SRR389222_sub1_bismark_hisat2.deduplicated.M-bias.txt", + "SRR389222_sub1_bismark_hisat2.deduplicated_splitting_report.txt", + "SRR389222_sub1_bismark_hisat2.deduplication_report.txt", + "SRR389222_sub1_bismark_hisat2_SE_report.html", + "SRR389222_sub1_bismark_hisat2_SE_report.txt", + "bismark_summary_report.html", + "bismark_summary_report.txt" + ], + [ + "versions.yml:md5,46e043d0037e7446544ae1e25b65536c", + "versions.yml:md5,6c516cc03aa69228e503c540ee3794aa", + "versions.yml:md5,6f2f867f534bb0ae0ffbdc52d036afce", + "versions.yml:md5,9b480db277eebeb6265cbd003553c22c", + "versions.yml:md5,a675051417ba65700b5db32d98aa65b6", + "versions.yml:md5,aa64d431e6cfc5ffcbd5012a76b0c1a3", + "versions.yml:md5,df1a6bcb24960ee4a22a2cc914c65272" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-15T15:20:53.556708293" + }, + "Params: bismark_hisat | skip_deduplication": { + "content": [ + [ + + ], + [ + "test.sorted.bam.bai" + ], + [ + + ], + [ + + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.bedGraph.gz:md5,75be0d8be0134a48fd55e15a49568d3f" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "CHG_OB_SRR389222_sub1_bismark_hisat2.txt.gz:md5,11ae58ebe6513375468ebe63a521d6e3", + "CHG_OT_SRR389222_sub1_bismark_hisat2.txt.gz:md5,2963a2702be660068818073a2989c790", + "CHH_OB_SRR389222_sub1_bismark_hisat2.txt.gz:md5,12e9e4ebf59e6b23fb52f4872f534251", + "CHH_OT_SRR389222_sub1_bismark_hisat2.txt.gz:md5,e6815f62702d06dc01d12ea18dbd9a03", + "CpG_OB_SRR389222_sub1_bismark_hisat2.txt.gz:md5,21d614f45ecf703117550cb2eebfa3d5", + "CpG_OT_SRR389222_sub1_bismark_hisat2.txt.gz:md5,1a07c82f278b4ed637d33833df1e9749" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.bismark.cov.gz:md5,ab610e006112a52e5ecb230a1704f236" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2_splitting_report.txt:md5,e6b01d28d7248361750dbd23eef667df" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "SRR389222_sub1_bismark_hisat2.M-bias.txt:md5,bbfe49763c571a55a50d1e46c0fb4e46" + ] + ], + [ + "SRR389222_sub1_bismark_hisat2_SE_report.html" + ], + "bismark_summary_report.txt:md5,7a466655c11944b6035901910378e559", + [ + "SRR389222_sub1_bismark_hisat2.M-bias.txt", + "SRR389222_sub1_bismark_hisat2_SE_report.html", + "SRR389222_sub1_bismark_hisat2_SE_report.txt", + "SRR389222_sub1_bismark_hisat2_splitting_report.txt", + "bismark_summary_report.html", + "bismark_summary_report.txt" + ], + [ + "versions.yml:md5,46e043d0037e7446544ae1e25b65536c", + "versions.yml:md5,6c516cc03aa69228e503c540ee3794aa", + "versions.yml:md5,6f2f867f534bb0ae0ffbdc52d036afce", + "versions.yml:md5,9b480db277eebeb6265cbd003553c22c", + "versions.yml:md5,aa64d431e6cfc5ffcbd5012a76b0c1a3", + "versions.yml:md5,df1a6bcb24960ee4a22a2cc914c65272" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-15T15:21:33.809590706" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_align_dedup_bismark/tests/nextflow.config b/subworkflows/nf-core/fastq_align_dedup_bismark/tests/nextflow.config new file mode 100644 index 00000000000..903bb19fa88 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_dedup_bismark/tests/nextflow.config @@ -0,0 +1,15 @@ +params { + aligner = "bismark" + cytosine_report = false + skip_deduplication = false +} + +process { + withName: 'BISMARK_ALIGN' { + ext.args = { params.aligner == 'bismark_hisat' ? ' --hisat2' : ' --bowtie2' } + } + + withName: 'SAMTOOLS_SORT_DEDUPLICATED' { + ext.prefix = { "${meta.id}.sorted" } + } +} diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index de10acc9fb2..c86fb134d75 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -25,11 +25,6 @@ if ("$PROFILE" == "singularity") { podman.enabled = true podman.userEmulation = true podman.runOptions = "--runtime crun --platform linux/x86_64 --systemd=always" -} else if ("$PROFILE" == "gpu") { - docker.runOptions = '-u $(id -u):$(id -g) --gpus device=0' - apptainer.runOptions = '--no-mount tmp --writable-tmpfs --nv' - singularity.runOptions = '--no-mount tmp --writable-tmpfs --nv' - use_gpu = true } else { docker.enabled = true docker.userEmulation = false diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 1bdf57d23c1..f651ff4d89d 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -43,6 +43,12 @@ profiles { docker.fixOwnership = true docker.runOptions = '--platform=linux/amd64' } + gpu { + docker.runOptions = '-u $(id -u):$(id -g) --gpus all' + apptainer.runOptions = '--nv' + singularity.runOptions = '--nv' + use_gpu = true + } } docker.registry = 'quay.io'