From efe85884eb74431dfc9973012430099da9e42a82 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:00:21 +0000 Subject: [PATCH 01/79] Try alternative strategy for extracting tags --- .github/python/find_changed_files.py | 152 +++++++++++++++++++++++++++ .github/workflows/test.yml | 89 +++++++++++----- 2 files changed, 215 insertions(+), 26 deletions(-) create mode 100644 .github/python/find_changed_files.py diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py new file mode 100644 index 00000000000..6dc73449826 --- /dev/null +++ b/.github/python/find_changed_files.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python + +## This script is used to generate scan *.nf.test files for function/process/workflow name and return as a JSON list +# It is functionally similar to nf-test list but fills a gap until feature https://github.com/askimed/nf-test/issues/196 is added + +import argparse +import json +import logging +import re + +from itertools import chain +from pathlib import Path + + +def parse_args() -> argparse.Namespace: + """ + Parse command line arguments and return an ArgumentParser object. + + Returns: + argparse.ArgumentParser: The ArgumentParser object with the parsed arguments. + """ + parser = argparse.ArgumentParser( + description="Scan *.nf.test files for function/process/workflow name and return as a JSON list" + ) + parser.add_argument( + "-p", + "--paths", + nargs="+", + default=["."], + help="List of directories or files to scan", + ) + parser.add_argument( + "-l", + "--log-level", + choices=["DEBUG", "INFO", "WARNING", "ERROR"], + default="INFO", + help="Logging level", + ) + parser.add_argument( + "-t", + "--types", + nargs="+", + choices=["function", "process", "workflow", "pipeline"], + default=["function", "process", "workflow", "pipeline"], + help="Types of tests to include.", + ) + return parser.parse_args() + + +def find_files(paths: list[str]) -> list[Path]: + """ + Find all files matching pattern *.nf.test recursively from a list of paths. + + Args: + paths (list): List of directories or files to scan. + + Returns: + list: List of files matching the pattern *.nf.test. + """ + # this is a bit clunky + result = [] + for path in paths: + path_obj = Path(path) + # If Path is the exact nf-test file add to list: + if path_obj.match("*.nf.test"): + result.append(path_obj) + # Else recursively search for nf-test files: + else: + for file in path_obj.rglob("*.nf.test"): + result.append(file) + return result + + +def process_files(files: list[Path]) -> list[str]: + """ + Process the files and return lines that begin with 'workflow', 'process', or 'function' and have a single string afterwards. + + Args: + files (list): List of files to process. + + Returns: + list: List of lines that match the criteria. + """ + result = [] + for file in files: + with open(file, "r") as f: + is_pipeline_test = True + lines = f.readlines() + for line in lines: + line = line.strip() + if line.startswith(("workflow", "process", "function")): + words = line.split() + if len(words) == 2 and re.match(r'^".*"$', words[1]): + result.append(line) + is_pipeline_test = False + + # If no results included workflow, process or function + # Add a dummy result to fill the 'pipeline' category + if is_pipeline_test: + result.append("pipeline 'PIPELINE'") + + return result + + +def generate( + lines: list[str], types: list[str] = ["function", "process", "workflow", "pipeline"] +) -> dict[str, list[str]]: + """ + Generate a dictionary of function, process and workflow lists from the lines. + + Args: + lines (list): List of lines to process. + types (list): List of types to include. + + Returns: + dict: Dictionary with function, process and workflow lists. + """ + result: dict[str, list[str]] = { + "function": [], + "process": [], + "workflow": [], + "pipeline": [], + } + for line in lines: + words = line.split() + if len(words) == 2: + keyword = words[0] + name = words[1].strip("'\"") # Strip both single and double quotes + if keyword in types: + result[keyword].append(name) + return result + + +if __name__ == "__main__": + + # Utility stuff + args = parse_args() + logging.basicConfig(level=args.log_level) + + # Parse nf-test files for targets of tests + files = find_files(args.paths) + lines = process_files(files) + result = generate(lines) + + # Get only relevant results (specified by -t) + # Unique using a set + target_results = list( + {item for sublist in map(result.get, args.types) for item in sublist} + ) + + # Print to stdout + print(json.dumps(target_results)) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 354174ea269..ba26abfcc74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,8 @@ jobs: runs-on: ubuntu-latest outputs: # Expose matched filters as job 'modules' output variable - modules: ${{ steps.filter.outputs.changes }} + modules: ${{ steps.get_module_names.outputs.module_names }} + subworkflows: ${{ steps.get_subworkflow_names.outputs.subworkflow_names }} steps: - uses: actions/checkout@v4 with: @@ -81,36 +82,78 @@ jobs: filters: "tests/config/pytest_modules.yml" token: "" + - name: Remove substring from matrix.tags + id: get_module_names + run: echo module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows) >> $GITHUB_OUTPUT + + - name: Remove substring from matrix.tags + id: get_subworkflow_names + run: echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT + + - name: debug + run: | + echo "module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows)" + echo "subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | sed 's/subworkflows\///g')" + nf-test-changes: name: nf-test-changes runs-on: ubuntu-latest outputs: - # Expose matched filters as job 'modules' output variable - modules: ${{ steps.filter.outputs.changes }} + # Expose detected tags as 'modules' and 'workflows' output variables + modules: ${{ steps.list_modules.outputs.changes }} + workflows: ${{ steps.list_workflows.outputs.changes }} + steps: - - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: - fetch-depth: 2 # To retrieve the preceding commit. - - - name: Combine all tags.yml files - id: get_tags - run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml + python-version: "3.11" + architecture: "x64" - - name: debug - run: cat .github/tags.yml + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - # TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented - - uses: mirpedrol/paths-filter@main - id: filter + - uses: tj-actions/changed-files@v42 + id: changed_files with: - filters: ".github/tags.yml" - token: "" + dir_names: "true" + output_renamed_files_as_deleted_and_added: "true" + files_ignore: | + .git* + .gitpod.yml + .prettierignore + .prettierrc.yml + **.md + **.png + modules.json + pyproject.toml + tower.yml + + - name: nf-test list tags modules + id: list_modules + if: ${{ steps.changed_files.outputs.any_modified }} + run: | + echo tags=$(python \ + .github/python/find_changed_files.py \ + -t process \ + -p ${{ steps.changed_files.outputs.all_changed_files }} ${{ steps.changed_files.outputs.changed_keys }} \ + ) >> $GITHUB_OUTPUT + + - name: nf-test list tags modules + id: list_workflows + if: ${{ steps.changed_files.outputs.any_modified }} + run: | + echo tags=$(python \ + .github/python/find_changed_files.py \ + -t workflow \ + -p ${{ steps.changed_files.outputs.all_changed_files }} ${{ steps.changed_files.outputs.changed_keys }} \ + ) >> $GITHUB_OUTPUT nf-core-lint: runs-on: ubuntu-latest - name: nf-core-lint + name: nf-core-lint-modules needs: [pytest-changes, nf-test-changes] - if: ${{ (needs.pytest-changes.outputs.modules != '[]') || (needs.nf-test-changes.outputs.modules != '[]') }} + if: ${{ (needs.pytest-changes.outputs.modules != '[]') || ( needs.nf-test-changes.outputs.modules != '[]') }} strategy: fail-fast: false matrix: @@ -141,6 +184,7 @@ jobs: with: distribution: "temurin" java-version: "17" + - name: Setup Nextflow uses: nf-core/setup-nextflow@v1 @@ -149,15 +193,8 @@ jobs: - name: Lint module ${{ matrix.tags }} run: nf-core modules lint ${{ matrix.tags }} - if: ${{ !startsWith(matrix.tags, 'subworkflows/') }} - - - name: Remove substring from matrix.tags - id: remove_substring - run: echo subworkflow_names=$(echo "${{ matrix.tags }}" | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT - - name: Lint subworkflow ${{ matrix.tags }} - run: nf-core subworkflows lint ${{steps.remove_substring.outputs.subworkflow_names}} - if: ${{ startsWith(matrix.tags, 'subworkflows/') }} + # TODO: Add subworkflow linting here pytest: runs-on: ubuntu-latest From ef0eaf0b790c048f3131ca627f90fcf5d765aad5 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:07:33 +0000 Subject: [PATCH 02/79] Add check to prevent confirm pass if no tags present --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba26abfcc74..0170fe45a8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -693,7 +693,7 @@ jobs: confirm-pass: runs-on: ubuntu-latest needs: [prettier, editorconfig, pytest-changes, nf-core-lint, pytest, nf-test-changes, nf-test] - if: always() + if: ${{ (needs.pytest-changes.outputs.modules != '[]') && ( needs.nf-test-changes.outputs.modules != '[]') || ( needs.pytest-changes.outputs.subworkflows != '[]') && ( needs.nf-test-changes.outputs.subworkflows != '[]') }} steps: - name: All tests ok if: ${{ success() || !contains(needs.*.result, 'failure') }} From 5a184d5e30016c84389889e5eb553a3bb7ec701b Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:11:01 +0000 Subject: [PATCH 03/79] Fix some names for GHA steps --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0170fe45a8f..6343fdd3779 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,11 +82,11 @@ jobs: filters: "tests/config/pytest_modules.yml" token: "" - - name: Remove substring from matrix.tags + - name: Fetch module tags id: get_module_names run: echo module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows) >> $GITHUB_OUTPUT - - name: Remove substring from matrix.tags + - name: Fetch subworkflow tags id: get_subworkflow_names run: echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT From 692690f0390e40077ff4d84b9c85fa59a45c6984 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:12:03 +0000 Subject: [PATCH 04/79] Add fake change in fastp module --- modules/nf-core/fastp/main.nf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index 2a3b679e34e..3d1ceb68c20 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -1,3 +1,5 @@ +// Fake change if you see this it should not have been merged and can be deleted. + process FASTP { tag "$meta.id" label 'process_medium' From 7cac5987284702f68a1721f852cb7531deb37bd6 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:12:54 +0000 Subject: [PATCH 05/79] Add fake change in bam_sort_stats_samtools module --- subworkflows/nf-core/bam_sort_stats_samtools/main.nf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/main.nf b/subworkflows/nf-core/bam_sort_stats_samtools/main.nf index fc1c652b9ea..a94e5f3c818 100644 --- a/subworkflows/nf-core/bam_sort_stats_samtools/main.nf +++ b/subworkflows/nf-core/bam_sort_stats_samtools/main.nf @@ -1,3 +1,5 @@ +// Fake change if you see this it should not have been merged and can be deleted. + // // Sort, index BAM file and run samtools stats, flagstat and idxstats // From 54750f216fb46e8a3f4c3d553fbaeecaaf80c085 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:15:24 +0000 Subject: [PATCH 06/79] Add fake changes to pytest module and subworkflow --- tests/modules/nf-core/cnvkit/batch/main.nf | 1 + tests/subworkflows/nf-core/bam_qc_picard/main.nf | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/modules/nf-core/cnvkit/batch/main.nf b/tests/modules/nf-core/cnvkit/batch/main.nf index 68a15c6bc78..625315851ce 100755 --- a/tests/modules/nf-core/cnvkit/batch/main.nf +++ b/tests/modules/nf-core/cnvkit/batch/main.nf @@ -1,4 +1,5 @@ #!/usr/bin/env nextflow +// Fake change if you see this it should not have been merged and can be deleted. nextflow.enable.dsl = 2 diff --git a/tests/subworkflows/nf-core/bam_qc_picard/main.nf b/tests/subworkflows/nf-core/bam_qc_picard/main.nf index a23447255c9..a13f915c545 100644 --- a/tests/subworkflows/nf-core/bam_qc_picard/main.nf +++ b/tests/subworkflows/nf-core/bam_qc_picard/main.nf @@ -1,4 +1,5 @@ #!/usr/bin/env nextflow +// Fake change if you see this it should not have been merged and can be deleted. nextflow.enable.dsl = 2 From b9b18346382a9f8571e274e7369ca84b30102cf2 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:16:59 +0000 Subject: [PATCH 07/79] Add debug step --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6343fdd3779..ac209d95db6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -149,6 +149,11 @@ jobs: -p ${{ steps.changed_files.outputs.all_changed_files }} ${{ steps.changed_files.outputs.changed_keys }} \ ) >> $GITHUB_OUTPUT + - name: debug + run: | + echo "module_names=$(echo "${{ steps.list_modules.outputs.changes }}" | grep -v subworkflows)" + echo "subworkflow_names=$(echo "${{ steps.list_workflows.outputs.changes }}" | sed 's/subworkflows\///g')" + nf-core-lint: runs-on: ubuntu-latest name: nf-core-lint-modules From d5885262a813a588bf9587712dd2ec54ff526cf3 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:22:45 +0000 Subject: [PATCH 08/79] fixup --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac209d95db6..2f9a5205e1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -88,12 +88,12 @@ jobs: - name: Fetch subworkflow tags id: get_subworkflow_names - run: echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT + run: echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | grep subworkflows | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT - name: debug run: | - echo "module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows)" - echo "subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | sed 's/subworkflows\///g')" + echo module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows) + echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | grep subworkflows | sed 's/subworkflows\///g') nf-test-changes: name: nf-test-changes @@ -151,8 +151,8 @@ jobs: - name: debug run: | - echo "module_names=$(echo "${{ steps.list_modules.outputs.changes }}" | grep -v subworkflows)" - echo "subworkflow_names=$(echo "${{ steps.list_workflows.outputs.changes }}" | sed 's/subworkflows\///g')" + echo module_names=${{ steps.list_modules.outputs.changes }} + echo subworkflow_names=${{ steps.list_workflows.outputs.changes }} nf-core-lint: runs-on: ubuntu-latest From 73ce73a1d9be70f68ae9ba4fdee1f07054af1380 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:28:35 +0000 Subject: [PATCH 09/79] Got some variable names wrong... --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f9a5205e1c..be866c3dd42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -100,8 +100,8 @@ jobs: runs-on: ubuntu-latest outputs: # Expose detected tags as 'modules' and 'workflows' output variables - modules: ${{ steps.list_modules.outputs.changes }} - workflows: ${{ steps.list_workflows.outputs.changes }} + modules: ${{ steps.list_modules.outputs.tags }} + workflows: ${{ steps.list_workflows.outputs.tags }} steps: - uses: actions/setup-python@v4 @@ -136,7 +136,7 @@ jobs: echo tags=$(python \ .github/python/find_changed_files.py \ -t process \ - -p ${{ steps.changed_files.outputs.all_changed_files }} ${{ steps.changed_files.outputs.changed_keys }} \ + -p ${{ steps.changed_files.outputs.all_changed_files }} \ ) >> $GITHUB_OUTPUT - name: nf-test list tags modules @@ -146,13 +146,13 @@ jobs: echo tags=$(python \ .github/python/find_changed_files.py \ -t workflow \ - -p ${{ steps.changed_files.outputs.all_changed_files }} ${{ steps.changed_files.outputs.changed_keys }} \ + -p ${{ steps.changed_files.outputs.all_changed_files }} \ ) >> $GITHUB_OUTPUT - name: debug run: | - echo module_names=${{ steps.list_modules.outputs.changes }} - echo subworkflow_names=${{ steps.list_workflows.outputs.changes }} + echo module_names=${{ steps.list_modules.outputs.tags }} + echo subworkflow_names=${{ steps.list_workflows.outputs.tags }} nf-core-lint: runs-on: ubuntu-latest From 37fb5591fe337df1da498e8eb8bcd70b022965e5 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:58:07 +0000 Subject: [PATCH 10/79] Add subworkflows back to nf-tests --- .github/workflows/test.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be866c3dd42..2027ab0bc69 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,8 +68,8 @@ jobs: runs-on: ubuntu-latest outputs: # Expose matched filters as job 'modules' output variable - modules: ${{ steps.get_module_names.outputs.module_names }} - subworkflows: ${{ steps.get_subworkflow_names.outputs.subworkflow_names }} + modules: ${{ steps.get_module_names.outputs.tags }} + subworkflows: ${{ steps.get_subworkflow_names.outputs.tags }} steps: - uses: actions/checkout@v4 with: @@ -84,11 +84,11 @@ jobs: - name: Fetch module tags id: get_module_names - run: echo module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows) >> $GITHUB_OUTPUT + run: echo tags=$(echo "${{ steps.filter.outputs.changes }}" | | sed 's/[][]//g' | tr "," "\n" | grep -v subworkflows) >> $GITHUB_OUTPUT - name: Fetch subworkflow tags id: get_subworkflow_names - run: echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | grep subworkflows | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT + run: echo tags=$(echo "${{ steps.filter.outputs.changes }}" | grep subworkflows | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT - name: debug run: | @@ -139,7 +139,7 @@ jobs: -p ${{ steps.changed_files.outputs.all_changed_files }} \ ) >> $GITHUB_OUTPUT - - name: nf-test list tags modules + - name: nf-test list tags workflows id: list_workflows if: ${{ steps.changed_files.outputs.any_modified }} run: | @@ -504,11 +504,15 @@ jobs: runs-on: ubuntu-latest name: nf-test needs: [nf-test-changes] - if: needs.nf-test-changes.outputs.modules != '[]' + if: ( needs.nf-test-changes.outputs.modules != '[]' || needs.nf-test-changes.outputs.workflows != '[]' ) strategy: fail-fast: false matrix: - tags: ["${{ fromJson(needs.nf-test-changes.outputs.modules) }}"] + tags: + [ + "${{ fromJson(needs.nf-test-changes.outputs.modules) }}", + "${{ fromJson(needs.nf-test-changes.outputs.workflows) }}", + ] profile: [conda, docker, singularity] exclude: - tags: nf-test From cc88375b7ec5965ccb4d820d355285a147206daa Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:59:35 +0000 Subject: [PATCH 11/79] revert confirm-pass if statement --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2027ab0bc69..44159ebc2a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -702,7 +702,7 @@ jobs: confirm-pass: runs-on: ubuntu-latest needs: [prettier, editorconfig, pytest-changes, nf-core-lint, pytest, nf-test-changes, nf-test] - if: ${{ (needs.pytest-changes.outputs.modules != '[]') && ( needs.nf-test-changes.outputs.modules != '[]') || ( needs.pytest-changes.outputs.subworkflows != '[]') && ( needs.nf-test-changes.outputs.subworkflows != '[]') }} + if: always() steps: - name: All tests ok if: ${{ success() || !contains(needs.*.result, 'failure') }} From 0908cad4d50bb0d4ad3bc5ad8e99e55faf1d5e7a Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:08:47 +0000 Subject: [PATCH 12/79] use JQ to separate modules and subworkflows --- .github/workflows/test.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44159ebc2a3..8efac9d6863 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,8 +68,8 @@ jobs: runs-on: ubuntu-latest outputs: # Expose matched filters as job 'modules' output variable - modules: ${{ steps.get_module_names.outputs.tags }} - subworkflows: ${{ steps.get_subworkflow_names.outputs.tags }} + modules: ${{ steps.tags.outputs.modules }} + subworkflows: ${{ steps.tags.outputs.subworkflows }} steps: - uses: actions/checkout@v4 with: @@ -83,17 +83,15 @@ jobs: token: "" - name: Fetch module tags - id: get_module_names - run: echo tags=$(echo "${{ steps.filter.outputs.changes }}" | | sed 's/[][]//g' | tr "," "\n" | grep -v subworkflows) >> $GITHUB_OUTPUT - - - name: Fetch subworkflow tags - id: get_subworkflow_names - run: echo tags=$(echo "${{ steps.filter.outputs.changes }}" | grep subworkflows | sed 's/subworkflows\///g') >> $GITHUB_OUTPUT + id: tags + run: + echo modules=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT - name: debug run: | - echo module_names=$(echo "${{ steps.filter.outputs.changes }}" | grep -v subworkflows) - echo subworkflow_names=$(echo "${{ steps.filter.outputs.changes }}" | grep subworkflows | sed 's/subworkflows\///g') + echo modules=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow") | not))') + echo subworkflows=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow")))') nf-test-changes: name: nf-test-changes From ae0e2e3fd799d097ff59753e259d7e9664a40418 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:15:56 +0000 Subject: [PATCH 13/79] Fix quoting when parsing tags --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8efac9d6863..b9fdae4a12f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,9 +84,9 @@ jobs: - name: Fetch module tags id: tags - run: - echo modules=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT - echo subworkflows=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT + run: | + echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT - name: debug run: | From b06e4d2083e1100750b806afc38e700fee088777 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:27:58 +0000 Subject: [PATCH 14/79] coerce modules and subworkflows to lower case --- .github/workflows/test.yml | 69 +++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9fdae4a12f..5c953cbbd16 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,7 +85,7 @@ jobs: - name: Fetch module tags id: tags run: | - echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT + export modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT - name: debug @@ -100,6 +100,8 @@ jobs: # Expose detected tags as 'modules' and 'workflows' output variables modules: ${{ steps.list_modules.outputs.tags }} workflows: ${{ steps.list_workflows.outputs.tags }} + modules_lower: ${{ steps.modules_lower_case_export.outputs.tags_lower }} + workflows_lower: ${{ steps.workflows_lower_case_export.outputs.tags_lower }} steps: - uses: actions/setup-python@v4 @@ -152,7 +154,23 @@ jobs: echo module_names=${{ steps.list_modules.outputs.tags }} echo subworkflow_names=${{ steps.list_workflows.outputs.tags }} - nf-core-lint: + - id: modules_to_lower + uses: ASzc/change-string-case-action@v6 + with: + string: ${{ steps.list_modules.outputs.tags }} + + - id: modules_lower_case_export + run: echo tags_lower=${{ steps.modules_to_lower.outputs.lowercase }} >> $GITHUB_OUTPUT + + - id: workflows_to_lower + uses: ASzc/change-string-case-action@v6 + with: + string: ${{ steps.list_workflows.outputs.tags }} + + - id: workflows_lower_case_export + run: echo tags_lower=${{ steps.workflows_to_lower.outputs.lowercase }} >> $GITHUB_OUTPUT + + nf-core-lint-modules: runs-on: ubuntu-latest name: nf-core-lint-modules needs: [pytest-changes, nf-test-changes] @@ -163,7 +181,7 @@ jobs: tags: [ "${{ fromJson(needs.pytest-changes.outputs.modules) }}", - "${{ fromJson(needs.nf-test-changes.outputs.modules) }}", + "${{ fromJson(needs.nf-test-changes.outputs.modules_lower) }}", ] steps: - uses: actions/checkout@v4 @@ -197,7 +215,50 @@ jobs: - name: Lint module ${{ matrix.tags }} run: nf-core modules lint ${{ matrix.tags }} - # TODO: Add subworkflow linting here + nf-core-lint-workflows: + runs-on: ubuntu-latest + name: nf-core-lint-modules + needs: [pytest-changes, nf-test-changes] + if: ${{ (needs.pytest-changes.outputs.subworkflows != '[]') || ( needs.nf-test-changes.outputs.workflows != '[]') }} + strategy: + fail-fast: false + matrix: + tags: + [ + "${{ fromJson(needs.pytest-changes.outputs.subworkflows) }}", + "${{ fromJson(needs.nf-test-changes.outputs.workflows_lower) }}", + ] + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install pip + run: python -m pip install --upgrade pip + + - uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: "17" + + - name: Setup Nextflow + uses: nf-core/setup-nextflow@v1 + + - name: Install nf-core tools development version + run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev + + - name: Lint module ${{ matrix.tags }} + run: nf-core modules lint ${{ matrix.tags }} pytest: runs-on: ubuntu-latest From 24c981c7bc6280fff016408828dd492ea8c2babf Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:29:03 +0000 Subject: [PATCH 15/79] Add specific linting checks to dependencies --- .github/workflows/test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c953cbbd16..bec9988f001 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -760,7 +760,17 @@ jobs: confirm-pass: runs-on: ubuntu-latest - needs: [prettier, editorconfig, pytest-changes, nf-core-lint, pytest, nf-test-changes, nf-test] + needs: + [ + prettier, + editorconfig, + pytest-changes, + nf-core-lint-modules, + nf-core-lint-workflows, + pytest, + nf-test-changes, + nf-test, + ] if: always() steps: - name: All tests ok From 39ff1ce243df98e33fb3ea1d2062a3624dce2d21 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:33:34 +0000 Subject: [PATCH 16/79] Single vs double quotes again --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bec9988f001..14f781945b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,8 +90,8 @@ jobs: - name: debug run: | - echo modules=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow") | not))') - echo subworkflows=$(echo "${{ steps.filter.outputs.changes }}" | jq '. | map(select(contains("subworkflow")))') + echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow") | not))') + echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') nf-test-changes: name: nf-test-changes From 8b3d6b75aaf0774c63852cdbb8fcf88d0173e93f Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:39:50 +0000 Subject: [PATCH 17/79] Some more variable fixing --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14f781945b3..eda6bed36b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,7 +85,7 @@ jobs: - name: Fetch module tags id: tags run: | - export modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT - name: debug From 9e9b5cbf6e610795d03fae7357e18fd3a22df2b7 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:46:08 +0100 Subject: [PATCH 18/79] this might work --- .github/python/find_changed_files.py | 226 +++++++++++++++++++++++---- .github/workflows/test.yml | 91 +++-------- 2 files changed, 222 insertions(+), 95 deletions(-) diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py index 6dc73449826..e27888a2e61 100644 --- a/.github/python/find_changed_files.py +++ b/.github/python/find_changed_files.py @@ -1,15 +1,17 @@ #!/usr/bin/env python -## This script is used to generate scan *.nf.test files for function/process/workflow name and return as a JSON list -# It is functionally similar to nf-test list but fills a gap until feature https://github.com/askimed/nf-test/issues/196 is added +# This script is used to identify *.nf.test files for changed functions/processs/workflows/pipelines and *.nf-test files +# with changed dependencies, then return as a JSON list import argparse import json import logging import re +import yaml from itertools import chain from pathlib import Path +from git import Repo def parse_args() -> argparse.Namespace: @@ -23,11 +25,40 @@ def parse_args() -> argparse.Namespace: description="Scan *.nf.test files for function/process/workflow name and return as a JSON list" ) parser.add_argument( - "-p", - "--paths", + "-r", + "--head_ref", + required=True, + help="Head reference branch (Source branch for a PR).", + ) + parser.add_argument( + "-b", + "--base_ref", + required=True, + help="Base reference branch (Target branch for a PR).", + ) + parser.add_argument( + "-x", + "--ignored_files", nargs="+", - default=["."], - help="List of directories or files to scan", + default=[ + ".git/*", + ".gitpod.yml", + ".prettierignore", + ".prettierrc.yml", + "*.md", + "*.png", + "modules.json", + "pyproject.toml", + "tower.yml", + ], + help="List of files or file substrings to ignore.", + ) + parser.add_argument( + "-i", + "--include", + type=Path, + default=None, + help="Path to an include file containing a YAML of key value pairs to include in changed files. I.e., return the current directory if an important file is changed.", ) parser.add_argument( "-l", @@ -47,26 +78,109 @@ def parse_args() -> argparse.Namespace: return parser.parse_args() -def find_files(paths: list[str]) -> list[Path]: +def read_yaml_inverted(file_path: str) -> dict: """ - Find all files matching pattern *.nf.test recursively from a list of paths. + Read a YAML file and return its contents as a dictionary but reversed, i.e. the values become the keys and the keys become the values. Args: - paths (list): List of directories or files to scan. + file_path (str): The path to the YAML file. Returns: - list: List of files matching the pattern *.nf.test. + dict: The contents of the YAML file as a dictionary inverted. """ - # this is a bit clunky - result = [] - for path in paths: - path_obj = Path(path) + with open(file_path, "r") as f: + data = yaml.safe_load(f) + + # Invert dictionary of lists into contents of lists are keys, values are the original keys + # { "key": ["item1", "item2] } --> { "item1": "key", "item2": "key" } + return {value: key for key, values in data.items() for value in values} + + +def find_changed_files( + branch1: str, + branch2: str, + ignore: list[str], +) -> list[Path]: + """ + Find all *.nf.tests that are associated with files that have been changed between two specified branches. + + Args: + branch1 (str) : The first branch being compared + branch2 (str) : The second branch being compared + ignore (list) : List of files or file substrings to ignore. + + Returns: + list: List of files matching the pattern *.nf.test that have changed between branch2 and branch1. + """ + # create repo + repo = Repo(".") + # identify commit on branch1 + branch1_commit = repo.commit(branch1) + # identify commit on branch2 + branch2_commit = repo.commit(branch2) + # compare two branches + diff_index = branch1_commit.diff(branch2_commit) + + # Start empty list of changed files + changed_files = [] + + # For every file that has changed between commits + for file in diff_index: + # Get pathlib.Path object + filepath = Path(file.a_path) + # If file does not match any in the ignore list, add containing directory to changed_files + if not any(filepath.match(ignored_path) for ignored_path in ignore): + changed_files.append(filepath) + + # Uniqueify the results before returning for efficiency + return list(set(changed_files)) + + +def detect_include_files( + changed_files: list[Path], include_files: dict[str, str] +) -> list[Path]: + """ + Detects the include files based on the changed files. + + Args: + changed_files (list[Path]): List of paths to the changed files. + include_files (dict[str, str]): Key-value pairs to return if a certain file has changed. If a file in a directory has changed, it points to a different directory. + + Returns: + list[Path]: List of paths to representing the keys of the include_files dictionary, where a value matched a path in changed_files. + """ + new_changed_files = [] + for filepath in changed_files: + # If file is in the include_files, we return the key instead of the value + for include_path, include_key in include_files.items(): + if filepath.match(include_path): + new_changed_files.append(Path(include_key)) + return new_changed_files + + +def detect_nf_test_files(changed_files: list[Path]) -> list[Path]: + """ + Detects and returns a list of nf-test files from the given list of changed files. + + Args: + changed_files (list[Path]): A list of file paths. + + Returns: + list[Path]: A list of nf-test file paths. + """ + result: list[Path] = [] + for path in changed_files: # If Path is the exact nf-test file add to list: - if path_obj.match("*.nf.test"): - result.append(path_obj) + if path.match("*.nf.test") and path.exists(): + result.append(path) # Else recursively search for nf-test files: else: - for file in path_obj.rglob("*.nf.test"): + # Get the enclosing dir so files in the same dir can be found. + # e.g. + # dir/ + # ├─ main.nf + # ├─ main.nf.test + for file in path.parent.rglob("*.nf.test"): result.append(file) return result @@ -102,7 +216,7 @@ def process_files(files: list[Path]) -> list[str]: return result -def generate( +def convert_nf_test_files_to_test_types( lines: list[str], types: list[str] = ["function", "process", "workflow", "pipeline"] ) -> dict[str, list[str]]: """ @@ -115,15 +229,12 @@ def generate( Returns: dict: Dictionary with function, process and workflow lists. """ - result: dict[str, list[str]] = { - "function": [], - "process": [], - "workflow": [], - "pipeline": [], - } + # Populate empty dict from types + result: dict[str, list[str]] = {key: [] for key in types} + for line in lines: words = line.split() - if len(words) == 2: + if len(words) == 2 and re.match(r'^".*"$', words[1]): keyword = words[0] name = words[1].strip("'\"") # Strip both single and double quotes if keyword in types: @@ -131,16 +242,62 @@ def generate( return result +def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: + """ + Find all *.nf.test files with changed dependencies from a list of paths. + + Args: + paths (list): List of directories or files to scan. + tags (list): List of tags identified as having changes. + + Returns: + list: List of *.nf.test files with changed dependencies. + """ + + result: list[Path] = [] + + nf_test_files = detect_nf_test_files(paths) + + # find nf-test files with changed dependencies + for nf_test_file in nf_test_files: + with open(nf_test_file, "r") as f: + lines = f.readlines() + # Get all tags from nf-test file + # Make case insensitive with .casefold() + tags_in_nf_test_file = [ + tag.casefold().replace("/", "_") + for tag in convert_nf_test_files_to_test_types(lines, types=["tag"])[ + "tag" + ] + ] + # Check if tag in nf-test file appears in a tag. + # Use .casefold() to be case insensitive + if any( + tag.casefold().replace("/", "_") in tags_in_nf_test_file for tag in tags + ): + result.append(nf_test_file) + + return result + + if __name__ == "__main__": # Utility stuff args = parse_args() logging.basicConfig(level=args.log_level) - # Parse nf-test files for targets of tests - files = find_files(args.paths) - lines = process_files(files) - result = generate(lines) + # Parse nf-test files for target test tags + changed_files = find_changed_files(args.head_ref, args.base_ref, args.ignored_files) + + # If an additional include YAML is added, we detect additional changed dirs to include + if args.include: + include_files = read_yaml_inverted(args.include) + changed_files = changed_files + detect_include_files( + changed_files, include_files + ) + nf_test_files = detect_nf_test_files(changed_files) + lines = process_files(nf_test_files) + result = convert_nf_test_files_to_test_types(lines) # Get only relevant results (specified by -t) # Unique using a set @@ -148,5 +305,14 @@ def generate( {item for sublist in map(result.get, args.types) for item in sublist} ) + # Parse files to identify nf-tests with changed dependencies + changed_dep_files = find_changed_dependencies([Path(".")], target_results) + + # Combine target nf-test files and nf-test files with changed dependencies + # Go back one dir so we get the module or subworkflow path + all_nf_tests = [ + str(test_path.parent.parent) for test_path in set(changed_dep_files + nf_test_files) + ] + # Print to stdout - print(json.dumps(target_results)) + print(json.dumps(all_nf_tests)) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eda6bed36b5..4b9dff60902 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,23 +85,21 @@ jobs: - name: Fetch module tags id: tags run: | - echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("subworkflow") | not))') >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules")))') >> $GITHUB_OUTPUT echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT - name: debug run: | - echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow") | not))') - echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') + echo ${{ steps.tags.outputs.modules }} + echo ${{ steps.tags.outputs.subworkflows }} nf-test-changes: name: nf-test-changes runs-on: ubuntu-latest outputs: # Expose detected tags as 'modules' and 'workflows' output variables - modules: ${{ steps.list_modules.outputs.tags }} - workflows: ${{ steps.list_workflows.outputs.tags }} - modules_lower: ${{ steps.modules_lower_case_export.outputs.tags_lower }} - workflows_lower: ${{ steps.workflows_lower_case_export.outputs.tags_lower }} + modules: ${{ steps.outputs.outputs.modules }} + subworkflows: ${{ steps.outputs.outputs.subworkflows}} steps: - uses: actions/setup-python@v4 @@ -113,62 +111,26 @@ jobs: with: fetch-depth: 0 - - uses: tj-actions/changed-files@v42 - id: changed_files - with: - dir_names: "true" - output_renamed_files_as_deleted_and_added: "true" - files_ignore: | - .git* - .gitpod.yml - .prettierignore - .prettierrc.yml - **.md - **.png - modules.json - pyproject.toml - tower.yml - - - name: nf-test list tags modules - id: list_modules - if: ${{ steps.changed_files.outputs.any_modified }} + - name: Install gitpython find changed files run: | - echo tags=$(python \ - .github/python/find_changed_files.py \ - -t process \ - -p ${{ steps.changed_files.outputs.all_changed_files }} \ - ) >> $GITHUB_OUTPUT + python -m pip install --upgrade pip + pip install gitpython pyyaml - - name: nf-test list tags workflows - id: list_workflows - if: ${{ steps.changed_files.outputs.any_modified }} + - name: List nf-test files + id: list run: | - echo tags=$(python \ + echo nf_test_files=$(python \ .github/python/find_changed_files.py \ - -t workflow \ - -p ${{ steps.changed_files.outputs.all_changed_files }} \ + -t pipeline workflow process \ + --head_ref ${{ github.sha }} \ + --base_ref origin/${{ github.base_ref }} \ ) >> $GITHUB_OUTPUT - - name: debug + - name: Separate modules and subworkflows + id: outputs run: | - echo module_names=${{ steps.list_modules.outputs.tags }} - echo subworkflow_names=${{ steps.list_workflows.outputs.tags }} - - - id: modules_to_lower - uses: ASzc/change-string-case-action@v6 - with: - string: ${{ steps.list_modules.outputs.tags }} - - - id: modules_lower_case_export - run: echo tags_lower=${{ steps.modules_to_lower.outputs.lowercase }} >> $GITHUB_OUTPUT - - - id: workflows_to_lower - uses: ASzc/change-string-case-action@v6 - with: - string: ${{ steps.list_workflows.outputs.tags }} - - - id: workflows_lower_case_export - run: echo tags_lower=${{ steps.workflows_to_lower.outputs.lowercase }} >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.list.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))'') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.list.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/nf-core/"; ""))'') >> $GITHUB_OUTPUT nf-core-lint-modules: runs-on: ubuntu-latest @@ -181,7 +143,7 @@ jobs: tags: [ "${{ fromJson(needs.pytest-changes.outputs.modules) }}", - "${{ fromJson(needs.nf-test-changes.outputs.modules_lower) }}", + "${{ fromJson(needs.nf-test-changes.outputs.modules) }}", ] steps: - uses: actions/checkout@v4 @@ -219,14 +181,14 @@ jobs: runs-on: ubuntu-latest name: nf-core-lint-modules needs: [pytest-changes, nf-test-changes] - if: ${{ (needs.pytest-changes.outputs.subworkflows != '[]') || ( needs.nf-test-changes.outputs.workflows != '[]') }} + if: ${{ (needs.pytest-changes.outputs.subworkflows != '[]') || ( needs.nf-test-changes.outputs.subworkflows != '[]') }} strategy: fail-fast: false matrix: tags: [ "${{ fromJson(needs.pytest-changes.outputs.subworkflows) }}", - "${{ fromJson(needs.nf-test-changes.outputs.workflows_lower) }}", + "${{ fromJson(needs.nf-test-changes.outputs.subworkflows) }}", ] steps: - uses: actions/checkout@v4 @@ -563,14 +525,14 @@ jobs: runs-on: ubuntu-latest name: nf-test needs: [nf-test-changes] - if: ( needs.nf-test-changes.outputs.modules != '[]' || needs.nf-test-changes.outputs.workflows != '[]' ) + if: ( needs.nf-test-changes.outputs.modules != '[]' || needs.nf-test-changes.outputs.subworkflows != '[]' ) strategy: fail-fast: false matrix: - tags: + module: [ "${{ fromJson(needs.nf-test-changes.outputs.modules) }}", - "${{ fromJson(needs.nf-test-changes.outputs.workflows) }}", + "${{ fromJson(needs.nf-test-changes.outputs.subworkflows) }}", ] profile: [conda, docker, singularity] exclude: @@ -717,7 +679,6 @@ jobs: miniconda-version: "latest" auto-update-conda: true channels: conda-forge,bioconda,defaults - python-version: ${{ matrix.python-version }} - name: Conda setup run: | @@ -749,9 +710,9 @@ jobs: NFT_WORKDIR=~ \ nf-test test \ --profile=${{ matrix.profile }} \ - --tag ${{ matrix.tags }} \ --tap=test.tap \ - --verbose + --verbose \ + ${{ matrix.module }} \ - uses: pcolby/tap-summary@v1 with: From 2ddab9a009bed2312c09229baf15c5f793673b77 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:00:06 +0100 Subject: [PATCH 19/79] fixup --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 525a93ce267..288e04f6b83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,11 +112,12 @@ jobs: steps: - uses: actions/setup-python@v4 - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: python-version: "3.11" architecture: "x64" + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -129,7 +130,7 @@ jobs: - name: List nf-test files id: list run: | - echo nf_test_files=$(python \ + echo changes=$(python \ .github/python/find_changed_files.py \ -t pipeline workflow process \ --head_ref ${{ github.sha }} \ From 4dd114ac6c90dbadbfb77d5bb9dc8bd03c65a1e1 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:24:23 +0100 Subject: [PATCH 20/79] yet another fixup --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 288e04f6b83..e0262c6dd10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -140,8 +140,8 @@ jobs: - name: Separate modules and subworkflows id: outputs run: | - echo modules=$(echo '${{ steps.list.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))'') >> $GITHUB_OUTPUT - echo subworkflows=$(echo '${{ steps.list.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/nf-core/"; ""))'') >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.list.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.list.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT nf-core-lint-modules: runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} @@ -435,6 +435,7 @@ jobs: uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 with: python-version: "3.11" + - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4 id: cache-pip-pytest with: From bc20f2aee2246a736d954d236fd54a30cfe992ca Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:38:13 +0100 Subject: [PATCH 21/79] Correct modules -> subworkflows --- .github/workflows/test.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0262c6dd10..0fdf004b9ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,8 +94,8 @@ jobs: - name: Fetch module tags id: tags run: | - echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules")))') >> $GITHUB_OUTPUT - echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow")))') >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT - name: debug run: | @@ -141,7 +141,12 @@ jobs: id: outputs run: | echo modules=$(echo '${{ steps.list.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT - echo subworkflows=$(echo '${{ steps.list.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.list.outputs.changes }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT + + - name: debug + run: | + echo ${{ steps.outputs.outputs.modules }} + echo ${{ steps.outputs.outputs.subworkflows }} nf-core-lint-modules: runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} @@ -189,7 +194,7 @@ jobs: - name: Lint module ${{ matrix.tags }} run: nf-core modules lint ${{ matrix.tags }} - nf-core-lint-workflows: + nf-core-lint-subworkflows: runs-on: ubuntu-latest name: nf-core-lint-modules needs: [pytest-changes, nf-test-changes] @@ -232,7 +237,7 @@ jobs: run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev - name: Lint module ${{ matrix.tags }} - run: nf-core modules lint ${{ matrix.tags }} + run: nf-core subworkflows lint ${{ matrix.tags }} pytest: runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} From 2819c542637e2b30dfa6507d9b954b409a2e493d Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:38:46 +0100 Subject: [PATCH 22/79] Fake change to pytest module --- modules/nf-core/gunzip/tests/main.nf.test | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nf-core/gunzip/tests/main.nf.test b/modules/nf-core/gunzip/tests/main.nf.test index 6406008ef93..9e51e8bd574 100644 --- a/modules/nf-core/gunzip/tests/main.nf.test +++ b/modules/nf-core/gunzip/tests/main.nf.test @@ -1,3 +1,4 @@ +// Fake change if you see this it should not have been merged and can be deleted. nextflow_process { name "Test Process GUNZIP" From dc297b83ffe7a99031de4d88e57deaab1fb84119 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:43:14 +0100 Subject: [PATCH 23/79] Correct dependency --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fdf004b9ea..ab2ca7cbe8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -770,7 +770,7 @@ jobs: editorconfig, pytest-changes, nf-core-lint-modules, - nf-core-lint-workflows, + nf-core-lint-subworkflows, pytest, nf-test-changes, nf-test, From 21cccaa12bd5441d7a462599bb6438c87811f452 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:46:21 +0100 Subject: [PATCH 24/79] One more time --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab2ca7cbe8a..95ffa1be55f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,8 +94,8 @@ jobs: - name: Fetch module tags id: tags run: | - echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT - echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/"; ""))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/"; ""))') >> $GITHUB_OUTPUT - name: debug run: | From 57fa3b07af6f5ab4479e3c352ac5f9443bf3f350 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:17:06 +0100 Subject: [PATCH 25/79] More sorting stuff out --- .github/workflows/test.yml | 135 ++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 69 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95ffa1be55f..6374c49559f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: name: pytest-changes runs-on: ubuntu-latest outputs: - # Expose matched filters as job 'modules' output variable + tags: ${{ steps.filter.outputs.changes }} modules: ${{ steps.tags.outputs.modules }} subworkflows: ${{ steps.tags.outputs.subworkflows }} steps: @@ -107,6 +107,7 @@ jobs: runs-on: ubuntu-latest outputs: # Expose detected tags as 'modules' and 'workflows' output variables + paths: ${{ steps.list.outputs.changes }} modules: ${{ steps.outputs.outputs.modules }} subworkflows: ${{ steps.outputs.outputs.subworkflows}} @@ -243,11 +244,11 @@ jobs: runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} name: pytest needs: [pytest-changes] - if: needs.pytest-changes.outputs.modules != '[]' + if: needs.pytest-changes.outputs.tags != '[]' strategy: fail-fast: false matrix: - tags: ["${{ fromJson(needs.pytest-changes.outputs.modules) }}"] + tags: ["${{ fromJson(needs.pytest-changes.outputs.tags) }}"] profile: [conda, docker, singularity] exclude: - tags: nf-test @@ -536,132 +537,128 @@ jobs: runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} name: nf-test needs: [nf-test-changes] - if: ( needs.nf-test-changes.outputs.modules != '[]' || needs.nf-test-changes.outputs.subworkflows != '[]' ) + if: ( needs.nf-test-changes.outputs.paths != '[]' ) strategy: fail-fast: false matrix: - module: - [ - "${{ fromJson(needs.nf-test-changes.outputs.modules) }}", - "${{ fromJson(needs.nf-test-changes.outputs.subworkflows) }}", - ] + path: ["${{ fromJson(needs.nf-test-changes.outputs.paths) }}"] profile: [conda, docker, singularity] exclude: - - tags: nf-test + - path: modules/nf-core/nf-test - profile: conda - tags: angsd/gl + path: modules/nf-core/angsd/gl - profile: conda - tags: annotsv + path: modules/nf-core/annotsv - profile: conda - tags: happy/sompy + path: modules/nf-core/happy/sompy - profile: conda - tags: backsub + path: modules/nf-core/backsub - profile: conda - tags: bakta/bakta + path: modules/nf-core/bakta/bakta - profile: conda - tags: bakta/baktadbdownload + path: modules/nf-core/bakta/baktadbdownload - profile: conda - tags: bases2fastq + path: modules/nf-core/bases2fastq - profile: conda - tags: bcl2fastq + path: modules/nf-core/bcl2fastq - profile: conda - tags: bclconvert + path: modules/nf-core/bclconvert - profile: conda - tags: celesta + path: modules/nf-core/celesta - profile: conda - tags: cellpose + path: modules/nf-core/cellpose - profile: conda - tags: cellranger/count + path: modules/nf-core/cellranger/count - profile: conda - tags: cellranger/mkfastq + path: modules/nf-core/cellranger/mkfastq - profile: conda - tags: cellranger/mkgtf + path: modules/nf-core/cellranger/mkgtf - profile: conda - tags: cellranger/mkref + path: modules/nf-core/cellranger/mkref - profile: conda - tags: cellranger/mkvdjref + path: modules/nf-core/cellranger/mkvdjref - profile: conda - tags: cellranger/multi + path: modules/nf-core/cellranger/multi - profile: conda - tags: cellranger/vdj + path: modules/nf-core/cellranger/vdj - profile: conda - tags: custom/dumpsoftwareversions + path: modules/nf-core/custom/dumpsoftwareversions - profile: conda - tags: deepcell/mesmer + path: modules/nf-core/deepcell/mesmer - profile: conda - tags: deepvariant + path: modules/nf-core/deepvariant - profile: conda - tags: ensemblvep/vep + path: modules/nf-core/ensemblvep/vep - profile: conda - tags: fastk/fastk + path: modules/nf-core/fastk/fastk - profile: conda - tags: fastk/histex + path: modules/nf-core/fastk/histex - profile: conda - tags: fastk/merge + path: modules/nf-core/fastk/merge - profile: conda - tags: fcs/fcsadaptor + path: modules/nf-core/fcs/fcsadaptor - profile: conda - tags: fcs/fcsgx + path: modules/nf-core/fcs/fcsgx - profile: conda - tags: ganon/buildcustom + path: modules/nf-core/ganon/buildcustom - profile: conda - tags: ganon/classify + path: modules/nf-core/ganon/classify - profile: conda - tags: ganon/report + path: modules/nf-core/ganon/report - profile: conda - tags: ganon/table + path: modules/nf-core/ganon/table - profile: conda - tags: gatk4/cnnscorevariants + path: modules/nf-core/gatk4/cnnscorevariants - profile: conda - tags: gatk4/determinegermlinecontigploidy + path: modules/nf-core/gatk4/determinegermlinecontigploidy - profile: conda - tags: genescopefk + path: modules/nf-core/genescopefk - profile: conda - tags: ilastik/multicut + path: modules/nf-core/ilastik/multicut - profile: conda - tags: ilastik/pixelclassification + path: modules/nf-core/ilastik/pixelclassification - profile: conda - tags: imputeme/vcftoprs + path: modules/nf-core/imputeme/vcftoprs - profile: conda - tags: merquryfk/katcomp + path: modules/nf-core/merquryfk/katcomp - profile: conda - tags: merquryfk/katgc + path: modules/nf-core/merquryfk/katgc - profile: conda - tags: merquryfk/merquryfk + path: modules/nf-core/merquryfk/merquryfk - profile: conda - tags: merquryfk/ploidyplot + path: modules/nf-core/merquryfk/ploidyplot - profile: conda - tags: molkartgarage/clahe + path: modules/nf-core/molkartgarage/clahe - profile: conda - tags: quartonotebook + path: modules/nf-core/quartonotebook - profile: conda - tags: scimap/spatiallda + path: modules/nf-core/scimap/spatiallda - profile: conda - tags: sentieon/bwaindex + path: modules/nf-core/sentieon/bwaindex - profile: conda - tags: sentieon/bwamem + path: modules/nf-core/sentieon/bwamem - profile: conda - tags: spaceranger/mkgtf + path: modules/nf-core/spaceranger/mkgtf - profile: conda - tags: spaceranger/mkref + path: modules/nf-core/spaceranger/mkref - profile: conda - tags: spaceranger/count + path: modules/nf-core/spaceranger/count - profile: conda - tags: svanalyzer/svbenchmark + path: modules/nf-core/svanalyzer/svbenchmark - profile: conda - tags: universc + path: modules/nf-core/universc - profile: singularity - tags: universc + path: modules/nf-core/universc - profile: conda - tags: vt/decompose - - profile: conda - tags: subworkflows/vcf_annotate_ensemblvep + path: modules/nf-core/vt/decompose - profile: singularity - tags: bases2fastq + path: modules/nf-core/bases2fastq - profile: conda - tags: wittyer + path: modules/nf-core/wittyer - profile: conda - tags: islandpath + path: modules/nf-core/islandpath + - profile: conda + path: subworkflows/nf-core/vcf_annotate_ensemblvep env: NXF_ANSI_LOG: false SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }} @@ -750,7 +747,7 @@ jobs: --profile=${{ matrix.profile }} \ --tap=test.tap \ --verbose \ - ${{ matrix.module }} \ + ${{ matrix.tags }} - uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 with: From 64c072b679c78342fb38f6b752e1a914c87651fe Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:20:17 +0100 Subject: [PATCH 26/79] Update modules/nf-core/gunzip/tests/main.nf.test --- modules/nf-core/gunzip/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/gunzip/tests/main.nf.test b/modules/nf-core/gunzip/tests/main.nf.test index 9e51e8bd574..6406008ef93 100644 --- a/modules/nf-core/gunzip/tests/main.nf.test +++ b/modules/nf-core/gunzip/tests/main.nf.test @@ -1,4 +1,3 @@ -// Fake change if you see this it should not have been merged and can be deleted. nextflow_process { name "Test Process GUNZIP" From 073ae2bf95137bcd2fab412962f2d2b96ebe7e7d Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:24:38 +0100 Subject: [PATCH 27/79] Add fake change to module without nf-test so pytest ONLY is triggered --- modules/nf-core/seqkit/grep/main.nf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/nf-core/seqkit/grep/main.nf b/modules/nf-core/seqkit/grep/main.nf index 0c81ea56b90..40d3f4d7ccb 100644 --- a/modules/nf-core/seqkit/grep/main.nf +++ b/modules/nf-core/seqkit/grep/main.nf @@ -1,3 +1,5 @@ +// Fake change if you see this it should not have been merged and can be deleted. + process SEQKIT_GREP { tag "$meta.id" label 'process_low' From acc5b39aafe5281afb3e5c0677af957e5e3edfa3 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 10 Apr 2024 12:49:17 +0100 Subject: [PATCH 28/79] fixup incorrect variable --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6374c49559f..781b47fe38a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -747,7 +747,7 @@ jobs: --profile=${{ matrix.profile }} \ --tap=test.tap \ --verbose \ - ${{ matrix.tags }} + ${{ matrix.path }} - uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 with: From c2ceb2da5315455620bef587c0cb74b593cfd691 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:04:15 +0100 Subject: [PATCH 29/79] Switch to using self-hosted Docker profile --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 781b47fe38a..1455e4ef043 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -542,7 +542,7 @@ jobs: fail-fast: false matrix: path: ["${{ fromJson(needs.nf-test-changes.outputs.paths) }}"] - profile: [conda, docker, singularity] + profile: [conda, docker_self_hosted, singularity] exclude: - path: modules/nf-core/nf-test - profile: conda From c2f09a8e18e916c93d917f0cb106e8d33207b37d Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:55:09 +0100 Subject: [PATCH 30/79] Add dependency checker from Carson Miller --- .github/python/find_changed_files.py | 104 ++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 16 deletions(-) diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py index e27888a2e61..b492ec64f78 100644 --- a/.github/python/find_changed_files.py +++ b/.github/python/find_changed_files.py @@ -57,7 +57,7 @@ def parse_args() -> argparse.Namespace: "-i", "--include", type=Path, - default=None, + default=".github/python/include.yaml", help="Path to an include file containing a YAML of key value pairs to include in changed files. I.e., return the current directory if an important file is changed.", ) parser.add_argument( @@ -158,12 +158,13 @@ def detect_include_files( return new_changed_files -def detect_nf_test_files(changed_files: list[Path]) -> list[Path]: +def detect_files(changed_files: list[Path], suffix: str) -> list[Path]: """ Detects and returns a list of nf-test files from the given list of changed files. Args: changed_files (list[Path]): A list of file paths. + suffix (str): File suffix to detect Returns: list[Path]: A list of nf-test file paths. @@ -171,7 +172,7 @@ def detect_nf_test_files(changed_files: list[Path]) -> list[Path]: result: list[Path] = [] for path in changed_files: # If Path is the exact nf-test file add to list: - if path.match("*.nf.test") and path.exists(): + if path.match(suffix) and path.exists(): result.append(path) # Else recursively search for nf-test files: else: @@ -180,12 +181,12 @@ def detect_nf_test_files(changed_files: list[Path]) -> list[Path]: # dir/ # ├─ main.nf # ├─ main.nf.test - for file in path.parent.rglob("*.nf.test"): + for file in path.parent.rglob(suffix): result.append(file) return result -def process_files(files: list[Path]) -> list[str]: +def process_nf_test_files(files: list[Path]) -> list[str]: """ Process the files and return lines that begin with 'workflow', 'process', or 'function' and have a single string afterwards. @@ -239,12 +240,28 @@ def convert_nf_test_files_to_test_types( name = words[1].strip("'\"") # Strip both single and double quotes if keyword in types: result[keyword].append(name) + elif "run" in line: + run_words = words[0].strip(")").split("(") + if len(run_words) == 2 and re.match(r'^".*"$', run_words[1]): + keyword = run_words[0] + name = run_words[1].strip("'\"") # Strip both single and double quotes + if keyword in types: + result[keyword].append(name) + elif "include {" in line and "include" in types: + keyword = words[0] + name = words[2].strip("'\"") # Strip both single and double quotes + if keyword in types: + result[keyword].append(name) + return result -def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: +def find_nf_tests_with_changed_dependencies( + paths: list[Path], tags: list[str] +) -> list[Path]: """ - Find all *.nf.test files with changed dependencies from a list of paths. + Find all *.nf.test files with changed dependencies + (identified as modules loaded in the via setup { run("") } from a list of paths. Args: paths (list): List of directories or files to scan. @@ -256,7 +273,7 @@ def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: result: list[Path] = [] - nf_test_files = detect_nf_test_files(paths) + nf_test_files = detect_files(paths, "*.nf.test") # find nf-test files with changed dependencies for nf_test_file in nf_test_files: @@ -266,8 +283,8 @@ def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: # Make case insensitive with .casefold() tags_in_nf_test_file = [ tag.casefold().replace("/", "_") - for tag in convert_nf_test_files_to_test_types(lines, types=["tag"])[ - "tag" + for tag in convert_nf_test_files_to_test_types(lines, types=["run"])[ + "run" ] ] # Check if tag in nf-test file appears in a tag. @@ -280,6 +297,52 @@ def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: return result +def find_nf_files_with_changed_dependencies( + paths: list[Path], tags: list[str] +) -> list[Path]: + """ + Find all *.nf.test files with where the *.nf file uses changed dependencies + (identified via include { }) in *.nf files from a list of paths. + + Args: + paths (list): List of directories or files to scan. + tags (list): List of tags identified as having changes. + + Returns: + list: List of *.nf.test files from *.nf files with changed dependencies. + """ + + nf_files_w_changed_dependencies: list[Path] = [] + + nf_files = detect_files(paths, "*.nf") + + # find nf files with changed dependencies + for nf_file in nf_files: + with open(nf_file, "r") as f: + lines = f.readlines() + # Get all include statements from nf file + # Make case insensitive with .casefold() + includes_in_nf_file = [ + tag.casefold().replace("/", "_") + for tag in convert_nf_test_files_to_test_types( + lines, types=["include"] + )["include"] + ] + # Check if include in nf file appears in a tag. + # Use .casefold() to be case insensitive + if any( + tag.casefold().replace("/", "_") in includes_in_nf_file for tag in tags + ): + nf_files_w_changed_dependencies.append(nf_file) + + # find nf-test for nf files with changed dependencies + nf_test_files_for_changed_dependencies = detect_files( + nf_files_w_changed_dependencies, "*.nf.test" + ) + + return nf_test_files_for_changed_dependencies + + if __name__ == "__main__": # Utility stuff @@ -295,8 +358,8 @@ def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: changed_files = changed_files + detect_include_files( changed_files, include_files ) - nf_test_files = detect_nf_test_files(changed_files) - lines = process_files(nf_test_files) + nf_test_files = detect_files(changed_files, "*.nf.test") + lines = process_nf_test_files(nf_test_files) result = convert_nf_test_files_to_test_types(lines) # Get only relevant results (specified by -t) @@ -305,13 +368,22 @@ def find_changed_dependencies(paths: list[Path], tags: list[str]) -> list[Path]: {item for sublist in map(result.get, args.types) for item in sublist} ) - # Parse files to identify nf-tests with changed dependencies - changed_dep_files = find_changed_dependencies([Path(".")], target_results) + # Parse nf-test files to identify nf-tests containing "setup" with changed module/subworkflow/workflow + nf_test_changed_setup = find_nf_tests_with_changed_dependencies( + [Path(".")], target_results + ) + + # Parse *.nf files to identify nf-files containing include with changed module/subworkflow/workflow + nf_files_changed_include = find_nf_files_with_changed_dependencies( + [Path(".")], target_results + ) # Combine target nf-test files and nf-test files with changed dependencies - # Go back one dir so we get the module or subworkflow path all_nf_tests = [ - str(test_path.parent.parent) for test_path in set(changed_dep_files + nf_test_files) + str(test_path) + for test_path in set( + nf_test_files + nf_test_changed_setup + nf_files_changed_include + ) ] # Print to stdout From 6979760da813f88ec99aae246fa2d34c7d744b77 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:55:45 +0100 Subject: [PATCH 31/79] fixup --- .github/python/find_changed_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py index b492ec64f78..2561328fdc3 100644 --- a/.github/python/find_changed_files.py +++ b/.github/python/find_changed_files.py @@ -57,7 +57,7 @@ def parse_args() -> argparse.Namespace: "-i", "--include", type=Path, - default=".github/python/include.yaml", + default=None, help="Path to an include file containing a YAML of key value pairs to include in changed files. I.e., return the current directory if an important file is changed.", ) parser.add_argument( From dfcff56060922ada1472219c59ed4bf1a930d858 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:35:37 +0100 Subject: [PATCH 32/79] fix(.github/python/find_changed_files.py): detect nf files less greedily and ignore tests directory The scanning function was picking up nf files outside of the target repos. This change only scans modules, subworkflows and workflows. --- .github/python/find_changed_files.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py index 2561328fdc3..c89d3187c75 100644 --- a/.github/python/find_changed_files.py +++ b/.github/python/find_changed_files.py @@ -158,31 +158,41 @@ def detect_include_files( return new_changed_files -def detect_files(changed_files: list[Path], suffix: str) -> list[Path]: +def detect_files(paths: list[Path], suffix: str) -> list[Path]: """ Detects and returns a list of nf-test files from the given list of changed files. Args: - changed_files (list[Path]): A list of file paths. + paths (list[Path]): A list of file paths to scan. suffix (str): File suffix to detect Returns: list[Path]: A list of nf-test file paths. """ result: list[Path] = [] - for path in changed_files: + + for path in paths: # If Path is the exact nf-test file add to list: if path.match(suffix) and path.exists(): result.append(path) # Else recursively search for nf-test files: - else: - # Get the enclosing dir so files in the same dir can be found. + elif path.is_dir(): + # Search the dir + # e.g. + # dir/ + # ├─ main.nf + # ├─ main.nf.test + for file in path.rglob(suffix): + result.append(file) + elif path.is_file(): + # Search the enclosing dir so files in the same dir can be found. # e.g. # dir/ # ├─ main.nf # ├─ main.nf.test for file in path.parent.rglob(suffix): result.append(file) + return result @@ -370,12 +380,14 @@ def find_nf_files_with_changed_dependencies( # Parse nf-test files to identify nf-tests containing "setup" with changed module/subworkflow/workflow nf_test_changed_setup = find_nf_tests_with_changed_dependencies( - [Path(".")], target_results + [Path("./modules/"), Path("./subworkflows/"), Path("./workflows/")], + target_results, ) # Parse *.nf files to identify nf-files containing include with changed module/subworkflow/workflow nf_files_changed_include = find_nf_files_with_changed_dependencies( - [Path(".")], target_results + [Path("./modules/"), Path("./subworkflows/"), Path("./workflows/")], + target_results, ) # Combine target nf-test files and nf-test files with changed dependencies From 703631c0da77be41b2915937310bbbed2ae78a80 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:52:11 +0100 Subject: [PATCH 33/79] Revert to directories instead of files for module tagging --- .github/python/find_changed_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py index c89d3187c75..1133c4ce608 100644 --- a/.github/python/find_changed_files.py +++ b/.github/python/find_changed_files.py @@ -392,7 +392,7 @@ def find_nf_files_with_changed_dependencies( # Combine target nf-test files and nf-test files with changed dependencies all_nf_tests = [ - str(test_path) + str(test_path.parent.parent) for test_path in set( nf_test_files + nf_test_changed_setup + nf_files_changed_include ) From b99e46aaf783968e4d193bcd15a6a479f9e149ae Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:05:40 +0100 Subject: [PATCH 34/79] Create optional returntype for Python script --- .github/python/find_changed_files.py | 26 ++++++++++++++++++++------ .github/workflows/test.yml | 1 + 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py index 1133c4ce608..912cbccbea5 100644 --- a/.github/python/find_changed_files.py +++ b/.github/python/find_changed_files.py @@ -75,6 +75,12 @@ def parse_args() -> argparse.Namespace: default=["function", "process", "workflow", "pipeline"], help="Types of tests to include.", ) + parser.add_argument( + "--returntype", + choices=["file", "dir"], + default="file", + help="Return either the nf-test file or modules/subworkflow directory of the changed files", + ) return parser.parse_args() @@ -391,12 +397,20 @@ def find_nf_files_with_changed_dependencies( ) # Combine target nf-test files and nf-test files with changed dependencies - all_nf_tests = [ - str(test_path.parent.parent) - for test_path in set( - nf_test_files + nf_test_changed_setup + nf_files_changed_include - ) - ] + if args.returntype == "file": + all_nf_tests = [ + str(test_path) + for test_path in set( + nf_test_files + nf_test_changed_setup + nf_files_changed_include + ) + ] + elif args.returntype == "dir": + all_nf_tests = [ + str(test_path.parent.parent) + for test_path in set( + nf_test_files + nf_test_changed_setup + nf_files_changed_include + ) + ] # Print to stdout print(json.dumps(all_nf_tests)) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1455e4ef043..da168ea46a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -136,6 +136,7 @@ jobs: -t pipeline workflow process \ --head_ref ${{ github.sha }} \ --base_ref origin/${{ github.base_ref }} \ + --returntype dir \ ) >> $GITHUB_OUTPUT - name: Separate modules and subworkflows From a888a915bcab0f7ab93a0b007900ce1f4ae895f4 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:06:25 +0100 Subject: [PATCH 35/79] Remove superfluous python cache --- .github/workflows/test.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da168ea46a9..efaebeb8d10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -217,13 +217,6 @@ jobs: with: python-version: "3.11" - - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install pip run: python -m pip install --upgrade pip From 82b40d21f4693ea39290062d1c3afa4fe34eec33 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:24:42 +0100 Subject: [PATCH 36/79] feat: replace custom python with reusable github action for detecting nf-test changes --- .github/python/find_changed_files.py | 416 --------------------------- .github/workflows/test.yml | 31 +- 2 files changed, 8 insertions(+), 439 deletions(-) delete mode 100644 .github/python/find_changed_files.py diff --git a/.github/python/find_changed_files.py b/.github/python/find_changed_files.py deleted file mode 100644 index 912cbccbea5..00000000000 --- a/.github/python/find_changed_files.py +++ /dev/null @@ -1,416 +0,0 @@ -#!/usr/bin/env python - -# This script is used to identify *.nf.test files for changed functions/processs/workflows/pipelines and *.nf-test files -# with changed dependencies, then return as a JSON list - -import argparse -import json -import logging -import re -import yaml - -from itertools import chain -from pathlib import Path -from git import Repo - - -def parse_args() -> argparse.Namespace: - """ - Parse command line arguments and return an ArgumentParser object. - - Returns: - argparse.ArgumentParser: The ArgumentParser object with the parsed arguments. - """ - parser = argparse.ArgumentParser( - description="Scan *.nf.test files for function/process/workflow name and return as a JSON list" - ) - parser.add_argument( - "-r", - "--head_ref", - required=True, - help="Head reference branch (Source branch for a PR).", - ) - parser.add_argument( - "-b", - "--base_ref", - required=True, - help="Base reference branch (Target branch for a PR).", - ) - parser.add_argument( - "-x", - "--ignored_files", - nargs="+", - default=[ - ".git/*", - ".gitpod.yml", - ".prettierignore", - ".prettierrc.yml", - "*.md", - "*.png", - "modules.json", - "pyproject.toml", - "tower.yml", - ], - help="List of files or file substrings to ignore.", - ) - parser.add_argument( - "-i", - "--include", - type=Path, - default=None, - help="Path to an include file containing a YAML of key value pairs to include in changed files. I.e., return the current directory if an important file is changed.", - ) - parser.add_argument( - "-l", - "--log-level", - choices=["DEBUG", "INFO", "WARNING", "ERROR"], - default="INFO", - help="Logging level", - ) - parser.add_argument( - "-t", - "--types", - nargs="+", - choices=["function", "process", "workflow", "pipeline"], - default=["function", "process", "workflow", "pipeline"], - help="Types of tests to include.", - ) - parser.add_argument( - "--returntype", - choices=["file", "dir"], - default="file", - help="Return either the nf-test file or modules/subworkflow directory of the changed files", - ) - return parser.parse_args() - - -def read_yaml_inverted(file_path: str) -> dict: - """ - Read a YAML file and return its contents as a dictionary but reversed, i.e. the values become the keys and the keys become the values. - - Args: - file_path (str): The path to the YAML file. - - Returns: - dict: The contents of the YAML file as a dictionary inverted. - """ - with open(file_path, "r") as f: - data = yaml.safe_load(f) - - # Invert dictionary of lists into contents of lists are keys, values are the original keys - # { "key": ["item1", "item2] } --> { "item1": "key", "item2": "key" } - return {value: key for key, values in data.items() for value in values} - - -def find_changed_files( - branch1: str, - branch2: str, - ignore: list[str], -) -> list[Path]: - """ - Find all *.nf.tests that are associated with files that have been changed between two specified branches. - - Args: - branch1 (str) : The first branch being compared - branch2 (str) : The second branch being compared - ignore (list) : List of files or file substrings to ignore. - - Returns: - list: List of files matching the pattern *.nf.test that have changed between branch2 and branch1. - """ - # create repo - repo = Repo(".") - # identify commit on branch1 - branch1_commit = repo.commit(branch1) - # identify commit on branch2 - branch2_commit = repo.commit(branch2) - # compare two branches - diff_index = branch1_commit.diff(branch2_commit) - - # Start empty list of changed files - changed_files = [] - - # For every file that has changed between commits - for file in diff_index: - # Get pathlib.Path object - filepath = Path(file.a_path) - # If file does not match any in the ignore list, add containing directory to changed_files - if not any(filepath.match(ignored_path) for ignored_path in ignore): - changed_files.append(filepath) - - # Uniqueify the results before returning for efficiency - return list(set(changed_files)) - - -def detect_include_files( - changed_files: list[Path], include_files: dict[str, str] -) -> list[Path]: - """ - Detects the include files based on the changed files. - - Args: - changed_files (list[Path]): List of paths to the changed files. - include_files (dict[str, str]): Key-value pairs to return if a certain file has changed. If a file in a directory has changed, it points to a different directory. - - Returns: - list[Path]: List of paths to representing the keys of the include_files dictionary, where a value matched a path in changed_files. - """ - new_changed_files = [] - for filepath in changed_files: - # If file is in the include_files, we return the key instead of the value - for include_path, include_key in include_files.items(): - if filepath.match(include_path): - new_changed_files.append(Path(include_key)) - return new_changed_files - - -def detect_files(paths: list[Path], suffix: str) -> list[Path]: - """ - Detects and returns a list of nf-test files from the given list of changed files. - - Args: - paths (list[Path]): A list of file paths to scan. - suffix (str): File suffix to detect - - Returns: - list[Path]: A list of nf-test file paths. - """ - result: list[Path] = [] - - for path in paths: - # If Path is the exact nf-test file add to list: - if path.match(suffix) and path.exists(): - result.append(path) - # Else recursively search for nf-test files: - elif path.is_dir(): - # Search the dir - # e.g. - # dir/ - # ├─ main.nf - # ├─ main.nf.test - for file in path.rglob(suffix): - result.append(file) - elif path.is_file(): - # Search the enclosing dir so files in the same dir can be found. - # e.g. - # dir/ - # ├─ main.nf - # ├─ main.nf.test - for file in path.parent.rglob(suffix): - result.append(file) - - return result - - -def process_nf_test_files(files: list[Path]) -> list[str]: - """ - Process the files and return lines that begin with 'workflow', 'process', or 'function' and have a single string afterwards. - - Args: - files (list): List of files to process. - - Returns: - list: List of lines that match the criteria. - """ - result = [] - for file in files: - with open(file, "r") as f: - is_pipeline_test = True - lines = f.readlines() - for line in lines: - line = line.strip() - if line.startswith(("workflow", "process", "function")): - words = line.split() - if len(words) == 2 and re.match(r'^".*"$', words[1]): - result.append(line) - is_pipeline_test = False - - # If no results included workflow, process or function - # Add a dummy result to fill the 'pipeline' category - if is_pipeline_test: - result.append("pipeline 'PIPELINE'") - - return result - - -def convert_nf_test_files_to_test_types( - lines: list[str], types: list[str] = ["function", "process", "workflow", "pipeline"] -) -> dict[str, list[str]]: - """ - Generate a dictionary of function, process and workflow lists from the lines. - - Args: - lines (list): List of lines to process. - types (list): List of types to include. - - Returns: - dict: Dictionary with function, process and workflow lists. - """ - # Populate empty dict from types - result: dict[str, list[str]] = {key: [] for key in types} - - for line in lines: - words = line.split() - if len(words) == 2 and re.match(r'^".*"$', words[1]): - keyword = words[0] - name = words[1].strip("'\"") # Strip both single and double quotes - if keyword in types: - result[keyword].append(name) - elif "run" in line: - run_words = words[0].strip(")").split("(") - if len(run_words) == 2 and re.match(r'^".*"$', run_words[1]): - keyword = run_words[0] - name = run_words[1].strip("'\"") # Strip both single and double quotes - if keyword in types: - result[keyword].append(name) - elif "include {" in line and "include" in types: - keyword = words[0] - name = words[2].strip("'\"") # Strip both single and double quotes - if keyword in types: - result[keyword].append(name) - - return result - - -def find_nf_tests_with_changed_dependencies( - paths: list[Path], tags: list[str] -) -> list[Path]: - """ - Find all *.nf.test files with changed dependencies - (identified as modules loaded in the via setup { run("") } from a list of paths. - - Args: - paths (list): List of directories or files to scan. - tags (list): List of tags identified as having changes. - - Returns: - list: List of *.nf.test files with changed dependencies. - """ - - result: list[Path] = [] - - nf_test_files = detect_files(paths, "*.nf.test") - - # find nf-test files with changed dependencies - for nf_test_file in nf_test_files: - with open(nf_test_file, "r") as f: - lines = f.readlines() - # Get all tags from nf-test file - # Make case insensitive with .casefold() - tags_in_nf_test_file = [ - tag.casefold().replace("/", "_") - for tag in convert_nf_test_files_to_test_types(lines, types=["run"])[ - "run" - ] - ] - # Check if tag in nf-test file appears in a tag. - # Use .casefold() to be case insensitive - if any( - tag.casefold().replace("/", "_") in tags_in_nf_test_file for tag in tags - ): - result.append(nf_test_file) - - return result - - -def find_nf_files_with_changed_dependencies( - paths: list[Path], tags: list[str] -) -> list[Path]: - """ - Find all *.nf.test files with where the *.nf file uses changed dependencies - (identified via include { }) in *.nf files from a list of paths. - - Args: - paths (list): List of directories or files to scan. - tags (list): List of tags identified as having changes. - - Returns: - list: List of *.nf.test files from *.nf files with changed dependencies. - """ - - nf_files_w_changed_dependencies: list[Path] = [] - - nf_files = detect_files(paths, "*.nf") - - # find nf files with changed dependencies - for nf_file in nf_files: - with open(nf_file, "r") as f: - lines = f.readlines() - # Get all include statements from nf file - # Make case insensitive with .casefold() - includes_in_nf_file = [ - tag.casefold().replace("/", "_") - for tag in convert_nf_test_files_to_test_types( - lines, types=["include"] - )["include"] - ] - # Check if include in nf file appears in a tag. - # Use .casefold() to be case insensitive - if any( - tag.casefold().replace("/", "_") in includes_in_nf_file for tag in tags - ): - nf_files_w_changed_dependencies.append(nf_file) - - # find nf-test for nf files with changed dependencies - nf_test_files_for_changed_dependencies = detect_files( - nf_files_w_changed_dependencies, "*.nf.test" - ) - - return nf_test_files_for_changed_dependencies - - -if __name__ == "__main__": - - # Utility stuff - args = parse_args() - logging.basicConfig(level=args.log_level) - - # Parse nf-test files for target test tags - changed_files = find_changed_files(args.head_ref, args.base_ref, args.ignored_files) - - # If an additional include YAML is added, we detect additional changed dirs to include - if args.include: - include_files = read_yaml_inverted(args.include) - changed_files = changed_files + detect_include_files( - changed_files, include_files - ) - nf_test_files = detect_files(changed_files, "*.nf.test") - lines = process_nf_test_files(nf_test_files) - result = convert_nf_test_files_to_test_types(lines) - - # Get only relevant results (specified by -t) - # Unique using a set - target_results = list( - {item for sublist in map(result.get, args.types) for item in sublist} - ) - - # Parse nf-test files to identify nf-tests containing "setup" with changed module/subworkflow/workflow - nf_test_changed_setup = find_nf_tests_with_changed_dependencies( - [Path("./modules/"), Path("./subworkflows/"), Path("./workflows/")], - target_results, - ) - - # Parse *.nf files to identify nf-files containing include with changed module/subworkflow/workflow - nf_files_changed_include = find_nf_files_with_changed_dependencies( - [Path("./modules/"), Path("./subworkflows/"), Path("./workflows/")], - target_results, - ) - - # Combine target nf-test files and nf-test files with changed dependencies - if args.returntype == "file": - all_nf_tests = [ - str(test_path) - for test_path in set( - nf_test_files + nf_test_changed_setup + nf_files_changed_include - ) - ] - elif args.returntype == "dir": - all_nf_tests = [ - str(test_path.parent.parent) - for test_path in set( - nf_test_files + nf_test_changed_setup + nf_files_changed_include - ) - ] - - # Print to stdout - print(json.dumps(all_nf_tests)) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index efaebeb8d10..b92c2c3fac2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,38 +112,23 @@ jobs: subworkflows: ${{ steps.outputs.outputs.subworkflows}} steps: - - uses: actions/setup-python@v4 - with: - python-version: "3.11" - architecture: "x64" - - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install gitpython find changed files - run: | - python -m pip install --upgrade pip - pip install gitpython pyyaml - - name: List nf-test files id: list - run: | - echo changes=$(python \ - .github/python/find_changed_files.py \ - -t pipeline workflow process \ - --head_ref ${{ github.sha }} \ - --base_ref origin/${{ github.base_ref }} \ - --returntype dir \ - ) >> $GITHUB_OUTPUT + uses: adamrtalbot/detect-nf-test-changes@main + with: + head: ${{ github.sha }} + base: origin/${{ github.base_ref }} + returntype: "dir" - name: Separate modules and subworkflows id: outputs run: | - echo modules=$(echo '${{ steps.list.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT - echo subworkflows=$(echo '${{ steps.list.outputs.changes }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT + echo modules=$(echo '${{ steps.list.outputs.components }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT + echo subworkflows=$(echo '${{ steps.list.outputs.components }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT - name: debug run: | From 5d902b5e3b787da66c50f8b3d45013bfd3e79974 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:54:08 +0100 Subject: [PATCH 37/79] Fix variable name in output paths --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b92c2c3fac2..9b7819e60d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -107,7 +107,7 @@ jobs: runs-on: ubuntu-latest outputs: # Expose detected tags as 'modules' and 'workflows' output variables - paths: ${{ steps.list.outputs.changes }} + paths: ${{ steps.list.outputs.components }} modules: ${{ steps.outputs.outputs.modules }} subworkflows: ${{ steps.outputs.outputs.subworkflows}} From 2238fe6db037b7f7d69f8a023a9fb8e8ef6402fc Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:34:08 +0100 Subject: [PATCH 38/79] Switch to new parents dir syntax --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b7819e60d6..d07207598c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: with: head: ${{ github.sha }} base: origin/${{ github.base_ref }} - returntype: "dir" + n_parents: 2 - name: Separate modules and subworkflows id: outputs From 2b94d3823359b254f48b425a8892d7ec669d274d Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:42:14 +0100 Subject: [PATCH 39/79] prod to bump version of action --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d07207598c3..c7c10f9eefa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -110,6 +110,7 @@ jobs: paths: ${{ steps.list.outputs.components }} modules: ${{ steps.outputs.outputs.modules }} subworkflows: ${{ steps.outputs.outputs.subworkflows}} + # Prod for version bumping steps: - uses: actions/checkout@v4 From 5a28a9197c65e3e6fc695631a5bbe3aec353f18b Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:39:40 +0100 Subject: [PATCH 40/79] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7c10f9eefa..3cb2eb891f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,7 +119,7 @@ jobs: - name: List nf-test files id: list - uses: adamrtalbot/detect-nf-test-changes@main + uses: adamrtalbot/detect-nf-test-changes@rewrite-using-class-instead-of-loops with: head: ${{ github.sha }} base: origin/${{ github.base_ref }} From 173c66746cd4a2eb1f959846171eceb56aa327bd Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:13:02 +0100 Subject: [PATCH 41/79] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cb2eb891f5..458c3225fac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,7 +119,7 @@ jobs: - name: List nf-test files id: list - uses: adamrtalbot/detect-nf-test-changes@rewrite-using-class-instead-of-loops + uses: adamrtalbot/detect-nf-test-changes@v0.0.1 with: head: ${{ github.sha }} base: origin/${{ github.base_ref }} From fc43815096701f4ee8ee8edb3e2f34e360a36c2a Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:33:38 +0100 Subject: [PATCH 42/79] Exclude more subworkflows from Conda --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 458c3225fac..19738418e13 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -639,6 +639,10 @@ jobs: path: modules/nf-core/islandpath - profile: conda path: subworkflows/nf-core/vcf_annotate_ensemblvep + - profile: conda + path: subworkflows/nf-core/fastq_align_bamcmp_bwa + - profile: conda + path: subworkflows/nf-core/fastq_align_bwa env: NXF_ANSI_LOG: false SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }} From 9db4b22b4ee42923b9fa184553330121387e791a Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:39:11 +0100 Subject: [PATCH 43/79] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19738418e13..6df40cc67ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,7 +119,7 @@ jobs: - name: List nf-test files id: list - uses: adamrtalbot/detect-nf-test-changes@v0.0.1 + uses: adamrtalbot/detect-nf-test-changes@9f8c94bee392098ca3e247e1004613a3728bbce5 with: head: ${{ github.sha }} base: origin/${{ github.base_ref }} From 979fe8ba766c99973c721a32a3401e1578928e69 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:03:38 +0100 Subject: [PATCH 44/79] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6df40cc67ff..6e3131bf817 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,7 +119,7 @@ jobs: - name: List nf-test files id: list - uses: adamrtalbot/detect-nf-test-changes@9f8c94bee392098ca3e247e1004613a3728bbce5 + uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} base: origin/${{ github.base_ref }} From cde646aba4c0ea78b477ebae35d6e54ee3817706 Mon Sep 17 00:00:00 2001 From: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:50:41 +0200 Subject: [PATCH 45/79] QUILT nf-test and bamlist (#5515) * Migrate quilt to nf-test and swithc bamlist to auto generation inside the module * Fix tests * Fix test * Fix tests * Add snap * Update license * Add quilt tag * Specify build hash for conda environment * Specify build hash for conda environment * Undo commit * Update nf-test snapshot * Fix config name * Update snapshot * Update meta.yml * Add r-base to environment * Update snapshot generation * Update meta.yml * Update snap * Update snap * Force sorting * Update snapshot --- modules/nf-core/quilt/quilt/environment.yml | 3 +- modules/nf-core/quilt/quilt/main.nf | 10 +- modules/nf-core/quilt/quilt/meta.yml | 11 +- .../nf-core/quilt/quilt/tests/main.nf.test | 132 ++++++ .../quilt/quilt/tests/main.nf.test.snap | 376 ++++++++++++++++++ .../quilt/quilt/tests/quilt_default.config | 6 + .../quilt/quilt/tests/quilt_noseed.config | 6 + .../quilt/quilt/tests/quilt_optional.config | 6 + modules/nf-core/quilt/quilt/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/quilt/quilt/main.nf | 98 ----- .../nf-core/quilt/quilt/nextflow.config | 18 - tests/modules/nf-core/quilt/quilt/test.yml | 145 ------- 13 files changed, 540 insertions(+), 276 deletions(-) create mode 100644 modules/nf-core/quilt/quilt/tests/main.nf.test create mode 100644 modules/nf-core/quilt/quilt/tests/main.nf.test.snap create mode 100644 modules/nf-core/quilt/quilt/tests/quilt_default.config create mode 100644 modules/nf-core/quilt/quilt/tests/quilt_noseed.config create mode 100644 modules/nf-core/quilt/quilt/tests/quilt_optional.config create mode 100644 modules/nf-core/quilt/quilt/tests/tags.yml delete mode 100644 tests/modules/nf-core/quilt/quilt/main.nf delete mode 100644 tests/modules/nf-core/quilt/quilt/nextflow.config delete mode 100644 tests/modules/nf-core/quilt/quilt/test.yml diff --git a/modules/nf-core/quilt/quilt/environment.yml b/modules/nf-core/quilt/quilt/environment.yml index 9872e81955e..a2161a6515d 100644 --- a/modules/nf-core/quilt/quilt/environment.yml +++ b/modules/nf-core/quilt/quilt/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::r-quilt=1.0.5 + - bioconda::r-quilt=1.0.5=r43h06b5641_0 + - r-base=4.3.1 diff --git a/modules/nf-core/quilt/quilt/main.nf b/modules/nf-core/quilt/quilt/main.nf index 3068ba7c962..982479b5c12 100644 --- a/modules/nf-core/quilt/quilt/main.nf +++ b/modules/nf-core/quilt/quilt/main.nf @@ -8,7 +8,7 @@ process QUILT_QUILT { 'biocontainers/r-quilt:1.0.5--r43h06b5641_0' }" input: - tuple val(meta), path(bams), path(bais), path(bamlist), path(reference_haplotype_file), path(reference_legend_file), val(chr), val(regions_start), val(regions_end), val(ngen), val(buffer), path(genetic_map_file) + tuple val(meta), path(bams), path(bais), path(reference_haplotype_file), path(reference_legend_file), val(chr), val(regions_start), val(regions_end), val(ngen), val(buffer), path(genetic_map_file) tuple val(meta2), path(posfile), path(phasefile) tuple val(meta3), path(fasta) @@ -27,18 +27,18 @@ process QUILT_QUILT { def prefix = task.ext.prefix ?: "${meta.id}" def extensions = bams.collect { it.extension } def extension = extensions.flatten().unique() - def list_command = extension == ["bam"] ? "--bamlist=${bamlist}" : - extension == ["cram"] ? "--cramlist=${bamlist} --reference=${fasta}" : "" + def list_command = extension == ["bam"] ? "--bamlist=" : + extension == ["cram"] ? "--reference=${fasta} --cramlist=" : "" def genetic_map_file_command = genetic_map_file ? "--genetic_map_file=${genetic_map_file}" : "" def posfile_command = posfile ? "--posfile=${posfile}" : "" def phasefile_command = phasefile ? "--phasefile=${phasefile}" : "" if (!(args ==~ /.*--seed.*/)) {args += " --seed=1"} """ - + printf "%s\\n" $bams | tr -d '[],' > all_files.txt QUILT.R \\ - $list_command \\ + ${list_command}all_files.txt \\ $genetic_map_file_command \\ $posfile_command \\ $phasefile_command \\ diff --git a/modules/nf-core/quilt/quilt/meta.yml b/modules/nf-core/quilt/quilt/meta.yml index 34c67a79db7..e4653983217 100644 --- a/modules/nf-core/quilt/quilt/meta.yml +++ b/modules/nf-core/quilt/quilt/meta.yml @@ -13,7 +13,7 @@ tools: documentation: "https://github.com/rwdavies/quilt" tool_dev_url: "https://github.com/rwdavies/quilt" doi: "10.1038/s41588-021-00877-0" - licence: "['GPL v3']" + licence: ["GPL v3"] input: - meta: type: map @@ -28,10 +28,6 @@ input: type: file description: (Mandatory) BAM/CRAM index files pattern: "*.{bai}" - - bamlist: - type: file - description: (Mandatory) "Path to file with bam file locations. File is one row per entry, path to bam files. Bam index files should exist in same directory as for each bam, suffixed either .bam.bai or .bai. - pattern: "*.{txt}" - reference_haplotype_file: type: file description: (Mandatory) Reference haplotype file in IMPUTE format (file with no header and no rownames, one row per SNP, one column per reference haplotype, space separated, values must be 0 or 1) @@ -99,9 +95,12 @@ output: type: file description: TBI file of the VCF. pattern: "*.{vcf.gz.tbi}" - - RData: + - rdata: type: directory description: Optional directory path to prepared RData file with reference objects (useful with --save_prepared_reference=TRUE). + - plots: + type: directory + description: Optional directory path to save plots. authors: - "@atrigila" maintainers: diff --git a/modules/nf-core/quilt/quilt/tests/main.nf.test b/modules/nf-core/quilt/quilt/tests/main.nf.test new file mode 100644 index 00000000000..2d80516df52 --- /dev/null +++ b/modules/nf-core/quilt/quilt/tests/main.nf.test @@ -0,0 +1,132 @@ +// Input data +def path = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/" +def bam = "[${path}NA12878.haplotagged.1.0.bam', checkIfExists: true), ${path}NA12878.ont.1.0.bam', checkIfExists: true), ${path}NA12878.illumina.1.0.bam', checkIfExists: true)]" +def bai = "[${path}NA12878.haplotagged.1.0.bam.bai', checkIfExists: true), ${path}NA12878.ont.1.0.bam.bai', checkIfExists: true),${path}NA12878.illumina.1.0.bam.bai', checkIfExists: true)]" + +// Input reference data +def reference_haplotype_file = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.hap.gz', checkIfExists: true)" +def reference_legend_file = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.legend.gz', checkIfExists: true)" +def genetic_map_file = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/CEU-chr20-final.b38.txt.gz', checkIfExists: true)" + +// Parameters +def chr = "'chr20'" +def regions_start = "2000001" +def regions_end = "2100000" +def ngen = "100" +def buffer = "10000" + + +// (optional) input truth data +def posfile = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.posfile.txt', checkIfExists: true)" +def phasefile = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.phasefile.txt', checkIfExists: true)" +def posfile_phasefile = "[[ id:'test', chr:'chr20' ], [$posfile], [$phasefile]]" +def fasta = "[[id:'test'], []]" + +// Input channel quilt +def ch_input = "[ id:'test', chr:'chr20' ], $bam, $bai, [$reference_haplotype_file], [$reference_legend_file], $chr, $regions_start, $regions_end, $ngen, $buffer" +def ch_input_gmap = "[$ch_input, [$genetic_map_file]]" +def ch_input_nogmap = "[$ch_input, []]" + +nextflow_process { + + name "Test Process QUILT" + script "../main.nf" + process "QUILT_QUILT" + + tag "modules" + tag "modules_nfcore" + tag "quilt/quilt" + tag "quilt" + + test("QUILT") { + config ("./quilt_default.config") + when { + process { + """ + input[0] = $ch_input_gmap + input[1] = $posfile_phasefile + input[2] = $fasta + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("QUILT no optional files") { + config ("./quilt_default.config") + when { + process { + """ + input[0] = $ch_input_nogmap + input[1] = [[id: null], [], []] + input[2] = $fasta + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("QUILT optional output") { + config ("./quilt_optional.config") + when { + process { + """ + input[0] = $ch_input_gmap + input[1] = $posfile_phasefile + input[2] = $fasta + """ + } + } + + then { + def dir = new File(process.out.plots[0][1]) + def list = [] + dir.eachFileRecurse { file -> list << file.getName() } + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf + process.out.tbi + + list.sort() + + process.out.rdata + process.out.versions + ).match() } + ) + } + + } + + test("QUILT no seed") { + config ("./quilt_noseed.config") + when { + process { + """ + input[0] = $ch_input_gmap + input[1] = $posfile_phasefile + input[2] = $fasta + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/quilt/quilt/tests/main.nf.test.snap b/modules/nf-core/quilt/quilt/tests/main.nf.test.snap new file mode 100644 index 00000000000..191b519a53d --- /dev/null +++ b/modules/nf-core/quilt/quilt/tests/main.nf.test.snap @@ -0,0 +1,376 @@ +{ + "QUILT": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,32f539c80971e2e8e0c31870be094a25" + ] + ], + "1": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,4607cdcb20599cbebd1ccf76d4dc56ae" + ] + ], + "2": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ], + "plots": [ + + ], + "rdata": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "tbi": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,4607cdcb20599cbebd1ccf76d4dc56ae" + ] + ], + "vcf": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,32f539c80971e2e8e0c31870be094a25" + ] + ], + "versions": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T17:27:54.607934432" + }, + "QUILT no seed": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,32f539c80971e2e8e0c31870be094a25" + ] + ], + "1": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,4607cdcb20599cbebd1ccf76d4dc56ae" + ] + ], + "2": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ], + "plots": [ + + ], + "rdata": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "tbi": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,4607cdcb20599cbebd1ccf76d4dc56ae" + ] + ], + "vcf": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,32f539c80971e2e8e0c31870be094a25" + ] + ], + "versions": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T17:29:31.357244889" + }, + "QUILT no optional files": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,3fde483728ef2287416b2340c06aaf85" + ] + ], + "1": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,20d9e8cda03fc84482f3aa53a0c94fb6" + ] + ], + "2": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ], + "plots": [ + + ], + "rdata": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "tbi": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,20d9e8cda03fc84482f3aa53a0c94fb6" + ] + ], + "vcf": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,3fde483728ef2287416b2340c06aaf85" + ] + ], + "versions": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T17:28:16.39358682" + }, + "QUILT optional output": { + "content": [ + [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,8352fbcabdd102a8ba2c4490e0834287" + ], + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,88d16933f2ac53058b7a5d5c849dc19a" + ], + "haps.NA12878.chr20.2000001.2100000_igs.1.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.1.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.1.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.1.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.2.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.2.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.2.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.2.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.3.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.3.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.3.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.3.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.4.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.4.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.4.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.4.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.5.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.5.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.5.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.5.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.6.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.6.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.6.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.6.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.7.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.7.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.7.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.7.it3.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.8.0.truth.png", + "haps.NA12878.chr20.2000001.2100000_igs.8.it1.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.8.it2.gibbs.png", + "haps.NA12878.chr20.2000001.2100000_igs.8.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.1.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.1.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.1.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.1.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.2.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.2.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.2.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.2.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.3.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.3.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.3.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.3.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.4.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.4.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.4.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.4.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.5.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.5.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.5.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.5.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.6.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.6.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.6.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.6.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.7.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.7.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.7.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.7.it3.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.8.0.truth.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.8.it1.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.8.it2.gibbs.png", + "haps.NA12878HT.chr20.2000001.2100000_igs.8.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.1.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.1.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.1.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.1.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.2.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.2.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.2.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.2.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.3.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.3.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.3.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.3.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.4.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.4.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.4.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.4.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.5.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.5.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.5.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.5.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.6.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.6.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.6.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.6.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.7.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.7.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.7.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.7.it3.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.8.0.truth.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.8.it1.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.8.it2.gibbs.png", + "haps.NA12878ONT.chr20.2000001.2100000_igs.8.it3.gibbs.png", + [ + { + "id": "test", + "chr": "chr20" + }, + [ + "QUILT_prepared_reference.chr20.2000001.2100000.RData:md5,c2bbcf91085f33536fbaf094b4f0ea05" + ] + ], + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T17:28:59.999377862" + } +} \ No newline at end of file diff --git a/modules/nf-core/quilt/quilt/tests/quilt_default.config b/modules/nf-core/quilt/quilt/tests/quilt_default.config new file mode 100644 index 00000000000..87f87b9a61d --- /dev/null +++ b/modules/nf-core/quilt/quilt/tests/quilt_default.config @@ -0,0 +1,6 @@ +process { + cpus = 1 // More than 1 cpu may lead to different md5sum + withName: QUILT_QUILT { + ext.args = "--seed=1" + } +} diff --git a/modules/nf-core/quilt/quilt/tests/quilt_noseed.config b/modules/nf-core/quilt/quilt/tests/quilt_noseed.config new file mode 100644 index 00000000000..e9f81a34f96 --- /dev/null +++ b/modules/nf-core/quilt/quilt/tests/quilt_noseed.config @@ -0,0 +1,6 @@ +process { + cpus = 1 // More than 1 cpu may lead to different md5sum + withName: QUILT_QUILT { + ext.args = "" + } +} diff --git a/modules/nf-core/quilt/quilt/tests/quilt_optional.config b/modules/nf-core/quilt/quilt/tests/quilt_optional.config new file mode 100644 index 00000000000..cfbd1353c43 --- /dev/null +++ b/modules/nf-core/quilt/quilt/tests/quilt_optional.config @@ -0,0 +1,6 @@ +process { + cpus = 1 // More than 1 cpu may lead to different md5sum + withName: QUILT_QUILT { + ext.args = "--save_prepared_reference=TRUE --make_plots=TRUE --seed=1" + } +} diff --git a/modules/nf-core/quilt/quilt/tests/tags.yml b/modules/nf-core/quilt/quilt/tests/tags.yml new file mode 100644 index 00000000000..ac1b90920f2 --- /dev/null +++ b/modules/nf-core/quilt/quilt/tests/tags.yml @@ -0,0 +1,2 @@ +quilt/quilt: + - "modules/nf-core/quilt/quilt/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 22a6c7472b3..c1038eac90c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1609,9 +1609,6 @@ qcat: quast: - modules/nf-core/quast/** - tests/modules/nf-core/quast/** -quilt/quilt: - - modules/nf-core/quilt/quilt/** - - tests/modules/nf-core/quilt/quilt/** racon: - modules/nf-core/racon/** - tests/modules/nf-core/racon/** diff --git a/tests/modules/nf-core/quilt/quilt/main.nf b/tests/modules/nf-core/quilt/quilt/main.nf deleted file mode 100644 index 646ba8f6e35..00000000000 --- a/tests/modules/nf-core/quilt/quilt/main.nf +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { QUILT_QUILT } from '../../../../../modules/nf-core/quilt/quilt/main.nf' -include { QUILT_QUILT as QUILT_OPTIONAL } from '../../../../../modules/nf-core/quilt/quilt/main.nf' -include { QUILT_QUILT as QUILT_NOSEED } from '../../../../../modules/nf-core/quilt/quilt/main.nf' - - - // input sequencing data (bam) - bam = [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/NA12878.haplotagged.1.0.bam', checkIfExists: true), - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/NA12878.ont.1.0.bam', checkIfExists: true), - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/NA12878.illumina.1.0.bam', checkIfExists: true) - ] - - bai = [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/NA12878.haplotagged.1.0.bam.bai', checkIfExists: true), - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/NA12878.ont.1.0.bam.bai', checkIfExists: true), - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/NA12878.illumina.1.0.bam.bai', checkIfExists: true) - ] - - bamlist = [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/bamlist.1.0.txt', checkIfExists: true) - ] - - bam_bai_bamlist = [ [ id:"test", chr:"chr20" ], bam, bai, bamlist ] - - // input reference data - - reference_haplotype_file = [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.hap.gz', checkIfExists: true) - ] - - reference_legend_file = [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.legend.gz', checkIfExists: true) - ] - - genetic_map_file = [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/CEU-chr20-final.b38.txt.gz', checkIfExists: true) - ] - - // parameters - - def chr = "chr20" - def regions_start = 2000001 - def regions_end = 2100000 - def ngen = 100 - def buffer = 10000 - - // input channel quilt - - ch_input = [ [ id:"test", chr:"chr20" ], bam, bai, bamlist, reference_haplotype_file, reference_legend_file, chr, regions_start, regions_end , ngen, buffer, genetic_map_file ] - - // (optional) input truth data - - posfile_phasefile = [ - [ id:'test', chr:"chr20" ], // meta map - [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.posfile.txt', checkIfExists: true) - ], - [ - file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.phasefile.txt', checkIfExists: true) - ] - ] - - fasta = [[id:'test'], []] - - - -workflow test_quilt { - - QUILT_QUILT ( ch_input, posfile_phasefile, fasta ) -} - - -workflow test_quilt_no_optional_files { - - posfile = [] - phasefile = [] - posfile_phasefile = [[id: null], posfile, phasefile] - genetic_map_file = [] - - ch_input = [ [ id:"test", chr:"chr20" ], bam, bai, bamlist, reference_haplotype_file, reference_legend_file, chr, regions_start, regions_end, ngen, buffer, genetic_map_file ] - - - QUILT_QUILT ( ch_input, posfile_phasefile, fasta ) -} - -workflow test_quilt_optional_outputs { - - QUILT_OPTIONAL ( ch_input, posfile_phasefile, fasta ) -} - -workflow test_quilt_no_seed { - - QUILT_NOSEED ( ch_input, posfile_phasefile, fasta ) -} diff --git a/tests/modules/nf-core/quilt/quilt/nextflow.config b/tests/modules/nf-core/quilt/quilt/nextflow.config deleted file mode 100644 index 754998af134..00000000000 --- a/tests/modules/nf-core/quilt/quilt/nextflow.config +++ /dev/null @@ -1,18 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - cpus = 1 // More than 1 cpu may lead to different md5sum - - withName: QUILT_QUILT { - ext.args = "--seed=1" - } - - withName: QUILT_OPTIONAL { - ext.args = "--save_prepared_reference=TRUE --make_plots=TRUE --seed=1" - } - - withName: QUILT_NOSEED { - ext.args = "" - } - -} diff --git a/tests/modules/nf-core/quilt/quilt/test.yml b/tests/modules/nf-core/quilt/quilt/test.yml deleted file mode 100644 index d701986cf4b..00000000000 --- a/tests/modules/nf-core/quilt/quilt/test.yml +++ /dev/null @@ -1,145 +0,0 @@ -- name: quilt quilt test_quilt - command: nextflow run ./tests/modules/nf-core/quilt/quilt -entry test_quilt -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/quilt/quilt/nextflow.config - tags: - - quilt/quilt - - quilt - files: - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz - md5sum: 81e23143117401f1f37a7c125ce37751 - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz.tbi - md5sum: 4607cdcb20599cbebd1ccf76d4dc56ae - - path: output/quilt/versions.yml - -- name: quilt quilt test_quilt_no_optional_files - command: nextflow run ./tests/modules/nf-core/quilt/quilt -entry test_quilt_no_optional_files -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/quilt/quilt/nextflow.config - tags: - - quilt/quilt - - quilt - files: - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz - md5sum: 65a415af7fa763422e628c2a418ab189 - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz.tbi - md5sum: 20d9e8cda03fc84482f3aa53a0c94fb6 - - path: output/quilt/versions.yml - -- name: quilt quilt test_quilt_optional_outputs - command: nextflow run ./tests/modules/nf-core/quilt/quilt -entry test_quilt_optional_outputs -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/quilt/quilt/nextflow.config - tags: - - quilt/quilt - - quilt - files: - - path: output/quilt/RData/QUILT_prepared_reference.chr20.2000001.2100000.RData - md5sum: c2bbcf91085f33536fbaf094b4f0ea05 - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.1.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.1.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.1.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.1.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.2.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.2.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.2.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.2.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.3.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.3.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.3.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.3.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.4.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.4.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.4.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.4.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.5.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.5.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.5.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.5.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.6.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.6.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.6.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.6.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.7.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.7.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.7.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.7.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.8.0.truth.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.8.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.8.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878.chr20.2000001.2100000_igs.8.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.1.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.1.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.1.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.1.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.2.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.2.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.2.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.2.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.3.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.3.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.3.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.3.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.4.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.4.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.4.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.4.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.5.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.5.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.5.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.5.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.6.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.6.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.6.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.6.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.7.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.7.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.7.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.7.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.8.0.truth.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.8.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.8.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878HT.chr20.2000001.2100000_igs.8.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.1.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.1.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.1.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.1.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.2.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.2.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.2.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.2.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.3.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.3.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.3.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.3.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.4.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.4.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.4.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.4.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.5.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.5.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.5.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.5.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.6.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.6.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.6.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.6.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.7.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.7.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.7.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.7.it3.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.8.0.truth.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.8.it1.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.8.it2.gibbs.png - - path: output/quilt/plots/haps.NA12878ONT.chr20.2000001.2100000_igs.8.it3.gibbs.png - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz - md5sum: 251e93d85272bbfe5a3fc5b7b319b99c - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz.tbi - md5sum: 88d16933f2ac53058b7a5d5c849dc19a - - path: output/quilt/versions.yml - -- name: quilt quilt test_quilt_no_seed - command: nextflow run ./tests/modules/nf-core/quilt/quilt -entry test_quilt_no_seed -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/quilt/quilt/nextflow.config - tags: - - quilt/quilt - - quilt - files: - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz - md5sum: 81e23143117401f1f37a7c125ce37751 - - path: output/quilt/quilt.chr20.2000001.2100000.vcf.gz.tbi - md5sum: 4607cdcb20599cbebd1ccf76d4dc56ae - - path: output/quilt/versions.yml From 62f3409dd80f7d1dd4bbb4ad04b9309093a1ab4f Mon Sep 17 00:00:00 2001 From: Kyle Hazen <41054023+k1sauce@users.noreply.github.com> Date: Wed, 24 Apr 2024 01:36:52 -0700 Subject: [PATCH 46/79] New module: gnu/split (#5428) * dev * dev * dev * add tests * fix lint * fix(gnu/split): pin coreutils in conda to match singularity and docker * fix: minor formatting fixes, use modules_testdata_base_path in nf-test --------- Co-authored-by: Kyle --- modules/nf-core/gnu/split/environment.yml | 9 + modules/nf-core/gnu/split/main.nf | 57 ++++ modules/nf-core/gnu/split/meta.yml | 44 +++ modules/nf-core/gnu/split/tests/main.nf.test | 102 +++++++ .../nf-core/gnu/split/tests/main.nf.test.snap | 271 ++++++++++++++++++ .../nf-core/gnu/split/tests/split_csv.config | 5 + .../gnu/split/tests/split_fastq_gz.config | 5 + modules/nf-core/gnu/split/tests/tags.yml | 2 + 8 files changed, 495 insertions(+) create mode 100644 modules/nf-core/gnu/split/environment.yml create mode 100644 modules/nf-core/gnu/split/main.nf create mode 100644 modules/nf-core/gnu/split/meta.yml create mode 100644 modules/nf-core/gnu/split/tests/main.nf.test create mode 100644 modules/nf-core/gnu/split/tests/main.nf.test.snap create mode 100644 modules/nf-core/gnu/split/tests/split_csv.config create mode 100644 modules/nf-core/gnu/split/tests/split_fastq_gz.config create mode 100644 modules/nf-core/gnu/split/tests/tags.yml diff --git a/modules/nf-core/gnu/split/environment.yml b/modules/nf-core/gnu/split/environment.yml new file mode 100644 index 00000000000..5d5d8644647 --- /dev/null +++ b/modules/nf-core/gnu/split/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: gnu_split +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - conda-forge::coreutils=9.3 diff --git a/modules/nf-core/gnu/split/main.nf b/modules/nf-core/gnu/split/main.nf new file mode 100644 index 00000000000..08a082c20c5 --- /dev/null +++ b/modules/nf-core/gnu/split/main.nf @@ -0,0 +1,57 @@ +process GNU_SPLIT { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/coreutils:9.3': + 'biocontainers/coreutils:9.3' }" + + input: + tuple val(meta), path(input) + + output: + tuple val(meta), path( "*split*" ), emit: split + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = input.extension + if (suffix == 'gz') { + def next_suffix = file(input.baseName).getExtension() + """ + gunzip -c ${input} | split ${args} --additional-suffix=.${next_suffix} - ${prefix}.split. + gzip ${prefix}.split.* + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gnu: \$(split --version |& sed '1!d ; s/split (GNU coreutils) //') + END_VERSIONS + """ + } else { + """ + split ${args} --additional-suffix=.${suffix} ${input} ${prefix}.split. + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gnu: \$(split --version |& sed '1!d ; s/split (GNU coreutils) //') + END_VERSIONS + """ + } + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.split.000.csv ${prefix}.split.001.csv ${prefix}.split.002.csv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gnu: \$(split --version |& sed '1!d ; s/split (GNU coreutils) //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/gnu/split/meta.yml b/modules/nf-core/gnu/split/meta.yml new file mode 100644 index 00000000000..da705b8f595 --- /dev/null +++ b/modules/nf-core/gnu/split/meta.yml @@ -0,0 +1,44 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "gnu_split" +description: Split a file into consecutive or interleaved sections +keywords: + - gnu + - split + - coreutils + - generic +tools: + - "gnu": + description: "The GNU Core Utilities are the basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every operating system." + homepage: "https://www.gnu.org/software/coreutils/" + documentation: "https://www.gnu.org/software/coreutils/manual/html_node/index.html" + tool_dev_url: "https://git.savannah.gnu.org/cgit/coreutils.git" + doi: "10.5281/zenodo.581670" + licence: ["GPL"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - input: + type: file + description: Text file, possibly gzip file +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - split: + type: file + description: Split files + pattern: "*split*" + - versions: + type: file + description: The split files + +authors: + - "@k1sauce" +maintainers: + - "@k1sauce" diff --git a/modules/nf-core/gnu/split/tests/main.nf.test b/modules/nf-core/gnu/split/tests/main.nf.test new file mode 100644 index 00000000000..03818475a3c --- /dev/null +++ b/modules/nf-core/gnu/split/tests/main.nf.test @@ -0,0 +1,102 @@ +nextflow_process { + + name "Test Process GNU_SPLIT" + script "../main.nf" + process "GNU_SPLIT" + + tag "modules" + tag "modules_nfcore" + tag "gnu" + tag "gnu/split" + + test("split_csv") { + config "./split_csv.config" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'generic/csv/test.csv', checkIfExists: true) + ]) + """ + } + } + then { + assertAll( + // check the process ran successfully + { assert process.success }, + // check meta + { assert snapshot(process.out.split[0][0]).match('split_csv_meta') }, + // check each of the resulting split files + { + process.out.split[0][1].eachWithIndex { split, i -> + assert snapshot(path(split)).match("split_csv_${i}") + } + }, + // check the version file matches + { assert snapshot(path(process.out.versions[0])).match('split_csv_version') } + ) + } + } + + test("split_fastq_gz"){ + config "./split_fastq_gz.config" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ]) + """ + } + } + then { + assertAll( + // check the process ran successfully + { assert process.success }, + // check meta + { assert snapshot(process.out.split[0][0]).match('split_fastq_gz_meta') }, + // check each of the resulting split files + { + process.out.split[0][1].eachWithIndex { split, i -> + assert snapshot(path(split)).match("split_fastq_gz_${i}") + } + }, + // check the version file matches + { assert snapshot(path(process.out.versions[0])).match('split_fastq_gz_version') } + ) + } + } + + test("split_fastq_gz_stub") { + options "-stub" + config "./split_fastq_gz.config" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ]) + """ + } + } + then { + assertAll( + // check the process ran successfully + { assert process.success }, + // check meta + { assert snapshot(process.out.split[0][0]).match('split_stub_meta') }, + // check each of the resulting split files + { + process.out.split[0][1].eachWithIndex { split, i -> + assert snapshot(path(split)).match("split_stub_${i}") + } + }, + // check the version file matches + { assert snapshot(path(process.out.versions[0])).match('split_stub_version') } + ) + } + } +} diff --git a/modules/nf-core/gnu/split/tests/main.nf.test.snap b/modules/nf-core/gnu/split/tests/main.nf.test.snap new file mode 100644 index 00000000000..c17bb6fbade --- /dev/null +++ b/modules/nf-core/gnu/split/tests/main.nf.test.snap @@ -0,0 +1,271 @@ +{ + "split_fastq_gz_8": { + "content": [ + "test.split.008.fastq.gz:md5,a56e07bcea892a0a5ef7446db2273e7e" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:41.518258" + }, + "split_fastq_gz_7": { + "content": [ + "test.split.007.fastq.gz:md5,51e3ccdf945197b409a5324769d8a2d5" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:40.700003" + }, + "split_fastq_gz_6": { + "content": [ + "test.split.006.fastq.gz:md5,bc856f9bc6eef9c51928ccef912f033c" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:39.977614" + }, + "split_fastq_gz_5": { + "content": [ + "test.split.005.fastq.gz:md5,77b7fee4bf49a2e9b7231a8288fe6607" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:39.348281" + }, + "split_fastq_gz_9": { + "content": [ + "test.split.009.fastq.gz:md5,29af101d496e7d6c360f2554efbfd150" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:42.502571" + }, + "split_csv_version": { + "content": [ + "versions.yml:md5,c38fd07d59dbe00739b38d5a7582518b" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.594709" + }, + "split_fastq_gz_0": { + "content": [ + "test.split.000.fastq.gz:md5,ae3f2792135f632c883e1063865cc6e1" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:37.235934" + }, + "split_csv_meta": { + "content": [ + { + "id": "test", + "single_end": false + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.564536" + }, + "split_fastq_gz_4": { + "content": [ + "test.split.004.fastq.gz:md5,341fd32524f35560ae3b99cb7709eeed" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:38.816164" + }, + "split_fastq_gz_3": { + "content": [ + "test.split.003.fastq.gz:md5,97c96008969f7718b76a478b8fdcf5a0" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:38.33402" + }, + "split_fastq_gz_2": { + "content": [ + "test.split.002.fastq.gz:md5,4b26d36235f51d4bd6b5f10f65f4facb" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:37.887604" + }, + "split_fastq_gz_1": { + "content": [ + "test.split.001.fastq.gz:md5,def480ce4000b0d28d729653e956da62" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:37.432759" + }, + "split_fastq_gz_10": { + "content": [ + "test.split.010.fastq.gz:md5,61b0888491b9e6cabd9bb8d423a388d0" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:43.500829" + }, + "split_stub_2": { + "content": [ + "test.split.002.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:55.041783" + }, + "split_stub_1": { + "content": [ + "test.split.001.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:53.988045" + }, + "split_stub_0": { + "content": [ + "test.split.000.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:52.906152" + }, + "split_stub_meta": { + "content": [ + { + "id": "test", + "single_end": false + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:51.809832" + }, + "split_fastq_gz_meta": { + "content": [ + { + "id": "test", + "single_end": false + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:37.217561" + }, + "split_csv_0": { + "content": [ + "test.split.000.csv:md5,4067e71d9fcfb3848d0fd9b25bdd6fd8" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.572256" + }, + "split_csv_1": { + "content": [ + "test.split.001.csv:md5,4d23eb93a68421fd510eff2e3860ae9f" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.574633" + }, + "split_csv_2": { + "content": [ + "test.split.002.csv:md5,e568dae22ee9bd0a1f23f984303eb248" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.577085" + }, + "split_csv_3": { + "content": [ + "test.split.003.csv:md5,0d321878860c8922dca6655dec7162de" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.580798" + }, + "split_csv_4": { + "content": [ + "test.split.004.csv:md5,d8acff4e935ebe70b4117fcedcae8435" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.585006" + }, + "split_csv_5": { + "content": [ + "test.split.005.csv:md5,b22a57ab26e4ebe2603cc0ac41a6b4ad" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:13.589925" + }, + "split_fastq_gz_version": { + "content": [ + "versions.yml:md5,c38fd07d59dbe00739b38d5a7582518b" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:44.587886" + }, + "split_stub_version": { + "content": [ + "versions.yml:md5,c38fd07d59dbe00739b38d5a7582518b" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T17:03:56.077482" + } +} \ No newline at end of file diff --git a/modules/nf-core/gnu/split/tests/split_csv.config b/modules/nf-core/gnu/split/tests/split_csv.config new file mode 100644 index 00000000000..45ad00c5565 --- /dev/null +++ b/modules/nf-core/gnu/split/tests/split_csv.config @@ -0,0 +1,5 @@ +process { + withName: GNU_SPLIT { + ext.args = { "-l 1 -d -a 3" } + } +} \ No newline at end of file diff --git a/modules/nf-core/gnu/split/tests/split_fastq_gz.config b/modules/nf-core/gnu/split/tests/split_fastq_gz.config new file mode 100644 index 00000000000..44e496bbda3 --- /dev/null +++ b/modules/nf-core/gnu/split/tests/split_fastq_gz.config @@ -0,0 +1,5 @@ +process { + withName: GNU_SPLIT { + ext.args = { "-l 100000 -d -a 3" } + } +} \ No newline at end of file diff --git a/modules/nf-core/gnu/split/tests/tags.yml b/modules/nf-core/gnu/split/tests/tags.yml new file mode 100644 index 00000000000..51e11b8a21b --- /dev/null +++ b/modules/nf-core/gnu/split/tests/tags.yml @@ -0,0 +1,2 @@ +gnu/split: + - "modules/nf-core/gnu/split/**" From a84c33e77019e214d66c1f72f3b9546cc91de467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Myl=C3=A8ne=20Mariana=20Gonzales=20Andr=C3=A9?= <103585173+mari-ga@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:04:03 +0200 Subject: [PATCH 47/79] Add Demuxem (#5504) * Fix lint test * added input * inputs and outputs demuxem * updates demuxem, missing snap test * fixes * out new parameters testing * tests passed * lint test check * editorconfig fixes * more fixes editorconfig * fix editorconfig * line 24 whitespace * blank spaces * fix line 23 * test to fix trailing whitespace * fix line23 * fix main --- modules/nf-core/demuxem/environment.yml | 9 ++ modules/nf-core/demuxem/main.nf | 54 ++++++++++++ modules/nf-core/demuxem/meta.yml | 80 ++++++++++++++++++ modules/nf-core/demuxem/nextflow.config | 20 +++++ modules/nf-core/demuxem/tests/main.nf.test | 74 ++++++++++++++++ .../nf-core/demuxem/tests/main.nf.test.snap | 84 +++++++++++++++++++ modules/nf-core/demuxem/tests/nextflow.config | 20 +++++ modules/nf-core/demuxem/tests/tags.yml | 2 + tests/config/test_data.config | 3 + 9 files changed, 346 insertions(+) create mode 100644 modules/nf-core/demuxem/environment.yml create mode 100644 modules/nf-core/demuxem/main.nf create mode 100644 modules/nf-core/demuxem/meta.yml create mode 100644 modules/nf-core/demuxem/nextflow.config create mode 100644 modules/nf-core/demuxem/tests/main.nf.test create mode 100644 modules/nf-core/demuxem/tests/main.nf.test.snap create mode 100644 modules/nf-core/demuxem/tests/nextflow.config create mode 100644 modules/nf-core/demuxem/tests/tags.yml diff --git a/modules/nf-core/demuxem/environment.yml b/modules/nf-core/demuxem/environment.yml new file mode 100644 index 00000000000..1b56f172a7b --- /dev/null +++ b/modules/nf-core/demuxem/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "demuxem" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::demuxem=0.1.7.post1" diff --git a/modules/nf-core/demuxem/main.nf b/modules/nf-core/demuxem/main.nf new file mode 100644 index 00000000000..7c850ac0248 --- /dev/null +++ b/modules/nf-core/demuxem/main.nf @@ -0,0 +1,54 @@ +process DEMUXEM { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/demuxem:0.1.7.post1--pyhdfd78af_0' : + 'biocontainers/demuxem:0.1.7.post1--pyhdfd78af_0' }" + input: + tuple val(meta), path(input_raw_gene_bc_matrices_h5), path(input_hto_csv_file) + val output_name + val generate_gender_plot + val genome + val generate_diagnostic_plots + output: + tuple val(meta), path("*_demux.zarr.zip"), emit: zarr + tuple val(meta), path("*.out.demuxEM.zarr.zip"), emit: out_zarr + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def generateGenderPlot = generate_gender_plot ? "--generate-gender-plot $generate_gender_plot" : "" + def genome_file = genome ? "--genome $genome" : "" + def diagnostic_plots = generate_diagnostic_plots ? "--generate-diagnostic-plots $generate_diagnostic_plots" : "" + """ + demuxEM $input_raw_gene_bc_matrices_h5 \\ + $input_hto_csv_file $output_name \\ + $args \\ + $generateGenderPlot\\ + $genome_file\\ + $diagnostic_plots + cat <<-END_VERSIONS > versions.yml + "${task.process}":g + echo \$(demuxEM --version 2>&1) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.out.demuxEM.zarr.zip + touch ${prefix}_demux.zarr.zip + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + echo \$(demuxEM --version 2>&1) + END_VERSIONS + """ + +} diff --git a/modules/nf-core/demuxem/meta.yml b/modules/nf-core/demuxem/meta.yml new file mode 100644 index 00000000000..0aa94d1de60 --- /dev/null +++ b/modules/nf-core/demuxem/meta.yml @@ -0,0 +1,80 @@ +name: "demuxem" +description: Demultiplexing cell nucleus hashing data, using the estimated antibody background probability. +keywords: + - demultiplexing + - hashing-based deconvoltion + - single-cell +tools: + - demuxem: + description: "DemuxEM is the demultiplexing module of Pegasus, which works on cell-hashing and nucleus-hashing genomics data." + homepage: "https://demuxEM.readthedocs.io" + documentation: "https://demuxEM.readthedocs.io" + tool_dev_url: "https://github.com/lilab-bcb/pegasus/tree/master" + doi: "10.1038/s41467-019-10756-2" + licence: ["BSD-3-clause"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input_raw_gene_bc_matrices_h5: + type: string + description: | + Path to file containing input raw RNA expression matrix in 10x hdf5 format + pattern: "*.{h5}" + - input_hto_csv_file: + type: string + description: | + Path to file containing input HTO (antibody tag) count matrix in CSV format. + pattern: "*.{csv}" + - output_name: + type: string + description: | + Output name. All outputs will use it as the prefix. + - generate_gender_plot: + type: string + description: | + Generate violin plots using gender-specific genes (e.g. Xist). It is a comma-separated list of gene names. + - genome: + type: string + description: | + Reference genome name. If not provided, the tools infers it from the expression matrix file + - generate_diagnostic_plots: + type: string + description: | + Generate diagnostic plots, including the background/signal between HTO counts, estimated background probabilities, HTO distributions. + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1' ] + - zarr: + type: file + description: | + RNA expression matrix with demultiplexed sample identities in Zarr format. + pattern: "*_demux.zarr.zip" + + - out_zarr: + type: file + description: | + DemuxEM-calculated results in Zarr format, containing two datasets, one for HTO and one for RNA. + pattern: "*.out.demuxEM.zarr.zip" + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@mari-ga" + - "@maxozo" + - "@wxicu" + - "@Zethson" +maintainers: + - "@mari-ga" + - "@maxozo" + - "@wxicu" + - "@Zethson" diff --git a/modules/nf-core/demuxem/nextflow.config b/modules/nf-core/demuxem/nextflow.config new file mode 100644 index 00000000000..e8465283f01 --- /dev/null +++ b/modules/nf-core/demuxem/nextflow.config @@ -0,0 +1,20 @@ +params { + // Optional parameters for Demuxem - Default values + threads = 1 + genome = null + alpha_on_samples = 0.0 + min_num_genes = 100 + min_num_umis = 100 + min_signal_hashtag = 10.0 + random_state = 0 + +} + + +process { + + withName: DEMUXEM { + ext.args = "--threads ${params.threads} --alpha-on-samples ${params.alpha_on_samples} --min-num-genes ${params.min_num_genes} --min-num-umis ${params.min_num_umis} --min-signal-hashtag ${params.min_signal_hashtag} --random-state ${params.random_state}" + } + +} diff --git a/modules/nf-core/demuxem/tests/main.nf.test b/modules/nf-core/demuxem/tests/main.nf.test new file mode 100644 index 00000000000..49b75f70a8c --- /dev/null +++ b/modules/nf-core/demuxem/tests/main.nf.test @@ -0,0 +1,74 @@ +// nf-core modules test demuxem +nextflow_process { + + name "Test Process DEMUXEM" + script "../main.nf" + process "DEMUXEM" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "demuxem" + + test("Standard_Multiome - h5 - csv") { + + when { + process { + """ + + input[0] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + "/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438-21-raw_feature_bc_matrix.h5",checkIfExists: true), + file(params.modules_testdata_base_path + "/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438_21_raw_HTO.csv",checkIfExists: true) + ] + input[1] = "results" + input[2] = "" + input[3] = "" + input[4] = "" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.zarr.get(0).get(1)).exists() }, + { assert path(process.out.out_zarr.get(0).get(1)).exists() }, + + ) + } + + } + + test("Standard_Multiome - h5 - csv - stub") { + + options "-stub" + + when { + process { + """ + + input[0] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + "/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438-21-raw_feature_bc_matrix.h5",checkIfExists: true), + file(params.modules_testdata_base_path + "/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438_21_raw_HTO.csv",checkIfExists: true) + ] + input[1] = "results" + input[2] = "" + input[3] = "" + input[4] = "True" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.zarr.get(0).get(1)).exists() }, + { assert path(process.out.out_zarr.get(0).get(1)).exists() }, + ) + } + + } + +} diff --git a/modules/nf-core/demuxem/tests/main.nf.test.snap b/modules/nf-core/demuxem/tests/main.nf.test.snap new file mode 100644 index 00000000000..55b5b72b86b --- /dev/null +++ b/modules/nf-core/demuxem/tests/main.nf.test.snap @@ -0,0 +1,84 @@ +{ + "Standard_Multiome - h5 - csv - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "out_zarr": [ + + ], + "versions": [ + + ], + "zarr": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T11:53:38.668726" + }, + "versions": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T11:35:55.502389" + }, + "Standard_Multiome - h5 - csv": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "out_zarr": [ + + ], + "versions": [ + + ], + "zarr": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T11:35:55.532153" + }, + "stub-versions": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T11:53:38.65021" + } +} \ No newline at end of file diff --git a/modules/nf-core/demuxem/tests/nextflow.config b/modules/nf-core/demuxem/tests/nextflow.config new file mode 100644 index 00000000000..e8465283f01 --- /dev/null +++ b/modules/nf-core/demuxem/tests/nextflow.config @@ -0,0 +1,20 @@ +params { + // Optional parameters for Demuxem - Default values + threads = 1 + genome = null + alpha_on_samples = 0.0 + min_num_genes = 100 + min_num_umis = 100 + min_signal_hashtag = 10.0 + random_state = 0 + +} + + +process { + + withName: DEMUXEM { + ext.args = "--threads ${params.threads} --alpha-on-samples ${params.alpha_on_samples} --min-num-genes ${params.min_num_genes} --min-num-umis ${params.min_num_umis} --min-signal-hashtag ${params.min_signal_hashtag} --random-state ${params.random_state}" + } + +} diff --git a/modules/nf-core/demuxem/tests/tags.yml b/modules/nf-core/demuxem/tests/tags.yml new file mode 100644 index 00000000000..c1227320bd7 --- /dev/null +++ b/modules/nf-core/demuxem/tests/tags.yml @@ -0,0 +1,2 @@ +demuxem: + - "modules/nf-core/demuxem/**" diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 5edfe4029cb..9dd2bc559ea 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -226,6 +226,9 @@ params { test_scATAC_2_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger-atac/test_scATAC_S1_L001_R2_001.fastq.gz" test_scATAC_3_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger-atac/test_scATAC_S1_L001_R3_001.fastq.gz" test_scATAC_I_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger-atac/test_scATAC_S1_L001_I1_001.fastq.gz" + + test_10x_matrix_rna_raw_h5 = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438-21-raw_feature_bc_matrix.h5" + test_10x_matrix_hto_csv = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438_21_raw_HTO.csv" } spaceranger { test_10x_ffpe_cytassist_fastq_1_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/spaceranger/human-brain-cancer-11-mm-capture-area-ffpe-2-standard_v2_ffpe_cytassist/CytAssist_11mm_FFPE_Human_Glioblastoma_2_S1_L001_R1_001.fastq.gz" From d50427d9faf7a852a7d26e2ff50a3bb901fbddbd Mon Sep 17 00:00:00 2001 From: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:49:01 +0000 Subject: [PATCH 48/79] Fix AMRFinderPlus (#5521) Fix folder renaming --- modules/nf-core/amrfinderplus/run/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/amrfinderplus/run/main.nf b/modules/nf-core/amrfinderplus/run/main.nf index 937a85fd920..046ba262536 100644 --- a/modules/nf-core/amrfinderplus/run/main.nf +++ b/modules/nf-core/amrfinderplus/run/main.nf @@ -43,7 +43,7 @@ process AMRFINDERPLUS_RUN { mkdir amrfinderdb tar xzvf $db -C amrfinderdb else - cp $db amrfinderdb + mv $db amrfinderdb fi amrfinder \\ From 951a2dd192657503b90aebe6a93d18dbd8b921c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=ADa=20Pe=C3=B1a-P=C3=A9rez?= Date: Wed, 24 Apr 2024 16:18:32 +0200 Subject: [PATCH 49/79] fix stubs salmon (#5517) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix stubs * fix stub¨ * Update modules/nf-core/salmon/quant/main.nf --------- Co-authored-by: Lucpen Co-authored-by: Annick Renevey <47788523+rannick@users.noreply.github.com> --- .../nf-core/salmon/index/tests/main.nf.test | 24 ++++ .../salmon/index/tests/main.nf.test.snap | 12 ++ modules/nf-core/salmon/quant/main.nf | 19 +-- .../nf-core/salmon/quant/tests/main.nf.test | 136 ++++++++++++++++++ .../salmon/quant/tests/main.nf.test.snap | 75 ++++++++++ 5 files changed, 248 insertions(+), 18 deletions(-) diff --git a/modules/nf-core/salmon/index/tests/main.nf.test b/modules/nf-core/salmon/index/tests/main.nf.test index 538b231b47a..16b3c1a7914 100644 --- a/modules/nf-core/salmon/index/tests/main.nf.test +++ b/modules/nf-core/salmon/index/tests/main.nf.test @@ -32,4 +32,28 @@ nextflow_process { } + test("sarscov2 stub") { + options "-stub" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true)]) + input[1] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/transcriptome.fasta", checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.index.get(0)).exists() }, + { assert snapshot(process.out.versions).match("versions stub") } + ) + } + + } + } \ No newline at end of file diff --git a/modules/nf-core/salmon/index/tests/main.nf.test.snap b/modules/nf-core/salmon/index/tests/main.nf.test.snap index 94edf39034f..703e455c574 100644 --- a/modules/nf-core/salmon/index/tests/main.nf.test.snap +++ b/modules/nf-core/salmon/index/tests/main.nf.test.snap @@ -10,5 +10,17 @@ "nextflow": "23.10.1" }, "timestamp": "2023-11-22T14:26:33.32036" + }, + "versions stub": { + "content": [ + [ + "versions.yml:md5,563eeafb4577be0b13801d7021c0bf42" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T09:47:58.828124" } } \ No newline at end of file diff --git a/modules/nf-core/salmon/quant/main.nf b/modules/nf-core/salmon/quant/main.nf index c3f16f6cb1d..e177b42acf7 100644 --- a/modules/nf-core/salmon/quant/main.nf +++ b/modules/nf-core/salmon/quant/main.nf @@ -78,26 +78,9 @@ process SALMON_QUANT { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" """ mkdir ${prefix} - mkdir ${prefix}/aux_info - touch ${prefix}/aux_info/ambig_info.tsv - touch ${prefix}/aux_info/expected_bias.gz - touch ${prefix}/aux_info/exp_gc.gz - touch ${prefix}/aux_info/fld.gz - touch ${prefix}/aux_info/meta_info.json - touch ${prefix}/aux_info/observed_bias_3p.gz - touch ${prefix}/aux_info/observed_bias.gz - touch ${prefix}/aux_info/obs_gc.gz - touch ${prefix}/cmd_info.json - touch ${prefix}/lib_format_counts.json - mkdir ${prefix}/libParams - touch ${prefix}/libParams/flenDist.txt - mkdir ${prefix}/logs - touch ${prefix}/logs/salmon_quant.log - mkdir ${prefix}/quant.genes.sf - mkdir ${prefix}/quant.sf touch ${prefix}_meta_info.json cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/salmon/quant/tests/main.nf.test b/modules/nf-core/salmon/quant/tests/main.nf.test index 04e61e2b3c0..b387fac2a13 100644 --- a/modules/nf-core/salmon/quant/tests/main.nf.test +++ b/modules/nf-core/salmon/quant/tests/main.nf.test @@ -54,6 +54,38 @@ nextflow_process { } + test("sarscov2 - single_end stub") { + options "-stub" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end: true ], // meta map + [ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ] + ]) + input[1] = SALMON_INDEX.out.index + input[2] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true)]) + input[3] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/transcriptome.fasta", checkIfExists: true)]) + input[4] = false + input[5] = '' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.json_info.get(0).get(1)).exists() }, + { assert path(process.out.results.get(0).get(1)).exists() }, + { assert snapshot(process.out.versions).match("versions_single_end_stub") } + ) + } + + } + test("sarscov2 - single_end lib type A") { when { @@ -86,6 +118,38 @@ nextflow_process { } + test("sarscov2 - single_end lib type A stub") { + options "-stub" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end: true ], // meta map + [ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ] + ]) + input[1] = SALMON_INDEX.out.index + input[2] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true)]) + input[3] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/transcriptome.fasta", checkIfExists: true)]) + input[4] = false + input[5] = 'A' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.json_info.get(0).get(1)).exists() }, + { assert path(process.out.results.get(0).get(1)).exists() }, + { assert snapshot(process.out.versions).match("versions_single_end_lib_type_a_stub") } + ) + } + + } + test("sarscov2 - pair_end") { when { @@ -121,6 +185,41 @@ nextflow_process { } + test("sarscov2 - pair_end stub") { + options "-stub" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end: true ], // meta map + [ + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true) + ] + ]) + input[1] = SALMON_INDEX.out.index + input[2] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true)]) + input[3] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/transcriptome.fasta", checkIfExists: true)]) + input[4] = false + input[5] = '' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.json_info.get(0).get(1)).exists() }, + { assert path(process.out.results.get(0).get(1)).exists() }, + { assert snapshot(process.out.versions).match("versions_pair_end stub") } + ) + } + + } + test("sarscov2 - pair_end multiple") { when { @@ -157,4 +256,41 @@ nextflow_process { } } + + test("sarscov2 - pair_end multiple stub") { + options "-stub" + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test2_1.fastq.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test2_2.fastq.gz", checkIfExists: true) + ] + ]) + input[1] = SALMON_INDEX.out.index + input[2] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true)]) + input[3] = Channel.of([file(params.modules_testdata_base_path + "genomics/sarscov2/genome/transcriptome.fasta", checkIfExists: true)]) + input[4] = false + input[5] = '' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.json_info.get(0).get(1)).exists() }, + { assert path(process.out.results.get(0).get(1)).exists() }, + { assert snapshot(process.out.versions).match("versions_pair_end_multiple_stub") } + ) + } + + } } diff --git a/modules/nf-core/salmon/quant/tests/main.nf.test.snap b/modules/nf-core/salmon/quant/tests/main.nf.test.snap index a1ec792e0ad..a80bc8aa821 100644 --- a/modules/nf-core/salmon/quant/tests/main.nf.test.snap +++ b/modules/nf-core/salmon/quant/tests/main.nf.test.snap @@ -1,4 +1,43 @@ { + "versions_single_end_lib_type_a_stub": { + "content": [ + [ + "versions.yml:md5,80eb3d2ad36960c7e9263f81ede9d263" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-24T14:34:21.647863" + }, + "versions_pair_end_multiple_stub": { + "content": [ + [ + "versions.yml:md5,80eb3d2ad36960c7e9263f81ede9d263" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-24T14:34:48.03415" + }, + "sarscov2 - single_end stub": { + "content": [ + [ + + ], + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T09:34:16.444372" + }, "versions_single_end": { "content": [ [ @@ -23,6 +62,42 @@ }, "timestamp": "2024-02-06T17:10:56.121713" }, + "versions_pair_end_stub": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T08:38:01.276656" + }, + "versions_pair_end stub": { + "content": [ + [ + "versions.yml:md5,80eb3d2ad36960c7e9263f81ede9d263" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-24T14:34:36.570127" + }, + "versions_single_end_stub": { + "content": [ + [ + "versions.yml:md5,80eb3d2ad36960c7e9263f81ede9d263" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-24T14:28:01.864343" + }, "versions_single_end_lib_type_a": { "content": [ [ From ab707a29ea5d80ee6f229978c584355299e84638 Mon Sep 17 00:00:00 2001 From: Florian Wuennemann Date: Wed, 24 Apr 2024 12:28:50 -0400 Subject: [PATCH 50/79] Update mcquant: Added nf-test and meta.yml information (#5507) * Transition to nf-test and meta.yml info fix. * Added MIT license. * Removed conda environment.yml for mcquant. * Added conda exclusion for nf-test. * Changed to quay.io container. * Removed quay.io from container --- .github/workflows/test.yml | 2 + modules/nf-core/mcquant/environment.yml | 5 -- modules/nf-core/mcquant/main.nf | 2 +- modules/nf-core/mcquant/meta.yml | 4 +- modules/nf-core/mcquant/tests/main.nf.test | 76 +++++++++++++++++++ .../nf-core/mcquant/tests/main.nf.test.snap | 64 ++++++++++++++++ modules/nf-core/mcquant/tests/nextflow.config | 5 ++ modules/nf-core/mcquant/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/mcquant/main.nf | 25 ------ tests/modules/nf-core/mcquant/nextflow.config | 9 --- tests/modules/nf-core/mcquant/test.yml | 9 --- 12 files changed, 152 insertions(+), 54 deletions(-) delete mode 100644 modules/nf-core/mcquant/environment.yml create mode 100644 modules/nf-core/mcquant/tests/main.nf.test create mode 100644 modules/nf-core/mcquant/tests/main.nf.test.snap create mode 100644 modules/nf-core/mcquant/tests/nextflow.config create mode 100644 modules/nf-core/mcquant/tests/tags.yml delete mode 100644 tests/modules/nf-core/mcquant/main.nf delete mode 100644 tests/modules/nf-core/mcquant/nextflow.config delete mode 100644 tests/modules/nf-core/mcquant/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e3131bf817..2b218e3f91e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -599,6 +599,8 @@ jobs: path: modules/nf-core/ilastik/pixelclassification - profile: conda path: modules/nf-core/imputeme/vcftoprs + - profile: conda + path: modules/nf-core/mcquant - profile: conda path: modules/nf-core/merquryfk/katcomp - profile: conda diff --git a/modules/nf-core/mcquant/environment.yml b/modules/nf-core/mcquant/environment.yml deleted file mode 100644 index 5ee62892c6b..00000000000 --- a/modules/nf-core/mcquant/environment.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: mcquant -channels: - - conda-forge - - bioconda - - defaults diff --git a/modules/nf-core/mcquant/main.nf b/modules/nf-core/mcquant/main.nf index bc0eedf6b51..a995540f85d 100644 --- a/modules/nf-core/mcquant/main.nf +++ b/modules/nf-core/mcquant/main.nf @@ -3,7 +3,7 @@ process MCQUANT { label 'process_single' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container "docker.io/labsyspharm/quantification:1.5.4" + container "nf-core/quantification:1.5.4" input: tuple val(meta), path(image) diff --git a/modules/nf-core/mcquant/meta.yml b/modules/nf-core/mcquant/meta.yml index 44623f925cd..1423074bddb 100644 --- a/modules/nf-core/mcquant/meta.yml +++ b/modules/nf-core/mcquant/meta.yml @@ -1,5 +1,5 @@ name: "mcquant" -description: write your description here +description: Mcquant extracts single-cell data given a multi-channel image and a segmentation mask. keywords: - quantification - image_analysis @@ -12,7 +12,7 @@ tools: documentation: "https://github.com/labsyspharm/quantification/blob/master/README.md" tool_dev_url: "https://github.com/labsyspharm/quantification" doi: 10.1038/s41592-021-01308-y - licence: "" + licence: ["MIT"] input: - meta: type: map diff --git a/modules/nf-core/mcquant/tests/main.nf.test b/modules/nf-core/mcquant/tests/main.nf.test new file mode 100644 index 00000000000..6ac5ea23dd3 --- /dev/null +++ b/modules/nf-core/mcquant/tests/main.nf.test @@ -0,0 +1,76 @@ +nextflow_process { + + name "Test Process MCQUANT" + script "../main.nf" + process "MCQUANT" + + tag "modules" + tag "modules_nfcore" + tag "mcquant" + + test("imaging - image,mask,marker") { + + when { + process { + """ + input[0] = [ + [ id:'image' ], // meta map + file(params.test_data['imaging']['quantification']['image'], checkIfExists: true) + ] + input[1] = [ + [ id:'mask' ], // meta map + file(params.test_data['imaging']['quantification']['mask'], checkIfExists: true) + ] + + input[2] = [ + [ id:'marker' ], // meta map + file(params.test_data['imaging']['quantification']['markers'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.csv).match("csv") }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } + + test("imaging - image,mask,marker - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'image' ], // meta map + file(params.test_data['imaging']['quantification']['image'], checkIfExists: true) + ] + input[1] = [ + [ id:'mask' ], // meta map + file(params.test_data['imaging']['quantification']['mask'], checkIfExists: true) + ] + + input[2] = [ + [ id:'marker' ], // meta map + file(params.test_data['imaging']['quantification']['markers'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/mcquant/tests/main.nf.test.snap b/modules/nf-core/mcquant/tests/main.nf.test.snap new file mode 100644 index 00000000000..5889fedebc4 --- /dev/null +++ b/modules/nf-core/mcquant/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,e27b6a87e2ea34d5ebaaf7f3e1200805" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T20:05:03.083136949" + }, + "imaging - image,mask,marker - stub": { + "content": [ + { + "0": [ + [ + { + "id": "image" + }, + "image.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,e27b6a87e2ea34d5ebaaf7f3e1200805" + ], + "csv": [ + [ + { + "id": "image" + }, + "image.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e27b6a87e2ea34d5ebaaf7f3e1200805" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T20:11:53.400762546" + }, + "csv": { + "content": [ + [ + [ + { + "id": "image" + }, + "cycif_tonsil_registered_cell.csv:md5,f5d41f3cc64a573cf45682bda6ffe0d9" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T20:05:03.06867638" + } +} \ No newline at end of file diff --git a/modules/nf-core/mcquant/tests/nextflow.config b/modules/nf-core/mcquant/tests/nextflow.config new file mode 100644 index 00000000000..99551b1bc3c --- /dev/null +++ b/modules/nf-core/mcquant/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: "MCQUANT" { + ext.args = '--intensity_props intensity_sum' + } +} diff --git a/modules/nf-core/mcquant/tests/tags.yml b/modules/nf-core/mcquant/tests/tags.yml new file mode 100644 index 00000000000..f1721645198 --- /dev/null +++ b/modules/nf-core/mcquant/tests/tags.yml @@ -0,0 +1,2 @@ +mcquant: + - "modules/nf-core/mcquant/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index c1038eac90c..2ccbc93ab04 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1147,9 +1147,6 @@ maxbin2: maxquant/lfq: - modules/nf-core/maxquant/lfq/** - tests/modules/nf-core/maxquant/lfq/** -mcquant: - - modules/nf-core/mcquant/** - - tests/modules/nf-core/mcquant/** mcroni: - modules/nf-core/mcroni/** - tests/modules/nf-core/mcroni/** diff --git a/tests/modules/nf-core/mcquant/main.nf b/tests/modules/nf-core/mcquant/main.nf deleted file mode 100644 index 8bcf55ebc8b..00000000000 --- a/tests/modules/nf-core/mcquant/main.nf +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MCQUANT } from '../../../../modules/nf-core/mcquant/main.nf' - -workflow test_mcquant { - - image = [ - [ id:'image' ], // meta map - file(params.test_data['imaging']['quantification']['image'], checkIfExists: true) - ] - - mask = [ - [ id:'mask' ], // meta map - file(params.test_data['imaging']['quantification']['mask'], checkIfExists: true) - ] - - markerfile = [ - [ id:'marker' ], // meta map - file(params.test_data['imaging']['quantification']['markers'], checkIfExists: true) - ] - - MCQUANT ( image, mask, markerfile ) -} diff --git a/tests/modules/nf-core/mcquant/nextflow.config b/tests/modules/nf-core/mcquant/nextflow.config deleted file mode 100644 index fab862c47f1..00000000000 --- a/tests/modules/nf-core/mcquant/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: "MCQUANT" { - ext.args = '--intensity_props intensity_sum' - } - -} diff --git a/tests/modules/nf-core/mcquant/test.yml b/tests/modules/nf-core/mcquant/test.yml deleted file mode 100644 index 243a986f042..00000000000 --- a/tests/modules/nf-core/mcquant/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: mcquant test_mcquant - command: nextflow run ./tests/modules/nf-core/mcquant -entry test_mcquant -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/mcquant/nextflow.config - tags: - - mcquant - files: - - path: output/mcquant/cycif_tonsil_registered_cell.csv - contains: - - "CellID" - - path: output/mcquant/versions.yml From 0b10545ab41e0f77ca11e47bf2e112d89aa87f56 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Thu, 25 Apr 2024 19:23:51 +1200 Subject: [PATCH 51/79] Added repeatmodeler/builddatabase (#5416) * Added repeatmodeler/builddatabase * Fixed version extraction * Now doing md5 check on stable db files --- .../builddatabase/environment.yml | 9 ++ .../repeatmodeler/builddatabase/main.nf | 50 ++++++++++ .../repeatmodeler/builddatabase/meta.yml | 44 +++++++++ .../builddatabase/tests/main.nf.test | 60 ++++++++++++ .../builddatabase/tests/main.nf.test.snap | 92 +++++++++++++++++++ .../builddatabase/tests/tags.yml | 2 + 6 files changed, 257 insertions(+) create mode 100644 modules/nf-core/repeatmodeler/builddatabase/environment.yml create mode 100644 modules/nf-core/repeatmodeler/builddatabase/main.nf create mode 100644 modules/nf-core/repeatmodeler/builddatabase/meta.yml create mode 100644 modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test create mode 100644 modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test.snap create mode 100644 modules/nf-core/repeatmodeler/builddatabase/tests/tags.yml diff --git a/modules/nf-core/repeatmodeler/builddatabase/environment.yml b/modules/nf-core/repeatmodeler/builddatabase/environment.yml new file mode 100644 index 00000000000..ecc282e6854 --- /dev/null +++ b/modules/nf-core/repeatmodeler/builddatabase/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "repeatmodeler_builddatabase" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::repeatmodeler=2.0.5" diff --git a/modules/nf-core/repeatmodeler/builddatabase/main.nf b/modules/nf-core/repeatmodeler/builddatabase/main.nf new file mode 100644 index 00000000000..6fe244b2448 --- /dev/null +++ b/modules/nf-core/repeatmodeler/builddatabase/main.nf @@ -0,0 +1,50 @@ +process REPEATMODELER_BUILDDATABASE { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/repeatmodeler:2.0.5--pl5321hdfd78af_0': + 'biocontainers/repeatmodeler:2.0.5--pl5321hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("${prefix}.*") , emit: db + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + prefix = task.ext.prefix ?: "${meta.id}" + """ + BuildDatabase \\ + -name $prefix \\ + $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + repeatmodeler: \$(RepeatModeler --version | sed 's/RepeatModeler version //') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.nhr + touch ${prefix}.nin + touch ${prefix}.njs + touch ${prefix}.nnd + touch ${prefix}.nni + touch ${prefix}.nog + touch ${prefix}.nsq + touch ${prefix}.translation + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + repeatmodeler: \$(RepeatModeler --version | sed 's/RepeatModeler version //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/repeatmodeler/builddatabase/meta.yml b/modules/nf-core/repeatmodeler/builddatabase/meta.yml new file mode 100644 index 00000000000..d3aa9310fb5 --- /dev/null +++ b/modules/nf-core/repeatmodeler/builddatabase/meta.yml @@ -0,0 +1,44 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "repeatmodeler_builddatabase" +description: Create a database for RepeatModeler +keywords: + - genomics + - fasta + - repeat +tools: + - "repeatmodeler": + description: "RepeatModeler is a de-novo repeat family identification and modeling package." + homepage: "https://github.com/Dfam-consortium/RepeatModeler" + documentation: "https://github.com/Dfam-consortium/RepeatModeler" + tool_dev_url: "https://github.com/Dfam-consortium/RepeatModeler" + licence: ["Open Software License v2.1"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: Fasta file + pattern: "*.{fasta,fsa,fa}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - db: + type: file + description: Database files for repeatmodeler + pattern: "`${prefix}.*`" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@GallVp" +maintainers: + - "@GallVp" diff --git a/modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test b/modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test new file mode 100644 index 00000000000..bfe5d78c2d7 --- /dev/null +++ b/modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process REPEATMODELER_BUILDDATABASE" + script "../main.nf" + process "REPEATMODELER_BUILDDATABASE" + + tag "modules" + tag "modules_nfcore" + tag "repeatmodeler" + tag "repeatmodeler/builddatabase" + + test("sarscov2-genome_fasta") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(process.out.db[0][1].collect { file(it).name }.sort().toString()).match("db") }, + { assert snapshot(process.out.db[0][1].findAll { ! ( "$it"[-3..-1] in [ 'nin', 'njs' ] ) } ).match("stable_md5") } + ) + } + + } + + test("sarscov2-genome_fasta-stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test.snap b/modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test.snap new file mode 100644 index 00000000000..1f1a5518717 --- /dev/null +++ b/modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test.snap @@ -0,0 +1,92 @@ +{ + "sarscov2-genome_fasta-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test.nhr:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nin:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.njs:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nnd:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nni:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nog:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nsq:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.translation:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,7944637266bc3e2726899eaad5e46c87" + ], + "db": [ + [ + { + "id": "test" + }, + [ + "test.nhr:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nin:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.njs:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nnd:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nni:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nog:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.nsq:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.translation:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,7944637266bc3e2726899eaad5e46c87" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-02T12:06:44.261566" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,7944637266bc3e2726899eaad5e46c87" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-09T15:14:48.807063" + }, + "stable_md5": { + "content": [ + [ + "test.nhr:md5,1a41cb6d0b00c28f62ad60e75ae2f6fc", + "test.nnd:md5,2002e13acf59079a1a5782c918894579", + "test.nni:md5,26a954ba0fd80983b550d8f6b8b35ff8", + "test.nog:md5,30896f123998e926ea2237b89091e7fe", + "test.nsq:md5,982cbc7d9e38743b9b1037588862b9da", + "test.translation:md5,ccbb119522c09daa976a9015ba999329" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-23T10:03:41.669433" + }, + "db": { + "content": [ + "[test.nhr, test.nin, test.njs, test.nnd, test.nni, test.nog, test.nsq, test.translation]" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-02T12:08:36.94713" + } +} \ No newline at end of file diff --git a/modules/nf-core/repeatmodeler/builddatabase/tests/tags.yml b/modules/nf-core/repeatmodeler/builddatabase/tests/tags.yml new file mode 100644 index 00000000000..c524294ce95 --- /dev/null +++ b/modules/nf-core/repeatmodeler/builddatabase/tests/tags.yml @@ -0,0 +1,2 @@ +repeatmodeler/builddatabase: + - "modules/nf-core/repeatmodeler/builddatabase/**" From 891aae43e1fa8531ab79277eae4bdaebf8f61bfd Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke <101190534+nvnieuwk@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:56:06 +0200 Subject: [PATCH 52/79] bump wisecondorx to v1.2.7 (#5523) --- modules/nf-core/wisecondorx/convert/main.nf | 8 ++++---- .../convert/tests/main.nf.test.snap | 18 +++++++++--------- modules/nf-core/wisecondorx/gender/main.nf | 8 ++++---- .../wisecondorx/gender/tests/main.nf.test.snap | 6 +++--- modules/nf-core/wisecondorx/newref/main.nf | 8 ++++---- .../wisecondorx/newref/tests/main.nf.test.snap | 4 ++-- modules/nf-core/wisecondorx/predict/main.nf | 8 ++++---- .../predict/tests/main.nf.test.snap | 4 ++-- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/nf-core/wisecondorx/convert/main.nf b/modules/nf-core/wisecondorx/convert/main.nf index 9c40b64b4ac..e284edb0c79 100644 --- a/modules/nf-core/wisecondorx/convert/main.nf +++ b/modules/nf-core/wisecondorx/convert/main.nf @@ -5,8 +5,8 @@ process WISECONDORX_CONVERT { // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.6--pyhdfd78af_0': - 'biocontainers/wisecondorx:1.2.6--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.7--pyhdfd78af_0': + 'biocontainers/wisecondorx:1.2.7--pyhdfd78af_0' }" input: tuple val(meta), path(bam), path(bai) @@ -24,7 +24,7 @@ process WISECONDORX_CONVERT { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--reference ${fasta}" : "" - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ WisecondorX convert \\ @@ -41,7 +41,7 @@ process WISECONDORX_CONVERT { stub: def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.npz diff --git a/modules/nf-core/wisecondorx/convert/tests/main.nf.test.snap b/modules/nf-core/wisecondorx/convert/tests/main.nf.test.snap index cf920063674..aa1f22c231c 100644 --- a/modules/nf-core/wisecondorx/convert/tests/main.nf.test.snap +++ b/modules/nf-core/wisecondorx/convert/tests/main.nf.test.snap @@ -12,7 +12,7 @@ ] ], "1": [ - "versions.yml:md5,867fac789f15d6e2484e372df42dc1fa" + "versions.yml:md5,dc34a4dc3f7c98e236b54d2b58c81e92" ], "npz": [ [ @@ -24,7 +24,7 @@ ] ], "versions": [ - "versions.yml:md5,867fac789f15d6e2484e372df42dc1fa" + "versions.yml:md5,dc34a4dc3f7c98e236b54d2b58c81e92" ] } ], @@ -32,7 +32,7 @@ "nf-test": "0.8.4", "nextflow": "24.02.0" }, - "timestamp": "2024-04-19T15:44:04.304677987" + "timestamp": "2024-04-25T10:32:21.089786336" }, "sarscov2 - bam, bai, [], []": { "content": [ @@ -47,7 +47,7 @@ ] ], "1": [ - "versions.yml:md5,867fac789f15d6e2484e372df42dc1fa" + "versions.yml:md5,dc34a4dc3f7c98e236b54d2b58c81e92" ], "npz": [ [ @@ -59,7 +59,7 @@ ] ], "versions": [ - "versions.yml:md5,867fac789f15d6e2484e372df42dc1fa" + "versions.yml:md5,dc34a4dc3f7c98e236b54d2b58c81e92" ] } ], @@ -67,7 +67,7 @@ "nf-test": "0.8.4", "nextflow": "24.02.0" }, - "timestamp": "2024-04-19T15:43:48.33030357" + "timestamp": "2024-04-25T10:32:11.059476585" }, "sarscov2 - bam, bai - stub": { "content": [ @@ -82,7 +82,7 @@ ] ], "1": [ - "versions.yml:md5,867fac789f15d6e2484e372df42dc1fa" + "versions.yml:md5,dc34a4dc3f7c98e236b54d2b58c81e92" ], "npz": [ [ @@ -94,7 +94,7 @@ ] ], "versions": [ - "versions.yml:md5,867fac789f15d6e2484e372df42dc1fa" + "versions.yml:md5,dc34a4dc3f7c98e236b54d2b58c81e92" ] } ], @@ -102,6 +102,6 @@ "nf-test": "0.8.4", "nextflow": "24.02.0" }, - "timestamp": "2024-04-19T15:44:10.372144798" + "timestamp": "2024-04-25T10:32:28.177177149" } } \ No newline at end of file diff --git a/modules/nf-core/wisecondorx/gender/main.nf b/modules/nf-core/wisecondorx/gender/main.nf index 3af8a967330..f688d7fadc6 100644 --- a/modules/nf-core/wisecondorx/gender/main.nf +++ b/modules/nf-core/wisecondorx/gender/main.nf @@ -5,8 +5,8 @@ process WISECONDORX_GENDER { // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.6--pyhdfd78af_0': - 'biocontainers/wisecondorx:1.2.6--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.7--pyhdfd78af_0': + 'biocontainers/wisecondorx:1.2.7--pyhdfd78af_0' }" input: tuple val(meta), path(npz) @@ -20,7 +20,7 @@ process WISECONDORX_GENDER { task.ext.when == null || task.ext.when script: - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ WisecondorX gender \\ @@ -34,7 +34,7 @@ process WISECONDORX_GENDER { """ stub: - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ echo male diff --git a/modules/nf-core/wisecondorx/gender/tests/main.nf.test.snap b/modules/nf-core/wisecondorx/gender/tests/main.nf.test.snap index d622fe2c9a1..bcc1cf61642 100644 --- a/modules/nf-core/wisecondorx/gender/tests/main.nf.test.snap +++ b/modules/nf-core/wisecondorx/gender/tests/main.nf.test.snap @@ -12,7 +12,7 @@ ] ], "1": [ - "versions.yml:md5,0c391140d8b20d0447ada5c507ab86cf" + "versions.yml:md5,b921e6c6f859cb7184845daf4b361f9f" ], "gender": [ [ @@ -24,7 +24,7 @@ ] ], "versions": [ - "versions.yml:md5,0c391140d8b20d0447ada5c507ab86cf" + "versions.yml:md5,b921e6c6f859cb7184845daf4b361f9f" ] } ], @@ -32,6 +32,6 @@ "nf-test": "0.8.4", "nextflow": "24.02.0" }, - "timestamp": "2024-04-19T15:44:22.430941739" + "timestamp": "2024-04-25T10:32:36.237487072" } } \ No newline at end of file diff --git a/modules/nf-core/wisecondorx/newref/main.nf b/modules/nf-core/wisecondorx/newref/main.nf index f28b43c7ab5..e1c79055a04 100644 --- a/modules/nf-core/wisecondorx/newref/main.nf +++ b/modules/nf-core/wisecondorx/newref/main.nf @@ -5,8 +5,8 @@ process WISECONDORX_NEWREF { // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.6--pyhdfd78af_0': - 'biocontainers/wisecondorx:1.2.6--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.7--pyhdfd78af_0': + 'biocontainers/wisecondorx:1.2.7--pyhdfd78af_0' }" input: tuple val(meta), path(inputs) @@ -21,7 +21,7 @@ process WISECONDORX_NEWREF { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. inputs.each { if("${it}" == "${prefix}.npz") error "${it} has the same name as the output file, set prefix in module configuration to disambiguate!"} @@ -41,7 +41,7 @@ process WISECONDORX_NEWREF { stub: def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. inputs.each { if("${it}" == "${prefix}.npz") error "${it} has the same name as the output file, set prefix in module configuration to disambiguate!"} diff --git a/modules/nf-core/wisecondorx/newref/tests/main.nf.test.snap b/modules/nf-core/wisecondorx/newref/tests/main.nf.test.snap index 1d2110f0e4f..1182e6899a5 100644 --- a/modules/nf-core/wisecondorx/newref/tests/main.nf.test.snap +++ b/modules/nf-core/wisecondorx/newref/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "homo_sapiens - [npz]": { "content": [ [ - "versions.yml:md5,187e7748e6ae48d77e1e43b428de5f32" + "versions.yml:md5,076bd8869bb3e00ee1995ad7eb60f2ba" ], [ [ @@ -17,6 +17,6 @@ "nf-test": "0.8.4", "nextflow": "24.02.0" }, - "timestamp": "2024-04-19T15:43:40.252060275" + "timestamp": "2024-04-25T10:32:01.585153049" } } \ No newline at end of file diff --git a/modules/nf-core/wisecondorx/predict/main.nf b/modules/nf-core/wisecondorx/predict/main.nf index 585d1eea774..1cba5900943 100644 --- a/modules/nf-core/wisecondorx/predict/main.nf +++ b/modules/nf-core/wisecondorx/predict/main.nf @@ -5,8 +5,8 @@ process WISECONDORX_PREDICT { // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.6--pyhdfd78af_0': - 'biocontainers/wisecondorx:1.2.6--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.7--pyhdfd78af_0': + 'biocontainers/wisecondorx:1.2.7--pyhdfd78af_0' }" input: tuple val(meta), path(npz) @@ -32,7 +32,7 @@ process WISECONDORX_PREDICT { def plots = args.contains("--plot") ? "mv ${prefix}.plots/* ." : "" - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ WisecondorX predict \\ @@ -53,7 +53,7 @@ process WISECONDORX_PREDICT { stub: def args = task.ext.args ?: '--bed --plot' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '1.2.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.2.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. def bed = args.contains("--bed") ? "touch ${prefix}_aberrations.bed && touch ${prefix}_bins.bed && touch ${prefix}_chr_statistics.txt && touch ${prefix}_segments.bed" : "" def plot = args.contains("--plot") ? "touch genome_wide.png && touch chr22.png && touch chr1.png" : "" diff --git a/modules/nf-core/wisecondorx/predict/tests/main.nf.test.snap b/modules/nf-core/wisecondorx/predict/tests/main.nf.test.snap index b46ace40bb0..59e9a214618 100644 --- a/modules/nf-core/wisecondorx/predict/tests/main.nf.test.snap +++ b/modules/nf-core/wisecondorx/predict/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "sarscov2 - npz, reference, []": { "content": [ [ - "versions.yml:md5,e51bd81606241794d14e3da4c1b93ebe" + "versions.yml:md5,7760ef13f826776ae67780d937c82729" ], [ [ @@ -60,6 +60,6 @@ "nf-test": "0.8.4", "nextflow": "24.02.0" }, - "timestamp": "2024-04-19T15:43:32.282429683" + "timestamp": "2024-04-25T10:31:51.830934617" } } \ No newline at end of file From 1f8a032e5a08d5ed3f6c9d93964863403c95f93c Mon Sep 17 00:00:00 2001 From: Xichen Wu <102925032+wxicu@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:22:56 +0200 Subject: [PATCH 53/79] Add Freemuxlet to modules (#5520) * add freemuxlet * add snapshot * pass container test * remove trailing whitespace * add optional output files creation * remove ldist * fix test * add snapshot --------- Co-authored-by: Xichen Wu Co-authored-by: wxicu --- .../popscle/freemuxlet/environment.yml | 9 + modules/nf-core/popscle/freemuxlet/main.nf | 61 ++++++ modules/nf-core/popscle/freemuxlet/meta.yml | 73 +++++++ .../popscle/freemuxlet/tests/main.nf.test | 183 ++++++++++++++++++ .../freemuxlet/tests/main.nf.test.snap | 50 +++++ .../popscle/freemuxlet/tests/nextflow.config | 5 + .../nf-core/popscle/freemuxlet/tests/tags.yml | 2 + 7 files changed, 383 insertions(+) create mode 100644 modules/nf-core/popscle/freemuxlet/environment.yml create mode 100644 modules/nf-core/popscle/freemuxlet/main.nf create mode 100644 modules/nf-core/popscle/freemuxlet/meta.yml create mode 100644 modules/nf-core/popscle/freemuxlet/tests/main.nf.test create mode 100644 modules/nf-core/popscle/freemuxlet/tests/main.nf.test.snap create mode 100644 modules/nf-core/popscle/freemuxlet/tests/nextflow.config create mode 100644 modules/nf-core/popscle/freemuxlet/tests/tags.yml diff --git a/modules/nf-core/popscle/freemuxlet/environment.yml b/modules/nf-core/popscle/freemuxlet/environment.yml new file mode 100644 index 00000000000..c6747a0ae1e --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "popscle_freemuxlet" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::popscle=0.1" diff --git a/modules/nf-core/popscle/freemuxlet/main.nf b/modules/nf-core/popscle/freemuxlet/main.nf new file mode 100644 index 00000000000..d94d36a126f --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/main.nf @@ -0,0 +1,61 @@ +process POPSCLE_FREEMUXLET { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/popscle:0.1beta--h2c78cec_0' : + 'biocontainers/popscle:0.1beta--h2c78cec_0' }" + + input: + tuple val(meta), path(plp), val(n_sample) + + output: + tuple val(meta), path('*.clust1.samples.gz') , emit: result + tuple val(meta), path('*.clust1.vcf.gz') , emit: vcf + tuple val(meta), path('*.lmix') , emit: lmix + tuple val(meta), path('*.clust0.samples.gz') , emit: singlet_result , optional: true + tuple val(meta), path('*.clust0.vcf.gz') , emit: singlet_vcf , optional: true + path 'versions.yml' , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.1' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + """ + popscle freemuxlet \\ + --plp ${plp}/$prefix \\ + --out $prefix \\ + --nsample $n_sample \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + popscle: $VERSION + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.1' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + + """ + touch ${prefix}.clust1.samples.gz + touch ${prefix}.clust1.vcf.gz + touch ${prefix}.lmix + + if [[ "$args" == *"--aux-files"* ]]; then + touch ${prefix}.clust0.samples.gz + touch ${prefix}.clust0.vcf.gz + fi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + popscle: $VERSION + END_VERSIONS + """ +} diff --git a/modules/nf-core/popscle/freemuxlet/meta.yml b/modules/nf-core/popscle/freemuxlet/meta.yml new file mode 100644 index 00000000000..34eaaa59dc9 --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/meta.yml @@ -0,0 +1,73 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "popscle_freemuxlet" +description: Software to deconvolute sample identity and identify multiplets when multiple samples are pooled by barcoded single cell sequencing and external genotyping data for each sample is not available. +keywords: + - popscle + - demultiplexing + - genotype-based deconvoltion + - single cell +tools: + - "popscle": + description: "A suite of population scale analysis tools for single-cell genomics data including implementation of Demuxlet / Freemuxlet methods and auxilary tools" + homepage: "https://github.com/statgen/popscle" + documentation: "https://github.com/statgen/popscle" + tool_dev_url: "https://github.com/statgen/popscle" + doi: "10.1038/nbt.4042" + licence: ["Apache-2.0"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1']` + + - plp: + type: directory + description: Directory contains pileup files (CEL,VAR and PLP) produced by popscle/dsc_pileup. + - n_sample: + type: integer + description: Number of samples multiplexed together. + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + + - result: + type: file + description: Output file contains the best guess of the sample identity, with detailed statistics to reach to the best guess. + pattern: "*.clust1.samples.gz" + + - vcf: + type: file + description: Output vcf file for each sample inferred and clustered from freemuxlet. + pattern: "*.clust1.vcf.gz" + + - lmix: + type: file + description: Output file contains basic statistics for each barcode. + pattern: "*.lmix" + + - singlet_result: + type: file + description: Optional output file contains the best sample identity assuming all droplets are singlets when writing auxiliary output files is turned on. + pattern: "*.clust0.samples.gz" + + - singlet_vcf: + type: file + description: Optional output vcf file for each sample inferred and clustered from freemuxlet assuming all droplets are singlets when writing auxiliary output files is turned on. + pattern: "*.clust0.vcf.gz" + +authors: + - "@wxicu" +maintainers: + - "@wxicu" diff --git a/modules/nf-core/popscle/freemuxlet/tests/main.nf.test b/modules/nf-core/popscle/freemuxlet/tests/main.nf.test new file mode 100644 index 00000000000..e8c2225c6e7 --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/tests/main.nf.test @@ -0,0 +1,183 @@ +nextflow_process { + + name "Test Process POPSCLE_FREEMUXLET" + script "../main.nf" + process "POPSCLE_FREEMUXLET" + + tag "modules" + tag "modules_nfcore" + tag "popscle" + tag "popscle/dscpileup" + tag "popscle/freemuxlet" + + test("demultiplexing") { + setup { + run("POPSCLE_DSCPILEUP") { + script "../../dscpileup/main.nf" + process { + """ + input[0] = [ + [ id:'sample1' ], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true), + ] + """ + } + } + } + + when { + process { + """ + input[0] = POPSCLE_DSCPILEUP.out.plp.collect{ meta, plp -> plp }.map{ + plp -> [[ id: 'sample1'], + plp[0].getParent(), + 2 ]} + """ + } + } + + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert path(process.out.result.get(0).get(1)).exists() }, + { assert path(process.out.vcf.get(0).get(1)).exists() }, + { assert path(process.out.lmix.get(0).get(1)).exists() } + ) + } + + } + + test("demultiplexing - auxilary - files") { + config "./nextflow.config" + setup { + run("POPSCLE_DSCPILEUP") { + script "../../dscpileup/main.nf" + process { + """ + input[0] = [ + [ id:'sample1' ], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true), + ] + """ + } + } + } + + when { + process { + """ + input[0] = POPSCLE_DSCPILEUP.out.plp.collect{ meta, plp -> plp }.map{ + plp -> [[ id: 'sample1'], + plp[0].getParent(), + 2 ]} + """ + } + } + + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions-aux-files") }, + { assert path(process.out.result.get(0).get(1)).exists() }, + { assert path(process.out.vcf.get(0).get(1)).exists() }, + { assert path(process.out.lmix.get(0).get(1)).exists() }, + { assert path(process.out.singlet_result.get(0).get(1)).exists() }, + { assert path(process.out.singlet_vcf.get(0).get(1)).exists() } + ) + } + + } + + test("demultiplexing - stub") { + + options "-stub" + + setup { + run("POPSCLE_DSCPILEUP") { + script "../../dscpileup/main.nf" + process { + """ + input[0] = [ + [ id:'sample1' ], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true), + ] + """ + } + } + } + + when { + process { + """ + input[0] = POPSCLE_DSCPILEUP.out.plp.collect{ meta, plp -> plp }.map{ + plp -> [[ id: 'sample1'], + plp[0].toString() - '.plp.gz', + 2 ]} + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions-stub") }, + { assert path(process.out.result.get(0).get(1)).exists() }, + { assert path(process.out.vcf.get(0).get(1)).exists() }, + { assert path(process.out.lmix.get(0).get(1)).exists() } + ) + } + + } + + test("demultiplexing - auxilary - files - stub") { + + options "-stub" + config "./nextflow.config" + + setup { + run("POPSCLE_DSCPILEUP") { + script "../../dscpileup/main.nf" + process { + """ + input[0] = [ + [ id:'sample1' ], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true), + ] + """ + } + } + } + + when { + process { + """ + input[0] = POPSCLE_DSCPILEUP.out.plp.collect{ meta, plp -> plp }.map{ + plp -> [[ id: 'sample1'], + plp[0].toString() - '.plp.gz', + 2 ]} + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions-aux-files-stub") }, + { assert path(process.out.result.get(0).get(1)).exists() }, + { assert path(process.out.vcf.get(0).get(1)).exists() }, + { assert path(process.out.lmix.get(0).get(1)).exists() }, + { assert path(process.out.singlet_result.get(0).get(1)).exists() }, + { assert path(process.out.singlet_vcf.get(0).get(1)).exists() } + ) + } + + } + +} diff --git a/modules/nf-core/popscle/freemuxlet/tests/main.nf.test.snap b/modules/nf-core/popscle/freemuxlet/tests/main.nf.test.snap new file mode 100644 index 00000000000..b2502c9194d --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,8d90ac14cd657f4c831007418a55910d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-25T12:49:23.684387488" + }, + "versions-aux-files": { + "content": [ + [ + "versions.yml:md5,8d90ac14cd657f4c831007418a55910d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-25T12:49:35.355844696" + }, + "versions-aux-files-stub": { + "content": [ + [ + "versions.yml:md5,8d90ac14cd657f4c831007418a55910d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-25T12:49:56.179166814" + }, + "versions-stub": { + "content": [ + [ + "versions.yml:md5,8d90ac14cd657f4c831007418a55910d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-25T12:49:45.801327201" + } +} \ No newline at end of file diff --git a/modules/nf-core/popscle/freemuxlet/tests/nextflow.config b/modules/nf-core/popscle/freemuxlet/tests/nextflow.config new file mode 100644 index 00000000000..55d2a6d11bf --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: POPSCLE_FREEMUXLET { + ext.args = '--aux-files' + } +} diff --git a/modules/nf-core/popscle/freemuxlet/tests/tags.yml b/modules/nf-core/popscle/freemuxlet/tests/tags.yml new file mode 100644 index 00000000000..8eca91f7a48 --- /dev/null +++ b/modules/nf-core/popscle/freemuxlet/tests/tags.yml @@ -0,0 +1,2 @@ +popscle/freemuxlet: + - "modules/nf-core/popscle/freemuxlet/**" From f18f96582003353cb613e25c02950e7073705b46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:29:55 +0200 Subject: [PATCH 54/79] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.4.2 (#5527) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f6ac5b6735..fbd30190ce5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: renovate-config-validator # use ruff for python files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.4.2 hooks: - id: ruff files: \.py$ From b2b2180fa6c9f0a7e5cb94ad18a80fe4eb33055e Mon Sep 17 00:00:00 2001 From: Anders Sune Pedersen <37172585+asp8200@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:30:46 +0200 Subject: [PATCH 55/79] Updating sentieon to 202308.02 (#5525) * Updating sentieon to 202308.02 * Fixing typo --- modules/nf-core/sentieon/applyvarcal/environment.yml | 2 +- modules/nf-core/sentieon/applyvarcal/main.nf | 4 ++-- modules/nf-core/sentieon/bwaindex/environment.yml | 2 +- modules/nf-core/sentieon/bwaindex/main.nf | 4 ++-- modules/nf-core/sentieon/bwamem/environment.yml | 2 +- modules/nf-core/sentieon/bwamem/main.nf | 4 ++-- modules/nf-core/sentieon/datametrics/environment.yml | 2 +- modules/nf-core/sentieon/datametrics/main.nf | 4 ++-- modules/nf-core/sentieon/dedup/environment.yml | 2 +- modules/nf-core/sentieon/dedup/main.nf | 4 ++-- modules/nf-core/sentieon/dnamodelapply/environment.yml | 2 +- modules/nf-core/sentieon/dnamodelapply/main.nf | 4 ++-- modules/nf-core/sentieon/dnascope/environment.yml | 2 +- modules/nf-core/sentieon/dnascope/main.nf | 4 ++-- modules/nf-core/sentieon/gvcftyper/environment.yml | 2 +- modules/nf-core/sentieon/gvcftyper/main.nf | 4 ++-- modules/nf-core/sentieon/haplotyper/environment.yml | 2 +- modules/nf-core/sentieon/haplotyper/main.nf | 4 ++-- modules/nf-core/sentieon/readwriter/environment.yml | 2 +- modules/nf-core/sentieon/readwriter/main.nf | 4 ++-- modules/nf-core/sentieon/tnfilter/environment.yml | 2 +- modules/nf-core/sentieon/tnfilter/main.nf | 4 ++-- modules/nf-core/sentieon/tnhaplotyper2/environment.yml | 2 +- modules/nf-core/sentieon/tnhaplotyper2/main.nf | 4 ++-- modules/nf-core/sentieon/tnscope/environment.yml | 2 +- modules/nf-core/sentieon/tnscope/main.nf | 4 ++-- modules/nf-core/sentieon/varcal/environment.yml | 2 +- modules/nf-core/sentieon/varcal/main.nf | 4 ++-- modules/nf-core/sentieon/wgsmetrics/environment.yml | 2 +- modules/nf-core/sentieon/wgsmetrics/main.nf | 4 ++-- 30 files changed, 45 insertions(+), 45 deletions(-) diff --git a/modules/nf-core/sentieon/applyvarcal/environment.yml b/modules/nf-core/sentieon/applyvarcal/environment.yml index c4c11b1f855..0af79bedcd8 100644 --- a/modules/nf-core/sentieon/applyvarcal/environment.yml +++ b/modules/nf-core/sentieon/applyvarcal/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/applyvarcal/main.nf b/modules/nf-core/sentieon/applyvarcal/main.nf index d1d3435dc93..6e5e863c515 100644 --- a/modules/nf-core/sentieon/applyvarcal/main.nf +++ b/modules/nf-core/sentieon/applyvarcal/main.nf @@ -7,8 +7,8 @@ process SENTIEON_APPLYVARCAL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(recal), path(recal_index), path(tranches) diff --git a/modules/nf-core/sentieon/bwaindex/environment.yml b/modules/nf-core/sentieon/bwaindex/environment.yml index ce0a85e4094..c806ed0eb53 100644 --- a/modules/nf-core/sentieon/bwaindex/environment.yml +++ b/modules/nf-core/sentieon/bwaindex/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/bwaindex/main.nf b/modules/nf-core/sentieon/bwaindex/main.nf index e36dcc3413b..f5e8b582ecc 100644 --- a/modules/nf-core/sentieon/bwaindex/main.nf +++ b/modules/nf-core/sentieon/bwaindex/main.nf @@ -5,8 +5,8 @@ process SENTIEON_BWAINDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/sentieon/bwamem/environment.yml b/modules/nf-core/sentieon/bwamem/environment.yml index c090bfa5aea..f03db6f8a38 100644 --- a/modules/nf-core/sentieon/bwamem/environment.yml +++ b/modules/nf-core/sentieon/bwamem/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/bwamem/main.nf b/modules/nf-core/sentieon/bwamem/main.nf index 230297d087c..62693851c3d 100644 --- a/modules/nf-core/sentieon/bwamem/main.nf +++ b/modules/nf-core/sentieon/bwamem/main.nf @@ -7,8 +7,8 @@ process SENTIEON_BWAMEM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/sentieon/datametrics/environment.yml b/modules/nf-core/sentieon/datametrics/environment.yml index df0942077a4..b5ea91f6f49 100644 --- a/modules/nf-core/sentieon/datametrics/environment.yml +++ b/modules/nf-core/sentieon/datametrics/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/datametrics/main.nf b/modules/nf-core/sentieon/datametrics/main.nf index d1678187169..bc55d275f6a 100644 --- a/modules/nf-core/sentieon/datametrics/main.nf +++ b/modules/nf-core/sentieon/datametrics/main.nf @@ -7,8 +7,8 @@ process SENTIEON_DATAMETRICS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/sentieon/dedup/environment.yml b/modules/nf-core/sentieon/dedup/environment.yml index 622cf739093..e29cfff3e48 100644 --- a/modules/nf-core/sentieon/dedup/environment.yml +++ b/modules/nf-core/sentieon/dedup/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/dedup/main.nf b/modules/nf-core/sentieon/dedup/main.nf index fbcd595f477..5f19ab56d8e 100644 --- a/modules/nf-core/sentieon/dedup/main.nf +++ b/modules/nf-core/sentieon/dedup/main.nf @@ -7,8 +7,8 @@ process SENTIEON_DEDUP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/sentieon/dnamodelapply/environment.yml b/modules/nf-core/sentieon/dnamodelapply/environment.yml index 6d27d44a1d1..a2f88193138 100644 --- a/modules/nf-core/sentieon/dnamodelapply/environment.yml +++ b/modules/nf-core/sentieon/dnamodelapply/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/dnamodelapply/main.nf b/modules/nf-core/sentieon/dnamodelapply/main.nf index b728a5ec311..9a0c70dc228 100644 --- a/modules/nf-core/sentieon/dnamodelapply/main.nf +++ b/modules/nf-core/sentieon/dnamodelapply/main.nf @@ -7,8 +7,8 @@ process SENTIEON_DNAMODELAPPLY { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(idx) diff --git a/modules/nf-core/sentieon/dnascope/environment.yml b/modules/nf-core/sentieon/dnascope/environment.yml index 45c2116c044..e6da2dde3ef 100644 --- a/modules/nf-core/sentieon/dnascope/environment.yml +++ b/modules/nf-core/sentieon/dnascope/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/dnascope/main.nf b/modules/nf-core/sentieon/dnascope/main.nf index 6adea35eea0..0671307ba00 100644 --- a/modules/nf-core/sentieon/dnascope/main.nf +++ b/modules/nf-core/sentieon/dnascope/main.nf @@ -7,8 +7,8 @@ process SENTIEON_DNASCOPE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai), path(intervals) diff --git a/modules/nf-core/sentieon/gvcftyper/environment.yml b/modules/nf-core/sentieon/gvcftyper/environment.yml index 9a8143068ad..732e2ca8463 100644 --- a/modules/nf-core/sentieon/gvcftyper/environment.yml +++ b/modules/nf-core/sentieon/gvcftyper/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/gvcftyper/main.nf b/modules/nf-core/sentieon/gvcftyper/main.nf index 4b5c9df4e38..7539214507d 100644 --- a/modules/nf-core/sentieon/gvcftyper/main.nf +++ b/modules/nf-core/sentieon/gvcftyper/main.nf @@ -7,8 +7,8 @@ process SENTIEON_GVCFTYPER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(gvcfs), path(tbis), path(intervals) diff --git a/modules/nf-core/sentieon/haplotyper/environment.yml b/modules/nf-core/sentieon/haplotyper/environment.yml index a3a721cf1d2..89108f8e8bc 100644 --- a/modules/nf-core/sentieon/haplotyper/environment.yml +++ b/modules/nf-core/sentieon/haplotyper/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/haplotyper/main.nf b/modules/nf-core/sentieon/haplotyper/main.nf index 87a93434741..16eb775744c 100644 --- a/modules/nf-core/sentieon/haplotyper/main.nf +++ b/modules/nf-core/sentieon/haplotyper/main.nf @@ -7,8 +7,8 @@ process SENTIEON_HAPLOTYPER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) diff --git a/modules/nf-core/sentieon/readwriter/environment.yml b/modules/nf-core/sentieon/readwriter/environment.yml index 67dd1505b2a..423de42da2f 100644 --- a/modules/nf-core/sentieon/readwriter/environment.yml +++ b/modules/nf-core/sentieon/readwriter/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/readwriter/main.nf b/modules/nf-core/sentieon/readwriter/main.nf index 0bace53833f..c12ca2f99fb 100644 --- a/modules/nf-core/sentieon/readwriter/main.nf +++ b/modules/nf-core/sentieon/readwriter/main.nf @@ -7,8 +7,8 @@ process SENTIEON_READWRITER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(input), path(index) diff --git a/modules/nf-core/sentieon/tnfilter/environment.yml b/modules/nf-core/sentieon/tnfilter/environment.yml index 0ead7d95b17..842e515a2c0 100644 --- a/modules/nf-core/sentieon/tnfilter/environment.yml +++ b/modules/nf-core/sentieon/tnfilter/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/tnfilter/main.nf b/modules/nf-core/sentieon/tnfilter/main.nf index 75c4c48ef4c..49c57ebedb6 100644 --- a/modules/nf-core/sentieon/tnfilter/main.nf +++ b/modules/nf-core/sentieon/tnfilter/main.nf @@ -7,8 +7,8 @@ process SENTIEON_TNFILTER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(stats), path(contamination), path(segments), path(orientation_priors) diff --git a/modules/nf-core/sentieon/tnhaplotyper2/environment.yml b/modules/nf-core/sentieon/tnhaplotyper2/environment.yml index e43aaa4a585..a90abca2672 100644 --- a/modules/nf-core/sentieon/tnhaplotyper2/environment.yml +++ b/modules/nf-core/sentieon/tnhaplotyper2/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/tnhaplotyper2/main.nf b/modules/nf-core/sentieon/tnhaplotyper2/main.nf index 840d9486a9c..e95b7466d1e 100644 --- a/modules/nf-core/sentieon/tnhaplotyper2/main.nf +++ b/modules/nf-core/sentieon/tnhaplotyper2/main.nf @@ -7,8 +7,8 @@ process SENTIEON_TNHAPLOTYPER2 { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) diff --git a/modules/nf-core/sentieon/tnscope/environment.yml b/modules/nf-core/sentieon/tnscope/environment.yml index 1ab646e7254..94ab594aaf4 100644 --- a/modules/nf-core/sentieon/tnscope/environment.yml +++ b/modules/nf-core/sentieon/tnscope/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/tnscope/main.nf b/modules/nf-core/sentieon/tnscope/main.nf index 4ec778e4014..239d8b76316 100644 --- a/modules/nf-core/sentieon/tnscope/main.nf +++ b/modules/nf-core/sentieon/tnscope/main.nf @@ -7,8 +7,8 @@ process SENTIEON_TNSCOPE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/sentieon/varcal/environment.yml b/modules/nf-core/sentieon/varcal/environment.yml index 93921ff046a..481da2ce84c 100644 --- a/modules/nf-core/sentieon/varcal/environment.yml +++ b/modules/nf-core/sentieon/varcal/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/varcal/main.nf b/modules/nf-core/sentieon/varcal/main.nf index 17a3b718454..aa8847f8392 100644 --- a/modules/nf-core/sentieon/varcal/main.nf +++ b/modules/nf-core/sentieon/varcal/main.nf @@ -7,8 +7,8 @@ process SENTIEON_VARCAL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(tbi) // input vcf and tbi of variants to recalibrate diff --git a/modules/nf-core/sentieon/wgsmetrics/environment.yml b/modules/nf-core/sentieon/wgsmetrics/environment.yml index 24878e2974e..a33a3fcc62b 100644 --- a/modules/nf-core/sentieon/wgsmetrics/environment.yml +++ b/modules/nf-core/sentieon/wgsmetrics/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::sentieon=202308.01 + - bioconda::sentieon=202308.02 diff --git a/modules/nf-core/sentieon/wgsmetrics/main.nf b/modules/nf-core/sentieon/wgsmetrics/main.nf index a028e4a157d..811c0077fbe 100644 --- a/modules/nf-core/sentieon/wgsmetrics/main.nf +++ b/modules/nf-core/sentieon/wgsmetrics/main.nf @@ -7,8 +7,8 @@ process SENTIEON_WGSMETRICS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : - 'biocontainers/sentieon:202308.01--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' : + 'biocontainers/sentieon:202308.02--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai) From c804f96d1ee0aa71e1c56a42a91bdcf6191d41f7 Mon Sep 17 00:00:00 2001 From: Edmund Miller <20095261+edmundmiller@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:35:13 -0500 Subject: [PATCH 56/79] Fix stale action (#5530) * ci: Try not setting the repo-token * ci: Run clean-up on dispatch --- .github/workflows/clean-up.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clean-up.yml b/.github/workflows/clean-up.yml index 089877dc3af..f1a336067cc 100644 --- a/.github/workflows/clean-up.yml +++ b/.github/workflows/clean-up.yml @@ -2,6 +2,7 @@ name: "Close user-tagged issues and PRs" on: schedule: - cron: "0 0 * * 0" # Once a week + workflow_dispatch: jobs: clean-up: @@ -21,4 +22,3 @@ jobs: any-of-labels: "awaiting-changes,awaiting-feedback" exempt-issue-labels: "WIP" exempt-pr-labels: "WIP" - repo-token: ${{ secrets.GITHUB_TOKEN }}} From 8ffdbb00cefe27b47a4a8db50cb91696f2bc533c Mon Sep 17 00:00:00 2001 From: Leon Hafner <60394289+LeonHafner@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:53:30 +0200 Subject: [PATCH 57/79] Changed tag from single quotes to double quotes (#5531) Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- modules/nf-core/ucsc/gtftogenepred/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/ucsc/gtftogenepred/main.nf b/modules/nf-core/ucsc/gtftogenepred/main.nf index 88aace26be0..afbb5f3f9e7 100644 --- a/modules/nf-core/ucsc/gtftogenepred/main.nf +++ b/modules/nf-core/ucsc/gtftogenepred/main.nf @@ -1,5 +1,5 @@ process UCSC_GTFTOGENEPRED { - tag '${meta.id}' + tag "${meta.id}" label 'process_low' conda "${moduleDir}/environment.yml" From 880bd941e59143a0543c7b86b7b543611a1a568c Mon Sep 17 00:00:00 2001 From: Leon Rauschning <99650940+lrauschning@users.noreply.github.com> Date: Sat, 27 Apr 2024 07:45:46 +0200 Subject: [PATCH 58/79] [TYPO] Align commas (#5380) Align commas Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- modules/nf-core/tcoffee/align/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/tcoffee/align/main.nf b/modules/nf-core/tcoffee/align/main.nf index e159bb801e2..a7aa106ce0e 100644 --- a/modules/nf-core/tcoffee/align/main.nf +++ b/modules/nf-core/tcoffee/align/main.nf @@ -16,7 +16,7 @@ process TCOFFEE_ALIGN { output: tuple val(meta), path("*.aln{.gz,}"), emit: alignment // in the args there might be the request to generate a lib file, so the following is an optional output - tuple val(meta), path("*.*lib") , emit: lib, optional : true + tuple val(meta), path("*.*lib") , emit: lib, optional : true path "versions.yml" , emit: versions when: From 1023de4f46ed203b2dcbe8a99221a4f4fd920d90 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Mon, 29 Apr 2024 17:48:38 +1200 Subject: [PATCH 59/79] GFFREAD: updated to 0.12.7, added meta and fasta input/output (#5448) * GFFREAD: updated to 0.12.7, added meta and fasta input/output * Added a comment explaining args_sorted --- modules/nf-core/gffread/environment.yml | 2 +- modules/nf-core/gffread/main.nf | 49 +++- modules/nf-core/gffread/meta.yml | 21 +- modules/nf-core/gffread/tests/main.nf.test | 178 ++++++++++- .../nf-core/gffread/tests/main.nf.test.snap | 276 +++++++++++++++++- .../gffread/tests/nextflow-fasta.config | 5 + 6 files changed, 492 insertions(+), 39 deletions(-) create mode 100644 modules/nf-core/gffread/tests/nextflow-fasta.config diff --git a/modules/nf-core/gffread/environment.yml b/modules/nf-core/gffread/environment.yml index 5398f71c5e5..c6df58ad065 100644 --- a/modules/nf-core/gffread/environment.yml +++ b/modules/nf-core/gffread/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gffread=0.12.1 + - bioconda::gffread=0.12.7 diff --git a/modules/nf-core/gffread/main.nf b/modules/nf-core/gffread/main.nf index d8a473e0a50..da55cbab72b 100644 --- a/modules/nf-core/gffread/main.nf +++ b/modules/nf-core/gffread/main.nf @@ -1,32 +1,57 @@ process GFFREAD { - tag "$gff" + tag "$meta.id" label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0' : - 'biocontainers/gffread:0.12.1--h8b12597_0' }" + 'https://depot.galaxyproject.org/singularity/gffread:0.12.7--hdcf5f25_4' : + 'biocontainers/gffread:0.12.7--hdcf5f25_4' }" input: - path gff + tuple val(meta), path(gff) + path fasta output: - path "*.gtf" , emit: gtf , optional: true - path "*.gff3" , emit: gffread_gff , optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("*.gtf") , emit: gtf , optional: true + tuple val(meta), path("*.gff3") , emit: gffread_gff , optional: true + tuple val(meta), path("*.fasta"), emit: gffread_fasta , optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${gff.baseName}" - def extension = args.contains("-T") ? 'gtf' : 'gffread.gff3' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def extension = args.contains("-T") ? 'gtf' : ( ( ['-w', '-x', '-y' ].any { args.contains(it) } ) ? 'fasta' : 'gff3' ) + def fasta_arg = fasta ? "-g $fasta" : '' + def output_name = "${prefix}.${extension}" + def output = extension == "fasta" ? "$output_name" : "-o $output_name" + def args_sorted = args.replaceAll(/(.*)(-[wxy])(.*)/) { all, pre, param, post -> "$pre $post $param" }.trim() + // args_sorted = Move '-w', '-x', and '-y' to the end of the args string as gffread expects the file name after these parameters + if ( "$output_name" in [ "$gff", "$fasta" ] ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ gffread \\ $gff \\ - $args \\ - -o ${prefix}.${extension} + $fasta_arg \\ + $args_sorted \\ + $output + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gffread: \$(gffread --version 2>&1) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def extension = args.contains("-T") ? 'gtf' : ( ( ['-w', '-x', '-y' ].any { args.contains(it) } ) ? 'fasta' : 'gff3' ) + def output_name = "${prefix}.${extension}" + if ( "$output_name" in [ "$gff", "$fasta" ] ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + touch $output_name + cat <<-END_VERSIONS > versions.yml "${task.process}": gffread: \$(gffread --version 2>&1) diff --git a/modules/nf-core/gffread/meta.yml b/modules/nf-core/gffread/meta.yml index d38cbcda90f..c060282084b 100644 --- a/modules/nf-core/gffread/meta.yml +++ b/modules/nf-core/gffread/meta.yml @@ -13,11 +13,25 @@ tools: doi: 10.12688/f1000research.23297.1 licence: ["MIT"] input: + - meta: + type: map + description: | + Groovy Map containing meta data + e.g. [ id:'test' ] - gff: type: file description: A reference file in either the GFF3, GFF2 or GTF format. pattern: "*.{gff, gtf}" + - fasta: + type: file + description: A multi-fasta file with the genomic sequences + pattern: "*.{fasta,fa,faa,fas,fsa}" output: + - meta: + type: map + description: | + Groovy Map containing meta data + e.g. [ id:'test' ] - gtf: type: file description: GTF file resulting from the conversion of the GFF input file if '-T' argument is present @@ -25,7 +39,11 @@ output: - gffread_gff: type: file description: GFF3 file resulting from the conversion of the GFF input file if '-T' argument is absent - pattern: "*.{gff3}" + pattern: "*.gff3" + - gffread_fasta: + type: file + description: Fasta file produced when either of '-w', '-x', '-y' parameters is present + pattern: "*.fasta" - versions: type: file description: File containing software versions @@ -34,3 +52,4 @@ authors: - "@edmundmiller" maintainers: - "@edmundmiller" + - "@gallvp" diff --git a/modules/nf-core/gffread/tests/main.nf.test b/modules/nf-core/gffread/tests/main.nf.test index 452aba1bafa..4cd13dcd33b 100644 --- a/modules/nf-core/gffread/tests/main.nf.test +++ b/modules/nf-core/gffread/tests/main.nf.test @@ -18,7 +18,11 @@ nextflow_process { } process { """ - input[0] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] """ } } @@ -26,11 +30,40 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot( - process.out.gtf, - process.out.versions - ).match() }, - { assert process.out.gffread_gff == [] } + { assert snapshot(process.out).match() }, + { assert process.out.gffread_gff == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-gtf-stub") { + + options '-stub' + config "./nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gffread_gff == [] }, + { assert process.out.gffread_fasta == [] } ) } @@ -46,7 +79,42 @@ nextflow_process { } process { """ - input[0] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-gff3-stub") { + + options '-stub' + config "./nextflow-gff3.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] """ } } @@ -54,11 +122,99 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot( - process.out.gffread_gff, - process.out.versions - ).match() }, + { assert snapshot(process.out).match() }, { assert process.out.gtf == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-fasta") { + + config "./nextflow-fasta.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_gff == [] } + ) + } + + } + + test("sarscov2-gff3-fasta-stub") { + + options '-stub' + config "./nextflow-fasta.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_gff == [] } + ) + } + + } + + test("sarscov2-gff3-fasta-fail-catch") { + + options '-stub' + config "./nextflow-fasta.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'genome'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + """ + } + } + + then { + assertAll ( + { assert ! process.success }, + { assert process.stdout.toString().contains("Input and output names are the same") } ) } diff --git a/modules/nf-core/gffread/tests/main.nf.test.snap b/modules/nf-core/gffread/tests/main.nf.test.snap index 00a11a40661..15262320dc6 100644 --- a/modules/nf-core/gffread/tests/main.nf.test.snap +++ b/modules/nf-core/gffread/tests/main.nf.test.snap @@ -1,24 +1,272 @@ { "sarscov2-gff3-gtf": { "content": [ - [ - "genome.gtf:md5,2394072d7d31530dfd590c4a117bf6e3" - ], - [ - "versions.yml:md5,a71b6cdfa528dd206a238ec64bae13d6" - ] + { + "0": [ + [ + { + "id": "test" + }, + "test.gtf:md5,1ea0ae98d3388e0576407dc4a24ef428" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + + ], + "gtf": [ + [ + { + "id": "test" + }, + "test.gtf:md5,1ea0ae98d3388e0576407dc4a24ef428" + ] + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } ], - "timestamp": "2024-01-23T20:00:32.688779117" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T10:48:56.496187" }, "sarscov2-gff3-gff3": { "content": [ - [ - "genome.gffread.gff3:md5,a7d40d99dcddac23ac673c473279ea2d" - ], - [ - "versions.yml:md5,a71b6cdfa528dd206a238ec64bae13d6" - ] + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.gff3:md5,c4e5da6267c6bee5899a2c204ae1ad91" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + [ + { + "id": "test" + }, + "test.gff3:md5,c4e5da6267c6bee5899a2c204ae1ad91" + ] + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } ], - "timestamp": "2024-01-23T20:07:11.457356625" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T10:49:00.892782" + }, + "sarscov2-gff3-gtf-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.gtf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + + ], + "gtf": [ + [ + { + "id": "test" + }, + "test.gtf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T11:11:26.975666" + }, + "sarscov2-gff3-fasta-stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gffread_gff": [ + + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T11:11:44.34792" + }, + "sarscov2-gff3-gff3-stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + [ + { + "id": "test" + }, + "test.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T11:11:35.221671" + }, + "sarscov2-gff3-fasta": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.fasta:md5,5f8108fb51739a0588ccf0a251de919a" + ] + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,5f8108fb51739a0588ccf0a251de919a" + ] + ], + "gffread_gff": [ + + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T10:54:02.88143" } } \ No newline at end of file diff --git a/modules/nf-core/gffread/tests/nextflow-fasta.config b/modules/nf-core/gffread/tests/nextflow-fasta.config new file mode 100644 index 00000000000..ac6cb14844b --- /dev/null +++ b/modules/nf-core/gffread/tests/nextflow-fasta.config @@ -0,0 +1,5 @@ +process { + withName: GFFREAD { + ext.args = '-w -S' + } +} From 896d83ff3de0797ab1db571ec7167bf783f59ecf Mon Sep 17 00:00:00 2001 From: vlebars <104759956+vlebars@users.noreply.github.com> Date: Mon, 29 Apr 2024 07:49:58 +0200 Subject: [PATCH 60/79] re delete gatk4/bedtointervallist from pytest_modules.yml after it was added again (see #5251) (#5328) delete gatk4/bedtointervallist from pytest_modules.yml Co-authored-by: LE BARS Victor --- tests/config/pytest_modules.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2ccbc93ab04..7b72ee9b4e0 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -622,9 +622,6 @@ gatk/unifiedgenotyper: gatk4/applyvqsr: - modules/nf-core/gatk4/applyvqsr/** - tests/modules/nf-core/gatk4/applyvqsr/** -gatk4/bedtointervallist: - - modules/nf-core/gatk4/bedtointervallist/** - - tests/modules/nf-core/gatk4/bedtointervallist/** gatk4/calculatecontamination: - modules/nf-core/gatk4/calculatecontamination/** - tests/modules/nf-core/gatk4/calculatecontamination/** From cb2fed3eeb1fefd075f8849f973456885994ccea Mon Sep 17 00:00:00 2001 From: Anders Sune Pedersen <37172585+asp8200@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:54:14 +0200 Subject: [PATCH 61/79] Update mosdepth to 0.3.8 (#5538) * Update mosdepth to 0.3.8 * Updating main.nf.test.snap --- modules/nf-core/mosdepth/environment.yml | 2 +- modules/nf-core/mosdepth/main.nf | 4 +- .../nf-core/mosdepth/tests/main.nf.test.snap | 120 +++++++++--------- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/modules/nf-core/mosdepth/environment.yml b/modules/nf-core/mosdepth/environment.yml index 88c7126c053..bcb9d64a7a0 100644 --- a/modules/nf-core/mosdepth/environment.yml +++ b/modules/nf-core/mosdepth/environment.yml @@ -5,4 +5,4 @@ channels: - defaults dependencies: # renovate: datasource=conda depName=bioconda/mosdepth - - mosdepth=0.3.6 + - mosdepth=0.3.8 diff --git a/modules/nf-core/mosdepth/main.nf b/modules/nf-core/mosdepth/main.nf index 0190a09d801..6f4a838343c 100644 --- a/modules/nf-core/mosdepth/main.nf +++ b/modules/nf-core/mosdepth/main.nf @@ -4,8 +4,8 @@ process MOSDEPTH { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.6--hd299d5a_0' : - 'biocontainers/mosdepth:0.3.6--hd299d5a_0'}" + 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.8--hd299d5a_0' : + 'biocontainers/mosdepth:0.3.8--hd299d5a_0'}" input: tuple val(meta), path(bam), path(bai), path(bed) diff --git a/modules/nf-core/mosdepth/tests/main.nf.test.snap b/modules/nf-core/mosdepth/tests/main.nf.test.snap index 00f4cd974b9..c604540b032 100644 --- a/modules/nf-core/mosdepth/tests/main.nf.test.snap +++ b/modules/nf-core/mosdepth/tests/main.nf.test.snap @@ -39,7 +39,7 @@ ] ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -222,15 +222,15 @@ ] ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:29:04.084192" + "timestamp": "2024-04-29T13:33:16.953408231" }, "homo_sapiens - cram, crai, bed": { "content": [ @@ -260,7 +260,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -289,7 +289,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -307,7 +307,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "8": [ @@ -340,7 +340,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -367,7 +367,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "regions_txt": [ @@ -395,15 +395,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:28:16.664319" + "timestamp": "2024-04-29T13:32:50.160217828" }, "homo_sapiens - bam, bai, [] - quantized": { "content": [ @@ -433,7 +433,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ @@ -456,7 +456,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -480,7 +480,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz.csi:md5,be9617f551f19a33923f1e886eaefb93" + "test.quantized.bed.gz.csi:md5,4f69e6ace50206a2768be66ded3a56f0" ] ], "global_txt": [ @@ -507,7 +507,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -528,7 +528,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz.csi:md5,be9617f551f19a33923f1e886eaefb93" + "test.quantized.bed.gz.csi:md5,4f69e6ace50206a2768be66ded3a56f0" ] ], "regions_bed": [ @@ -556,15 +556,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:28:35.978752" + "timestamp": "2024-04-29T13:33:01.164885111" }, "homo_sapiens - bam, bai, bed": { "content": [ @@ -594,7 +594,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -623,7 +623,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -641,7 +641,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "8": [ @@ -674,7 +674,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -701,7 +701,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "regions_txt": [ @@ -729,15 +729,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:27:55.598384" + "timestamp": "2024-04-29T13:32:39.071657456" }, "homo_sapiens - bam, bai, [] - window": { "content": [ @@ -767,7 +767,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -775,7 +775,7 @@ "id": "test", "single_end": true }, - "test.mosdepth.region.dist.txt:md5,39e0e707ec32feb5176fd20a95f1f468" + "test.mosdepth.region.dist.txt:md5,0b6ea9f0da1228252d9aef2d3b6f7f76" ] ], "3": [ @@ -796,7 +796,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -814,7 +814,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,257d67678136963d9dd904330079609d" + "test.regions.bed.gz.csi:md5,2a30bcb7f5c7632136b3efce24723970" ] ], "8": [ @@ -847,7 +847,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -874,7 +874,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,257d67678136963d9dd904330079609d" + "test.regions.bed.gz.csi:md5,2a30bcb7f5c7632136b3efce24723970" ] ], "regions_txt": [ @@ -883,7 +883,7 @@ "id": "test", "single_end": true }, - "test.mosdepth.region.dist.txt:md5,39e0e707ec32feb5176fd20a95f1f468" + "test.mosdepth.region.dist.txt:md5,0b6ea9f0da1228252d9aef2d3b6f7f76" ] ], "summary_txt": [ @@ -902,15 +902,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:28:26.37386" + "timestamp": "2024-04-29T13:32:55.631776118" }, "homo_sapiens - bam, bai, []": { "content": [ @@ -940,7 +940,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ @@ -963,7 +963,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -1002,7 +1002,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -1039,15 +1039,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:27:44.658599" + "timestamp": "2024-04-29T13:32:33.642125299" }, "homo_sapiens - cram, crai, []": { "content": [ @@ -1077,7 +1077,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ @@ -1100,7 +1100,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -1139,7 +1139,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -1176,15 +1176,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:28:06.482838" + "timestamp": "2024-04-29T13:32:44.704920941" }, "homo_sapiens - bam, bai, bed - thresholds": { "content": [ @@ -1222,11 +1222,11 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz.csi:md5,912055ee9452229439df6fae95644196" + "test.thresholds.bed.gz.csi:md5,219414a0751185adb98d2235d83ea055" ] ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -1255,7 +1255,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -1273,7 +1273,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "8": [ @@ -1306,7 +1306,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -1333,7 +1333,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "regions_txt": [ @@ -1369,18 +1369,18 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz.csi:md5,912055ee9452229439df6fae95644196" + "test.thresholds.bed.gz.csi:md5,219414a0751185adb98d2235d83ea055" ] ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T12:28:45.918241" + "timestamp": "2024-04-29T13:33:06.737266831" } } \ No newline at end of file From 912e7fd19af8deddc038cc77e6483088dbaeed04 Mon Sep 17 00:00:00 2001 From: DavideBag <96130443+DavideBag@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:06:10 +0200 Subject: [PATCH 62/79] migrating flash to nf-test (#5470) * migrating flash to nf-test * removing args2 from main.nf * Update nextflow.config * Changes discussed in the outputs --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- modules/nf-core/flash/main.nf | 29 +++++-- modules/nf-core/flash/meta.yml | 12 ++- modules/nf-core/flash/tests/main.nf.test | 37 +++++++++ modules/nf-core/flash/tests/main.nf.test.snap | 79 +++++++++++++++++++ modules/nf-core/flash/tests/nextflow.config | 5 ++ modules/nf-core/flash/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/flash/main.nf | 15 ---- tests/modules/nf-core/flash/nextflow.config | 9 --- tests/modules/nf-core/flash/test.yml | 8 -- 10 files changed, 157 insertions(+), 42 deletions(-) create mode 100644 modules/nf-core/flash/tests/main.nf.test create mode 100644 modules/nf-core/flash/tests/main.nf.test.snap create mode 100644 modules/nf-core/flash/tests/nextflow.config create mode 100644 modules/nf-core/flash/tests/tags.yml delete mode 100644 tests/modules/nf-core/flash/main.nf delete mode 100644 tests/modules/nf-core/flash/nextflow.config delete mode 100644 tests/modules/nf-core/flash/test.yml diff --git a/modules/nf-core/flash/main.nf b/modules/nf-core/flash/main.nf index 1ba6add774c..cb8c0c93474 100644 --- a/modules/nf-core/flash/main.nf +++ b/modules/nf-core/flash/main.nf @@ -4,22 +4,28 @@ process FLASH { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/flash:1.2.11--hed695b0_5' : - 'biocontainers/flash:1.2.11--hed695b0_5' }" + 'https://depot.galaxyproject.org/singularity/flash:1.2.11--h5bf99c6_6' : + 'biocontainers/flash:1.2.11--h5bf99c6_6' }" input: tuple val(meta), path(reads) output: - tuple val(meta), path("*.fastq.gz"), emit: reads - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}.extendedFrags.fastq.gz"), emit: merged + tuple val(meta), path("${prefix}.notCombined_*.fastq.gz"), emit: notcombined + tuple val(meta), path("${prefix}.hist") , emit: histogram + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" + if ("$reads" == "${prefix}.extendedFrags.fastq.gz") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if ("$reads" == "${prefix}.notCombined_1.fastq.gz") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if ("$reads" == "${prefix}.notCombined_2.fastq.gz") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ flash \\ $args \\ @@ -33,4 +39,17 @@ process FLASH { flash: \$(echo \$(flash --version 2>&1) | sed 's/^.*FLASH v//; s/ .*\$//') END_VERSIONS """ + + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + + touch ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + flash: \$(echo \$(flash --version 2>&1) | sed 's/^.*FLASH v//; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/flash/meta.yml b/modules/nf-core/flash/meta.yml index 9c0d39c2c74..8253482ebcf 100644 --- a/modules/nf-core/flash/meta.yml +++ b/modules/nf-core/flash/meta.yml @@ -28,10 +28,18 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - reads: + - merged: type: file description: The merged fastq reads - pattern: "*fastq.gz" + pattern: ".extendedFrags.fastq.gz" + - notcombined: + type: file + description: Not combined reads from flash + pattern: ".notCombined_*.fastq.gz" + - histogram: + type: file + description: HistogramNumeric histogram of merged read lengths. + pattern: ".hist" - versions: type: file description: File containing software versions diff --git a/modules/nf-core/flash/tests/main.nf.test b/modules/nf-core/flash/tests/main.nf.test new file mode 100644 index 00000000000..019c582a2ac --- /dev/null +++ b/modules/nf-core/flash/tests/main.nf.test @@ -0,0 +1,37 @@ +nextflow_process { + + name "Test Process FLASH" + script "../main.nf" + process "FLASH" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "flash" + + test("sarscov2 - bam") { + + when { + params{ + outdir = "test" + } + process { + """ + input[0] = [ + [ id: "test", single_end:false], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/flash/tests/main.nf.test.snap b/modules/nf-core/flash/tests/main.nf.test.snap new file mode 100644 index 00000000000..fbb43eff634 --- /dev/null +++ b/modules/nf-core/flash/tests/main.nf.test.snap @@ -0,0 +1,79 @@ +{ + "sarscov2 - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.extendedFrags.fastq.gz:md5,a2f163bfc21f9d6f9cb6b02c2bbcc57f" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.notCombined_1.fastq.gz:md5,3597e676a09cd3426ab3904a6ebed111", + "test.notCombined_2.fastq.gz:md5,9bb71579b34567a15c11b30e46bae6aa" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist:md5,6aa28c9bcb430ba16c0fd0115dacda5f" + ] + ], + "3": [ + "versions.yml:md5,324e2f6592d7c6aa86f624076a88a10f" + ], + "histogram": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist:md5,6aa28c9bcb430ba16c0fd0115dacda5f" + ] + ], + "merged": [ + [ + { + "id": "test", + "single_end": false + }, + "test.extendedFrags.fastq.gz:md5,a2f163bfc21f9d6f9cb6b02c2bbcc57f" + ] + ], + "notcombined": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.notCombined_1.fastq.gz:md5,3597e676a09cd3426ab3904a6ebed111", + "test.notCombined_2.fastq.gz:md5,9bb71579b34567a15c11b30e46bae6aa" + ] + ] + ], + "versions": [ + "versions.yml:md5,324e2f6592d7c6aa86f624076a88a10f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:53:22.274475538" + } +} \ No newline at end of file diff --git a/modules/nf-core/flash/tests/nextflow.config b/modules/nf-core/flash/tests/nextflow.config new file mode 100644 index 00000000000..bf115195a3d --- /dev/null +++ b/modules/nf-core/flash/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: FLASH { + ext.args = '-m 20 -M 150' + } +} diff --git a/modules/nf-core/flash/tests/tags.yml b/modules/nf-core/flash/tests/tags.yml new file mode 100644 index 00000000000..848ea5e3301 --- /dev/null +++ b/modules/nf-core/flash/tests/tags.yml @@ -0,0 +1,2 @@ +flash: + - "modules/nf-core/flash/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 7b72ee9b4e0..5d097877175 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -585,9 +585,6 @@ fgbio/sortbam: fgbio/zipperbams: - modules/nf-core/fgbio/zipperbams/** - tests/modules/nf-core/fgbio/zipperbams/** -flash: - - modules/nf-core/flash/** - - tests/modules/nf-core/flash/** fqtk: - modules/nf-core/fqtk/** - modules/nf-core/untar/** diff --git a/tests/modules/nf-core/flash/main.nf b/tests/modules/nf-core/flash/main.nf deleted file mode 100644 index 2e3bd94c858..00000000000 --- a/tests/modules/nf-core/flash/main.nf +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FLASH } from '../../../../modules/nf-core/flash/main.nf' - -workflow test_flash { - input = [ - [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] - ] - - FLASH ( input ) -} diff --git a/tests/modules/nf-core/flash/nextflow.config b/tests/modules/nf-core/flash/nextflow.config deleted file mode 100644 index 2845f9d9775..00000000000 --- a/tests/modules/nf-core/flash/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: FLASH { - ext.args = '-m 20 -M 100' - } - -} diff --git a/tests/modules/nf-core/flash/test.yml b/tests/modules/nf-core/flash/test.yml deleted file mode 100644 index 042c94aa34b..00000000000 --- a/tests/modules/nf-core/flash/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: flash test_flash - command: nextflow run ./tests/modules/nf-core/flash -entry test_flash -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/flash/nextflow.config - tags: - - flash - files: - - path: output/flash/test.notCombined_2.fastq.gz - - path: output/flash/test.extendedFrags.fastq.gz - - path: output/flash/test.notCombined_1.fastq.gz From f3fb8b78865b8fb61514ca6536d9e8c918d618c2 Mon Sep 17 00:00:00 2001 From: iraiosub <48185776+iraiosub@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:41:53 +0100 Subject: [PATCH 63/79] add riboseq transcriptome bam to test config (#5537) * add ribo-seq transcriptome bam * remove extra line --- tests/config/test_data.config | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 9dd2bc559ea..bf4936592d6 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -188,6 +188,7 @@ params { genome_fasta_20 = "${params.test_data_base}/data/genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz" genome_alignment_bam = "${params.test_data_base}/data/genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780888_chr20.bam" genome_alignment_bai = "${params.test_data_base}/data/genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780888_chr20.bai" + transcriptome_alignment_bam = "${params.test_data_base}/data/genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780888.Aligned.toTranscriptome.out.bam" } } '10xgenomics' { From 7a22dfcf9263fac35e8acee509b0e9b53b48fdfd Mon Sep 17 00:00:00 2001 From: Ashot Margaryan <9378723+ashotmarg@users.noreply.github.com> Date: Mon, 29 Apr 2024 22:33:37 +0200 Subject: [PATCH 64/79] Update nanoplot/main.nf (#5460) Update main.nf Updated the "def input_file" section so that it not only takes fastq file with ".fastq.gz" suffix but also ".fq.gz". --- modules/nf-core/nanoplot/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/nanoplot/main.nf b/modules/nf-core/nanoplot/main.nf index 9fe43c0eb4d..c1816caf9a6 100644 --- a/modules/nf-core/nanoplot/main.nf +++ b/modules/nf-core/nanoplot/main.nf @@ -22,7 +22,7 @@ process NANOPLOT { script: def args = task.ext.args ?: '' - def input_file = ("$ontfile".endsWith(".fastq.gz")) ? "--fastq ${ontfile}" : + def input_file = ("$ontfile".endsWith(".fastq.gz") || "$ontfile".endsWith(".fq.gz")) ? "--fastq ${ontfile}" : ("$ontfile".endsWith(".txt")) ? "--summary ${ontfile}" : '' """ NanoPlot \\ From 0c817a333a21037ee54ea6057f276bfa3882e638 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Tue, 30 Apr 2024 12:50:49 +1200 Subject: [PATCH 65/79] Added repeatmodeler/repeatmodeler (#5536) * repeatmodeler/repeatmodeler * Demoted to process_medium * Update modules/nf-core/repeatmodeler/repeatmodeler/main.nf Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- .../repeatmodeler/environment.yml | 9 ++ .../repeatmodeler/repeatmodeler/main.nf | 54 +++++++++ .../repeatmodeler/repeatmodeler/meta.yml | 52 ++++++++ .../repeatmodeler/tests/main.nf.test | 74 ++++++++++++ .../repeatmodeler/tests/main.nf.test.snap | 113 ++++++++++++++++++ .../repeatmodeler/tests/tags.yml | 2 + 6 files changed, 304 insertions(+) create mode 100644 modules/nf-core/repeatmodeler/repeatmodeler/environment.yml create mode 100644 modules/nf-core/repeatmodeler/repeatmodeler/main.nf create mode 100644 modules/nf-core/repeatmodeler/repeatmodeler/meta.yml create mode 100644 modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test create mode 100644 modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test.snap create mode 100644 modules/nf-core/repeatmodeler/repeatmodeler/tests/tags.yml diff --git a/modules/nf-core/repeatmodeler/repeatmodeler/environment.yml b/modules/nf-core/repeatmodeler/repeatmodeler/environment.yml new file mode 100644 index 00000000000..24220717e0a --- /dev/null +++ b/modules/nf-core/repeatmodeler/repeatmodeler/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "repeatmodeler_repeatmodeler" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::repeatmodeler=2.0.5" diff --git a/modules/nf-core/repeatmodeler/repeatmodeler/main.nf b/modules/nf-core/repeatmodeler/repeatmodeler/main.nf new file mode 100644 index 00000000000..9d0449fe7b7 --- /dev/null +++ b/modules/nf-core/repeatmodeler/repeatmodeler/main.nf @@ -0,0 +1,54 @@ +process REPEATMODELER_REPEATMODELER { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/repeatmodeler:2.0.5--pl5321hdfd78af_0': + 'biocontainers/repeatmodeler:2.0.5--pl5321hdfd78af_0' }" + + input: + tuple val(meta), path(db) + + output: + tuple val(meta), path("*.fa") , emit: fasta + tuple val(meta), path("*.stk"), emit: stk + tuple val(meta), path("*.log"), emit: log + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def db_name = file(db[0]).getBaseName() + """ + RepeatModeler \\ + -database $db_name \\ + $args \\ + -threads $task.cpus + + mv ${db_name}-families.fa ${prefix}.fa + mv ${db_name}-families.stk ${prefix}.stk + mv ${db_name}-rmod.log ${prefix}.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + repeatmodeler: \$(RepeatModeler --version | sed 's/RepeatModeler version //') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.fa + touch ${prefix}.stk + touch ${prefix}.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + repeatmodeler: \$(RepeatModeler --version | sed 's/RepeatModeler version //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/repeatmodeler/repeatmodeler/meta.yml b/modules/nf-core/repeatmodeler/repeatmodeler/meta.yml new file mode 100644 index 00000000000..29bb795bf35 --- /dev/null +++ b/modules/nf-core/repeatmodeler/repeatmodeler/meta.yml @@ -0,0 +1,52 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "repeatmodeler_repeatmodeler" +description: Performs de novo transposable element (TE) family identification with RepeatModeler +keywords: + - genomics + - fasta + - repeat + - transposable element +tools: + - "repeatmodeler": + description: "RepeatModeler is a de-novo repeat family identification and modeling package." + homepage: "https://github.com/Dfam-consortium/RepeatModeler" + documentation: "https://github.com/Dfam-consortium/RepeatModeler" + tool_dev_url: "https://github.com/Dfam-consortium/RepeatModeler" + licence: ["Open Software License v2.1"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - db: + type: file + description: RepeatModeler database files generated with REPEATMODELER_BUILDDATABASE + pattern: "*" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: Consensus repeat sequences + pattern: "*.fa" + - stk: + type: file + description: Seed alignments + pattern: "*.stk" + - log: + type: file + description: A summarized log of the run + pattern: "*.log" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@GallVp" +maintainers: + - "@GallVp" diff --git a/modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test b/modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test new file mode 100644 index 00000000000..65edd7e60aa --- /dev/null +++ b/modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test @@ -0,0 +1,74 @@ +nextflow_process { + + name "Test Process REPEATMODELER_REPEATMODELER" + script "../main.nf" + process "REPEATMODELER_REPEATMODELER" + + tag "modules" + tag "modules_nfcore" + tag "repeatmodeler" + tag "repeatmodeler/repeatmodeler" + tag "repeatmodeler/builddatabase" + + test("homo_sapiens-genome_fasta") { + + setup { + run("REPEATMODELER_BUILDDATABASE") { + script "../../../../nf-core/repeatmodeler/builddatabase" + + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = REPEATMODELER_BUILDDATABASE.out.db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.fasta).match("fasta") }, + { assert snapshot(process.out.stk).match("stk") }, + { assert file(process.out.log[0][1]).text.contains('1 families discovered.') }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } + + test("homo_sapiens-genome_fasta-stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test.snap b/modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test.snap new file mode 100644 index 00000000000..e92395228ce --- /dev/null +++ b/modules/nf-core/repeatmodeler/repeatmodeler/tests/main.nf.test.snap @@ -0,0 +1,113 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,1bb6846ecf1304c262eaef4d3de60cf9" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-09T15:06:55.753492" + }, + "homo_sapiens-genome_fasta-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.stk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,1bb6846ecf1304c262eaef4d3de60cf9" + ], + "fasta": [ + [ + { + "id": "test" + }, + "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test" + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stk": [ + [ + { + "id": "test" + }, + "test.stk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,1bb6846ecf1304c262eaef4d3de60cf9" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:16:41.45166" + }, + "stk": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.stk:md5,acd01ad35763c11315e2297a4f051d57" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-09T15:06:55.740963" + }, + "fasta": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.fa:md5,e25326771341204e1f8054d9529411e5" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-09T15:06:55.737658" + } +} \ No newline at end of file diff --git a/modules/nf-core/repeatmodeler/repeatmodeler/tests/tags.yml b/modules/nf-core/repeatmodeler/repeatmodeler/tests/tags.yml new file mode 100644 index 00000000000..df651102797 --- /dev/null +++ b/modules/nf-core/repeatmodeler/repeatmodeler/tests/tags.yml @@ -0,0 +1,2 @@ +repeatmodeler/repeatmodeler: + - "modules/nf-core/repeatmodeler/repeatmodeler/**" From 4441c294afe75a8b9b3fb1eff2500888c783a235 Mon Sep 17 00:00:00 2001 From: Toni Hermoso Pulido Date: Tue, 30 Apr 2024 09:58:21 +0200 Subject: [PATCH 66/79] Blastdbcmd new module (#5482) * starting blastdbcmd * carry on * Making it work with simple entry version * Upgrade to make entry_batch work * Upgrade to make it work with tests * adding missing tag * Removed versions to make it pass the tests in Github * Make it work with versions and so * Update modules/nf-core/blast/blastdbcmd/meta.yml Co-authored-by: James A. Fellows Yates * Update modules/nf-core/blast/blastdbcmd/meta.yml Co-authored-by: James A. Fellows Yates * Move module into two and upgrade according to comments * upgrade with outfmt forced * Turn back into one module * Update modules/nf-core/blast/blastdbcmd/main.nf Co-authored-by: James A. Fellows Yates * update tags and stub test * fix stub * making it work more widely * editorcheck error * addressing comments * Update modules/nf-core/blast/blastdbcmd/meta.yml Co-authored-by: James A. Fellows Yates --------- Co-authored-by: James A. Fellows Yates --- .../nf-core/blast/blastdbcmd/environment.yml | 7 + modules/nf-core/blast/blastdbcmd/main.nf | 64 +++++++ modules/nf-core/blast/blastdbcmd/meta.yml | 61 +++++++ .../blast/blastdbcmd/tests/main.nf.test | 122 ++++++++++++++ .../blast/blastdbcmd/tests/main.nf.test.snap | 158 ++++++++++++++++++ .../blast/blastdbcmd/tests/nextflow.config | 8 + .../blastdbcmd/tests/nextflow.txt.config | 5 + .../nf-core/blast/blastdbcmd/tests/tags.yml | 2 + tests/config/test_data.config | 2 +- 9 files changed, 428 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/blast/blastdbcmd/environment.yml create mode 100644 modules/nf-core/blast/blastdbcmd/main.nf create mode 100644 modules/nf-core/blast/blastdbcmd/meta.yml create mode 100644 modules/nf-core/blast/blastdbcmd/tests/main.nf.test create mode 100644 modules/nf-core/blast/blastdbcmd/tests/main.nf.test.snap create mode 100644 modules/nf-core/blast/blastdbcmd/tests/nextflow.config create mode 100644 modules/nf-core/blast/blastdbcmd/tests/nextflow.txt.config create mode 100644 modules/nf-core/blast/blastdbcmd/tests/tags.yml diff --git a/modules/nf-core/blast/blastdbcmd/environment.yml b/modules/nf-core/blast/blastdbcmd/environment.yml new file mode 100644 index 00000000000..b90a0b74587 --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/environment.yml @@ -0,0 +1,7 @@ +name: "blast_blastdbcmd" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::blast=2.15.0" diff --git a/modules/nf-core/blast/blastdbcmd/main.nf b/modules/nf-core/blast/blastdbcmd/main.nf new file mode 100644 index 00000000000..b7541e9f9c9 --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/main.nf @@ -0,0 +1,64 @@ +process BLAST_BLASTDBCMD { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/blast:2.15.0--pl5321h6f7f691_1': + 'biocontainers/blast:2.15.0--pl5321h6f7f691_1' }" + + input: + tuple val(meta) , val(entry), path(entry_batch) + tuple val(meta2), path(db) + + output: + tuple val(meta), path("*.fasta"), optional: true, emit: fasta + tuple val(meta), path("*.txt") , optional: true, emit: text + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + assert (!entry && entry_batch) || (entry && !entry_batch) : "ERROR: You must use either entry or entry_batch, not both at the same time" + def input = '' + if (entry) { + input = "-entry ${entry}" + } else { + input = "-entry_batch ${entry_batch}" + } + def extension = args.contains("-outfmt") && !args.contains("-outfmt %f") ? "txt" : "fasta" + """ + DB=`find -L ./ -name "*.nhr" | sed 's/\\.nhr\$//'` + if test -z "\$DB" + then + DB=`find -L ./ -name "*.phr" | sed 's/\\.phr\$//'` + fi + + blastdbcmd \\ + -db \$DB \\ + ${args} \\ + -out ${prefix}.${extension} \\ + ${input} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + blast: \$(blastdbcmd -version 2>&1 | head -n1 | sed 's/^.*blastdbcmd: //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def extension = args.contains("-outfmt") && !args.contains("-outfmt %f") ? "txt" : "fasta" + """ + touch ${prefix}.${extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + blast: \$(blastdbcmd -version 2>&1 | head -n1 | sed 's/^.*blastdbcmd: //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/blast/blastdbcmd/meta.yml b/modules/nf-core/blast/blastdbcmd/meta.yml new file mode 100644 index 00000000000..1c2f90e1ab8 --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/meta.yml @@ -0,0 +1,61 @@ +name: blast_blastdbcmd +description: Retrieve entries from a BLAST database +keywords: + - fasta + - blast + - database + - retrieval + - identifier +tools: + - blast: + description: | + BLAST finds regions of similarity between biological sequences. + homepage: https://blast.ncbi.nlm.nih.gov/Blast.cgi + documentation: https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs + doi: 10.1016/S0022-2836(05)80360-2 + licence: ["US-Government-Work"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - entry: + type: string + description: Entry identifier of sequence in database. It cannot be used along with entry_batch + - entry_batch: + type: file + description: | + File with a list of entry identifiers of sequences in database (one identifier per line). It cannot be used along with entry + - meta2: + type: map + description: | + Groovy Map containing db information + e.g. [ id:'test2', single_end:false ] + - db: + type: file + description: Input BLAST-indexed database + pattern: "*.{fa.*,fasta.*}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Output fasta file (default format) + pattern: "*.{fasta}" + - text: + type: file + description: | + Output text file (generic format if fasta not used, i.e. `--outfmt` is supplied to `ext.args`) + pattern: "*.{txt}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@toniher" +maintainers: + - "@toniher" diff --git a/modules/nf-core/blast/blastdbcmd/tests/main.nf.test b/modules/nf-core/blast/blastdbcmd/tests/main.nf.test new file mode 100644 index 00000000000..26d0397ac19 --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/tests/main.nf.test @@ -0,0 +1,122 @@ +nextflow_process { + + name "Test Process BLAST_BLASTDBCMD" + script "../main.nf" + process "BLAST_BLASTDBCMD" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "blast" + tag "blast/blastdbcmd" + tag "blast/makeblastdb" + + setup { + run("BLAST_MAKEBLASTDB") { + script "../../makeblastdb/main.nf" + process { + """ + input[0] = [ [id:'test2'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] + """ + } + } + } + + + test("Should query with a protein identifier against a FASTA DB") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [id: 'test'], 'ENSSASP00005000002.1', [] ] + input[1] = BLAST_MAKEBLASTDB.out.db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("Should query with a protein identifier against a FASTA DB - stub") { + + options '-stub' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [id: 'test'], 'ENSSASP00005000002.1', [] ] + input[1] = BLAST_MAKEBLASTDB.out.db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("Should query with a file containing a list of protein identifiers against a FASTA DB") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ [id:'test'], '', file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/blast/proteome.list', checkIfExists: true) ] + input[1] = BLAST_MAKEBLASTDB.out.db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("Should query with a file containing a list of protein identifiers against a FASTA DB - text file") { + + config "./nextflow.txt.config" + + when { + params { + outdir = "$outputDir" + } + process { + + """ + input[0] = [ [id:'test'], '', file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/blast/proteome.list', checkIfExists: true) ] + input[1] = BLAST_MAKEBLASTDB.out.db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/blast/blastdbcmd/tests/main.nf.test.snap b/modules/nf-core/blast/blastdbcmd/tests/main.nf.test.snap new file mode 100644 index 00000000000..bcd57489a4b --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/tests/main.nf.test.snap @@ -0,0 +1,158 @@ +{ + "Should query with a file containing a list of protein identifiers against a FASTA DB": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fasta:md5,0b209b6d43b3d5a160944227d3eb660b" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ], + "fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,0b209b6d43b3d5a160944227d3eb660b" + ] + ], + "text": [ + + ], + "versions": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-26T17:58:26.342873297" + }, + "Should query with a file containing a list of protein identifiers against a FASTA DB - text file": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.txt:md5,357bc4aac41b649ad48b756ae93943ac" + ] + ], + "2": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ], + "fasta": [ + + ], + "text": [ + [ + { + "id": "test" + }, + "test.txt:md5,357bc4aac41b649ad48b756ae93943ac" + ] + ], + "versions": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-26T17:58:37.353763379" + }, + "Should query with a protein identifier against a FASTA DB": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fasta:md5,11a6e8a5cb36e439e6209e8dfe94656a" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ], + "fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,11a6e8a5cb36e439e6209e8dfe94656a" + ] + ], + "text": [ + + ], + "versions": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-26T17:58:04.333482407" + }, + "Should query with a protein identifier against a FASTA DB - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ], + "fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "text": [ + + ], + "versions": [ + "versions.yml:md5,f57a6202dd1899e5081abda557352926" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-26T17:58:14.318938272" + } +} \ No newline at end of file diff --git a/modules/nf-core/blast/blastdbcmd/tests/nextflow.config b/modules/nf-core/blast/blastdbcmd/tests/nextflow.config new file mode 100644 index 00000000000..51127b00980 --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: BLAST_MAKEBLASTDB { + ext.args = '-dbtype prot -parse_seqids' + } + withName: BLAST_BLASTDBCMD { + ext.args = '-dbtype prot' + } +} diff --git a/modules/nf-core/blast/blastdbcmd/tests/nextflow.txt.config b/modules/nf-core/blast/blastdbcmd/tests/nextflow.txt.config new file mode 100644 index 00000000000..b522244378f --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/tests/nextflow.txt.config @@ -0,0 +1,5 @@ +process { + withName: BLAST_BLASTDBCMD { + ext.args = '-dbtype prot -outfmt "%a %l"' + } +} diff --git a/modules/nf-core/blast/blastdbcmd/tests/tags.yml b/modules/nf-core/blast/blastdbcmd/tests/tags.yml new file mode 100644 index 00000000000..d0a6c8419f5 --- /dev/null +++ b/modules/nf-core/blast/blastdbcmd/tests/tags.yml @@ -0,0 +1,2 @@ +blast/blastdbcmd: + - "modules/nf-core/blast/blastdbcmd/**" diff --git a/tests/config/test_data.config b/tests/config/test_data.config index bf4936592d6..a616fb4aac2 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -227,7 +227,7 @@ params { test_scATAC_2_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger-atac/test_scATAC_S1_L001_R2_001.fastq.gz" test_scATAC_3_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger-atac/test_scATAC_S1_L001_R3_001.fastq.gz" test_scATAC_I_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger-atac/test_scATAC_S1_L001_I1_001.fastq.gz" - + test_10x_matrix_rna_raw_h5 = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438-21-raw_feature_bc_matrix.h5" test_10x_matrix_hto_csv = "${params.test_data_base}/data/genomics/homo_sapiens/10xgenomics/cellranger/hashing_demultiplexing/438_21_raw_HTO.csv" } From 17210f32d89b741974f328b77185fa3e09471c29 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:40:28 +0100 Subject: [PATCH 67/79] Remove fake changes Co-authored-by: Carson J Miller <68351153+CarsonJM@users.noreply.github.com> --- modules/nf-core/fastp/main.nf | 2 -- modules/nf-core/seqkit/grep/main.nf | 2 -- subworkflows/nf-core/bam_sort_stats_samtools/main.nf | 2 -- tests/subworkflows/nf-core/bam_qc_picard/main.nf | 1 - 4 files changed, 7 deletions(-) diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index 174b8074d7a..4fc19b7443d 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -1,5 +1,3 @@ -// Fake change if you see this it should not have been merged and can be deleted. - process FASTP { tag "$meta.id" label 'process_medium' diff --git a/modules/nf-core/seqkit/grep/main.nf b/modules/nf-core/seqkit/grep/main.nf index 40d3f4d7ccb..0c81ea56b90 100644 --- a/modules/nf-core/seqkit/grep/main.nf +++ b/modules/nf-core/seqkit/grep/main.nf @@ -1,5 +1,3 @@ -// Fake change if you see this it should not have been merged and can be deleted. - process SEQKIT_GREP { tag "$meta.id" label 'process_low' diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/main.nf b/subworkflows/nf-core/bam_sort_stats_samtools/main.nf index 397d1c39f49..b716375b0a2 100644 --- a/subworkflows/nf-core/bam_sort_stats_samtools/main.nf +++ b/subworkflows/nf-core/bam_sort_stats_samtools/main.nf @@ -1,5 +1,3 @@ -// Fake change if you see this it should not have been merged and can be deleted. - // // Sort, index BAM file and run samtools stats, flagstat and idxstats // diff --git a/tests/subworkflows/nf-core/bam_qc_picard/main.nf b/tests/subworkflows/nf-core/bam_qc_picard/main.nf index a13f915c545..a23447255c9 100644 --- a/tests/subworkflows/nf-core/bam_qc_picard/main.nf +++ b/tests/subworkflows/nf-core/bam_qc_picard/main.nf @@ -1,5 +1,4 @@ #!/usr/bin/env nextflow -// Fake change if you see this it should not have been merged and can be deleted. nextflow.enable.dsl = 2 From 9635f637c7e1d1b9ea59751905d103294ca77f67 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:02:45 +0100 Subject: [PATCH 68/79] Use merge group base ref instead of PR base_ref when merging --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b218e3f91e..bc1d282bbc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: origin/${{ github.base_ref }} + base: ${{ github.base_ref || github.event.merge_group.base_ref }} n_parents: 2 - name: Separate modules and subworkflows From a6369df126d44b3bbaf17c5d99a4ff57bc9bccce Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:03:47 +0100 Subject: [PATCH 69/79] fixup --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc1d282bbc9..e0d9e451629 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: ${{ github.base_ref || github.event.merge_group.base_ref }} + base: origin/${{ github.base_ref || github.event.merge_group.base_ref }} n_parents: 2 - name: Separate modules and subworkflows From 0f052bc3306a11414ef82b5bb1b08cae76074237 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:18:02 +0100 Subject: [PATCH 70/79] Use SHA instead of head ref --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0d9e451629..08aaff96b4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: origin/${{ github.base_ref || github.event.merge_group.base_ref }} + base: ${{ github.base_sha || github.event.merge_group.base_sha }} n_parents: 2 - name: Separate modules and subworkflows From 2ec307f0b0261c9d3201e49cfac0d2d27bb99592 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:29:19 +0100 Subject: [PATCH 71/79] fixup --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 08aaff96b4d..047c2dee993 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: ${{ github.base_sha || github.event.merge_group.base_sha }} + base: ${{ github.pull_request.base.sha || github.event.merge_group.base_sha }} n_parents: 2 - name: Separate modules and subworkflows From 8e6cf9d1d7f9cc4df7286979c9233514adb10076 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:44:36 +0100 Subject: [PATCH 72/79] work --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 047c2dee993..44fc639ad62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: ${{ github.pull_request.base.sha || github.event.merge_group.base_sha }} + base: ${{ github.event.pull_request.base.ref || github.event.merge_queue.head_ref }} n_parents: 2 - name: Separate modules and subworkflows From 3408db55b9e8df5816be06aeb7679bb6530aedb7 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:46:05 +0100 Subject: [PATCH 73/79] origin/ --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44fc639ad62..3b5e40dd6d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: ${{ github.event.pull_request.base.ref || github.event.merge_queue.head_ref }} + base: origin/${{ github.event.pull_request.base.ref || github.event.merge_queue.head_ref }} n_parents: 2 - name: Separate modules and subworkflows From f7273f853ff8361b6c809a70de24c3b59a3f2599 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 10:58:20 +0100 Subject: [PATCH 74/79] cmon --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b5e40dd6d3..5c03adcd7f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -117,12 +117,16 @@ jobs: with: fetch-depth: 0 + - name: what the hell is in the merge_group context?! + run: | + echo ${{ toJson(github.event.merge_group) }} + - name: List nf-test files id: list uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: origin/${{ github.event.pull_request.base.ref || github.event.merge_queue.head_ref }} + base: origin/${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }} n_parents: 2 - name: Separate modules and subworkflows From c9eb127da874442266d507fa9d4c331a295053e0 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 11:01:22 +0100 Subject: [PATCH 75/79] one more time with feeling --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c03adcd7f7..2170fb32b96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -126,7 +126,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: origin/${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }} + base: origin/${{ github.event.pull_request.base.ref || github.event.merge_group.base_sha }} n_parents: 2 - name: Separate modules and subworkflows From 454616aae48e3bde486eb5b1f1155d1e960238c1 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 11:06:55 +0100 Subject: [PATCH 76/79] fixup again --- .github/workflows/test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2170fb32b96..9191fc9d86b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -117,10 +117,6 @@ jobs: with: fetch-depth: 0 - - name: what the hell is in the merge_group context?! - run: | - echo ${{ toJson(github.event.merge_group) }} - - name: List nf-test files id: list uses: adamrtalbot/detect-nf-test-changes@v0.0.3 From 65047b48516304110a039286fd1c1bd409913cc3 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 11:15:44 +0100 Subject: [PATCH 77/79] Worth a try --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9191fc9d86b..a9d1cc1fea5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: origin/${{ github.event.pull_request.base.ref || github.event.merge_group.base_sha }} + base: ${{ github.ref_name}} n_parents: 2 - name: Separate modules and subworkflows From 7ef86b942dfd990c41eeb396ed4f3521ad1ff80c Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 11:22:39 +0100 Subject: [PATCH 78/79] Increase fetch depth to 2 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9d1cc1fea5..ea5f0fa823e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -115,7 +115,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 2 - name: List nf-test files id: list From 06bf16b62c1bfdda90af098ea6e90580051088c3 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 1 May 2024 11:25:31 +0100 Subject: [PATCH 79/79] Use SHA instead of head ref --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea5f0fa823e..877ac9c91da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -115,14 +115,14 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 - name: List nf-test files id: list uses: adamrtalbot/detect-nf-test-changes@v0.0.3 with: head: ${{ github.sha }} - base: ${{ github.ref_name}} + base: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} n_parents: 2 - name: Separate modules and subworkflows