diff --git a/.github/workflows/code-linting-develop.yml b/.github/workflows/code-linting-develop.yml new file mode 100644 index 000000000000..df3365dfa011 --- /dev/null +++ b/.github/workflows/code-linting-develop.yml @@ -0,0 +1,38 @@ +name: Code Linting Develop +on: + pull_request: + branches: [develop] + +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + Prettier: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Install NodeJS + uses: actions/setup-node@v2 + + - name: Install Prettier + run: npm install -g prettier + + - name: Run Prettier --check + run: prettier --check . + + EditorConfig: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v2 + + - name: Install editorconfig-checker + run: npm install -g editorconfig-checker + + - name: Run ECLint check + run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test) diff --git a/.github/workflows/nf-core-linting-develop.yml b/.github/workflows/nf-core-linting-develop.yml new file mode 100644 index 000000000000..c12059ab168d --- /dev/null +++ b/.github/workflows/nf-core-linting-develop.yml @@ -0,0 +1,80 @@ +name: nf-core linting develop +# This workflow is triggered on pushes and PRs to the repository. +# It runs the `nf-core lint` tests to ensure that the module code meets the nf-core guidelines +on: + pull_request: + branches: [develop] + +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + changes: + name: Check for changes + runs-on: ubuntu-latest + outputs: + # Expose matched filters as job 'modules' output variable + modules: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v3 + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: "tests/config/pytest_modules.yml" + + lint: + runs-on: ubuntu-20.04 + name: ${{ matrix.tags }} + needs: changes + if: needs.changes.outputs.modules != '[]' + strategy: + fail-fast: false + matrix: + tags: ["${{ fromJson(needs.changes.outputs.modules) }}"] + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install pip + run: python -m pip install --upgrade pip + + - name: Install nf-core tools + run: python -m pip install nf-core + + - name: Install Nextflow + env: + CAPSULE_LOG: none + run: | + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Lint ${{ matrix.tags }} + run: nf-core modules lint ${{ matrix.tags }} + # HACK + if: startsWith( matrix.tags, 'subworkflow' ) != true + + - uses: actions/cache@v3 + with: + path: /usr/local/bin/nextflow + key: ${{ runner.os }} + restore-keys: | + ${{ runner.os }} diff --git a/.github/workflows/nf-test-develop.yml b/.github/workflows/nf-test-develop.yml new file mode 100644 index 000000000000..d139dc6a07e1 --- /dev/null +++ b/.github/workflows/nf-test-develop.yml @@ -0,0 +1,177 @@ +name: nf-test-develop +on: + pull_request: + branches: [develop] + +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + changes: + name: Check for changes + runs-on: ubuntu-latest + outputs: + # Expose matched filters as job 'modules' output variable + modules: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v3 + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: "tests/config/nftest_modules.yml" + + test: + runs-on: ubuntu-20.04 + + name: ${{ matrix.tags }} ${{ matrix.profile }} + needs: changes + if: needs.changes.outputs.modules != '[]' + strategy: + fail-fast: false + matrix: + tags: ["${{ fromJson(needs.changes.outputs.modules) }}"] + profile: ["docker", "singularity", "conda"] + exclude: + - profile: "conda" + tags: annotsv + - profile: "conda" + tags: bases2fastq + - profile: "conda" + tags: bcl2fastq + - profile: "conda" + tags: bclconvert + - profile: "conda" + tags: cellranger/count + - profile: "conda" + tags: cellranger/mkfastq + - profile: "conda" + tags: cellranger/mkgtf + - profile: "conda" + tags: cellranger/mkref + - profile: "conda" + tags: deepvariant + - profile: "conda" + tags: ensemblvep/vep + - profile: "conda" + tags: fastk/fastk + - profile: "conda" + tags: fastk/histex + - profile: "conda" + tags: fastk/merge + - profile: "conda" + tags: fcs/fcsadaptor + - profile: "conda" + tags: fcs/fcsgx + - profile: "conda" + tags: gatk4/cnnscorevariants + - profile: "conda" + tags: gatk4/determinegermlinecontigploidy + - profile: "conda" + tags: genescopefk + - profile: "conda" + tags: ilastik/multicut + - profile: "conda" + tags: ilastik/pixelclassification + - profile: "conda" + tags: imputeme/vcftoprs + - profile: "conda" + tags: merquryfk/katcomp + - profile: "conda" + tags: merquryfk/katgc + - profile: "conda" + tags: merquryfk/merquryfk + - profile: "conda" + tags: merquryfk/ploidyplot + - profile: "conda" + tags: sentieon/bwaindex + - profile: "conda" + tags: sentieon/bwamem + - profile: "conda" + tags: universc + - profile: "singularity" + tags: universc + - profile: "conda" + tags: subworkflows/vcf_annotate_ensemblvep + env: + NXF_ANSI_LOG: false + SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }} + steps: + - uses: actions/checkout@v3 + + - uses: actions/cache@v3 + with: + path: /usr/local/bin/nextflow + key: ${{ runner.os }} + restore-keys: | + ${{ runner.os }}-nextflow- + + - name: Install Nextflow + env: + CAPSULE_LOG: none + run: | + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Cache nf-test installation + id: cache-software + uses: actions/cache@v3 + with: + path: | + /usr/local/bin/nf-test + /home/runner/.nf-test/nf-test.jar + key: ${{ runner.os }}-nftest + + - name: Install nf-test + if: steps.cache-software.outputs.cache-hit != 'true' + run: | + wget -qO- https://code.askimed.com/install/nf-test | bash + sudo mv nf-test /usr/local/bin/ + + - name: Set up Singularity + if: matrix.profile == 'singularity' + uses: eWaterCycle/setup-singularity@v5 + with: + singularity-version: 3.7.1 + + - name: Set up miniconda + if: matrix.profile == 'conda' + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + channels: conda-forge,bioconda,defaults + python-version: ${{ matrix.python-version }} + + - name: Conda setup + if: matrix.profile == 'conda' + run: | + conda clean -a + conda install -n base conda-libmamba-solver + conda config --set solver libmamba + + # Set up secrets + - name: Set up nextflow secrets + if: env.SENTIEON_LICENSE_BASE64 != null + run: | + nextflow secrets set SENTIEON_LICENSE_BASE64 ${{ secrets.SENTIEON_LICENSE_BASE64 }} + nextflow secrets set SENTIEON_AUTH_MECH_BASE64 ${{ secrets.SENTIEON_AUTH_MECH_BASE64 }} + SENTIEON_ENCRYPTION_KEY=$(echo -n "${{ secrets.ENCRYPTION_KEY_BASE64 }}" | base64 -d) + SENTIEON_LICENSE_MESSAGE=$(echo -n "${{ secrets.LICENSE_MESSAGE_BASE64 }}" | base64 -d) + SENTIEON_AUTH_DATA=$(python tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE") + SENTIEON_AUTH_DATA_BASE64=$(echo -n "$SENTIEON_AUTH_DATA" | base64 -w 0) + nextflow secrets set SENTIEON_AUTH_DATA_BASE64 $SENTIEON_AUTH_DATA_BASE64 + + # Test the module + - name: Run nf-test + run: | + nf-test test \ + --profile=${{ matrix.profile }} \ + --tag ${{ matrix.tags }} \ + --tap=test.tap + + - uses: pcolby/tap-summary@v1 + with: + path: >- + test.tap diff --git a/.github/workflows/pytest-workflow-develop.yml b/.github/workflows/pytest-workflow-develop.yml new file mode 100644 index 000000000000..ab278ab3402b --- /dev/null +++ b/.github/workflows/pytest-workflow-develop.yml @@ -0,0 +1,229 @@ +name: Pytest-workflow-develop +on: + pull_request: + branches: [develop] + +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + changes: + name: Check for changes + runs-on: ubuntu-latest + outputs: + # Expose matched filters as job 'modules' output variable + modules: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v3 + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: "tests/config/pytest_modules.yml" + + test: + runs-on: ubuntu-20.04 + + name: ${{ matrix.tags }} ${{ matrix.profile }} + needs: changes + if: needs.changes.outputs.modules != '[]' + strategy: + fail-fast: false + matrix: + tags: ["${{ fromJson(needs.changes.outputs.modules) }}"] + profile: ["docker", "singularity", "conda"] + exclude: + - profile: "conda" + tags: annotsv + - profile: "conda" + tags: cellpose + - profile: "conda" + tags: mcquant + - profile: "conda" + tags: bases2fastq + - profile: "conda" + tags: backsub + - profile: "conda" + tags: basicpy + - profile: "conda" + tags: bcl2fastq + - profile: "conda" + tags: bclconvert + - profile: "conda" + tags: cellranger/count + - profile: "conda" + tags: cellranger/mkfastq + - profile: "conda" + tags: cellranger/mkgtf + - profile: "conda" + tags: cellranger/mkref + - profile: "conda" + tags: cellranger/mkvdjref + - profile: "conda" + tags: cellranger/multi + - profile: "conda" + tags: cellranger/vdj + - profile: "conda" + tags: coreograph + - profile: "conda" + tags: deepcell/mesmer + - profile: "conda" + tags: deepvariant + - profile: "conda" + tags: ensemblvep/vep + - profile: "conda" + tags: fastk/fastk + - profile: "conda" + tags: fastk/histex + - profile: "conda" + tags: fastk/merge + - profile: "conda" + tags: fcs/fcsadaptor + - profile: "conda" + tags: fcs/fcsgx + - profile: "conda" + tags: gatk4/baserecalibratorspark + - profile: "conda" + tags: gatk4/cnnscorevariants + - profile: "conda" + tags: gatk4/determinegermlinecontigploidy + - profile: "conda" + tags: gatk4/germlinecnvcaller + - profile: "conda" + tags: gatk4/markduplicatesspark + - profile: "conda" + tags: gatk4/postprocessgermlinecnvcalls + - profile: "conda" + tags: genescopefk + - profile: "conda" + tags: ilastik/multicut + - profile: "conda" + tags: ilastik/pixelclassification + - profile: "conda" + tags: imputeme/vcftoprs + - profile: "conda" + tags: merquryfk/katcomp + - profile: "conda" + tags: merquryfk/katgc + - profile: "conda" + tags: merquryfk/merquryfk + - profile: "conda" + tags: merquryfk/ploidyplot + - profile: "conda" + tags: mitohifi/findmitoreference + - profile: "conda" + tags: scimap/mcmicro + - tags: "sentieon/*" + - profile: "conda" + tags: universc + - profile: "singularity" + tags: universc + - profile: "singularity" + tags: gatk4/determinegermlinecontigploidy + - profile: "conda" + tags: subworkflows/bcl_demultiplex + - profile: "conda" + tags: subworkflows/vcf_annotate_ensemblvep + - profile: "conda" + tags: islandpath + env: + NXF_ANSI_LOG: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install Python dependencies + run: python -m pip install --upgrade pip pytest-workflow cryptography + + - uses: actions/cache@v3 + with: + path: /usr/local/bin/nextflow + key: ${{ runner.os }} + restore-keys: | + ${{ runner.os }}-nextflow- + + - name: Install Nextflow + env: + CAPSULE_LOG: none + run: | + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Set up Singularity + if: matrix.profile == 'singularity' + uses: eWaterCycle/setup-singularity@v5 + with: + singularity-version: 3.7.1 + + - name: Set up miniconda + if: matrix.profile == 'conda' + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + channels: conda-forge,bioconda,defaults + python-version: ${{ matrix.python-version }} + + - name: Conda setup + if: matrix.profile == 'conda' + run: | + conda clean -a + conda install -n base conda-libmamba-solver + conda config --set solver libmamba + + # Set up secrets + - name: Set up nextflow secrets + if: env.SENTIEON_LICENSE_BASE64 != null + run: | + nextflow secrets set SENTIEON_LICENSE_BASE64 ${{ secrets.SENTIEON_LICENSE_BASE64 }} + nextflow secrets set SENTIEON_AUTH_MECH_BASE64 ${{ secrets.SENTIEON_AUTH_MECH_BASE64 }} + SENTIEON_ENCRYPTION_KEY=$(echo -n "${{ secrets.ENCRYPTION_KEY_BASE64 }}" | base64 -d) + SENTIEON_LICENSE_MESSAGE=$(echo -n "${{ secrets.LICENSE_MESSAGE_BASE64 }}" | base64 -d) + SENTIEON_AUTH_DATA=$(python tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE") + SENTIEON_AUTH_DATA_BASE64=$(echo -n "$SENTIEON_AUTH_DATA" | base64 -w 0) + nextflow secrets set SENTIEON_AUTH_DATA_BASE64 $SENTIEON_AUTH_DATA_BASE64 + + # Test the module + - name: Run pytest-workflow + # only use one thread for pytest-workflow to avoid race condition on conda cache. + run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof --git-aware --color=yes + + - name: Output log on failure + if: failure() + run: | + sudo apt-get update > /dev/null + sudo apt-get install bat > /dev/null + batcat --decorations=always --color=always /home/runner/pytest_workflow_*/*/log.{out,err} + + - name: Setting global variables + uses: actions/github-script@v6 + id: parsed + with: + script: | + return '${{ matrix.tags }}'.toLowerCase().replaceAll(/\//g, '-').trim('-').trim('"') + result-encoding: string + + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: logs-${{ matrix.profile }}-${{ steps.parsed.outputs.result }} + path: | + /home/runner/pytest_workflow_*/*/.nextflow.log + /home/runner/pytest_workflow_*/*/log.out + /home/runner/pytest_workflow_*/*/log.err + /home/runner/pytest_workflow_*/*/work + !/home/runner/pytest_workflow_*/*/work/conda + !/home/runner/pytest_workflow_*/*/work/singularity diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 2c2c5fbb7189..44a2c827bd18 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -148,8 +148,6 @@ jobs: tags: gatk4/determinegermlinecontigploidy - profile: "conda" tags: subworkflows/bcl_demultiplex - - profile: "conda" - tags: subworkflows/vcf_annotate_ensemblvep_snpeff - profile: "conda" tags: subworkflows/vcf_annotate_ensemblvep - profile: "conda" diff --git a/.github/workflows/sync-action.yml b/.github/workflows/sync-action.yml new file mode 100644 index 000000000000..c16d4537aad0 --- /dev/null +++ b/.github/workflows/sync-action.yml @@ -0,0 +1,24 @@ +name: Sync Fork + +on: + schedule: + - cron: "0 0 * * *" # run once a night at midnight + workflow_dispatch: # on button click + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Sync master branch + uses: tgymnich/fork-sync@v1.8 + with: + token: ${{ secrets.PERSONAL_TOKEN }} + base: master + head: master + - name: Sync develop branch + uses: tgymnich/fork-sync@v1.8 + with: + token: ${{ secrets.PERSONAL_TOKEN }} + base: develop + head: master diff --git a/modules/nf-core/bcftools/query/main.nf b/modules/nf-core/bcftools/query/main.nf index 0a775ebebb27..dbc00e00b16e 100644 --- a/modules/nf-core/bcftools/query/main.nf +++ b/modules/nf-core/bcftools/query/main.nf @@ -1,6 +1,6 @@ process BCFTOOLS_QUERY { tag "$meta.id" - label 'process_single' + label 'process_medium' conda "bioconda::bcftools=1.17" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -28,12 +28,12 @@ process BCFTOOLS_QUERY { def samples_file = samples ? "--samples-file ${samples}" : "" """ bcftools query \\ + --output ${prefix}.txt \\ $regions_file \\ $targets_file \\ $samples_file \\ $args \\ - $vcf \\ - > ${prefix}.txt + $vcf cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/mergefastq/main.nf b/modules/nf-core/mergefastq/main.nf new file mode 100644 index 000000000000..846a4832df69 --- /dev/null +++ b/modules/nf-core/mergefastq/main.nf @@ -0,0 +1,37 @@ +process MERGEFASTQ { + tag "$meta.id" + label 'process_low' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using merge. Please use docker or singularity containers." + } + container "ghcr.io/mskcc-omics-workflows/merge-gzip:1.6-5ubuntu1.2" + + input: + tuple val(meta), path(fastq_1), path(fastq_2) + + output: + tuple val(meta), path("*_R*_mrg.fastq.gz") ,emit: mrg_fq + 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 fastq_filter = fastq_2.name != "null" ? fastq_2 : "" + + """ + zcat \\ + ${fastq_1} \\ + ${fastq_filter} \\ + | \\ + gzip > ${meta.sample_name}_L000_R${meta.read}_mrg.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mergefastq: \$(echo \$(gzip --version 2>&1) | sed 's/^.*gzip //; s/Copyright.*\$//' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/mergefastq/meta.yml b/modules/nf-core/mergefastq/meta.yml new file mode 100644 index 000000000000..deb719fce42a --- /dev/null +++ b/modules/nf-core/mergefastq/meta.yml @@ -0,0 +1,49 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: "mergefastq" +description: Merge a pair of raw fastq files from two different lanes (single fastq file is also acceptable) +keywords: + - msk + - mergefastq + - zcat + - gzip +tools: + - "gzip": + description: "Files to compress or decompress" + homepage: "https://www.gzip.org/" + documentation: "https://www.gzip.org/" + licence: "" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', sample_name:'Sample-T', read:'1' ] + - fastq_1: + type: file + description: fastq file from Lane 1 + pattern: "*_{L001_,}R*_001.fastq.gz" + - fastq_2: # Optional if there is only one fastq file + type: file + description: fastq file from Lane 2 + pattern: "*_L002_R*_001.fastq.gz" # OR null + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', sample_name:'Sample-T', read:'1' ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + + - mrg_fq: + type: file + description: Merge fastq file + pattern: "*_R*_mrg.fastq.gz" + +authors: + - "@huyu335" diff --git a/modules/nf-core/tabix/bgziptabix/main.nf b/modules/nf-core/tabix/bgziptabix/main.nf index d6c5a760f3da..fe8160bae4cd 100644 --- a/modules/nf-core/tabix/bgziptabix/main.nf +++ b/modules/nf-core/tabix/bgziptabix/main.nf @@ -11,8 +11,7 @@ process TABIX_BGZIPTABIX { tuple val(meta), path(input) output: - tuple val(meta), path("*.gz"), path("*.tbi"), optional: true, emit: gz_tbi - tuple val(meta), path("*.gz"), path("*.csi"), optional: true, emit: gz_csi + tuple val(meta), path("*.gz"), path("*.tbi"), emit: gz_tbi path "versions.yml" , emit: versions when: @@ -37,7 +36,6 @@ process TABIX_BGZIPTABIX { """ touch ${prefix}.${input.getExtension()}.gz touch ${prefix}.${input.getExtension()}.gz.tbi - touch ${prefix}.${input.getExtension()}.gz.csi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/tabix/bgziptabix/meta.yml b/modules/nf-core/tabix/bgziptabix/meta.yml index 2761e27183bb..49c032894157 100644 --- a/modules/nf-core/tabix/bgziptabix/meta.yml +++ b/modules/nf-core/tabix/bgziptabix/meta.yml @@ -37,14 +37,9 @@ output: type: file description: tabix index file pattern: "*.{gz.tbi}" - - csi: - type: file - description: tabix alternate index file - pattern: "*.{gz.csi}" - versions: type: file description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" - - "@DLBPointon" diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf deleted file mode 100644 index 91cace4d1d9f..000000000000 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf +++ /dev/null @@ -1,191 +0,0 @@ -// -// Run VEP and/or SNPEFF to annotate VCF files -// - -include { ENSEMBLVEP_VEP } from '../../../modules/nf-core/ensemblvep/vep/main' -include { SNPEFF_SNPEFF } from '../../../modules/nf-core/snpeff/snpeff/main' -include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix/main' -include { BCFTOOLS_PLUGINSCATTER } from '../../../modules/nf-core/bcftools/pluginscatter/main' -include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat/main' -include { BCFTOOLS_SORT } from '../../../modules/nf-core/bcftools/sort/main' - -workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { - take: - ch_vcf // channel: [ val(meta), path(vcf), path(tbi), [path(file1), path(file2)...] ] - ch_fasta // channel: [ val(meta2), path(fasta) ] (optional) - val_vep_genome // value: genome to use - val_vep_species // value: species to use - val_vep_cache_version // value: cache version to use - ch_vep_cache // channel: [ path(cache) ] (optional) - ch_vep_extra_files // channel: [ path(file1), path(file2)... ] (optional) - val_snpeff_db // value: the db version to use for snpEff - ch_snpeff_cache // channel: [ path(cache) ] (optional) - val_tools_to_use // value: a list of tools to use options are: ["ensemblvep", "snpeff"] - val_sites_per_chunk // value: the amount of variants per scattered VCF - - main: - ch_versions = Channel.empty() - - // Check if val_sites_per_chunk is set and scatter if it is - if(val_sites_per_chunk) { - // - // Prepare the input VCF channel for scattering (split VCFs from custom files) - // - - ch_input = ch_vcf - .multiMap { meta, vcf, tbi, custom_files -> - vcf: [ meta, vcf, tbi ] - custom: [ meta, custom_files ] - } - - // - // Scatter the input VCFs into multiple VCFs. These VCFs contain the amount of variants - // specified by `val_sites_per_chunk`. The lower this value is, the more files will be created - // - - BCFTOOLS_PLUGINSCATTER( - ch_input.vcf, - val_sites_per_chunk, - [], - [], - [], - [] - ) - ch_versions = ch_versions.mix(BCFTOOLS_PLUGINSCATTER.out.versions.first()) - - // - // Run the annotation with EnsemblVEP - // - - ch_scatter = BCFTOOLS_PLUGINSCATTER.out.scatter - .map { meta, vcfs -> - // This checks if multiple files were created using the scatter process - // If multiple files are created, a list will be made as output of the process - // So if the output isn't a list, there is always one file and if there is a list, - // the amount of files in the list gets counted by .size() - is_list = vcfs instanceof ArrayList - count = is_list ? vcfs.size() : 1 - [ meta, is_list ? vcfs : [vcfs], count ] - // Channel containing the list of VCFs and the size of this list - } - .transpose(by:1) // Transpose on the VCFs => Creates an entry for each VCF in the list - .combine(ch_input.custom, by: 0) // Re-add the sample specific custom files - .multiMap { meta, vcf, count, custom_files -> - // Define the new ID. The `_annotated` is to disambiguate the VEP output with its input - new_id = "${meta.id}${vcf.name.replace(meta.id,"").tokenize(".")[0]}_annotated" as String - new_meta = meta + [id:new_id] - - // Create channels: one with the VEP input and one with the original ID and count of scattered VCFs - input: [ new_meta, vcf, custom_files ] - count: [ new_meta, meta.id, count ] - } - - ch_vep_input = ch_scatter.input - } else { - // Use the normal input when no scattering has to be performed - ch_vep_input = ch_vcf.map { meta, vcf, tbi, files -> [ meta, vcf, files ] } - } - - // Annotate with ensemblvep if it's part of the requested tools - if("ensemblvep" in val_tools_to_use){ - ENSEMBLVEP_VEP( - ch_vep_input, - val_vep_genome, - val_vep_species, - val_vep_cache_version, - ch_vep_cache, - ch_fasta, - ch_vep_extra_files - ) - ch_versions = ch_versions.mix(ENSEMBLVEP_VEP.out.versions.first()) - - ch_vep_output = ENSEMBLVEP_VEP.out.vcf - ch_vep_reports = ENSEMBLVEP_VEP.out.report - } else { - ch_vep_output = ch_vep_input.map { meta, vcf, files -> [ meta, vcf ] } - ch_vep_reports = Channel.empty() - } - - // Annotate with snpeff if it's part of the requested tools - if("snpeff" in val_tools_to_use){ - SNPEFF_SNPEFF( - ch_vep_output, - val_snpeff_db, - ch_snpeff_cache - ) - ch_versions = ch_versions.mix(SNPEFF_SNPEFF.out.versions.first()) - - ch_snpeff_output = SNPEFF_SNPEFF.out.vcf - ch_snpeff_reports = SNPEFF_SNPEFF.out.report - ch_snpeff_html = SNPEFF_SNPEFF.out.summary_html - ch_snpeff_genes = SNPEFF_SNPEFF.out.genes_txt - } else { - ch_snpeff_output = ch_vep_output - ch_snpeff_reports = Channel.empty() - ch_snpeff_html = Channel.empty() - ch_snpeff_genes = Channel.empty() - } - - // Gather the files back together if they were scattered - if(val_sites_per_chunk) { - // - // Concatenate the VCFs back together with bcftools concat - // - - ch_concat_input = ch_snpeff_output - .join(ch_scatter.count, failOnDuplicate:true, failOnMismatch:true) - .map { meta, vcf, id, count -> - new_meta = meta + [id:id] - [ groupKey(new_meta, count), vcf ] - } - .groupTuple() // Group the VCFs which need to be concatenated - .map { it + [[]] } - - BCFTOOLS_CONCAT( - ch_concat_input - ) - ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions.first()) - - // - // Sort the concatenate output (bcftools concat is unable to do this on its own) - // - - BCFTOOLS_SORT( - BCFTOOLS_CONCAT.out.vcf - ) - ch_versions = ch_versions.mix(BCFTOOLS_SORT.out.versions.first()) - - ch_ready_vcfs = BCFTOOLS_SORT.out.vcf - } else { - ch_ready_vcfs = ch_snpeff_output - } - - // - // Index the resulting bgzipped VCFs - // - - ch_tabix_input = ch_ready_vcfs - .branch { meta, vcf -> - // Split the bgzipped VCFs from the unzipped VCFs (only bgzipped VCFs should be indexed) - bgzip: vcf.extension == "gz" - unzip: true - return [ meta, vcf, [] ] - } - - TABIX_TABIX( - ch_tabix_input.bgzip - ) - ch_versions = ch_versions.mix(TABIX_TABIX.out.versions) - - ch_vcf_tbi = ch_tabix_input.bgzip - .join(TABIX_TABIX.out.tbi, failOnDuplicate: true, failOnMismatch: true) - .mix(ch_tabix_input.unzip) - - emit: - vcf_tbi = ch_vcf_tbi // channel: [ val(meta), path(vcf), path(tbi) ] - vep_reports = ch_vep_reports // channel: [ path(html) ] - snpeff_reports = ch_snpeff_reports // channel: [ path(csv) ] - snpeff_html = ch_snpeff_html // channel: [ path(html) ] - snpeff_genes = ch_snpeff_genes // channel: [ path(genes) ] - versions = ch_versions // channel: [ versions.yml ] -} diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml deleted file mode 100644 index 211144330be6..000000000000 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml +++ /dev/null @@ -1,73 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: vcf_annotate_ensemblvep_snpeff -description: | - Perform annotation with ensemblvep and/or snpeff and bgzip + tabix index the resulting VCF file. This subworkflow uses the scatter-gather method to run VEP/snpEff in parallel to increase throughput. The input VCF is split into multiple smaller VCFs of fixed size, which are annotated separately and concatenated back together to a single output file per sample. Only VCF/BCF outputs are currently supported. -keywords: - - vcf - - annotation - - ensemblvep - - snpeff -modules: - - ensemblvep/vep - - snpeff/snpeff - - tabix/tabix - - bcftools/pluginscatter - - bcftools/concat -input: - - ch_vcf: - description: | - vcf file to annotate - Structure: [ val(meta), path(vcf), path(tbi) ] - - ch_fasta: - description: | - Reference genome fasta file (optional) - Structure: [ val(meta2), path(fasta) ] - - val_vep_genome: - type: string - description: genome to use for ensemblvep - - val_vep_species: - type: string - description: species to use for ensemblvep - - val_vep_cache_version: - type: integer - description: cache version to use for ensemblvep - - ch_vep_cache: - description: | - the root cache folder for ensemblvep (optional) - Structure: [ path(cache) ] - - ch_vep_extra_files: - description: | - any extra files needed by plugins for ensemblvep (optional) - Structure: [ path(file1), path(file2)... ] - - val_snpeff_db: - type: string - description: database to use for snpeff - - ch_snpeff_cache: - description: | - the root cache folder for snpeff (optional) - Structure: [ path(cache) ] - - val_tools_to_use: - type: list - description: The tools to use. Options => '["ensemblvep", "snpeff"]' - - val_sites_per_chunk: - type: integer - description: | - The amount of variants per scattered VCF. - Set this value to `null`, `[]` or `false` to disable scattering. -output: - - vcf_tbi: - description: | - Compressed vcf file + tabix index - Structure: [ val(meta), path(vcf), path(tbi) ] - - reports: - type: file - description: html reports - pattern: "*.html" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@maxulysse" - - "@matthdsm" - - "@nvnieuwk" diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index b6db38865d95..504ef74ee3a6 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -36,6 +36,7 @@ conda { createTimeout = "120 min" } // Load test_data.config containing paths to test data includeConfig 'test_data.config' +includeConfig 'test_data_msk.config' manifest { nextflowVersion = '!>=22.10.1' diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index dd96ec96d09f..72e7e637be55 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2426,6 +2426,10 @@ msisensorpro/scan: - modules/nf-core/msisensorpro/scan/** - tests/modules/nf-core/msisensorpro/scan/** +mergefastq: + - modules/nf-core/mergefastq/** + - tests/modules/nf-core/mergefastq/** + mtnucratio: - modules/nf-core/mtnucratio/** - tests/modules/nf-core/mtnucratio/** @@ -3648,10 +3652,6 @@ subworkflows/vcf_annotate_ensemblvep: - subworkflows/nf-core/vcf_annotate_ensemblvep/** - tests/subworkflows/nf-core/vcf_annotate_ensemblvep/** -subworkflows/vcf_annotate_ensemblvep_snpeff: - - subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/** - - tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/** - subworkflows/vcf_annotate_snpeff: - subworkflows/nf-core/vcf_annotate_snpeff/** - tests/subworkflows/nf-core/vcf_annotate_snpeff/** diff --git a/tests/config/test_data_msk.config b/tests/config/test_data_msk.config new file mode 100644 index 000000000000..58b7b61b7148 --- /dev/null +++ b/tests/config/test_data_msk.config @@ -0,0 +1,12 @@ +params { + // Base directory for test data + test_data_msk_base = "https://raw.githubusercontent.com/mskcc-omics-workflows/test-datasets" + + test_data_msk { + 'rawfastq' { + fastq_1 = "${params.test_data_msk_base}/master/raw_fastq/Sample1-T2_L001_R1_001.fastq.gz" + fastq_2 = "${params.test_data_msk_base}/master/raw_fastq/Sample1-T2_L002_R1_001.fastq.gz" + fastq_no_lane = "${params.test_data_msk_base}/master/raw_fastq/Sample1-T2_R2_001.fastq.gz" + } + } +} diff --git a/tests/modules/nf-core/bcftools/query/test.yml b/tests/modules/nf-core/bcftools/query/test.yml index 7acf1880dbda..829ee630e4d9 100644 --- a/tests/modules/nf-core/bcftools/query/test.yml +++ b/tests/modules/nf-core/bcftools/query/test.yml @@ -1,19 +1,17 @@ -- name: bcftools query test_bcftools_query +- name: bcftools query command: nextflow run ./tests/modules/nf-core/bcftools/query -entry test_bcftools_query -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/bcftools/query/nextflow.config tags: - bcftools - bcftools/query files: - path: output/bcftools/out.txt - md5sum: 51d135de052f3bcef50dcd6b74806094 - - path: output/bcftools/versions.yml + md5sum: c32a6d28f185822d8fe1eeb7e42ec155 -- name: bcftools query test_bcftools_query_with_optional_files +- name: bcftools query with optional files command: nextflow run ./tests/modules/nf-core/bcftools/query -entry test_bcftools_query_with_optional_files -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/bcftools/query/nextflow.config tags: - bcftools - bcftools/query files: - path: output/bcftools/out.txt - md5sum: 1785d1957ba7206df852d0689b91753f - - path: output/bcftools/versions.yml + md5sum: 5a87e0865df2f0ab2884fc113ec2a70d diff --git a/tests/modules/nf-core/mergefastq/main.nf b/tests/modules/nf-core/mergefastq/main.nf new file mode 100644 index 000000000000..bce237bce79a --- /dev/null +++ b/tests/modules/nf-core/mergefastq/main.nf @@ -0,0 +1,39 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MERGEFASTQ } from '../../../../modules/nf-core/mergefastq/main.nf' + +//ch_test_data = Channel.fromFilePairs('Sample*_L00{1,2}_R1_001.fastq.gz') +// .flatten() +// .toList() +// .set { ch_pair_data } + +// Sample*_R2_001.fastq.gz +//ch_test_data = Channel.fromPath('Sample*_L00{1,2}_R1_001.fastq.gz', checkIfExists:true) +ch_test_data = Channel.fromPath([params.test_data_msk['rawfastq']['fastq_1'], params.test_data_msk['rawfastq']['fastq_2']], checkIfExists:true) + .toList() + .map { fastq -> + def fastq_list = fastq.size == 2 ? fastq : fastq + [file("null")] // For single fastq file + fastq_list } + .flatten() + .toList() + .set{ ch_pair_data } +meta = [ id:'test', sample_name:'', read:'' ] // meta map + +workflow test_mergefastq { + + ch_pair_data + .map { fastq_1, fastq_2 -> + meta.read = fastq_1.name.split('_')[-2].replace("R", "") // get read name + meta.sample_name = fastq_1.name.split('_')[0] // get sample name + [ meta, fastq_1, fastq_2 ] } + .set { input } + + MERGEFASTQ ( input ) +} + +//workflow { +// test_mergefastq() +//} +//nextflow run main.nf -process.echo -profile docker diff --git a/tests/modules/nf-core/mergefastq/nextflow.config b/tests/modules/nf-core/mergefastq/nextflow.config new file mode 100644 index 000000000000..8324dbfee482 --- /dev/null +++ b/tests/modules/nf-core/mergefastq/nextflow.config @@ -0,0 +1,60 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} + + +params { + enable_conda = false + outdir = "output" +} + +profiles { + debug { process.beforeScript = 'echo $HOSTNAME' } + conda { + params.enable_conda = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + docker { + docker.enabled = true + docker.userEmulation = true + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + singularity { + singularity.enabled = true + singularity.autoMounts = true + docker.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + podman { + podman.enabled = true + docker.enabled = false + singularity.enabled = false + shifter.enabled = false + charliecloud.enabled = false + } + shifter { + shifter.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + charliecloud.enabled = false + } + charliecloud { + charliecloud.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + } +} diff --git a/tests/modules/nf-core/mergefastq/test.yml b/tests/modules/nf-core/mergefastq/test.yml new file mode 100644 index 000000000000..11f619fa5fa4 --- /dev/null +++ b/tests/modules/nf-core/mergefastq/test.yml @@ -0,0 +1,7 @@ +- name: mergefastq + command: nextflow run ./tests/modules/nf-core/mergefastq -entry test_mergefastq -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/mergefastq/nextflow.config + tags: + - mergefastq + files: + - path: output/mergefastq/Sample1-T2_L000_R1_mrg.fastq.gz + - path: output/mergefastq/versions.yml diff --git a/tests/modules/nf-core/tabix/bgziptabix/main.nf b/tests/modules/nf-core/tabix/bgziptabix/main.nf index f4bc4754bf58..26e17101f8b9 100644 --- a/tests/modules/nf-core/tabix/bgziptabix/main.nf +++ b/tests/modules/nf-core/tabix/bgziptabix/main.nf @@ -2,15 +2,12 @@ nextflow.enable.dsl = 2 -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_TBI } from '../../../../../modules/nf-core/tabix/bgziptabix/main.nf' -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_CSI } from '../../../../../modules/nf-core/tabix/bgziptabix/main.nf' +include { TABIX_BGZIPTABIX } from '../../../../../modules/nf-core/tabix/bgziptabix/main.nf' workflow test_tabix_bgziptabix { input = [ [ id:'test' ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] ] - TABIX_BGZIPTABIX_TBI ( input ) - TABIX_BGZIPTABIX_CSI ( input ) - + TABIX_BGZIPTABIX ( input ) } diff --git a/tests/modules/nf-core/tabix/bgziptabix/nextflow.config b/tests/modules/nf-core/tabix/bgziptabix/nextflow.config index 7830e9153461..041bfa6acc1c 100644 --- a/tests/modules/nf-core/tabix/bgziptabix/nextflow.config +++ b/tests/modules/nf-core/tabix/bgziptabix/nextflow.config @@ -2,12 +2,8 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: TABIX_BGZIPTABIX_TBI { + withName: TABIX_BGZIPTABIX { ext.args2 = '-p vcf' } - withName: TABIX_BGZIPTABIX_CSI { - ext.args2 = '-p vcf --csi' - } - } diff --git a/tests/modules/nf-core/tabix/bgziptabix/test.yml b/tests/modules/nf-core/tabix/bgziptabix/test.yml index 6bbfb09c798d..78ce288b3218 100644 --- a/tests/modules/nf-core/tabix/bgziptabix/test.yml +++ b/tests/modules/nf-core/tabix/bgziptabix/test.yml @@ -5,8 +5,6 @@ - tabix files: - path: output/tabix/test.vcf.gz - md5sum: 02aff9ae43faf2594f28e2cf87b32ba9 + md5sum: fc178eb342a91dc0d1d568601ad8f8e2 - path: output/tabix/test.vcf.gz.tbi - md5sum: d22e5b84e4fcd18792179f72e6da702e - - path: output/tabix/test.vcf.gz.csi - md5sum: 6f733d80ee760fcc8fdbe504a03f2640 + md5sum: 36e11bf96ed0af4a92caa91a68612d64 diff --git a/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf b/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf deleted file mode 100644 index d6af5c2c9998..000000000000 --- a/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { VCF_ANNOTATE_ENSEMBLVEP_SNPEFF } from '../../../../subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf' - -workflow vcf_annotate_ensemblvep_snpeff_vep { - input = Channel.of([ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - [] - ],[ - [ id:'custom_test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), - [ - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz_tbi'], checkIfExists: true) - ] - ]) - - VCF_ANNOTATE_ENSEMBLVEP_SNPEFF ( - input, - [[],[]], - "WBcel235", - "caenorhabditis_elegans", - "108", - [], - [], - [], - [], - ["ensemblvep"], - 5 - ) -} - -workflow vcf_annotate_ensemblvep_snpeff_snpeff { - input = Channel.of([ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - [] - ],[ - [ id:'custom_test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), - [ - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz_tbi'], checkIfExists: true) - ] - ]) - - VCF_ANNOTATE_ENSEMBLVEP_SNPEFF ( - input, - [[],[]], - [], - [], - [], - [], - [], - "WBcel235.99", - [], - ["snpeff"], - 5 - ) -} - -workflow vcf_annotate_ensemblvep_snpeff_both { - input = Channel.of([ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - [] - ],[ - [ id:'custom_test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), - [ - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz_tbi'], checkIfExists: true) - ] - ]) - - VCF_ANNOTATE_ENSEMBLVEP_SNPEFF ( - input, - [[],[]], - "WBcel235", - "caenorhabditis_elegans", - "108", - [], - [], - "WBcel235.99", - [], - ["snpeff", "ensemblvep"], - 5 - ) -} - -workflow vcf_annotate_ensemblvep_snpeff_large_chunks { - input = Channel.of([ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - [] - ],[ - [ id:'custom_test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), - [ - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz_tbi'], checkIfExists: true) - ] - ]) - - fasta = [ - [id:"fasta"], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - VCF_ANNOTATE_ENSEMBLVEP_SNPEFF ( - input, - fasta, - "WBcel235", - "caenorhabditis_elegans", - "108", - [], - [], - [], - [], - ["ensemblvep"], - 100 - ) -} - -workflow vcf_annotate_ensemblvep_snpeff_no_scatter { - input = Channel.of([ - [ id:'test1' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - [] - ],[ - [ id:'custom_test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), - [ - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test3_vcf_gz_tbi'], checkIfExists: true) - ] - ]) - - fasta = [ - [id:"fasta"], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - VCF_ANNOTATE_ENSEMBLVEP_SNPEFF ( - input, - fasta, - "WBcel235", - "caenorhabditis_elegans", - "108", - [], - [], - [], - [], - ["ensemblvep"], - [] - ) -} diff --git a/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/nextflow.config b/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/nextflow.config deleted file mode 100644 index e48fa306d676..000000000000 --- a/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/nextflow.config +++ /dev/null @@ -1,21 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: ENSEMBLVEP_VEP { - container = 'docker.io/nfcore/vep:108.2.WBcel235' - ext.args = {[ - "--vcf --offline", - meta.id.startsWith("custom_test") ? "--custom test3.vcf.gz,,vcf,exact,0,TOPMED" : "" - ].join(" ")} - } - - withName: SNPEFF_SNPEFF { - container = 'docker.io/nfcore/snpeff:5.0.WBcel235' - } - - withName: BCFTOOLS_CONCAT { - ext.prefix = { "${meta.id}_concat" } - } - -} diff --git a/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/test.yml b/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/test.yml deleted file mode 100644 index 92fa202cb90d..000000000000 --- a/tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/test.yml +++ /dev/null @@ -1,384 +0,0 @@ -- name: vcf_annotate_ensemblvep_snpeff vcf_annotate_ensemblvep_snpeff_vep - command: nextflow run ./tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff -entry vcf_annotate_ensemblvep_snpeff_vep -c ./tests/config/nextflow.config - tags: - - bcftools - - bcftools/concat - - bcftools/pluginscatter - - bcftools/sort - - ensemblvep - - ensemblvep/vep - - snpeff - - snpeff/snpeff - - subworkflows - - subworkflows/vcf_annotate_ensemblvep_snpeff - - tabix - - tabix/tabix - files: - - path: output/bcftools/custom_test.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/custom_test0.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/custom_test1.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/custom_test_concat.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test0.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test1.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test_concat.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/ensemblvep/custom_test0_annotated.summary.html - contains: - - "" - - "" - - path: output/ensemblvep/custom_test0_annotated.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/ensemblvep/custom_test1_annotated.summary.html - contains: - - "" - - "" - - path: output/ensemblvep/custom_test1_annotated.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/ensemblvep/test0_annotated.summary.html - contains: - - "" - - "" - - path: output/ensemblvep/test0_annotated.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/ensemblvep/test1_annotated.summary.html - contains: - - "" - - "" - - path: output/ensemblvep/test1_annotated.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/tabix/custom_test.vcf.gz.tbi - - path: output/tabix/test.vcf.gz.tbi -- name: vcf_annotate_ensemblvep_snpeff vcf_annotate_ensemblvep_snpeff_snpeff - command: nextflow run ./tests/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff -entry vcf_annotate_ensemblvep_snpeff_snpeff -c ./tests/config/nextflow.config - tags: - - bcftools - - bcftools/concat - - bcftools/pluginscatter - - bcftools/sort - - ensemblvep - - ensemblvep/vep - - snpeff - - snpeff/snpeff - - subworkflows - - subworkflows/vcf_annotate_ensemblvep_snpeff - - tabix - - tabix/tabix - files: - - path: output/bcftools/custom_test.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/custom_test0.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/custom_test1.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/custom_test_concat.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test0.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test1.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/bcftools/test_concat.vcf.gz - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/snpeff/custom_test0_annotated.ann.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/snpeff/custom_test0_annotated.csv - contains: - - "# Summary table" - - path: output/snpeff/custom_test0_annotated.genes.txt - md5sum: 130536bf0237d7f3f746d32aaa32840a - - path: output/snpeff/custom_test1_annotated.ann.vcf - contains: - - "##fileformat=VCFv4.2" - - '##FILTER=' - - path: output/snpeff/custom_test1_annotated.csv - contains: - - "# Summary table" - - path: output/snpeff/custom_test1_annotated.genes.txt - md5sum: 130536bf0237d7f3f746d32aaa32840a - - path: output/snpeff/snpEff_summary.html - contains: - - '