diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b290e090..237c9ed0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,20 +1,21 @@ { + "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json", "name": "nfcore", - "image": "nfcore/gitpod:latest", - "remoteUser": "gitpod", - "runArgs": ["--privileged"], + "image": "nfcore/devcontainer:latest", - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Set *default* container specific settings.json values on container create. - "settings": { - "python.defaultInterpreterPath": "/opt/conda/bin/python" - }, + "remoteUser": "root", + "privileged": true, - // Add the IDs of extensions you want installed when the container is created. - "extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"] - } + "remoteEnv": { + // Workspace path on the host for mounting with docker-outside-of-docker + "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" + }, + + "onCreateCommand": "./.devcontainer/setup.sh", + + "hostRequirements": { + "cpus": 4, + "memory": "16gb", + "storage": "32gb" } } diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 00000000..332a7495 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Customise the terminal command prompt +echo "export PROMPT_DIRTRIM=2" >> $HOME/.bashrc +echo "export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '" >> $HOME/.bashrc +export PROMPT_DIRTRIM=2 +export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] ' + +# Update Nextflow +nextflow self-update + +# Update welcome message +echo "Welcome to the plant-food-research-open/assemblyqc devcontainer!" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 0afb232d..00000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,116 +0,0 @@ -# `plant-food-research-open/assemblyqc`: Contributing Guidelines - -Hi there! -Many thanks for taking an interest in improving plant-food-research-open/assemblyqc. - -We try to manage the required tasks for plant-food-research-open/assemblyqc using GitHub issues, you probably came to this page when creating one. -Please use the pre-filled template to save time. - -However, don't be put off by this template - other more general issues and suggestions are welcome! -Contributions to the code are even more welcome ;) - -## Contribution workflow - -If you'd like to write some code for plant-food-research-open/assemblyqc, the standard workflow is as follows: - -1. Check that there isn't already an issue about your idea in the [plant-food-research-open/assemblyqc issues](https://github.com/plant-food-research-open/assemblyqc/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this -2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [plant-food-research-open/assemblyqc repository](https://github.com/plant-food-research-open/assemblyqc) to your GitHub account -3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions) -4. Use `nf-core pipelines schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10). -5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged - -If you're not used to this workflow with git, you can start with some [docs from GitHub](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or even their [excellent `git` resources](https://try.github.io/). - -## Tests - -You have the option to test your changes locally by running the pipeline. For receiving warnings about process selectors and other `debug` information, it is recommended to use the debug profile. Execute all the tests with the following command: - -```bash -nf-test test --profile docker tests/ -``` - -When you create a pull request with changes, [GitHub Actions](https://github.com/features/actions) will run automatic tests. -Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then. - -There are typically two types of tests that run: - -### Lint tests - -`nf-core` has a [set of guidelines](https://nf-co.re/developers/guidelines) which all pipelines must adhere to. -To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core pipelines lint ` command. - -If any failures or warnings are encountered, please follow the listed URL for more documentation. - -### Pipeline tests - -Each `nf-core` pipeline should be set up with a minimal set of test-data. -`GitHub Actions` then runs the pipeline on this data to ensure that it exits successfully. -If there are any failures then the automated tests fail. -These tests are run both with the latest available version of `Nextflow` and also the minimum required version that is stated in the pipeline code. - -## Patch - -:warning: Only in the unlikely and regretful event of a release happening with a bug. - -- On your own fork, make a new branch `patch` based on `upstream/main` or `upstream/master`. -- Fix the bug, and bump version (X.Y.Z+1). -- Open a pull-request from `patch` to `main`/`master` with the changes. - -## Pipeline contribution conventions - -To make the `plant-food-research-open/assemblyqc` code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written. - -### Adding a new step - -If you wish to contribute a new step, please use the following coding standards: - -1. Define the corresponding input channel into your new process from the expected previous process channel. -2. Write the process block (see below). -3. Define the output channel if needed (see below). -4. Add any new parameters to `nextflow.config` with a default (see below). -5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool). -6. Add sanity checks and validation for all relevant parameters. -7. Perform local tests to validate that the new code works as expected. -8. If applicable, add a new test in the `tests` directory. - -### Default values - -Parameters should be initialised / defined with default values within the `params` scope in `nextflow.config`. - -Once there, use `nf-core pipelines schema build` to add to `nextflow_schema.json`. - -### Default processes resource requirements - -Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels. - -The process resources can be passed on to the tool dynamically within the process with the `${task.cpus}` and `${task.memory}` variables in the `script:` block. - -### Naming schemes - -Please use the following naming schemes, to make it easy to understand what is going where. - -- initial process channel: `ch_output_from_` -- intermediate and terminal channels: `ch__for_` - -### Nextflow version bumping - -If you are using a new feature from core Nextflow, you may bump the minimum required version of nextflow in the pipeline with: `nf-core pipelines bump-version --nextflow . [min-nf-version]` - -### Images and figures - -For overview images and other documents we follow the nf-core [style guidelines and examples](https://nf-co.re/developers/design_guidelines). - -## GitHub Codespaces - -This repo includes a devcontainer configuration which will create a GitHub Codespaces for Nextflow development! This is an online developer environment that runs in your browser, complete with VSCode and a terminal. - -To get started: - -- Open the repo in [Codespaces](https://github.com/plant-food-research-open/assemblyqc/codespaces) -- Tools installed - - nf-core - - Nextflow - -Devcontainer specs: - -- [DevContainer config](.devcontainer/devcontainer.json) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..f2947f84 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - name: Join nf-core + url: https://nf-co.re/join + about: Please join the nf-core community here + - name: "Slack #assemblyqc channel" + url: https://nfcore.slack.com/channels/assemblyqc + about: Discussion about the plant-food-research-open/assemblyqc pipeline diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 582aa4bc..5c2e4e90 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,14 +8,14 @@ These are the most common things requested on pull requests (PRs). Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release. -Learn more about contributing: [CONTRIBUTING.md](https://github.com/plant-food-research-open/assemblyqc/tree/main/.github/CONTRIBUTING.md) +Learn more about contributing: [CONTRIBUTING.md](https://github.com/plant-food-research-open/assemblyqc/tree/main/docs/CONTRIBUTING.md) --> ## PR checklist - [ ] This comment contains a description of changes (with reason). - [ ] If you've fixed a bug or added code that should be tested, add tests! -- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/plant-food-research-open/assemblyqc/tree/main/.github/CONTRIBUTING.md) +- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/plant-food-research-open/assemblyqc/tree/main/docs/CONTRIBUTING.md) - [ ] Make sure your code lints (`nf-core pipelines lint`). - [ ] Ensure the test suite passes: `nextflow run . -profile test,docker --outdir ` and `nf-test test --profile docker tests/`. - [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). diff --git a/.github/actions/get-shards/action.yml b/.github/actions/get-shards/action.yml index 34085279..e2833ee9 100644 --- a/.github/actions/get-shards/action.yml +++ b/.github/actions/get-shards/action.yml @@ -21,7 +21,7 @@ runs: using: "composite" steps: - name: Install nf-test - uses: nf-core/setup-nf-test@v1 + uses: nf-core/setup-nf-test@4069fbbaabe94c08faba4ad261bfa88225ba133f # v2 with: version: ${{ env.NFT_VER }} - name: Get number of shards diff --git a/.github/actions/nf-test/action.yml b/.github/actions/nf-test/action.yml index bf44d961..ce27be2c 100644 --- a/.github/actions/nf-test/action.yml +++ b/.github/actions/nf-test/action.yml @@ -20,24 +20,24 @@ runs: using: "composite" steps: - name: Setup Nextflow - uses: nf-core/setup-nextflow@v2 + uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 with: version: "${{ env.NXF_VERSION }}" - name: Set up Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: - python-version: "3.13" + python-version: "3.14" - name: Install nf-test - uses: nf-core/setup-nf-test@v1 + uses: nf-core/setup-nf-test@4069fbbaabe94c08faba4ad261bfa88225ba133f # v2 with: version: "${{ env.NFT_VER }}" install-pdiff: true - name: Setup apptainer if: contains(inputs.profile, 'singularity') - uses: eWaterCycle/setup-apptainer@main + uses: eWaterCycle/setup-apptainer@3f706d898c9db585b1d741b4692e66755f3a1b40 # v2 - name: Set up Singularity if: contains(inputs.profile, 'singularity') @@ -48,12 +48,48 @@ runs: - name: Conda setup if: contains(inputs.profile, 'conda') - uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3 + uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4 with: auto-update-conda: true conda-solver: libmamba + channels: conda-forge + channel-priority: strict conda-remove-defaults: true + - name: Check if disk cleanup is needed + id: disk-cleanup-check + shell: bash + env: + NFT_WORKDIR: ${{ env.NFT_WORKDIR }} + run: | + nf-test test \ + --profile=+${{ inputs.profile }} \ + $(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \ + --ci \ + --changed-since HEAD^ \ + --verbose \ + --shard ${{ inputs.shard }}/${{ inputs.total_shards }} \ + --dry-run \ + &> nf-test.log + + if grep -q 'full - stub' nf-test.log; then + echo "cleanup=YES" >> $GITHUB_OUTPUT + else + echo "cleanup=NO" >> $GITHUB_OUTPUT + fi + + - name: Disk space cleanup + if: steps.disk-cleanup-check.outputs.cleanup == 'YES' + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + android: true + dotnet: false + haskell: false + large-packages: false + docker-images: false + swap-storage: false + - name: Run nf-test shell: bash env: diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 450da3af..2f8219f4 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -11,17 +11,17 @@ jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` or `fix` branches - name: Check PRs if: github.repository == 'Plant-Food-Research-Open/assemblyqc' run: | - { [[ ${{ github.event.pull_request.head.repo.full_name }} == Plant-Food-Research-Open/assemblyqc ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] + { [[ ${{ github.event.pull_request.head.repo.full_name }} == Plant-Food-Research-Open/assemblyqc ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ "${GITHUB_HEAD_REF%%/*}" == "patch" ]] || [[ "${GITHUB_HEAD_REF%%/*}" == "fix" ]] # If the above check failed, post a comment on the PR explaining the failure # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets - name: Post PR comment if: failure() - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 + uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0 # v3 with: message: | ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: diff --git a/.github/workflows/clean-up.yml b/.github/workflows/clean-up.yml index d3aa88e3..340d8b27 100644 --- a/.github/workflows/clean-up.yml +++ b/.github/workflows/clean-up.yml @@ -10,7 +10,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9 + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10 with: stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback. Remove stale label or add a comment otherwise this issue will be closed in 20 days." stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback. Remove stale label or add a comment if it is still useful." diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml index 999bcc38..a7bf4fc2 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -38,15 +38,18 @@ jobs: runs-on: ubuntu-latest needs: configure steps: + - name: Check out pipeline code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - name: Install Nextflow - uses: nf-core/setup-nextflow@v2 + uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 - name: Disk space cleanup uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: - python-version: "3.13" + python-version: "3.14" architecture: "x64" - name: Setup Apptainer @@ -54,10 +57,15 @@ jobs: with: apptainer-version: 1.3.4 + - name: Read .nf-core.yml + id: read_yml + run: | + echo "nf_core_version=$(yq '.nf_core_version' ${{ github.workspace }}/.nf-core.yml)" >> "$GITHUB_OUTPUT" + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install git+https://github.com/nf-core/tools.git@dev + pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} - name: Make a cache directory for the container images run: | @@ -127,7 +135,7 @@ jobs: fi - name: Upload Nextflow logfile for debugging purposes - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: nextflow_logfile.txt path: .nextflow.log* diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 82c4f2f1..8738ffc9 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,33 +11,31 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Set up Python 3.13 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 - with: - python-version: "3.13" - - - name: Install pre-commit - run: pip install pre-commit + - name: Install Nextflow + uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 - - name: Run pre-commit - run: pre-commit run --all-files + - name: Run prek + uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2 nf-core: runs-on: ubuntu-latest steps: - name: Check out pipeline code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Install Nextflow - uses: nf-core/setup-nextflow@v2 + uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: - python-version: "3.13" + python-version: "3.14" architecture: "x64" + - name: Setup uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + - name: read .nf-core.yml uses: pietrobolcato/action-read-yaml@9f13718d61111b69f30ab4ac683e67a56d254e1d # 1.1.0 id: read_yml @@ -45,12 +43,10 @@ jobs: config: ${{ github.workspace }}/.nf-core.yml - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} + run: uv tool install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} - name: Run nf-core pipelines lint - if: ${{ github.base_ref != 'main' }} + if: ${{ github.base_ref != 'master' || github.base_ref != 'main' }} env: GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -58,7 +54,7 @@ jobs: run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md - name: Run nf-core pipelines lint --release - if: ${{ github.base_ref == 'main' }} + if: ${{ github.base_ref == 'master' || github.base_ref == 'main' }} env: GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -71,7 +67,7 @@ jobs: - name: Upload linting log file artifact if: ${{ always() }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: linting-logs path: | diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index d43797d9..5b0c24f7 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11 + uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21 with: workflow: linting.yml workflow_conclusion: completed @@ -21,7 +21,7 @@ jobs: run: echo "pr_number=$(cat linting-logs/PR_number.txt)" >> $GITHUB_OUTPUT - name: Post PR comment - uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2 + uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} number: ${{ steps.pr_number.outputs.pr_number }} diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index f5165c92..034aa89a 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -16,7 +16,7 @@ concurrency: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NFT_VER: "0.9.2" + NFT_VER: "0.9.4" NFT_WORKDIR: "~" NXF_ANSI_LOG: false NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity @@ -37,7 +37,7 @@ jobs: rm -rf ./* || true rm -rf ./.??* || true ls -la ./ - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 @@ -47,7 +47,7 @@ jobs: env: NFT_VER: ${{ env.NFT_VER }} with: - max_shards: 7 + max_shards: 21 - name: debug run: | @@ -74,14 +74,14 @@ jobs: - isMain: false profile: "singularity" NXF_VER: - - "24.10.5" + - "25.10.4" - "latest-everything" env: NXF_ANSI_LOG: false TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.total_shards }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 @@ -91,6 +91,7 @@ jobs: continue-on-error: ${{ matrix.NXF_VER == 'latest-everything' }} env: NFT_WORKDIR: ${{ env.NFT_WORKDIR }} + NXF_VERSION: ${{ matrix.NXF_VER }} with: profile: ${{ matrix.profile }} shard: ${{ matrix.shard }} diff --git a/.github/workflows/template-version-comment.yml b/.github/workflows/template-version-comment.yml index beb5c77f..ea30827e 100644 --- a/.github/workflows/template-version-comment.yml +++ b/.github/workflows/template-version-comment.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out pipeline code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: ref: ${{ github.event.pull_request.head.sha }} @@ -29,7 +29,7 @@ jobs: run: echo "OUTPUT=$(pip list --outdated | grep nf-core)" >> ${GITHUB_ENV} - name: Post nf-core template version comment - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 + uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0 # v3 if: | contains(env.OUTPUT, 'nf-core') with: @@ -42,5 +42,5 @@ jobs: > Your pipeline is using an old version of the nf-core template: ${{ steps.read_yml.outputs['nf_core_version'] }}. > Please update your pipeline to the latest version. > - > For more documentation on how to update your pipeline, please see the [nf-core documentation](https://github.com/nf-core/tools?tab=readme-ov-file#sync-a-pipeline-with-the-template) and [Synchronisation documentation](https://nf-co.re/docs/contributing/sync). + > For more documentation on how to update your pipeline, please see the [Synchronisation documentation](https://nf-co.re/docs/developing/template-syncs/overview). # diff --git a/.gitignore b/.gitignore index 3950461f..94aba049 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ testing* .nf-test/ .nf-test.log null/ +.lineage/ diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 83599f63..00000000 --- a/.gitpod.yml +++ /dev/null @@ -1,10 +0,0 @@ -image: nfcore/gitpod:latest -tasks: - - name: Update Nextflow and setup pre-commit - command: | - pre-commit install --install-hooks - nextflow self-update - -vscode: - extensions: - - nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack diff --git a/.nf-core.yml b/.nf-core.yml index b12594c3..8e4131d3 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,8 +1,5 @@ lint: - multiqc_config: false - template_strings: false actions_nf_test: false - included_configs: false files_exist: - conf/igenomes.config - conf/igenomes_ignored.config @@ -23,6 +20,8 @@ lint: - .github/workflows/branch.yml - .github/workflows/linting.yml - docs/README.md + included_configs: false + multiqc_config: false nextflow_config: - manifest.name - manifest.homePage @@ -33,12 +32,12 @@ lint: nf_test_content: - tests/default.nf.test - tests/nextflow.config -nf_core_version: 3.3.2 + template_strings: false +nf_core_version: 4.0.2 repository_type: pipeline template: author: Usman Rashid, Ken Smith, Ross Crowhurst, Chen Wu, Marcus Davy - description: A NextFlow pipeline which evaluates assembly quality with multiple - QC tools and presents the results in a unified html report. + description: A NextFlow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report. force: false is_nfcore: false name: assemblyqc @@ -48,4 +47,4 @@ template: - igenomes - multiqc - fastqc - version: 3.0.0 + version: 3.1.0dev diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bff85a4f..a3f38515 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,9 +4,9 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@3.6.2 + - prettier@3.8.3 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -17,6 +17,8 @@ repos: modules/gallvp/.*| subworkflows/nf-core/.*| subworkflows/gallvp/.*| + modules/(?!local/).*| + subworkflows/(?!local/).*| .*\.snap$ )$ - id: end-of-file-fixer @@ -65,3 +67,9 @@ repos: always_run: true fail_fast: true pass_filenames: false + - repo: https://github.com/seqeralabs/nf-lint-pre-commit + rev: v0.3.0 + hooks: + - id: nextflow-lint + files: '\.nf$|nextflow\.config$' + args: ["-output", "json"] diff --git a/.prettierignore b/.prettierignore index edd29f01..63cde500 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,4 @@ email_template.html -adaptivecard.json -slackreport.json .nextflow* work/ data/ @@ -10,4 +8,7 @@ testing/ testing* *.pyc bin/ +.nf-test/ ro-crate-metadata.json +modules/nf-core/ +subworkflows/nf-core/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 9832ebf0..52ea206e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,33 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v3.1.0dev - [23-July-2026] + +### `Added` + +1. Updated nf-core pipeline template to 4.0.2 + +### `Dependencies` + +1. Nextflow!>=24.10.5 +2. nf-schema@2.5.1 + +## v3.0.1 - [14-Oct-2025] + +### `Added` + +1. Added disk cleanup to nf-test GitHub CI action to avoid the runner running out of disk space for `full - stub` runs + +### `Fixed` + +1. Fixed an issue in Synteny workflow which caused a pipeline crash when Syri failed for one of the synteny combinations [#315](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/315) +2. Fixed an issue which cause parameter validation to fail for `hic_map_combinations` when `hic` parameter was set to `null` [#317](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/317) + +### `Dependencies` + +1. Nextflow!>=25.10.4 +2. nf-schema@2.4.2 + ## v3.0.0 - [22-Sep-2025] ### `Added` diff --git a/CITATION.cff b/CITATION.cff index 007244e3..e1849a81 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -25,7 +25,7 @@ authors: - family-names: "Deng" given-names: "Cecilia" title: "AssemblyQC: A Nextflow pipeline for reproducible reporting of assembly quality" -version: 3.0.0 +version: 3.1.0dev date-released: 2024-07-30 url: "https://github.com/Plant-Food-Research-Open/assemblyqc" doi: 10.1093/bioinformatics/btae477 diff --git a/README.md b/README.md index 7415d12b..03baadd0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ # plant-food-research-open/assemblyqc +[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/plant-food-research-open/assemblyqc) [![GitHub Actions CI Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml) -[![GitHub Actions Linting Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml) -[![Cite Article](http://img.shields.io/badge/DOI-10.1093/bioinformatics/btae477-1073c8?labelColor=000000)](https://doi.org/10.1093/bioinformatics/btae477) - +[![GitHub Actions Linting Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml)[![Cite Article](http://img.shields.io/badge/DOI-10.1093/bioinformatics/btae477-1073c8?labelColor=000000)](https://doi.org/10.1093/bioinformatics/btae477) [![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com) -[![Nextflow](https://img.shields.io/badge/version-%E2%89%A524.10.5-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/) -[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.3.2) +[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.10.4-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/) +[![nf-core template version](https://img.shields.io/badge/nf--core_template-4.0.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/4.0.2) [![run with conda ❌](http://img.shields.io/badge/run%20with-conda%20❌-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) [![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/) [![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/) @@ -65,7 +64,7 @@ Refer to [usage](./docs/usage.md), [parameters](./docs/parameters.md) and [output](./docs/output.md) documents for details. > [!NOTE] -> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data. +> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/get_started/environment_setup/overview) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/get_started/run-your-first-pipeline) with `-profile test` before running the workflow on actual data. Prepare an `assemblysheet.csv` file with following columns representing target assemblies and associated meta-data. @@ -83,7 +82,7 @@ nextflow run plant-food-research-open/assemblyqc \ ``` > [!WARNING] -> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files). +> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/running/run-pipelines#using-parameter-files). ### Plant&Food Users @@ -150,7 +149,7 @@ The pipeline uses nf-core modules contributed by following authors: ## Contributions and Support -If you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md). +If you would like to contribute to this pipeline, please see the [contributing guidelines](docs/CONTRIBUTING.md). ## Citations diff --git a/assets/adaptivecard.json b/assets/adaptivecard.json deleted file mode 100644 index 6477ced0..00000000 --- a/assets/adaptivecard.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "message", - "attachments": [ - { - "contentType": "application/vnd.microsoft.card.adaptive", - "contentUrl": null, - "content": { - "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "msteams": { - "width": "Full" - }, - "type": "AdaptiveCard", - "version": "1.2", - "body": [ - { - "type": "TextBlock", - "size": "Large", - "weight": "Bolder", - "color": "<% if (success) { %>Good<% } else { %>Attention<%} %>", - "text": "plant-food-research-open/assemblyqc v${version} - ${runName}", - "wrap": true - }, - { - "type": "TextBlock", - "spacing": "None", - "text": "Completed at ${dateComplete} (duration: ${duration})", - "isSubtle": true, - "wrap": true - }, - { - "type": "TextBlock", - "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors. The full error message was: ${errorReport}.<% } %>", - "wrap": true - }, - { - "type": "TextBlock", - "text": "The command used to launch the workflow was as follows:", - "wrap": true - }, - { - "type": "TextBlock", - "text": "${commandLine}", - "isSubtle": true, - "wrap": true - } - ], - "actions": [ - { - "type": "Action.ShowCard", - "title": "Pipeline Configuration", - "card": { - "type": "AdaptiveCard", - "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "body": [ - { - "type": "FactSet", - "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %> - ] - } - ] - } - } - ] - } - } - ] -} diff --git a/assets/assemblysheet.csv b/assets/assemblysheet.csv index 06b8a783..fed031bc 100644 --- a/assets/assemblysheet.csv +++ b/assets/assemblysheet.csv @@ -1,2 +1,2 @@ tag,fasta,gff3,monoploid_ids,synteny_labels -FI1,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.gff.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.monoploid.seqs.txt,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.seq.labels.tsv +FI1,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.gff.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.monoploid.seqs.txt,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.seq.labels.tsv diff --git a/assets/assemblysheetv2.csv b/assets/assemblysheetv2.csv index 505e312c..f25014e4 100644 --- a/assets/assemblysheetv2.csv +++ b/assets/assemblysheetv2.csv @@ -1,2 +1,2 @@ tag,fasta,gff3,monoploid_ids,synteny_labels,reads_1 -FI1,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.gff.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.monoploid.seqs.txt,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.seq.labels.tsv,SRR8238189 +FI1,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.gff.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.monoploid.seqs.txt,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/FI1.seq.labels.tsv,SRR8238189 diff --git a/assets/slackreport.json b/assets/slackreport.json deleted file mode 100644 index 2786203f..00000000 --- a/assets/slackreport.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "attachments": [ - { - "fallback": "Plain-text summary of the attachment.", - "color": "<% if (success) { %>good<% } else { %>danger<%} %>", - "author_name": "plant-food-research-open/assemblyqc ${version} - ${runName}", - "author_icon": "https://www.nextflow.io/docs/latest/_static/favicon.ico", - "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors<% } %>", - "fields": [ - { - "title": "Command used to launch the workflow", - "value": "```${commandLine}```", - "short": false - } - <% - if (!success) { %> - , - { - "title": "Full error message", - "value": "```${errorReport}```", - "short": false - }, - { - "title": "Pipeline configuration", - "value": "<% out << summary.collect{ k,v -> k == "hook_url" ? "_${k}_: (_hidden_)" : ( ( v.class.toString().contains('Path') || ( v.class.toString().contains('String') && v.contains('/') ) ) ? "_${k}_: `${v}`" : (v.class.toString().contains('DateTime') ? ("_${k}_: " + v.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM))) : "_${k}_: ${v}") ) }.join(",\n") %>", - "short": false - } - <% } - %> - ], - "footer": "Completed at <% out << dateComplete.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM)) %> (duration: ${duration})" - } - ] -} diff --git a/assets/xrefsheet.csv b/assets/xrefsheet.csv index e945d3e4..87adec4c 100644 --- a/assets/xrefsheet.csv +++ b/assets/xrefsheet.csv @@ -1,3 +1,3 @@ tag,fasta,synteny_labels -TT_2021a,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/021/950/295/GCA_021950295.1_ASM2195029v1/GCA_021950295.1_ASM2195029v1_genomic.fna.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/TT_2021a.seq.labels.tsv -JAD,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/016/859/245/GCA_016859245.1_ASM1685924v1/GCA_016859245.1_ASM1685924v1_genomic.fna.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/JAD.seq.labels.tsv +TT_2021a,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_021950295.1_ASM2195029v1_genomic.fna.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/TT_2021a.seq.labels.tsv +JAD,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_016859245.1_ASM1685924v1_genomic.fna.gz,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/dev/tests/stub/JAD.seq.labels.tsv diff --git a/conf/base.config b/conf/base.config index 3f388700..9b053121 100644 --- a/conf/base.config +++ b/conf/base.config @@ -14,7 +14,7 @@ process { memory = { 6.GB * task.attempt } time = { 4.h * task.attempt } - errorStrategy = { task.exitStatus in ((130..145) + 104 + 175) ? 'retry' : 'finish' } + errorStrategy = { task.exitStatus in ((130..145) + 104 + (175..177)) ? 'retry' : 'finish' } maxRetries = 1 maxErrors = '-1' diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 00000000..dacdbee9 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,162 @@ +--- +title: Contributing +markdownPlugin: checklist +--- + +# `plant-food-research-open/assemblyqc`: Contributing guidelines + +Hi there! +Thanks for taking an interest in improving plant-food-research-open/assemblyqc. + +This page describes the recommended nf-core way to contribute to both plant-food-research-open/assemblyqc and nf-core pipelines in general, including: + +- [General contribution guidelines](#general-contribution-guidelines): common procedures or guides across all nf-core pipelines. +- [Pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines): procedures or guides specific to the development conventions of plant-food-research-open/assemblyqc. + +## General contribution guidelines + +### Contribution quick start + +To contribute code to any nf-core pipeline: + +- [ ] Ensure you have Nextflow, nf-core tools, and nf-test installed. See the [nf-core/tools repository](https://github.com/nf-core/tools) for instructions. +- [ ] Check whether a GitHub [issue](https://github.com/plant-food-research-open/assemblyqc/issues) about your idea already exists. If an issue does not exist, create one so that others are aware you are working on it. +- [ ] [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [plant-food-research-open/assemblyqc repository](https://github.com/plant-food-research-open/assemblyqc) to your GitHub account. +- [ ] Create a branch on your forked repository and make your changes following [pipeline conventions](#pipeline-contribution-conventions) (if applicable). +- [ ] To fix major bugs, name your branch `patch` and follow the [patch release](#patch-release) process. +- [ ] Update relevant documentation within the `docs/` folder, use nf-core/tools to update `nextflow_schema.json`, and update `CITATIONS.md`. +- [ ] Run and/or update tests. See [Testing](#testing) for more information. +- [ ] [Lint](#lint-tests) your code with nf-core/tools. +- [ ] Submit a pull request (PR) against the `dev` branch and request a review. + +If you are not used to this workflow with Git, see the [GitHub documentation](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or [Git resources](https://try.github.io/) for more information. + +### GitHub Codespaces + +You can contribute to plant-food-research-open/assemblyqc without installing a local development environment on your machine by using [GitHub Codespaces](https://github.com/codespaces). + +[GitHub Codespaces](https://github.com/codespaces) is an online developer environment that runs in your browser, complete with VS Code and a terminal. +Most nf-core repositories include a devcontainer configuration, which creates a GitHub Codespaces environment specifically for Nextflow development. +The environment includes pre-installed nf-core tools, Nextflow, and a few other helpful utilities via a Docker container. + +To get started, open the repository in [Codespaces](https://github.com/plant-food-research-open/assemblyqc/codespaces). + +### Testing + +Once you have made your changes, run the pipeline with nf-test to test them locally. +For additional information, use the `--verbose` flag to view the Nextflow console log output. + +```bash +nf-test test --tag test --profile +docker --verbose +``` + +If you have added new functionality, ensure you update the test assertions in the `.nf.test` files in the `tests/` directory. +Update the snapshots with the following command: + +```bash +nf-test test --tag test --profile +docker --verbose --update-snapshots +``` + +When you create a pull request with changes, GitHub Actions will run automatic tests. +Pull requests are typically reviewed when these tests are passing. + +Two types of tests are typically run: + +#### Lint tests + +nf-core has a [set of guidelines](https://nf-co.re/docs/specifications/overview) which all pipelines must follow. +To enforce these, run linting with nf-core/tools: + +```bash +nf-core pipelines lint +``` + +If you encounter failures or warnings, follow the linked documentation printed to screen. +For more information about linting tests, see [nf-core/tools API documentation](https://nf-co.re/docs/nf-core-tools/api_reference/latest/pipeline_lint_tests/actions_awsfulltest). + +#### Pipeline tests + +Each nf-core pipeline should be set up with a minimal set of test data. +GitHub Actions runs the pipeline on this data to ensure it runs through and exits successfully. +If there are any failures then the automated tests fail. +These tests are run with the latest available version of Nextflow and the minimum required version specified in the pipeline code. + +### Patch release + +> [!WARNING] +> Only in the unlikely event of a release that contains a critical bug. + +- [ ] Create a new branch `patch` on your fork based on `upstream/main` or `upstream/master`. +- [ ] Fix the bug and use nf-core/tools to bump the version to the next semantic version, for example, `1.2.3` → `1.2.4`. +- [ ] Open a Pull Request from `patch` directly to `main`/`master` with the changes. + +### Pipeline contribution conventions + +nf-core semi-standardises how you write code and other contributions to make the plant-food-research-open/assemblyqc code and processing logic more understandable for new contributors and to ensure quality. + +#### Add a new pipeline step + +To contribute a new step to the pipeline, follow the general nf-core coding procedure. +Please also refer to the [pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines): + +- [ ] Define the corresponding [input channel](#channel-naming-schemes) into your new process from the expected previous process channel. +- [ ] Install a module with nf-core/tools, or write a local module (see [default processes resource requirements](#default-processes-resource-requirements)), and add it to the target `.nf`. +- [ ] Define the output channel if needed. Mix the version output channel into `ch_versions` and relevant files into `ch_multiqc`. +- [ ] Add new or updated parameters to `nextflow.config` with a [default value](#default-parameter-values). +- [ ] Add new or updated parameters and relevant help text to `nextflow_schema.json` with [nf-core/tools](#default-parameter-values). +- [ ] Add validation for relevant parameters to the pipeline utilisation section of `utils_nfcore_\_pipeline/main.nf` subworkflow. +- [ ] Perform local tests to validate that the new code works as expected. + - [ ] If applicable, add a new test in the `tests` directory. +- [ ] Update `usage.md`, `output.md`, and `citation.md` as appropriate. +- [ ] [Lint](lint) the code with nf-core/tools. +- [ ] Update any diagrams or pipeline images as necessary. + +To update the minimum required Nextflow version, see the [Nextflow version bumping](#nextflow-version-bumping) section below. For more information about pipeline contributions, see [pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines). + +#### Channel naming schemes + +Use the following naming schemes for channels to make the channel flow easier to understand: + +- Initial process channel: `ch_output_from_` +- Intermediate and terminal channels: `ch__for_` + +#### Default parameter values + +Parameters should be initialised and defined with default values within the `params` scope in `nextflow.config`. +They should also be documented in the pipeline JSON schema. + +To update `nextflow_schema.json`, run: + +```bash +nf-core pipelines schema build +``` + +The schema builder interface that loads in your browser should automatically update the defaults in the parameter documentation. + +#### Default processes resource requirements + +If you write a local module, specify a default set of resource requirements for the process. + +Sensible defaults for process resource requirements (CPUs, memory, time) should be defined in `conf/base.config`. +Specify these with generic `withLabel:` selectors, so they can be shared across multiple processes and steps of the pipeline. + +nf-core provides a set of standard labels that you should follow where possible, as seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config). +These labels define resource defaults for single-core processes, modules that require a GPU, and different levels of multi-core configurations with increasing memory requirements. + +Values assigned within these labels can be dynamically passed to a tool using the the `${task.cpus}` and `${task.memory}` Nextflow variables in the `script:` block of a module (see an example in the [modules repository](https://github.com/nf-core/modules/blob/bd1b6a40f55933d94b8c9ca94ec8c1ea0eaf4b82/modules/nf-core/samtools/bam2fq/main.nf#L30)). + +#### Nextflow version bumping + +If you use a new feature from core Nextflow, bump the minimum required Nextflow version in the pipeline with: + +```bash +nf-core pipelines bump-version --nextflow . +``` + +#### Images and figures guidelines + +If you update images or graphics, follow the nf-core [style guidelines](https://nf-co.re/docs/community/brand/workflow-schematics). + +## Pipeline specific contribution guidelines + + diff --git a/docs/parameters.md b/docs/parameters.md index 29ec4763..dbb67549 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -138,12 +138,16 @@ Parameters used to describe centralised config profiles. These should not be edi Less common options for the pipeline, typically set in a config file. -| Parameter | Description | Type | Default | Required | Hidden | -| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | -------- | ------ | -| `version` | Display version and exit. | `boolean` | | | True | -| `publish_dir_mode` | Method used to save pipeline results to output directory. (accepted: `symlink`\|`rellink`\|`link`\|`copy`\|`copyNoFollow`\|`move`) | `string` | copy | | True | -| `email_on_fail` | Email address for completion summary, only when pipeline fails. | `string` | | | True | -| `plaintext_email` | Send plain-text email instead of HTML. | `boolean` | | | True | -| `monochrome_logs` | Do not use coloured log outputs. | `boolean` | | | True | -| `hook_url` | Incoming hook URL for messaging service | `string` | | | True | -| `trace_report_suffix` | Suffix to add to the trace report filename. Default is the date and time in the format yyyy-MM-dd_HH-mm-ss. | `string` | | | True | +| Parameter | Description | Type | Default | Required | Hidden | +| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------- | -------- | ------ | +| `version` | Display version and exit. | `boolean` | | | True | +| `publish_dir_mode` | Method used to save pipeline results to output directory. (accepted: `symlink`\|`rellink`\|`link`\|`copy`\|`copyNoFollow`\|`move`) | `string` | copy | | True | +| `email_on_fail` | Email address for completion summary, only when pipeline fails. | `string` | | | True | +| `plaintext_email` | Send plain-text email instead of HTML. | `boolean` | | | True | +| `monochrome_logs` | Do not use coloured log outputs. | `boolean` | | | True | +| `validate_params` | Boolean whether to validate parameters against the schema at runtime | `boolean` | True | | True | +| `pipelines_testdata_base_path` | Base URL or local path to location of pipeline test dataset files | `string` | https://raw.githubusercontent.com/nf-core/test-datasets/ | | True | +| `trace_report_suffix` | Suffix to add to the trace report filename. Default is the date and time in the format yyyy-MM-dd_HH-mm-ss. | `string` | | | True | +| `help` | Display the help message. | `['boolean', 'string']` | | | | +| `help_full` | Display the full detailed help message. | `boolean` | | | | +| `show_hidden` | Display hidden parameters in the help message (only works when --help or --help_full are provided). | `boolean` | | | | diff --git a/docs/usage.md b/docs/usage.md index 7d44ee0f..fdaafa31 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -156,7 +156,7 @@ If you wish to repeatedly use the same parameters for multiple runs, rather than Pipeline settings can be provided in a `yaml` or `json` file via `-params-file `. > [!WARNING] -> Do not use `-c ` to specify parameters as this will result in errors. Custom config files specified with `-c` must only be used for [tuning process resource specifications](https://nf-co.re/docs/usage/configuration#tuning-workflow-resources), other infrastructural tweaks (such as output directories), or module arguments (args). +> Do not use `-c ` to specify parameters as this will result in errors. Custom config files specified with `-c` must only be used for [tuning process resource specifications](https://nf-co.re/docs/running/run-pipelines#configuring-pipelines), other infrastructural tweaks (such as output directories), or module arguments (args). The above pipeline run specified with a params file in yaml format: @@ -227,7 +227,7 @@ If `-profile` is not specified, the pipeline will run locally and expect all sof - `shifter` - A generic configuration profile to be used with [Shifter](https://nersc.gitlab.io/development/shifter/how-to-use/) - `charliecloud` - - A generic configuration profile to be used with [Charliecloud](https://hpc.github.io/charliecloud/) + - A generic configuration profile to be used with [Charliecloud](https://charliecloud.io/) - `apptainer` - A generic configuration profile to be used with [Apptainer](https://apptainer.org/) - `wave` @@ -251,19 +251,19 @@ Specify the path to a specific config file (this is a core Nextflow command). Se Whilst the default requirements set within the pipeline will hopefully work for most people and with most input data, you may find that you want to customise the compute resources that the pipeline requests. Each step in the pipeline has a default set of requirements for number of CPUs, memory and time. For most of the pipeline steps, if the job exits with any of the error codes specified [here](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/conf/base.config#L18) it will automatically be resubmitted with higher resources request (2 x original, then 3 x original). If it still fails after the third attempt then the pipeline execution is stopped. -To change the resource requests, please see the [max resources](https://nf-co.re/docs/usage/configuration#max-resources) and [tuning workflow resources](https://nf-co.re/docs/usage/configuration#tuning-workflow-resources) section of the nf-core website. +To change the resource requests, please see the [max resources](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#set-max-resources) and [customise process resources](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#customize-process-resources) section of the nf-core website. ### Custom Containers In some cases, you may wish to change the container or conda environment used by a pipeline steps for a particular tool. By default, nf-core pipelines use containers and software from the [biocontainers](https://biocontainers.pro/) or [bioconda](https://bioconda.github.io/) projects. However, in some cases the pipeline specified version maybe out of date. -To use a different container from the default container or conda environment specified in a pipeline, please see the [updating tool versions](https://nf-co.re/docs/usage/configuration#updating-tool-versions) section of the nf-core website. +To use a different container from the default container or conda environment specified in a pipeline, please see the [updating tool versions](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#update-tool-versions) section of the nf-core website. ### Custom Tool Arguments A pipeline might not always support every possible argument or option of a particular tool used in pipeline. Fortunately, nf-core pipelines provide some freedom to users to insert additional parameters that the pipeline does not include by default. -To learn how to provide additional arguments to a particular tool of the pipeline, please see the [customising tool arguments](https://nf-co.re/docs/usage/configuration#customising-tool-arguments) section of the nf-core website. +To learn how to provide additional arguments to a particular tool of the pipeline, please see the [customising tool arguments](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#modifying-tool-arguments) section of the nf-core website. ### nf-core/configs diff --git a/main.nf b/main.nf index ba68cf53..f355f605 100755 --- a/main.nf +++ b/main.nf @@ -71,7 +71,11 @@ workflow { params.monochrome_logs, args, params.outdir, - params.input + params.input, + params.help, + params.help_full, + params.show_hidden, + params.validate_params ) // @@ -97,7 +101,6 @@ workflow { params.plaintext_email, params.outdir, params.monochrome_logs, - params.hook_url, ) } diff --git a/modules.json b/modules.json index 51262d97..e48a29d7 100644 --- a/modules.json +++ b/modules.json @@ -412,12 +412,12 @@ }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "git_sha": "a3fb7351b1fdb2b1de282b765816bbea190e86a8", "installed_by": ["subworkflows"] }, "utils_nfschema_plugin": { "branch": "master", - "git_sha": "dcd088f483cede0c3df4034d405126f05a764cc7", + "git_sha": "fdc08b8b1ae74f56686ce21f7ea11ad11990ce57", "installed_by": ["subworkflows"] } } diff --git a/nextflow.config b/nextflow.config index 7fee3d5d..8f65ab25 100644 --- a/nextflow.config +++ b/nextflow.config @@ -98,12 +98,13 @@ params { email_on_fail = null plaintext_email = false monochrome_logs = false - hook_url = null version = false help = false help_full = false show_hidden = false + validate_params = true trace_report_suffix = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')// Config options + pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/' // Config options config_profile_name = null @@ -113,6 +114,10 @@ params { } +// Backwards compatibility for publishDir syntax +outputDir = params.outdir +workflow.output.mode = params.publish_dir_mode + // Load base.config by default for all pipelines includeConfig 'conf/base.config' @@ -153,9 +158,20 @@ profiles { apptainer.enabled = false // docker.runOptions = '-u $(id -u):$(id -g)' } - arm { - // docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' - docker.runOptions = '--platform=linux/amd64' + arm64 { + process.arch = 'arm64' + // TODO https://github.com/nf-core/modules/issues/6694 + // For now if you're using arm64 you have to use wave for the sake of the maintainers + // wave profile + apptainer.ociAutoPull = true + singularity.ociAutoPull = true + wave.enabled = true + wave.freeze = true + wave.strategy = 'conda,container' + } + emulate_amd64 { + // docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' + docker.runOptions = '--platform=linux/amd64' } singularity { singularity.enabled = true @@ -211,18 +227,6 @@ profiles { wave.freeze = true wave.strategy = 'conda,container' } - gitpod { - executor.name = 'local' - executor.cpus = 4 - executor.memory = 8.GB - process { - resourceLimits = [ - memory: 8.GB, - cpus : 4, - time : 1.h - ] - } - } gpu { docker.runOptions = '-u $(id -u):$(id -g) --gpus all' apptainer.runOptions = '--nv' @@ -328,27 +332,19 @@ manifest { description = """A Nextflow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report.""" mainScript = 'main.nf' defaultBranch = 'main' - nextflowVersion = '!>=24.10.5' - version = '3.0.0' + nextflowVersion = '!>=25.10.4' + version = '3.1.0dev' doi = 'https://doi.org/10.1093/bioinformatics/btae477' } // Nextflow plugins plugins { - id 'nf-schema@2.4.2' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-schema@2.5.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet } validation { defaultIgnoreParams = ["genomes"] monochromeLogs = params.monochrome_logs - help { - enabled = true - command = "nextflow run plant-food-research-open/assemblyqc -profile --input assemblysheet.csv --outdir " - fullParameter = "help_full" - showHiddenParameter = "show_hidden" - } - monochromeLogs = params.monochrome_logs } - // Load modules.config for DSL2 module specific options includeConfig 'conf/modules.config' diff --git a/nextflow_schema.json b/nextflow_schema.json index 8fb5f903..1d4d571b 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -523,10 +523,18 @@ "fa_icon": "fas fa-palette", "hidden": true }, - "hook_url": { + "validate_params": { + "type": "boolean", + "description": "Boolean whether to validate parameters against the schema at runtime", + "default": true, + "fa_icon": "fas fa-check-square", + "hidden": true + }, + "pipelines_testdata_base_path": { "type": "string", - "description": "Incoming hook URL for messaging service", - "fa_icon": "fas fa-people-group", + "fa_icon": "far fa-check-circle", + "description": "Base URL or local path to location of pipeline test dataset files", + "default": "https://raw.githubusercontent.com/nf-core/test-datasets/", "hidden": true }, "trace_report_suffix": { @@ -534,6 +542,18 @@ "fa_icon": "far calendar", "description": "Suffix to add to the trace report filename. Default is the date and time in the format yyyy-MM-dd_HH-mm-ss.", "hidden": true + }, + "help": { + "type": ["boolean", "string"], + "description": "Display the help message." + }, + "help_full": { + "type": "boolean", + "description": "Display the full detailed help message." + }, + "show_hidden": { + "type": "boolean", + "description": "Display hidden parameters in the help message (only works when --help or --help_full are provided)." } } } diff --git a/nf-test.config b/nf-test.config index 4eed1f00..f0221b77 100644 --- a/nf-test.config +++ b/nf-test.config @@ -1,21 +1,37 @@ config { // location for all nf-test tests - testsDir "." + testsDir = "." // nf-test directory including temporary files for each test - workDir System.getenv("NFT_WORKDIR") ?: ".nf-test" + workDir = System.getenv("NFT_WORKDIR") ?: ".nf-test" // location of an optional nextflow.config file specific for executing tests - configFile "tests/nextflow.config" + configFile = "tests/nextflow.config" // ignore tests coming from the nf-core/modules repo - ignore 'modules/nf-core/**/tests/*', 'subworkflows/nf-core/**/tests/*' + ignore = [ + 'modules/nf-core/**/tests/*', + 'subworkflows/nf-core/**/tests/*', + 'modules/gallvp/**/tests/*', + 'subworkflows/gallvp/**/tests/*' + ] - // ignore tests coming from the gallvp/nxf-components repo - ignore 'modules/gallvp/**/tests/*', 'subworkflows/gallvp/**/tests/*' + // run all test with defined profile(s) from the main nextflow.config + profile = "test" // list of filenames or patterns that should be trigger a full test run - triggers 'nextflow.config', 'nf-test.config', 'conf/test.config', 'tests/nextflow.config', 'tests/.nftignore' + triggers = [ + '.github/actions/nf-test/action.yml', + '.github/workflows/nf-test.yml', + 'assets/schema_input.json', + 'bin/*', + 'conf/test.config', + 'nextflow.config', + 'nextflow_schema.json', + 'nf-test.config', + 'tests/.nftignore', + 'tests/nextflow.config', + ] // load the necessary plugins plugins { diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index 62453cbd..93e98ed8 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -21,9 +21,9 @@ { "@id": "./", "@type": "Dataset", - "creativeWorkStatus": "InProgress", - "datePublished": "2025-09-22T00:29:39+00:00", - "description": "# plant-food-research-open/assemblyqc\n\n[![GitHub Actions CI Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml)\n[![Cite Article](http://img.shields.io/badge/DOI-10.1093/bioinformatics/btae477-1073c8?labelColor=000000)](https://doi.org/10.1093/bioinformatics/btae477)\n\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A524.10.5-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.3.2)\n\n[![run with conda \u274c](http://img.shields.io/badge/run%20with-conda%20\u274c-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/plant-food-research-open/assemblyqc)\n\n## Introduction\n\n**plant-food-research-open/assemblyqc** is a [Nextflow](https://www.nextflow.io/docs/latest/index.html) pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report. The tools are shown in the [Pipeline Flowchart](#pipeline-flowchart) and their references are listed in [CITATIONS.md](./CITATIONS.md). The pipeline includes skip flags to disable execution of various tools.\n\n## Pipeline Flowchart\n\n

\n\n- `Assembly`\n - [fa-lint](https://github.com/GallVp/fa-lint) + [SeqKit rmdup](https://github.com/shenwei356/seqkit): FASTA validation\n - [assemblathon_stats](https://github.com/PlantandFoodResearch/assemblathon2-analysis/blob/a93cba25d847434f7eadc04e63b58c567c46a56d/assemblathon_stats.pl), [gfastats](https://github.com/vgl-hub/gfastats): Assembly statistics\n - [NCBI FCS-adaptor](https://github.com/ncbi/fcs): Adaptor contamination pass/fail\n - [NCBI FCS-GX](https://github.com/ncbi/fcs): Foreign organism contamination pass/fail\n - [tidk](https://github.com/tolkit/telomeric-identifier): Telomere repeat identification\n - [BUSCO](https://gitlab.com/ezlab/busco): Gene-space completeness estimation\n - [LAI](https://github.com/oushujun/LTR_retriever/blob/master/LAI): Continuity of repetitive sequences\n - [Kraken 2](https://github.com/DerrickWood/kraken2), [Krona](https://github.com/marbl/Krona): Taxonomy classification\n - `Alignment and visualisation of HiC data`\n - [sra-tools](https://github.com/ncbi/sra-tools): HiC data download from SRA or use of local FASTQ files\n - [fastp](https://github.com/OpenGene/fastp), [FastQC](https://github.com/s-andrews/FastQC): Read QC and trimming\n - [SeqKit sort](https://github.com/shenwei356/seqkit): Alphanumeric sorting of FASTA by sequence ID\n - [HapHiC refsort](https://github.com/zengxiaofei/HapHiC): Reference-based sorting of FASTA\n - [bwa-mem](https://github.com/lh3/bwa): HiC read alignment\n - [samblaster](https://github.com/GregoryFaust/samblaster): Duplicate marking\n - [hic_qc](https://github.com/phasegenomics/hic_qc): HiC read and alignment statistics\n - [YaHS juicer pre](https://github.com/c-zhou/yahs): BAM to juicer conversion\n - [hictk load/zoomify](https://github.com/paulsengroup/hictk): `.hic` file creation\n - [juicebox.js](https://github.com/igvteam/juicebox.js): HiC contact map visualisation\n - `K-mer completeness, consensus quality and phasing assessment`\n - [sra-tools](https://github.com/ncbi/sra-tools): Assembly, maternal and paternal data download from SRA or use of local FASTQ files\n - [Merqury hapmers](https://github.com/marbl/merqury/blob/master/trio/hapmers.sh): Hapmer generation if parental data is available\n - [Merqury](https://github.com/marbl/merqury): Completeness, consensus quality and phasing assessment\n - `Synteny analysis`\n - [MUMmer](https://github.com/mummer4/mummer) \u2192 [Circos](http://circos.ca/documentation/) + [dotplot](https://plotly.com): One-to-all and all-to-all synteny analysis at the contig level\n - [Minimap2](https://github.com/lh3/minimap2) \u2192 [Syri](https://github.com/schneebergerlab/syri)/[Plotsr](https://github.com/schneebergerlab/plotsr): One-to-one synteny analysis at the chromosome level\n - `Mapback profile from alignment of long-read data, GC content and variant detection`\n - [Winnowmap](https://github.com/marbl/Winnowmap): Align long-read data\n - [paftools sam2paf](https://github.com/lh3/minimap2): Convert SAM to PAF\n - [T2T-Polish pafToCovClippedWig](https://github.com/arangrhie/T2T-Polish): Convert PAF to coverage Wig\n - [bedtools nuc](https://bedtools.readthedocs.io/en/latest/): Compute GC content\n - [Clair3](https://github.com/HKU-BAL/Clair3): Variant detection\n- `Annotation`\n - [GenomeTools gt gff3validator](https://genometools.org/tools/gt_gff3validator.html) + [FASTA/GFF correspondence](subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/main.nf): GFF3 validation\n - [GenomeTools gt stat](https://genometools.org/tools/gt_stat.html): Annotation statistics\n - [GffRead](https://github.com/gpertea/gffread), [BUSCO](https://gitlab.com/ezlab/busco): Gene-space completeness estimation in annotation proteins\n - [OrthoFinder](https://github.com/davidemms/OrthoFinder): Phylogenetic orthology inference for comparative genomics\n\n## Usage\n\nRefer to [usage](./docs/usage.md), [parameters](./docs/parameters.md) and [output](./docs/output.md) documents for details.\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.\n\nPrepare an `assemblysheet.csv` file with following columns representing target assemblies and associated meta-data.\n\n- `tag:` A unique tag which represents the target assembly throughout the pipeline and in the final report\n- `fasta:` FASTA file\n\nNow, you can run the pipeline using:\n\n```bash\nnextflow run plant-food-research-open/assemblyqc \\\n -revision \\\n -profile \\\n --input assemblysheet.csv \\\n --outdir \n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\n### Plant&Food Users\n\nDownload the pipeline to your `/workspace/$USER` folder. Change the parameters defined in the [pfr/params.json](./pfr/params.json) file. Submit the pipeline to SLURM for execution.\n\n```bash\nsbatch ./pfr_assemblyqc\n```\n\n## Credits\n\nplant-food-research-open/assemblyqc was originally written by Usman Rashid ([@gallvp](https://github.com/gallvp)) and Ken Smith ([@hzlnutspread](https://github.com/hzlnutspread)).\n\nRoss Crowhurst ([@rosscrowhurst](https://github.com/rosscrowhurst)), Chen Wu ([@christinawu2008](https://github.com/christinawu2008)) and Marcus Davy ([@mdavy86](https://github.com/mdavy86)) generously contributed their QC scripts.\n\nMahesh Binzer-Panchal ([@mahesh-panchal](https://github.com/mahesh-panchal)) and Simon Pearce ([@SPPearce](https://github.com/SPPearce)) helped port the pipeline modules and sub-workflows to [nf-core](https://nf-co.re) schema.\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- [Cecilia Deng](https://github.com/CeciliaDeng)\n- [Ignacio Carvajal](https://github.com/ignacio3437)\n- [Jason Shiller](https://github.com/jasonshiller)\n- [Sarah Bailey](https://github.com/SarahBailey1998)\n- [Susan Thomson](https://github.com/cflsjt)\n- [Ting-Hsuan Chen](https://github.com/ting-hsuan-chen)\n\nThe pipeline uses nf-core modules contributed by following authors:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\n## Citations\n\nIf you use plant-food-research-open/assemblyqc for your analysis, please cite it as:\n\n> **AssemblyQC: A Nextflow pipeline for reproducible reporting of assembly quality.**\n>\n> Usman Rashid, Chen Wu, Jason Shiller, Ken Smith, Ross Crowhurst, Marcus Davy, Ting-Hsuan Chen, Ignacio Carvajal, Sarah Bailey, Susan Thomson & Cecilia H Deng.\n>\n> _Bioinformatics_. 2024 July 30. doi: [10.1093/bioinformatics/btae477](https://doi.org/10.1093/bioinformatics/btae477).\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nThis pipeline uses code and infrastructure developed and maintained by the [nf-core](https://nf-co.re) community, reused here under the [MIT license](https://github.com/nf-core/tools/blob/main/LICENSE).\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", + "creativeWorkStatus": "Stable", + "datePublished": "2026-07-22T21:16:21+00:00", + "description": "# plant-food-research-open/assemblyqc\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/plant-food-research-open/assemblyqc)\n[![GitHub Actions CI Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.10.4-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-4.0.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/4.0.2)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/plant-food-research-open/assemblyqc)\n\n## Introduction\n\n**plant-food-research-open/assemblyqc** is a bioinformatics pipeline that ...\n\n\n\n\n\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/get_started/environment_setup/overview) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/get_started/run-your-first-pipeline) with `-profile test` before running the workflow on actual data.\n\n\n\nNow, you can run the pipeline using:\n\n\n\n```bash\nnextflow run plant-food-research-open/assemblyqc \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/running/run-pipelines#using-parameter-files).\n\n## Credits\n\nplant-food-research-open/assemblyqc was originally written by Usman Rashid, Ken Smith, Ross Crowhurst, Chen Wu, Marcus Davy.\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](docs/CONTRIBUTING.md).\n\n## Citations\n\n\n\n\n\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nThis pipeline uses code and infrastructure developed and maintained by the [nf-core](https://nf-co.re) community, reused here under the [MIT license](https://github.com/nf-core/tools/blob/main/LICENSE).\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", "hasPart": [ { "@id": "main.nf" @@ -102,7 +102,7 @@ }, "mentions": [ { - "@id": "#6068a637-d0e8-4615-a5c9-68701748950b" + "@id": "#a07989b9-28c2-4b30-a725-41313d239b1c" } ], "name": "plant-food-research-open/assemblyqc" @@ -129,16 +129,25 @@ "SoftwareSourceCode", "ComputationalWorkflow" ], - "creator": [ + "contributor": [ { - "@id": "#usman@smme.edu.pk" + "@id": "#e779d185-1135-4952-aa53-d5cc9a4773c5" }, { - "@id": "#hrakws@aklppf31.pfr.co.nz" + "@id": "#c8699c85-d2b9-42c9-a5ac-9b9f3e01bed3" + }, + { + "@id": "https://orcid.org/0000-0003-0608-2134" + }, + { + "@id": "#8362f2ce-b479-43e6-bac9-317c7e33a81c" + }, + { + "@id": "https://orcid.org/0000-0003-0427-4925" } ], "dateCreated": "", - "dateModified": "2025-09-22T12:29:39Z", + "dateModified": "2026-07-23T09:16:21Z", "dct:conformsTo": "https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE/", "keywords": [ "nf-core", @@ -147,14 +156,6 @@ "license": [ "MIT" ], - "maintainer": [ - { - "@id": "#usman@smme.edu.pk" - }, - { - "@id": "#hrakws@aklppf31.pfr.co.nz" - } - ], "name": [ "plant-food-research-open/assemblyqc" ], @@ -166,10 +167,10 @@ }, "url": [ "https://github.com/plant-food-research-open/assemblyqc", - "https://nf-co.re/plant-food-research-open/assemblyqc/dev/" + "https://nf-co.re/plant-food-research-open/assemblyqc/3.1.0/" ], "version": [ - "3.0.0" + "3.1.0" ] }, { @@ -182,14 +183,14 @@ "url": { "@id": "https://www.nextflow.io/" }, - "version": "!>=24.10.5" + "version": "!>=25.10.4" }, { - "@id": "#6068a637-d0e8-4615-a5c9-68701748950b", + "@id": "#a07989b9-28c2-4b30-a725-41313d239b1c", "@type": "TestSuite", "instance": [ { - "@id": "#233e21c6-dec3-4d79-95be-2c71b303aed2" + "@id": "#3b806465-1229-44f9-bab4-6d7e56d3630c" } ], "mainEntity": { @@ -198,7 +199,7 @@ "name": "Test suite for plant-food-research-open/assemblyqc" }, { - "@id": "#233e21c6-dec3-4d79-95be-2c71b303aed2", + "@id": "#3b806465-1229-44f9-bab4-6d7e56d3630c", "@type": "TestInstance", "name": "GitHub Actions workflow for testing plant-food-research-open/assemblyqc", "resource": "repos/plant-food-research-open/assemblyqc/actions/workflows/nf-test.yml", @@ -332,16 +333,31 @@ "url": "https://nf-co.re/" }, { - "@id": "#usman@smme.edu.pk", + "@id": "#e779d185-1135-4952-aa53-d5cc9a4773c5", "@type": "Person", "email": "usman@smme.edu.pk", "name": "Usman Rashid" }, { - "@id": "#hrakws@aklppf31.pfr.co.nz", + "@id": "#c8699c85-d2b9-42c9-a5ac-9b9f3e01bed3", "@type": "Person", "email": "hrakws@aklppf31.pfr.co.nz", "name": "Ken Smith" + }, + { + "@id": "https://orcid.org/0000-0003-0608-2134", + "@type": "Person", + "name": "Ross Crowhurst" + }, + { + "@id": "#8362f2ce-b479-43e6-bac9-317c7e33a81c", + "@type": "Person", + "name": "Chen Wu" + }, + { + "@id": "https://orcid.org/0000-0003-0427-4925", + "@type": "Person", + "name": "Marcus Davy" } ] } \ No newline at end of file diff --git a/subworkflows/local/fasta_synteny.nf b/subworkflows/local/fasta_synteny.nf index eee94f8e..56c4181d 100644 --- a/subworkflows/local/fasta_synteny.nf +++ b/subworkflows/local/fasta_synteny.nf @@ -341,30 +341,7 @@ workflow FASTA_SYNTENY { ] } | groupTuple - | map { meta, syri, fastas -> - def fasta_list = fastas.flatten() - def syri_tags = syri.collect { it.name.replace('syri.out', '').split(/\.on\./).toList() }.flatten().unique() - def proposed_order = plotsr_assembly_order ? plotsr_assembly_order.tokenize(' ') : syri_tags.sort(false) { it.toUpperCase() } - - def available_tags = [] - proposed_order.each { tag -> if ( tag in syri_tags ) available_tags << tag } - - def ordered_fa = [] - available_tags.each { tag -> ordered_fa << ( fasta_list.find { it.baseName == "${tag}.plotsr" } ) } - - def ordered_syri_tags = [] - available_tags.eachWithIndex { tag, index -> if ( index > 0 ) { ordered_syri_tags << "${tag}.on.${available_tags[index-1]}" } } - - def ordered_syri = [] - ordered_syri_tags.each { tag -> ordered_syri << ( syri.find { it.baseName == "${tag}syri" } ) } - - [ - meta, - ordered_syri, - ordered_fa, - "#file\tname\n" + ordered_fa.collect { it.baseName.replace('.plotsr', '') }.join('\n') - ] - } + | map { meta, syri, fastas -> packageSyriOutputsForPlotSR ( meta, syri, fastas, plotsr_assembly_order ) } PLOTSR( ch_plotsr_inputs.map { meta, syri, _fastas, _txt -> [ meta, syri ] }, @@ -430,3 +407,55 @@ def extractBundleTag(filePath) { error "Error: Failed to parse the sequence tag from file name: ${filePath.getName()}" } } + +def packageSyriOutputsForPlotSR(meta, syri, fastas, plotsr_assembly_order) { + def fasta_list = fastas.flatten() + + // Iteration 1: Find available Syri tags from Syri outputs and order Syri.out files by their tags alphabetically or + // in accordance with the order listed in `plotsr_assembly_order` + def syri_tags = syri.collect { it.name.replace('syri.out', '').split(/\.on\./).toList() }.flatten().unique() + def proposed_order = plotsr_assembly_order ? plotsr_assembly_order.tokenize(' ') : syri_tags.sort(false) { it.toUpperCase() } + + def available_tags = [] + proposed_order.each { tag -> if ( tag in syri_tags ) available_tags << tag } + + if ( proposed_order.size() != available_tags.size() ) { + log.warn ( + "Plotsr combinations involving ${proposed_order - available_tags} will be skipped" + + " as Syri failed to find synteny for their combinations." + ) + } + + def ordered_syri_tags = [] + available_tags.eachWithIndex { tag, index -> if ( index > 0 ) { ordered_syri_tags << "${tag}.on.${available_tags[index-1]}" } } + + def ordered_syri = [] + ordered_syri_tags.each { tag -> ordered_syri << ( syri.find { it.baseName == "${tag}syri" } ) } + def first_null_tag_idx = ordered_syri.findIndexOf { it == null } + + // Remove all Syri files for combinations at and after the first null as Plotsr cannot handle skipped combinations + if ( first_null_tag_idx >= 0 ) { + ordered_syri = ordered_syri[0.. if ( tag in syri_tags ) available_tags << tag } + + def ordered_fa = [] + available_tags.each { tag -> ordered_fa << ( fasta_list.find { it.baseName == "${tag}.plotsr" } ) } + + [ + meta, + ordered_syri, + ordered_fa, + "#file\tname\n" + ordered_fa.collect { it.baseName.replace('.plotsr', '') }.join('\n') + ] +} diff --git a/subworkflows/local/utils_nfcore_assemblyqc_pipeline/main.nf b/subworkflows/local/utils_nfcore_assemblyqc_pipeline/main.nf index 97feb4ca..e1ff248b 100644 --- a/subworkflows/local/utils_nfcore_assemblyqc_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_assemblyqc_pipeline/main.nf @@ -11,9 +11,9 @@ include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin' include { paramsSummaryMap } from 'plugin/nf-schema' include { samplesheetToList } from 'plugin/nf-schema' +include { paramsHelp } from 'plugin/nf-schema' include { completionEmail } from '../../nf-core/utils_nfcore_pipeline' include { completionSummary } from '../../nf-core/utils_nfcore_pipeline' -include { imNotification } from '../../nf-core/utils_nfcore_pipeline' include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline' @@ -30,12 +30,16 @@ workflow PIPELINE_INITIALISATION { monochrome_logs // boolean: Do not use coloured log outputs nextflow_cli_args // array: List of positional nextflow CLI args outdir // string: The output directory where the results will be saved - input // string: Path to input assemblysheet + input // string: Path to input samplesheet + help // boolean: Display help message and exit + help_full // boolean: Show the full help message + show_hidden // boolean: Show hidden parameters in the help message + validate_params // boolean: Validate parameters and exit main: - ch_versions = Channel.empty() - summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") + ch_versions = channel.empty() + summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") // // Print version and exit if required and dump pipeline parameters to JSON file @@ -50,10 +54,25 @@ workflow PIPELINE_INITIALISATION { // // Validate parameters and generate parameter summary to stdout // + + def before_text = "" + def after_text = "" + if (monochrome_logs) { + before_text = before_text.replaceAll(/\033\[[0-9;]*m/, '') + } + + command = "nextflow run ${workflow.manifest.name} -profile --input samplesheet.csv --outdir " + UTILS_NFSCHEMA_PLUGIN ( workflow, - true, // validate params - null // schema path: nextflow_schema + validate_params, + null, + help, + help_full, + show_hidden, + before_text, + after_text, + command ) // @@ -71,22 +90,27 @@ workflow PIPELINE_INITIALISATION { // Initialise input channels // - ch_input = Channel.fromList (samplesheetToList(input, "assets/schema_input.json")) + ch_input = channel.fromList (samplesheetToList(input, "assets/schema_input.json")) // Function: validateInputTags ch_input_validated = ch_input | map { row -> row[0] } | collect - | map { tags -> validateInputTags( tags, params.hic_map_combinations ) } + | map { tags -> + validateInputTags( + tags, + params.hic ? params.hic_map_combinations : null + ) + } | combine ( ch_input.map { row -> [ row ] } ) | map { _result, row -> row } ch_hic_reads = ! params.hic - ? Channel.empty() + ? channel.empty() : ( "$params.hic".find(/\S+\{1,2\}[\w\.]*\.f(ast)?q\.gz/) - ? Channel.fromFilePairs(params.hic, checkIfExists: true) - : Channel.of( [ params.hic, 'is_sra' ] ) + ? channel.fromFilePairs(params.hic, checkIfExists: true) + : channel.of( [ params.hic, 'is_sra' ] ) ) | map { sample, fq -> "$fq" != 'is_sra' @@ -95,8 +119,8 @@ workflow PIPELINE_INITIALISATION { } ch_xref_assembly = params.synteny_skip || ! params.synteny_xref_assemblies - ? Channel.empty() - : Channel.fromList(samplesheetToList(params.synteny_xref_assemblies, "assets/schema_xref_assemblies.json")) + ? channel.empty() + : channel.fromList(samplesheetToList(params.synteny_xref_assemblies, "assets/schema_xref_assemblies.json")) ch_xref_assembly_validated = ch_xref_assembly | map { row -> row[0] } @@ -109,7 +133,7 @@ workflow PIPELINE_INITIALISATION { } ch_merqury_reads = params.merqury_skip - ? Channel.empty() + ? channel.empty() : ch_input_validated | map { input_data -> def tag = input_data[0] @@ -126,7 +150,7 @@ workflow PIPELINE_INITIALISATION { } ch_maternal_reads = params.merqury_skip - ? Channel.empty() + ? channel.empty() : ch_input_validated | map { input_data -> def tag = input_data[0] @@ -143,7 +167,7 @@ workflow PIPELINE_INITIALISATION { } ch_paternal_reads = params.merqury_skip - ? Channel.empty() + ? channel.empty() : ch_input_validated | map { input_data -> def tag = input_data[0] @@ -159,7 +183,7 @@ workflow PIPELINE_INITIALISATION { validateAndNormaliseReadsTuple ( fid, metas, m_reads, 'paternal' ) } ch_mapback_reads = params.mapback_skip - ? Channel.empty() + ? channel.empty() : ch_input_validated | map { input_data -> def tag = input_data[0] @@ -204,8 +228,8 @@ workflow PIPELINE_INITIALISATION { // Initialise parameter channels - ch_params_as_json = Channel.of ( jsonifyParams ( params ) ) - ch_summary_params_as_json = Channel.of ( jsonifySummaryParams ( summary_params ) ) + ch_params_as_json = channel.of ( jsonifyParams ( params ) ) + ch_summary_params_as_json = channel.of ( jsonifySummaryParams ( summary_params ) ) emit: input = ch_input_validated @@ -234,7 +258,6 @@ workflow PIPELINE_COMPLETION { plaintext_email // boolean: Send plain-text email instead of HTML outdir // path: Path to output directory where results will be published monochrome_logs // boolean: Disable ANSI colour codes in log output - hook_url // string: hook URL for notifications main: summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") @@ -256,13 +279,11 @@ workflow PIPELINE_COMPLETION { } completionSummary(monochrome_logs) - if (hook_url) { - imNotification(summary_params, hook_url) - } + } workflow.onError { - log.error "Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting" + log.error "Pipeline failed. Please refer to troubleshooting docs for common issues: https://nf-co.re/docs/running/troubleshooting" } } diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index bfd25876..afca5439 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -17,7 +17,7 @@ workflow UTILS_NFCORE_PIPELINE { checkProfileProvided(nextflow_cli_args) emit: - valid_config + valid_config = valid_config } /* @@ -98,7 +98,7 @@ def workflowVersionToYAML() { // Get channel of software versions used in pipeline in YAML format // def softwareVersionsToYAML(ch_versions) { - return ch_versions.unique().map { version -> processVersionsFromYAML(version) }.unique().mix(Channel.of(workflowVersionToYAML())) + return ch_versions.unique().map { version -> processVersionsFromYAML(version) }.unique().mix(channel.of(workflowVersionToYAML())) } // @@ -353,67 +353,3 @@ def completionSummary(monochrome_logs=true) { log.info("-${colors.purple}[${workflow.manifest.name}]${colors.red} Pipeline completed with errors${colors.reset}-") } } - -// -// Construct and send a notification to a web server as JSON e.g. Microsoft Teams and Slack -// -def imNotification(summary_params, hook_url) { - def summary = [:] - summary_params - .keySet() - .sort() - .each { group -> - summary << summary_params[group] - } - - def misc_fields = [:] - misc_fields['start'] = workflow.start - misc_fields['complete'] = workflow.complete - misc_fields['scriptfile'] = workflow.scriptFile - misc_fields['scriptid'] = workflow.scriptId - if (workflow.repository) { - misc_fields['repository'] = workflow.repository - } - if (workflow.commitId) { - misc_fields['commitid'] = workflow.commitId - } - if (workflow.revision) { - misc_fields['revision'] = workflow.revision - } - misc_fields['nxf_version'] = workflow.nextflow.version - misc_fields['nxf_build'] = workflow.nextflow.build - misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp - - def msg_fields = [:] - msg_fields['version'] = getWorkflowVersion() - msg_fields['runName'] = workflow.runName - msg_fields['success'] = workflow.success - msg_fields['dateComplete'] = workflow.complete - msg_fields['duration'] = workflow.duration - msg_fields['exitStatus'] = workflow.exitStatus - msg_fields['errorMessage'] = (workflow.errorMessage ?: 'None') - msg_fields['errorReport'] = (workflow.errorReport ?: 'None') - msg_fields['commandLine'] = workflow.commandLine.replaceFirst(/ +--hook_url +[^ ]+/, "") - msg_fields['projectDir'] = workflow.projectDir - msg_fields['summary'] = summary << misc_fields - - // Render the JSON template - def engine = new groovy.text.GStringTemplateEngine() - // Different JSON depending on the service provider - // Defaults to "Adaptive Cards" (https://adaptivecards.io), except Slack which has its own format - def json_path = hook_url.contains("hooks.slack.com") ? "slackreport.json" : "adaptivecard.json" - def hf = new File("${workflow.projectDir}/assets/${json_path}") - def json_template = engine.createTemplate(hf).make(msg_fields) - def json_message = json_template.toString() - - // POST - def post = new URL(hook_url).openConnection() - post.setRequestMethod("POST") - post.setDoOutput(true) - post.setRequestProperty("Content-Type", "application/json") - post.getOutputStream().write(json_message.getBytes("UTF-8")) - def postRC = post.getResponseCode() - if (!postRC.equals(200)) { - log.warn(post.getErrorStream().getText()) - } -} diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.nf.test b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.nf.test new file mode 100644 index 00000000..8940d32d --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.nf.test @@ -0,0 +1,29 @@ +nextflow_workflow { + + name "Test Workflow UTILS_NFCORE_PIPELINE" + script "../main.nf" + config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" + workflow "UTILS_NFCORE_PIPELINE" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "utils_nfcore_pipeline" + tag "subworkflows/utils_nfcore_pipeline" + + test("Should run without failures") { + + when { + workflow { + """ + input[0] = [] + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.nf.test.snap b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.nf.test.snap new file mode 100644 index 00000000..859d1030 --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.nf.test.snap @@ -0,0 +1,19 @@ +{ + "Should run without failures": { + "content": [ + { + "0": [ + true + ], + "valid_config": [ + true + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:25.726491" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/utils_nfschema_plugin/main.nf b/subworkflows/nf-core/utils_nfschema_plugin/main.nf index 4994303e..1df8b76f 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/main.nf +++ b/subworkflows/nf-core/utils_nfschema_plugin/main.nf @@ -4,6 +4,7 @@ include { paramsSummaryLog } from 'plugin/nf-schema' include { validateParameters } from 'plugin/nf-schema' +include { paramsHelp } from 'plugin/nf-schema' workflow UTILS_NFSCHEMA_PLUGIN { @@ -15,32 +16,58 @@ workflow UTILS_NFSCHEMA_PLUGIN { // when this input is empty it will automatically use the configured schema or // "${projectDir}/nextflow_schema.json" as default. This input should not be empty // for meta pipelines + help // boolean: show help message + help_full // boolean: show full help message + show_hidden // boolean: show hidden parameters in help message + before_text // string: text to show before the help message and parameters summary + after_text // string: text to show after the help message and parameters summary + command // string: an example command of the pipeline main: + if(help || help_full) { + help_options = [ + beforeText: before_text, + afterText: after_text, + command: command, + showHidden: show_hidden, + fullHelp: help_full, + ] + if(parameters_schema) { + help_options << [parametersSchema: parameters_schema] + } + log.info paramsHelp( + help_options, + (params.help instanceof String && params.help != "true") ? params.help : "", + ) + exit 0 + } + // // Print parameter summary to stdout. This will display the parameters // that differ from the default given in the JSON schema // + + summary_options = [:] if(parameters_schema) { - log.info paramsSummaryLog(input_workflow, parameters_schema:parameters_schema) - } else { - log.info paramsSummaryLog(input_workflow) + summary_options << [parametersSchema: parameters_schema] } + log.info before_text + log.info paramsSummaryLog(summary_options, input_workflow) + log.info after_text // // Validate the parameters using nextflow_schema.json or the schema // given via the validation.parametersSchema configuration option // if(validate_params) { + validateOptions = [:] if(parameters_schema) { - validateParameters(parameters_schema:parameters_schema) - } else { - validateParameters() + validateOptions << [parametersSchema: parameters_schema] } + validateParameters(validateOptions) } emit: dummy_emit = true } - diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test b/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test index 8fb30164..c977917a 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test @@ -25,6 +25,12 @@ nextflow_workflow { input[0] = workflow input[1] = validate_params input[2] = "" + input[3] = false + input[4] = false + input[5] = false + input[6] = "" + input[7] = "" + input[8] = "" """ } } @@ -51,6 +57,12 @@ nextflow_workflow { input[0] = workflow input[1] = validate_params input[2] = "" + input[3] = false + input[4] = false + input[5] = false + input[6] = "" + input[7] = "" + input[8] = "" """ } } @@ -77,6 +89,12 @@ nextflow_workflow { input[0] = workflow input[1] = validate_params input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" + input[3] = false + input[4] = false + input[5] = false + input[6] = "" + input[7] = "" + input[8] = "" """ } } @@ -103,6 +121,12 @@ nextflow_workflow { input[0] = workflow input[1] = validate_params input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" + input[3] = false + input[4] = false + input[5] = false + input[6] = "" + input[7] = "" + input[8] = "" """ } } @@ -114,4 +138,36 @@ nextflow_workflow { ) } } + + test("Should create a help message") { + + when { + + params { + test_data = '' + outdir = null + } + + workflow { + """ + validate_params = true + input[0] = workflow + input[1] = validate_params + input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" + input[3] = true + input[4] = false + input[5] = false + input[6] = "Before" + input[7] = "After" + input[8] = "nextflow run test/test" + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } } diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config index 443e828c..f6537cc3 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config @@ -1,5 +1,5 @@ plugins { - id "nf-schema@2.4.2" + id "nf-schema@2.6.1" } validation { diff --git a/tests/hic/main.nf.test.snap b/tests/hic/main.nf.test.snap index 966c4cea..bb06f9c0 100644 --- a/tests/hic/main.nf.test.snap +++ b/tests/hic/main.nf.test.snap @@ -63,7 +63,7 @@ "pigz": "2.3.4" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" }, "YAHS_JUICERPRE": { "yahs": "1.2.2" @@ -169,7 +169,7 @@ "pigz": "2.3.4" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" }, "YAHS_JUICERPRE": { "yahs": "1.2.2" diff --git a/tests/invalid/assemblysheet.csv b/tests/invalid/assemblysheet.csv index d9b6ba62..062258d9 100644 --- a/tests/invalid/assemblysheet.csv +++ b/tests/invalid/assemblysheet.csv @@ -1,6 +1,6 @@ tag,fasta,gff3 -FI1,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.gff.gz -TT_2021a,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/021/950/295/GCA_021950295.1_ASM2195029v1/GCA_021950295.1_ASM2195029v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.gff.gz +FI1,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.gff.gz +TT_2021a,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_021950295.1_ASM2195029v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.gff.gz MISC,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/5c5aa00a120e18979105aed0aad271ff836e0b02/tests/invalid/invalid.fsa.gz DUPSEQ,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/5c5aa00a120e18979105aed0aad271ff836e0b02/tests/invalid/dupseq.fsa.gz ALL_NSs,https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/5c5aa00a120e18979105aed0aad271ff836e0b02/tests/invalid/all_Ns.fa.gz diff --git a/tests/invalid/main.nf.test.snap b/tests/invalid/main.nf.test.snap index e67c83df..bbd69278 100644 --- a/tests/invalid/main.nf.test.snap +++ b/tests/invalid/main.nf.test.snap @@ -35,7 +35,7 @@ "pigz": "2.3.4" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" } }, "stable paths": [ diff --git a/tests/mapback/main.nf.test.snap b/tests/mapback/main.nf.test.snap index 72e74256..e97a9aae 100644 --- a/tests/mapback/main.nf.test.snap +++ b/tests/mapback/main.nf.test.snap @@ -51,7 +51,7 @@ "samtools": "1.16.1" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" } }, "stable paths": [ diff --git a/tests/minimal/main.nf.test.snap b/tests/minimal/main.nf.test.snap index 89d06036..e58e8850 100644 --- a/tests/minimal/main.nf.test.snap +++ b/tests/minimal/main.nf.test.snap @@ -35,7 +35,7 @@ "pigz": "2.3.4" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" } }, "stable paths": [ diff --git a/tests/noltr/assemblysheet.csv b/tests/noltr/assemblysheet.csv index 9769e377..141c8861 100644 --- a/tests/noltr/assemblysheet.csv +++ b/tests/noltr/assemblysheet.csv @@ -1,3 +1,3 @@ tag,fasta sarscov2,https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/genome.fasta -FI1,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.fna.gz +FI1,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCA_003814445.1_ASM381444v1_genomic.fna.gz diff --git a/tests/noltr/main.nf.test.snap b/tests/noltr/main.nf.test.snap index f05ed523..1a36e275 100644 --- a/tests/noltr/main.nf.test.snap +++ b/tests/noltr/main.nf.test.snap @@ -50,7 +50,7 @@ "seqkit": "v2.9.0" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" } }, "stable paths": [ diff --git a/tests/orthofinder/assemblysheet.csv b/tests/orthofinder/assemblysheet.csv index 64892681..cee455d3 100644 --- a/tests/orthofinder/assemblysheet.csv +++ b/tests/orthofinder/assemblysheet.csv @@ -1,5 +1,5 @@ tag,fasta,gff3 -agalactiae,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/063/605/GCF_000063605.1_ASM6360v1/GCF_000063605.1_ASM6360v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/063/605/GCF_000063605.1_ASM6360v1/GCF_000063605.1_ASM6360v1_genomic.gff.gz -gallisepticum,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/900/476/085/GCF_900476085.1_50569_G01/GCF_900476085.1_50569_G01_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/900/476/085/GCF_900476085.1_50569_G01/GCF_900476085.1_50569_G01_genomic.gff.gz -genitalium,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/027/325/GCF_000027325.1_ASM2732v1/GCF_000027325.1_ASM2732v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/027/325/GCF_000027325.1_ASM2732v1/GCF_000027325.1_ASM2732v1_genomic.gff.gz -hyopneumoniae,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/008/205/GCF_000008205.1_ASM820v1/GCF_000008205.1_ASM820v1_genomic.fna.gz,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/008/205/GCF_000008205.1_ASM820v1/GCF_000008205.1_ASM820v1_genomic.gff.gz +agalactiae,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_000063605.1_ASM6360v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_000063605.1_ASM6360v1_genomic.gff.gz +gallisepticum,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_900476085.1_50569_G01_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_900476085.1_50569_G01_genomic.gff.gz +genitalium,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_000027325.1_ASM2732v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_000027325.1_ASM2732v1_genomic.gff.gz +hyopneumoniae,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_000008205.1_ASM820v1_genomic.fna.gz,https://raw.githubusercontent.com/Plant-Food-Research-Open/assemblyqc/refs/heads/ncbi/ftp/tests/ncbi_ftp/GCF_000008205.1_ASM820v1_genomic.gff.gz diff --git a/tests/orthofinder/main.nf.test.snap b/tests/orthofinder/main.nf.test.snap index 07d799d3..30d11b89 100644 --- a/tests/orthofinder/main.nf.test.snap +++ b/tests/orthofinder/main.nf.test.snap @@ -41,7 +41,7 @@ "pigz": "2.3.4" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" } }, "stable paths": [ @@ -49,9 +49,9 @@ "gallisepticum_stats.csv:md5,cedd23a5778c76bf17053f5a0aa6eaf8", "genitalium_stats.csv:md5,04ef67d681fba6ca05df4171f888424a", "hyopneumoniae_stats.csv:md5,d59081ff1b5bb0e9f1be494b8463f3b8", - "agalactiae.gt.stat.yml:md5,6e8df307ea8bb5b668e105e8722ed959", - "gallisepticum.gt.stat.yml:md5,5bea6691c162699489d1b4f2a9864f4f", - "genitalium.gt.stat.yml:md5,042580254bc79383c07d2a461c8bf347", + "agalactiae.gt.stat.yml:md5,63c0935d08d5b0aabd45ce3987bf3f67", + "gallisepticum.gt.stat.yml:md5,5f22785cac256acf09eb3aeb1f649eed", + "genitalium.gt.stat.yml:md5,e8bb4d24bee4cecd9de60cf9e979f0f2", "hyopneumoniae.gt.stat.yml:md5,8601d416b9ffbe1d230c5b3ee29387de" ], "orthofinder stats": [ @@ -75,9 +75,9 @@ } ], "meta": { - "nf-test": "0.9.2", - "nextflow": "25.04.6" + "nf-test": "0.9.3", + "nextflow": "25.10.4" }, - "timestamp": "2025-07-17T22:43:41.196887617" + "timestamp": "2026-07-24T10:36:19.389269" } } \ No newline at end of file diff --git a/tests/stub/main.nf.test.snap b/tests/stub/main.nf.test.snap index 5be653fa..d9e6bb96 100644 --- a/tests/stub/main.nf.test.snap +++ b/tests/stub/main.nf.test.snap @@ -228,7 +228,7 @@ "untar": 1.34 }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" }, "YAHS_JUICERPRE": { "yahs": "1.2.2" diff --git a/tests/synteny/packageSyriOutputsForPlotSR.nf.test b/tests/synteny/packageSyriOutputsForPlotSR.nf.test new file mode 100644 index 00000000..e2ffa551 --- /dev/null +++ b/tests/synteny/packageSyriOutputsForPlotSR.nf.test @@ -0,0 +1,130 @@ +nextflow_function { + + name "packageSyriOutputsForPlotSR" + script "../../subworkflows/local/fasta_synteny.nf" + function "packageSyriOutputsForPlotSR" + + test("FI1 - JAD - TT_2021a") { + when { + function { + """ + input[0] = [ id: 'plotsr' ] + input[1] = [ file('JAD.on.FI1syri.out') ] + input[2] = [ + [ file('JAD.plotsr.fasta'), file('FI1.plotsr.fasta') ] + ] + input[3] = 'FI1 JAD TT_2021a' + """ + } + } + + then { + assert function.success + assert function.result + assert snapshot ( + function.result[0], + function.result[1].collect { file(it).name }, + function.result[2].collect { file(it).name }, + function.result[3], + ).match() + } + } + + test("FI1 - JAD - TT_2021a - null") { + when { + function { + """ + input[0] = [ id: 'plotsr' ] + input[1] = [ file('JAD.on.FI1syri.out') ] + input[2] = [ + [ file('JAD.plotsr.fasta'), file('FI1.plotsr.fasta') ] + ] + input[3] = null + """ + } + } + + then { + assert function.success + assert function.result + assert snapshot ( + function.result[0], + function.result[1].collect { file(it).name }, + function.result[2].collect { file(it).name }, + function.result[3], + ).match() + } + } + + test("gddh13_v1p1 - FujiA - FujiB - PbDS - PcKFL") { + when { + function { + """ + input[0] = [ id: 'plotsr' ] + input[1] = [ + file('FujiA.on.gddh13_v1p1syri.out'), file('FujiB.on.FujiAsyri.out'), file('PcKFL.on.PbDSsyri.out') + ] + input[2] = [ + [ + file('FujiA.plotsr.fasta'), file('gddh13_v1p1.plotsr.fasta') + ], + [ + file('FujiB.plotsr.fasta'), file('FujiA.plotsr.fasta') + ], + [ + file('PcKFL.plotsr.fasta'), file('PbDS.plotsr.fasta') + ] + ] + input[3] = 'gddh13_v1p1 FujiA FujiB PbDS PcKFL' + """ + } + } + + then { + assert function.success + assert function.result + assert snapshot ( + function.result[0], + function.result[1].collect { file(it).name }, + function.result[2].collect { file(it).name }, + function.result[3], + ).match() + } + } + + test("gddh13_v1p1 - FujiA - FujiB - PbDS - PcKFL - null") { + when { + function { + """ + input[0] = [ id: 'plotsr' ] + input[1] = [ + file('FujiA.on.gddh13_v1p1syri.out'), file('FujiB.on.FujiAsyri.out'), file('PcKFL.on.PbDSsyri.out') + ] + input[2] = [ + [ + file('FujiA.plotsr.fasta'), file('gddh13_v1p1.plotsr.fasta') + ], + [ + file('FujiB.plotsr.fasta'), file('FujiA.plotsr.fasta') + ], + [ + file('PcKFL.plotsr.fasta'), file('PbDS.plotsr.fasta') + ] + ] + input[3] = null + """ + } + } + + then { + assert function.success + assert function.result + assert snapshot ( + function.result[0], + function.result[1].collect { file(it).name }, + function.result[2].collect { file(it).name }, + function.result[3], + ).match() + } + } +} diff --git a/tests/synteny/packageSyriOutputsForPlotSR.nf.test.snap b/tests/synteny/packageSyriOutputsForPlotSR.nf.test.snap new file mode 100644 index 00000000..62c3893e --- /dev/null +++ b/tests/synteny/packageSyriOutputsForPlotSR.nf.test.snap @@ -0,0 +1,84 @@ +{ + "gddh13_v1p1 - FujiA - FujiB - PbDS - PcKFL - null": { + "content": [ + { + "id": "plotsr" + }, + [ + "FujiB.on.FujiAsyri.out" + ], + [ + "FujiA.plotsr.fasta", + "FujiB.plotsr.fasta" + ], + "#file\tname\nFujiA\nFujiB" + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.8" + }, + "timestamp": "2025-10-17T11:51:25.665918" + }, + "FI1 - JAD - TT_2021a - null": { + "content": [ + { + "id": "plotsr" + }, + [ + "JAD.on.FI1syri.out" + ], + [ + "FI1.plotsr.fasta", + "JAD.plotsr.fasta" + ], + "#file\tname\nFI1\nJAD" + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.8" + }, + "timestamp": "2025-10-17T12:07:02.170384" + }, + "gddh13_v1p1 - FujiA - FujiB - PbDS - PcKFL": { + "content": [ + { + "id": "plotsr" + }, + [ + "FujiA.on.gddh13_v1p1syri.out", + "FujiB.on.FujiAsyri.out" + ], + [ + "gddh13_v1p1.plotsr.fasta", + "FujiA.plotsr.fasta", + "FujiB.plotsr.fasta" + ], + "#file\tname\ngddh13_v1p1\nFujiA\nFujiB" + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.8" + }, + "timestamp": "2025-10-17T11:51:22.18351" + }, + "FI1 - JAD - TT_2021a": { + "content": [ + { + "id": "plotsr" + }, + [ + "JAD.on.FI1syri.out" + ], + [ + "FI1.plotsr.fasta", + "JAD.plotsr.fasta" + ], + "#file\tname\nFI1\nJAD" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.8" + }, + "timestamp": "2025-10-13T11:51:10.498346" + } +} \ No newline at end of file diff --git a/tests/tiny/main.nf.test.snap b/tests/tiny/main.nf.test.snap index 404bb90b..c9a07c4b 100644 --- a/tests/tiny/main.nf.test.snap +++ b/tests/tiny/main.nf.test.snap @@ -29,7 +29,7 @@ "pigz": "2.3.4" }, "Workflow": { - "plant-food-research-open/assemblyqc": "v3.0.0" + "plant-food-research-open/assemblyqc": "v3.1.0dev" } }, "stable paths": [ diff --git a/workflows/assemblyqc.nf b/workflows/assemblyqc.nf index d680daec..051eb774 100644 --- a/workflows/assemblyqc.nf +++ b/workflows/assemblyqc.nf @@ -63,7 +63,7 @@ workflow ASSEMBLYQC { main: // Versions - ch_versions = Channel.empty() + ch_versions = channel.empty() // Input channels ch_target_assemby_branch = ch_input @@ -148,7 +148,7 @@ workflow ASSEMBLYQC { // MODULE: SEQKIT_RMDUP ch_seqkit_rmdup_input = ! params.check_sequence_duplicates - ? Channel.empty() + ? channel.empty() : ch_falint_assembly SEQKIT_RMDUP ( ch_seqkit_rmdup_input ) @@ -199,7 +199,7 @@ workflow ASSEMBLYQC { // MODULE: FCS_FCSADAPTOR ch_fcs_adaptor_input = params.ncbi_fcs_adaptor_skip - ? Channel.empty() + ? channel.empty() : ch_valid_target_assembly FCS_FCSADAPTOR( @@ -244,7 +244,7 @@ workflow ASSEMBLYQC { // SUBWORKFLOW: NCBI_FCS_GX ch_fcs_gx_input_assembly = params.ncbi_fcs_gx_skip - ? Channel.empty() + ? channel.empty() : ch_valid_target_assembly | map { meta, fa -> [ meta.id, fa ] } @@ -315,7 +315,7 @@ workflow ASSEMBLYQC { // Prepare channels for FETCHNGS // HiC ch_hic_input_assembly = ! params.hic - ? Channel.empty() + ? channel.empty() : ch_clean_assembly | map { tag, fa -> [ [ id: tag ], fa ] } @@ -330,7 +330,7 @@ workflow ASSEMBLYQC { // Mapback reads ch_mapback_input_assembly = params.mapback_skip - ? Channel.empty() + ? channel.empty() : ch_clean_assembly | map { tag, fa -> [ [ id: tag ], fa ] } @@ -481,7 +481,7 @@ workflow ASSEMBLYQC { // MODULE: GFASTATS ch_gfastats_assembly = params.gfastats_skip - ? Channel.empty() + ? channel.empty() : ch_clean_assembly | map { tag, fasta -> [ [ id: tag ], fasta ] } @@ -502,7 +502,7 @@ workflow ASSEMBLYQC { // SUBWORKFLOW: FASTA_GXF_BUSCO_PLOT ch_busco_input_assembly = params.busco_skip - ? Channel.empty() + ? channel.empty() : ch_clean_assembly | map { tag, fasta -> [ [ id: tag ], fasta ] } @@ -551,11 +551,11 @@ workflow ASSEMBLYQC { // SUBWORKFLOW: FASTA_EXPLORE_SEARCH_PLOT_TIDK ch_tidk_inputs = params.tidk_skip - ? Channel.empty() + ? channel.empty() : ch_clean_assembly | map { tag, fa -> [ [ id: tag ], fa ] } | combine( - Channel.of(params.tidk_repeat_seq) + channel.of(params.tidk_repeat_seq) ) FASTA_EXPLORE_SEARCH_PLOT_TIDK( @@ -568,7 +568,7 @@ workflow ASSEMBLYQC { | mix(FASTA_EXPLORE_SEARCH_PLOT_TIDK.out.aposteriori_sequence) | map { _meta, file -> file } | mix( - Channel.of("$params.tidk_repeat_seq") + channel.of("$params.tidk_repeat_seq") | collectFile(name: 'a_priori.sequence', newLine: true) ) @@ -576,7 +576,7 @@ workflow ASSEMBLYQC { // SUBWORKFLOW: FASTA_LTRRETRIEVER_LAI ch_lai_inputs = params.lai_skip - ? Channel.empty() + ? channel.empty() : ch_clean_assembly | join( ch_mono_ids @@ -612,12 +612,12 @@ workflow ASSEMBLYQC { // SUBWORKFLOW: FASTA_KRAKEN2 ch_kraken2_input_assembly = params.kraken2_skip - ? Channel.empty() + ? channel.empty() : ch_clean_assembly ch_kraken2_db_path = params.kraken2_skip - ? Channel.empty() - : Channel.of(file(params.kraken2_db_path, checkIfExists:true)) + ? channel.empty() + : channel.of(file(params.kraken2_db_path, checkIfExists:true)) FASTA_KRAKEN2( ch_kraken2_input_assembly, ch_kraken2_db_path @@ -856,7 +856,7 @@ workflow ASSEMBLYQC { // MODULE: GFFREAD ch_gffread_inputs = params.orthofinder_skip - ? Channel.empty() + ? channel.empty() : ch_valid_gff3 | join( ch_clean_assembly @@ -925,7 +925,7 @@ workflow ASSEMBLYQC { FASTA_BEDTOOLS_MAKEWINDOWS_NUC ( params.mapback_skip - ? Channel.empty() + ? channel.empty() : ch_mapback_assembly_input ) @@ -938,7 +938,7 @@ workflow ASSEMBLYQC { // MODULE: SAMTOOLS_SORT | CLAIR3 ch_clair3_input = params.mapback_variants_skip - ? Channel.empty() + ? channel.empty() : FASTA_FASTQ_WINNOWMAP_COVERAGE.out.bam | join( ch_mapback_assembly_input @@ -1033,13 +1033,30 @@ workflow ASSEMBLYQC { if ( yml ) { yml } } - ch_versions_yml = softwareVersionsToYAML(ch_versions) + ch_topic_versions = channel.topic("versions") + | distinct() + | branch { entry -> + versions_file: entry instanceof Path + versions_tuple: true + } + + ch_topic_versions_string = ch_topic_versions.versions_tuple + | map { process, tool, version -> + [ process[process.lastIndexOf(':')+1..-1], " ${tool}: ${version}" ] + } + | groupTuple(by:0) + | map { process, tool_versions -> + tool_versions.unique().sort() + "${process}:\n${tool_versions.join('\n')}" + } + + ch_collated_versions = softwareVersionsToYAML(ch_versions.mix(ch_topic_versions.versions_file)) + | mix(ch_topic_versions_string) | collectFile( storeDir: "${params.outdir}/pipeline_info", name: 'software_versions.yml', sort: true, - newLine: true, - cache: false + newLine: true ) ch_params_as_json_stored = ch_params_as_json @@ -1077,10 +1094,13 @@ workflow ASSEMBLYQC { ch_merqury_outputs .collect().ifEmpty([]), ch_orthofinder_outputs .collect().ifEmpty([]), ch_mapback_outputs .collect().ifEmpty([]), - ch_versions_yml, + ch_collated_versions, ch_params_as_json_stored, ch_summary_params_as_json_stored ) + + emit: + versions = ch_versions // channel: [ path(versions.yml) ] } /*