diff --git a/.editorconfig b/.editorconfig index 89dd3564..44cb1a23 100644 --- a/.editorconfig +++ b/.editorconfig @@ -25,14 +25,14 @@ insert_final_newline = unset trim_trailing_whitespace = unset indent_style = unset -# These files are edited and tested upstream in pfr/modules -[/modules/pfr/**] +# These files are edited and tested upstream in gallvp/modules +[/modules/gallvp/**] charset = unset end_of_line = unset insert_final_newline = unset trim_trailing_whitespace = unset indent_style = unset -[/subworkflows/pfr/**] +[/subworkflows/gallvp/**] charset = unset end_of_line = unset insert_final_newline = unset diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b8059542..79b1aa06 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -52,9 +52,9 @@ These tests are run both with the latest available version of `Nextflow` and als :warning: Only in the unlikely and regretful event of a release happening with a bug. -- On your own fork, make a new branch `patch` based on `upstream/master`. +- On your own fork, make a new branch `patch` based on `upstream/main`. - Fix the bug, and bump version (X.Y.Z+1). -- A PR should be made on `master` from patch to directly this particular bug. +- A PR should be made on `main` from patch to directly this particular bug. ## Pipeline contribution conventions diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3da295ca..0cd29f73 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,14 +8,14 @@ These are the most common things requested on pull requests (PRs). Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release. -Learn more about contributing: [CONTRIBUTING.md](https://github.com/plant-food-research-open/assemblyqc/tree/master/.github/CONTRIBUTING.md) +Learn more about contributing: [CONTRIBUTING.md](https://github.com/plant-food-research-open/assemblyqc/tree/main/.github/CONTRIBUTING.md) --> ## PR checklist - [ ] This comment contains a description of changes (with reason). - [ ] If you've fixed a bug or added code that should be tested, add tests! -- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/plant-food-research-open/assemblyqc/tree/master/.github/CONTRIBUTING.md) +- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/plant-food-research-open/assemblyqc/tree/main/.github/CONTRIBUTING.md) - [ ] Make sure your code lints (`nf-core lint`). - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). - [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). diff --git a/.github/check_module_versions.py b/.github/check_module_versions.py new file mode 100755 index 00000000..fe039efc --- /dev/null +++ b/.github/check_module_versions.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python3 + +import colorlog +from urllib.parse import quote_plus +from functools import cmp_to_key +from pathlib import Path + +import subprocess +import argparse +import requests +import logging +import semver +import json +import re +import os + +PIPELINE_REPO = "plant-food-research-open/assemblyqc" + + +def get_logger(): + formatter = colorlog.ColoredFormatter( + "%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s", + datefmt=None, + reset=True, + log_colors={ + "DEBUG": "cyan", + "INFO": "green", + "WARNING": "yellow", + "ERROR": "red", + "CRITICAL": "red,bg_white", + }, + secondary_log_colors={}, + style="%", + ) + + handler = colorlog.StreamHandler() + handler.setFormatter(formatter) + + logger = colorlog.getLogger("") + logger.addHandler(handler) + return logger + + +LOGGER = get_logger() + + +def first(from_list): + if from_list == []: + return None + + return from_list[0] + + +def extract_semvar(from_version_str): + version_numbers = first( + re.findall(r"^[vV]?(\d+)\.?(\d*)\.?(\d*)$", from_version_str) + ) + if version_numbers == None: + return None + + major_ver = int(version_numbers[0]) + minor_ver = int(f"{version_numbers[1]}") if version_numbers[1] != "" else 0 + patch_ver = int(f"{version_numbers[2]}") if version_numbers[2] != "" else 0 + + return f"{major_ver}.{minor_ver}.{patch_ver}" + + +def check_version_status(git_repo_from_meta): + + host = git_repo_from_meta["host"] + org = git_repo_from_meta["org"] + repo = git_repo_from_meta["repo"] + current_ver = git_repo_from_meta["semver"] + + sem_versions = [] + if host == "github": + r = subprocess.run( + " ".join( + [ + "gh api", + '-H "Accept: application/vnd.github+json"', + '-H "X-GitHub-Api-Version: 2022-11-28"', + f"/repos/{org}/{repo}/tags", + ] + ), + shell=True, + capture_output=True, + text=True, + ) + + if r.returncode != 0: + LOGGER.warning(f"Failed to get tags for {org}/{repo}: {r.stderr}") + return None + + response_data = json.loads(r.stdout) + + elif host == "gitlab": + encoded = quote_plus(f"{org}/{repo}") + r = requests.get( + f"https://gitlab.com/api/v4/projects/{encoded}/repository/tags" + ) + + if r.status_code != 200: + LOGGER.warning(f"Failed to get tags for {org}/{repo}: {r.json()}") + return None + response_data = r.json() + + else: + raise f"{host} is not supported!" + + available_versions = [x["name"] for x in response_data] + + if available_versions == []: + LOGGER.warning(f"No versions available for {host}/{org}/{repo}") + return None + + LOGGER.debug(f"Available versions for {host}/{org}/{repo}: {available_versions}") + + sem_versions = [extract_semvar(x["name"]) for x in response_data] + sem_versions = [v for v in sem_versions if v != None] + if sem_versions == []: + LOGGER.warning(f"{host}/{org}/{repo} versions do not conform to semver") + return None + + newer_vers = [v for v in sem_versions if semver.compare(v, current_ver) > 0] + + if newer_vers == []: + LOGGER.info( + f"{host}/{org}/{repo} does not have a new version compared to {current_ver}, first/last {available_versions[0]}/{available_versions[-1]}" + ) + return None + + latest_version = max(newer_vers, key=cmp_to_key(semver.compare)) + + LOGGER.info( + f"{host}/{org}/{repo} has a new version {latest_version} compared to {current_ver}" + ) + + return {**git_repo_from_meta, "latest_version": latest_version} + + +def get_new_versions_from_meta_paths(): + + module_meta_paths = ( + subprocess.run( + "find ./modules -name meta.yml", + shell=True, + capture_output=True, + text=True, + ) + .stdout.strip() + .split("\n") + ) + + git_repos_from_meta = [] + for meta_path in module_meta_paths: + meta_text = Path(meta_path).read_text() + main_path = f"{os.path.dirname(meta_path)}/main.nf" + main_text = Path(main_path).read_text() + repo = first( + re.findall( + r"\s+tool_dev_url:\s+\"?https://(github|gitlab).com/([\w-]+)/([\w-]+)\"?", + meta_text, + ) + ) + + if repo == None: + LOGGER.warning(f"No repo found in {meta_path}") + continue + + LOGGER.debug(f"{meta_path} repo: {repo}") + + if "mulled-v2" in main_text: + LOGGER.warning(f"Mulled container found in {main_path}") + continue + + version = first(re.findall(rf".*/([\w-]+):v?([\.0-9]+)", main_text)) + + if version == None: + LOGGER.warning(f"No version found in {main_path}") + continue + + LOGGER.debug(f"{main_path} version: {version}") + + semver_version = extract_semvar(version[1]) + + if semver_version == None: + LOGGER.warning( + f"Version {version} from {main_path} does not conform to semver" + ) + continue + + repo_data = { + "meta.yml": meta_path, + "main.nf": main_path, + "host": repo[0], + "org": repo[1], + "repo": repo[2], + "tool": version[0], + "semver": semver_version, + } + + LOGGER.debug(f"{meta_path} version data: {repo_data}") + + git_repos_from_meta.append(repo_data) + + with_latest = [check_version_status(r) for r in git_repos_from_meta] + filtered = [v for v in with_latest if v != None] + grouped = {} + + for v in filtered: + key = f"{v['host']}/{v['org']}/{v['repo']}" + if key not in grouped.keys(): + grouped[key] = {} + grouped[key]["latest_version"] = v["latest_version"] + grouped[key]["modules"] = [] + grouped[key]["modules"].append(v) + continue + + grouped[key]["modules"].append(v) + grouped[key]["latest_version"] = semver.max_ver( + grouped[key]["latest_version"], v["latest_version"] + ) + + return grouped + + +def get_repo_issue_titles(repo): + r = subprocess.run( + " ".join( + [ + "gh api", + '-H "Accept: application/vnd.github+json"', + '-H "X-GitHub-Api-Version: 2022-11-28"', + f"/repos/{repo}/issues", + ] + ), + shell=True, + capture_output=True, + text=True, + ) + + if r.returncode != 0: + LOGGER.error(f"Failed to get issues for {repo}: {r.stderr}") + exit(1) + + response_data = json.loads(r.stdout) + + update_issues = [ + x["title"] for x in response_data if x["title"].startswith("[UPDATE]") + ] + + return update_issues + + +def register_issue(host_repo_name, issue_title, tool_data): + + first_module = tool_data["modules"][0] + host, org, repo = (first_module["host"], first_module["org"], first_module["repo"]) + + module_paths = "\n".join( + [f"- {module['main.nf']}" for module in tool_data["modules"]] + ) + + issue_data = [ + "gh api", + "--method POST", + '-H "Accept: application/vnd.github+json"', + '-H "X-GitHub-Api-Version: 2022-11-28"', + f"/repos/{host_repo_name}/issues", + f'-f "title={issue_title}"', + f'-f "body=- https://{host}.com/{org}/{repo}\n{module_paths}"', + '-f "labels[]=enhancement"', + ] + + issue_post = subprocess.run( + " ".join(issue_data), + shell=True, + capture_output=True, + text=True, + ) + + if issue_post.returncode == 0: + LOGGER.info(f"Submitted issue: {issue_title}") + else: + LOGGER.warning(f"Failed to submitted issue: {issue_title}: {issue_post.stderr}") + + +if __name__ == "__main__": + + parser = argparse.ArgumentParser() + + parser.add_argument( + "-v", "--verbose", action="store_true", help="Enable verbose mode" + ) + parser.add_argument( + "-d", "--dry-run", action="store_true", help="Enable dry-run mode" + ) + args = parser.parse_args() + + if args.verbose: + LOGGER.setLevel(level=logging.DEBUG) + else: + LOGGER.setLevel(level=logging.INFO) + + git_repos_from_meta = get_new_versions_from_meta_paths() + update_issue_titles = get_repo_issue_titles(PIPELINE_REPO) + + for key, tool_data in git_repos_from_meta.items(): + + new_issue_title = f"[UPDATE] {key.upper()} -> {tool_data['latest_version']}" + + if new_issue_title in update_issue_titles: + LOGGER.info(f"{new_issue_title} has already been raised!") + continue + + if args.dry_run: + LOGGER.info(f"Dry run new issue: {new_issue_title}") + continue + + register_issue(PIPELINE_REPO, new_issue_title, tool_data) diff --git a/docs/contributors.sh b/.github/contributors.sh similarity index 100% rename from docs/contributors.sh rename to .github/contributors.sh diff --git a/version_check.sh b/.github/version_checks.sh similarity index 76% rename from version_check.sh rename to .github/version_checks.sh index ca34d57e..23cf619c 100755 --- a/version_check.sh +++ b/.github/version_checks.sh @@ -12,8 +12,3 @@ fi head -10 CHANGELOG.md | grep "## v$config_version - " >/dev/null \ || (echo 'Failed to match CHANGELOG version'; exit 1) - -# Check README version - -grep "assembly quality ($config_version)" README.md >/dev/null \ - || (echo 'Failed to match README version'; exit 1) diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 9186934e..4bfbab63 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -1,15 +1,15 @@ name: nf-core branch protection -# This workflow is triggered on PRs to master branch on the repository -# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` +# This workflow is triggered on PRs to main branch on the repository +# It fails when someone tries to make a PR against the nf-core `main` branch instead of `dev` on: pull_request_target: - branches: [master] + branches: [main] jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-core repo main branch are only ok if coming from the nf-core repo `dev` or any `patch` branches - name: Check PRs if: github.repository == 'plant-food-research-open/assemblyqc' run: | @@ -22,7 +22,7 @@ jobs: uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | - ## This PR is against the `master` branch :x: + ## This PR is against the `main` branch :x: * Do not close this PR * Click _Edit_ and change the `base` to `dev` @@ -32,9 +32,9 @@ jobs: Hi @${{ github.event.pull_request.user.login }}, - It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. - The `master` branch on nf-core repositories should always contain code from the latest release. - Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. + It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `main` branch. + The `main` branch on nf-core repositories should always contain code from the latest release. + Because of this, PRs to `main` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. Note that even after this, the test will continue to show as failing until you push a new commit. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89f347df..715ae17c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: - minimal - invalid - stub + - noltr include: - OPTION_STUB: "" - OPTION_STUB: "-stub" diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml index 2d20d644..4a2e3eb4 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -2,7 +2,7 @@ name: Test successful pipeline download with 'nf-core download' # Run the workflow when: # - dispatched manually -# - when a PR is opened or reopened to master branch +# - when a PR is opened or reopened to main branch # - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. on: workflow_dispatch: @@ -17,10 +17,10 @@ on: - edited - synchronize branches: - - master + - main pull_request_target: branches: - - master + - main env: NXF_ANSI_LOG: false diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 05605419..1fcafe88 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -51,26 +51,7 @@ jobs: GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} - run: | - nf-core -l lint_log.txt lint \ - --dir ${GITHUB_WORKSPACE} \ - --markdown lint_results.md \ - --key actions_ci \ - --key actions_schema_validation \ - --key base_config \ - --key files_exist \ - --key files_unchanged \ - --key merge_markers \ - --key modules_config \ - --key nextflow_config \ - --key nfcore_yml \ - --key pipeline_name_conventions \ - --key pipeline_todos \ - --key readme \ - --key schema_description \ - --key schema_lint \ - --key schema_params \ - --key system_exit + run: nf-core -l lint_log.txt lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md - name: Save PR number if: ${{ always() }} diff --git a/.nf-core.yml b/.nf-core.yml index 87685f2a..0ade11e9 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -10,17 +10,15 @@ lint: - assets/multiqc_config.yml - conf/igenomes.config files_unchanged: - - CODE_OF_CONDUCT.md - - assets/nf-core-assemblyqc_logo_light.png - - docs/images/nf-core-assemblyqc_logo_light.png - - docs/images/nf-core-assemblyqc_logo_dark.png - docs/README.md + - .github/PULL_REQUEST_TEMPLATE.md - .github/CONTRIBUTING.md - - .github/workflows/linting.yml + - .github/workflows/branch.yml - LICENSE nextflow_config: - manifest.name - manifest.homePage + multiqc_config: False template_strings: False nf_core_version: 2.14.1 repository_type: pipeline diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b0780ba..1168e07f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: name: Version checks language: system entry: > - ./version_check.sh + .github/version_checks.sh always_run: true fail_fast: true pass_filenames: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae1f69e..99cc4b45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,45 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v2.1.0 - [31-July-2024] + +### `Added` + +1. Created summary presence/absence tables for NCBI FCS modules [#88](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/88) +2. Added min. system requirements [#91](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/91) +3. Added a test to verify the fix for the bug which resulted in a pipeline crash for assemblies without LTRs +4. Updated NCBI FCS GX to 0.5.4 [#93](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/93) +5. Updated `SYRI` to 1.7.0 [#104](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/104) +6. Added a script to automatically check for updates on GitHub/GitLab and post issues +7. Updated modules: `UNTAR`, `MERYL_COUNT`, `GUNZIP`, `MINIMAP2_ALIGN`, `FASTQC` + +### `Fixed` + +1. Fixed a bug where `intron_length_distribution` was used instead of `cds_length_distribution` when creating the CDS Length Distribution Graph [#95](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/95) +2. Fixed a bug where 'Subsequent pipeline modules are skipped.' was printed in the `report.html` even when `contamination_stops_pipeline` was set to false +3. Now NCBI FCS GX module uses all the cores available from the Nextflow task +4. Fixed a bug which caused `PLOTSR` to fail for certain assembly names [#102](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/102) +5. Now `LTRRETRIEVER_LTRRETRIEVER` does not crash when the input assembly does not contain any LTRs [#92](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/92) +6. Now `LTRRETRIEVER_LTRRETRIEVER` does not crash when the input assembly is not writable [#98](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/98) +7. Now soft masked regions are unmasked before computing LAI [#117](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/117) +8. Fixed a bug in `ASSEMBLATHON_STATS` which caused it to fail on MMC executor due to multiple binds of the `bin` directory +9. Changed `NextFlow` to `Nextflow` +10. Updated citation to Bioinformatics + +### `Dependencies` + +1. Nextflow!>=23.04.0 +2. nf-validation@1.1.3 + +### `Deprecated` + +1. Changed default branch name from `master` to `main` in nf-core template files +2. Moved `version_check.sh` to `.github/version_checks.sh` +3. Moved `docs/contributors.sh` to `.github/contributors.sh` +4. Removed dependency on +5. Replaced `nf-core/fastq_trim_fastp_fastqc` with `nf-core/fastq_fastqc_umitools_fastp` which has nf-test unit tests +6. Removed version check on README.md + ## v2.0.0 - [04-June-2024] ### `Added` @@ -37,11 +76,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 8. Updated `FASTA_LTRRETRIEVER_LAI` to fix a pipeline crash when `ch_monoploid_seqs` was `[ meta, [] ]` [#83](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/83) 9. Improved input assembly documentation [#86](https://github.com/Plant-Food-Research-Open/assemblyqc/issues/86) 10. Added assembly tag to synteny warning message regarding missing `synteny_labels` file -11. Now copying files in `NCBI_FCS_GX_SETUP_SAMPLE` rather than symlinking in an attempt to support NextFlow Fusion +11. Now copying files in `NCBI_FCS_GX_SETUP_SAMPLE` rather than symlinking in an attempt to support Nextflow Fusion ### `Dependencies` -1. NextFlow!>=23.04.0 +1. Nextflow!>=23.04.0 2. nf-validation@1.1.3 ### `Deprecated` @@ -80,7 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Dependencies` -1. NextFlow!>=23.04.0 +1. Nextflow!>=23.04.0 2. nf-validation@1.1.3 ### `Deprecated` @@ -130,7 +169,7 @@ For a ~600 MB assembly, EDTA (without sensitive flag) takes ~25 hours of compute ## v1.0.1 [07-Sep-2023] 1. Now pipeline timeline, report, and trace are enabled by default. -2. Included `procps` package where needed to allow NextFlow to collect system statistics. +2. Included `procps` package where needed to allow Nextflow to collect system statistics. ## v1 [25-Jul-2023] @@ -222,7 +261,7 @@ Same as v1rc6c ## v0.10.4 [16-May-2023] -1. Moved the main workflow into `workflows/assembly_qc.nf` so that it can be imported by other NextFlow pipelines. +1. Moved the main workflow into `workflows/assembly_qc.nf` so that it can be imported by other Nextflow pipelines. 2. Fixed a bug in synteny due to which the pipeline did not resume properly sometimes. 3. The included binaries now have unique versions to avoid collision with binaries with same names already present on local PATH. 4. Now using a unique name for the conda environment to have better interoperability across pipelines. diff --git a/CITATION.cff b/CITATION.cff index 23125eae..63044f81 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -16,12 +16,16 @@ authors: given-names: "Marcus" - family-names: "Chen" given-names: "Ting-Hsuan" + - family-names: "Carvajal" + given-names: "Ignacio" + - family-names: "Bailey" + given-names: "Sarah" - family-names: "Thomson" given-names: "Susan" - family-names: "Deng" given-names: "Cecilia" -title: "AssemblyQC: A NextFlow pipeline for evaluating assembly quality" -version: 2.0.0 -date-released: 2024-02-12 -url: "https://github.com/Plant-Food-Research-Open/assembly_qc" -doi: 10.5281/zenodo.10647870 +title: "AssemblyQC: A Nextflow pipeline for reproducible reporting of assembly quality" +version: 2.1.0 +date-released: 2024-07-30 +url: "https://github.com/Plant-Food-Research-Open/assemblyqc" +doi: 10.1093/bioinformatics/btae477 diff --git a/README.md b/README.md index 74f56c0d..3ae86dfa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![GitHub Actions CI Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/ci.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/ci.yml) -[![GitHub Actions Linting Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.10647870-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.10647870) +[![GitHub Actions Linting Status](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml/badge.svg)](https://github.com/plant-food-research-open/assemblyqc/actions/workflows/linting.yml)[![Cite Article](http://img.shields.io/badge/DOI-10.1093/bioinformatics/btae477-1073c8?labelColor=000000)](https://doi.org/10.1093/bioinformatics/btae477) [![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com) [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](https://www.nextflow.io/) @@ -10,7 +10,7 @@ ## Introduction -**plant-food-research-open/assemblyqc** is a [NextFlow](https://www.nextflow.io/docs/latest/index.html) pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report. The tools are shown in the [Pipeline Flowchart](#pipeline-flowchart) and their references are listed in [CITATIONS.md](./CITATIONS.md). +**plant-food-research-open/assemblyqc** is a [Nextflow](https://www.nextflow.io/docs/latest/index.html) pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report. The tools are shown in the [Pipeline Flowchart](#pipeline-flowchart) and their references are listed in [CITATIONS.md](./CITATIONS.md). ## Pipeline Flowchart @@ -123,7 +123,7 @@ plant-food-research-open/assemblyqc was originally written by Usman Rashid ([@ga Ross Crowhurst ([@rosscrowhurst](https://github.com/rosscrowhurst)), Chen Wu ([@christinawu2008](https://github.com/christinawu2008)) and Marcus Davy ([@mdavy86](https://github.com/mdavy86)) generously contributed their QC scripts. -Mahesh Binzer-Panchal ([@mahesh-panchal](https://github.com/mahesh-panchal)) helped port the pipeline modules and sub-workflows to [nf-core](https://nf-co.re) schema. +Mahesh Binzer-Panchal ([@mahesh-panchal](https://github.com/mahesh-panchal)) and Simon Pearce ([@SPPearce](https://github.com/SPPearce)) helped port the pipeline modules and sub-workflows to [nf-core](https://nf-co.re) schema. We thank the following people for their extensive assistance in the development of this pipeline: @@ -145,20 +145,21 @@ The pipeline uses nf-core modules contributed by following authors: + + - - + @@ -173,7 +174,11 @@ If you would like to contribute to this pipeline, please see the [contributing g If you use plant-food-research-open/assemblyqc for your analysis, please cite it as: -> Rashid, U., Wu, C., Shiller, J., Smith, K., Crowhurst, R., Davy, M., Chen, T.-H., Thomson, S., & Deng, C. (2024). AssemblyQC: A NextFlow pipeline for evaluating assembly quality (2.0.0). Zenodo. https://doi.org/10.5281/zenodo.10647870 +> **AssemblyQC: A Nextflow pipeline for reproducible reporting of assembly quality.** +> +> Usman Rashid, Chen Wu, Jason Shiller, Ken Smith, Ross Crowhurst, Marcus Davy, Ting-Hsuan Chen, Ignacio Carvajal, Sarah Bailey, Susan Thomson & Cecilia H Deng. +> +> _Bioinformatics_. 2024 July 30. doi: [10.1093/bioinformatics/btae477](https://doi.org/10.1093/bioinformatics/btae477). An extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file. diff --git a/assets/email_template.html b/assets/email_template.html index 5a56215f..672f3f2a 100644 --- a/assets/email_template.html +++ b/assets/email_template.html @@ -4,7 +4,7 @@ - + plant-food-research-open/assemblyqc Pipeline Report diff --git a/assets/schema_input.json b/assets/schema_input.json index f415c25e..afec8fe7 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/master/assets/schema_input.json", + "$id": "https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/main/assets/schema_input.json", "title": "plant-food-research-open/assemblyqc pipeline - params.input schema", "description": "Schema for the file provided with params.input", "type": "array", diff --git a/assets/schema_xref_assemblies.json b/assets/schema_xref_assemblies.json index 47ea1ed0..0da6ca1c 100644 --- a/assets/schema_xref_assemblies.json +++ b/assets/schema_xref_assemblies.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/master/assets/schema_xref_assemblies.json", + "$id": "https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/main/assets/schema_xref_assemblies.json", "title": "plant-food-research-open/assemblyqc pipeline - params.synteny_xref_assemblies schema", "description": "Schema for the file provided with params.synteny_xref_assemblies", "type": "array", diff --git a/bin/report_modules/parsers/genometools_gt_stat_parser.py b/bin/report_modules/parsers/genometools_gt_stat_parser.py index a4e4e6f4..ddc3bb95 100644 --- a/bin/report_modules/parsers/genometools_gt_stat_parser.py +++ b/bin/report_modules/parsers/genometools_gt_stat_parser.py @@ -82,7 +82,7 @@ def parse_genometools_gt_stat_folder(folder_name="genometools_gt_stat"): cds_length_distribution_graph = "" if cds_length_distribution != []: cds_length_distribution_graph = create_dist_graph( - intron_length_distribution, + cds_length_distribution, "Length", "CDS Length Distribution", f"./{folder_name}/{os.path.basename(report_path)}.cds.length.png", diff --git a/bin/report_modules/parsers/lai_parser.py b/bin/report_modules/parsers/lai_parser.py index 7318e92a..eac49a85 100644 --- a/bin/report_modules/parsers/lai_parser.py +++ b/bin/report_modules/parsers/lai_parser.py @@ -92,4 +92,28 @@ def parse_lai_folder(folder_name="lai_outputs"): } data["LAI"].append(stats) + list_of_ltrretriever_log_files = lai_folder_path.glob("*.log") + + for file in list_of_ltrretriever_log_files: + if str(file).endswith("LAI.log"): + continue + + p = re.compile("ERROR: (.*)") + match_results = p.findall(file.read_text()) + if len(match_results) < 1: + continue + + file_tokens = re.findall( + r"([\w]+).log", + os.path.basename(str(file)), + ) + + hap_name = file_tokens[0] + + stats = { + "hap": hap_name, + "result": f"LTR_retriever Error: {match_results[0]}".strip(), + } + data["LAI"].append(stats) + return {"LAI": sort_list_of_results(data["LAI"], "hap")} diff --git a/bin/report_modules/templates/lai/lai.html b/bin/report_modules/templates/lai/lai.html index 50a98582..34c5ccd8 100644 --- a/bin/report_modules/templates/lai/lai.html +++ b/bin/report_modules/templates/lai/lai.html @@ -14,7 +14,9 @@ Nucleic Acids Research, Volume 46, Issue 21, 30 November 2018, Page e126, 10.1093/nar/gky730

+ {% if 'LTRRETRIEVER_LAI' in all_stats_dicts['VERSIONS'] %}

Version: {{ all_stats_dicts['VERSIONS']['LTRRETRIEVER_LAI']['lai'] }}

+ {% endif %} {% include 'lai/dropdown.html' %} {% include 'lai/summary_contents.html' %} diff --git a/bin/report_modules/templates/ncbi_fcs_adaptor/dropdown.html b/bin/report_modules/templates/ncbi_fcs_adaptor/dropdown.html index 9f21bc26..fda13538 100644 --- a/bin/report_modules/templates/ncbi_fcs_adaptor/dropdown.html +++ b/bin/report_modules/templates/ncbi_fcs_adaptor/dropdown.html @@ -1,6 +1,7 @@ diff --git a/bin/report_modules/templates/ncbi_fcs_gx/report_contents.html b/bin/report_modules/templates/ncbi_fcs_gx/report_contents.html index c99c5622..a7d6f27d 100644 --- a/bin/report_modules/templates/ncbi_fcs_gx/report_contents.html +++ b/bin/report_modules/templates/ncbi_fcs_gx/report_contents.html @@ -1,9 +1,8 @@ -{% set vars = {'is_first': True} %} {% for item in range(all_stats_dicts["NCBI_FCS_GX"]|length) %} {% set active_text = -'display: block' if vars.is_first else 'display: none' %} +{% for item in range(all_stats_dicts["NCBI_FCS_GX"]|length) %}
@@ -11,7 +10,7 @@
{%if all_stats_dicts['NCBI_FCS_GX'][item]['did_detect_contamination'] %}
-

Contamination detected. Subsequent pipeline modules are skipped.

+

Contamination detected.{%if all_stats_dicts['PARAMS_DICT']['contamination_stops_pipeline'] %} Subsequent pipeline modules are skipped.{% endif %}

{{ all_stats_dicts['NCBI_FCS_GX'][item]['report_table_html'] }}
@@ -46,4 +45,4 @@
-{% if vars.update({'is_first': False}) %} {% endif %} {% endfor %} +{% endfor %} diff --git a/bin/report_modules/templates/ncbi_fcs_gx/summary_contents.html b/bin/report_modules/templates/ncbi_fcs_gx/summary_contents.html new file mode 100644 index 00000000..706a6d5d --- /dev/null +++ b/bin/report_modules/templates/ncbi_fcs_gx/summary_contents.html @@ -0,0 +1,32 @@ +
+
+
+
Summary
+
+ +
+
+ + + + + + + + + {% for item in range(all_stats_dicts["NCBI_FCS_GX"]|length) %} + + + + + {% endfor %} + +
AssemblyContaminated?
+ {{ all_stats_dicts['NCBI_FCS_GX'][item]['hap'] }} + + {%if all_stats_dicts['NCBI_FCS_GX'][item]['did_detect_contamination'] %}Yes!{% else %}No{% endif %} +
+
+
+
+
diff --git a/bin/report_modules/templates/params/params.html b/bin/report_modules/templates/params/params.html index 70452246..4d37d9b6 100644 --- a/bin/report_modules/templates/params/params.html +++ b/bin/report_modules/templates/params/params.html @@ -1,19 +1,18 @@ diff --git a/conf/modules.config b/conf/modules.config index 42bd196d..5f857db6 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -234,6 +234,10 @@ process { ] } + withName: '.*:FASTA_LTRRETRIEVER_LAI:UNMASK_IF_ANY' { + ext.args = '-u' + } + withName: CUSTOM_SHORTENFASTAIDS { publishDir = [ path: { "${params.outdir}/lai" }, @@ -278,7 +282,7 @@ process { ] } - withName: FASTQC_RAW { + withName: '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTQC_RAW' { publishDir = [ path: { "${params.outdir}/hic/fastqc_raw" }, mode: params.publish_dir_mode, @@ -286,7 +290,7 @@ process { ] } - withName: FASTQC_TRIM { + withName: '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTQC_TRIM' { publishDir = [ path: { "${params.outdir}/hic/fastqc_trim" }, mode: params.publish_dir_mode, @@ -294,7 +298,7 @@ process { ] } - withName: FASTP { + withName: '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP' { ext.args = params.hic_fastp_ext_args publishDir = [ path: { "${params.outdir}/hic/fastp" }, diff --git a/docs/output.md b/docs/output.md index b1cbf180..ae9e7f75 100644 --- a/docs/output.md +++ b/docs/output.md @@ -138,6 +138,9 @@ TIDK toolkit is designed to [identify and visualize](https://github.com/tolkit/t LTR Assembly Index (LAI) is a reference-free genome metric that [evaluates assembly continuity](https://doi.org/10.1093/nar/gky730) using LTR-RTs. LTR retrotransposons (LTR-RTs) are the predominant interspersed repeat that is poorly assembled in draft genomes. Correcting for LTR-RT amplification dynamics, LAI is independent of genome size, genomic LTR-RT content, and gene space evaluation metrics such as BUSCO. LAI = Raw LAI + 2.8138 × (94 – whole genome LTR identity). The LAI is set to 0 when raw LAI = 0 or the adjustment produces a negative value. Raw LAI = (Intact LTR element length / Total LTR sequence length) \* 100 +> [!WARNING] +> Soft masked regions are unmasked when calculating LAI. However, hard masked regions are left as is. The pipeline will fail to calculate LAI if all the LTRs are already hard masked. + ### Kraken2
diff --git a/docs/parameters.md b/docs/parameters.md index 3b763b7c..d99bb66d 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -1,6 +1,6 @@ # plant-food-research-open/assemblyqc pipeline parameters -A NextFlow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report. +A Nextflow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report. ## Input/output options diff --git a/docs/usage.md b/docs/usage.md index 8399a19c..82117eb5 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -1,4 +1,34 @@ -# plant-food-research-open/assemblyqc: Usage +# plant-food-research-open/assemblyqc: Usage + +- [Assemblysheet input](#assemblysheet-input) +- [External databases](#external-databases) + - [NCBI FCS GX database](#ncbi-fcs-gx-database) + - [Kraken2](#kraken2) + - [BUSCO](#busco) +- [Other parameters](#other-parameters) + - [Assemblathon stats](#assemblathon-stats) + - [NCBI FCS GX](#ncbi-fcs-gx) + - [BUSCO](#busco-1) + - [TIDK](#tidk) + - [HiC](#hic) + - [Synteny analysis](#synteny-analysis) + - [Merqury K-mer analysis](#merqury-k-mer-analysis) +- [Minimum System Requirements](#minimum-system-requirements) +- [Running the pipeline](#running-the-pipeline) + - [Updating the pipeline](#updating-the-pipeline) + - [Reproducibility](#reproducibility) +- [Core Nextflow arguments](#core-nextflow-arguments) + - [`-profile`](#-profile) + - [`-resume`](#-resume) + - [`-c`](#-c) +- [Custom configuration](#custom-configuration) + - [Resource requests](#resource-requests) + - [Custom Containers](#custom-containers) + - [Custom Tool Arguments](#custom-tool-arguments) + - [nf-core/configs](#nf-coreconfigs) +- [Azure Resource Requests](#azure-resource-requests) +- [Running in the background](#running-in-the-background) +- [Nextflow memory requirements](#nextflow-memory-requirements) ## Assemblysheet input @@ -7,7 +37,7 @@ You will need to create an assemblysheet with information about the assemblies y - `tag:` A unique tag which represents the target assembly throughout the pipeline and in the final report. The `tag` and `fasta` file name should not be same, such as `tag.fasta`. This can create file name collisions in the pipeline or result in file overwrite. It is also a good-practice to make all the input files read-only. - `fasta:` FASTA file - `gff3 [Optional]:` GFF3 annotation file if available -- `monoploid_ids [Optional]:` A txt file listing the sequence IDs used to calculate LAI in monoploid mode if necessary. If the intent is to run LAI against all the sequences in an assembly, this file can be skipped for that assembly. Soft masked regions are ignored when calculating LAI. The pipeline may fail if all the LTRs are already soft masked. +- `monoploid_ids [Optional]:` A txt file listing the sequence IDs used to calculate LAI in monoploid mode if necessary. If the intent is to run LAI against all the sequences in an assembly, this file can be skipped for that assembly. Soft masked regions are unmasked when calculating LAI. However, hard masked regions are left as is. The pipeline will fail to calculate LAI if all the LTRs are already hard masked. - `synteny_labels [Optional]:` A two column tsv file listing fasta sequence IDs (first column) and their labels for the synteny plots (second column) when performing synteny analysis. If a sequence ID is missing from this file, the corresponding sequence is excluded from the analysis. If `synteny_labels` is not provided for an assembly, that assembly is excluded from the analysis. See the [Merqury](#merqury-k-mer-analysis) section For description of assemblysheet columns related to k-mer analysis with Merqury. @@ -95,6 +125,13 @@ See following assemblysheet examples for MERQURY analysis. The data for these examples comes from: [umd.edu](https://obj.umiacs.umd.edu/marbl_publications/triobinning/index.html) +## Minimum System Requirements + +All the modules have been tested to work on a single machine with 10 CPUs + 30 GBs of memory, except NCBI FCS GX and Kraken2. Their minimum requirements are: + +- NCBI FCS GX: 1 CPU + 512 GBs memory +- Kraken2: 1 CPU + 200 GBs memory + ## Running the pipeline The typical command for running the pipeline is as follows: diff --git a/modules.json b/modules.json index c0c4132a..eaf1e089 100644 --- a/modules.json +++ b/modules.json @@ -2,136 +2,136 @@ "name": "plant-food-research-open/assemblyqc", "homePage": "https://github.com/plant-food-research-open/assemblyqc", "repos": { - "https://github.com/PlantandFoodResearch/nxf-modules.git": { + "https://github.com/GallVp/nxf-components.git": { "modules": { - "pfr": { + "gallvp": { "busco/busco": { "branch": "main", - "git_sha": "c3ef9317fe867609f5927588fbf17e3c3ebf389c", + "git_sha": "ab92c438688c1f4a3753b65914bfd2e6319cebb2", "installed_by": ["fasta_gxf_busco_plot"] }, "busco/generateplot": { "branch": "main", - "git_sha": "c3ef9317fe867609f5927588fbf17e3c3ebf389c", + "git_sha": "ab92c438688c1f4a3753b65914bfd2e6319cebb2", "installed_by": ["fasta_gxf_busco_plot"] }, "bwa/index": { "branch": "main", - "git_sha": "d158062346649b5d55bccef77f4bbd0468760aff", + "git_sha": "3cba9e138cf07f2db778a7ad6aae0ab707948c74", "installed_by": ["fastq_bwa_mem_samblaster"] }, "bwa/mem": { "branch": "main", - "git_sha": "d158062346649b5d55bccef77f4bbd0468760aff", + "git_sha": "3cba9e138cf07f2db778a7ad6aae0ab707948c74", "installed_by": ["fastq_bwa_mem_samblaster"] }, "cat/cat": { "branch": "main", - "git_sha": "10b046eaac396f279c08e7e2bb067482ccd9c74e", + "git_sha": "490f8ab54c632d84f99edd6f208305ac5e283ab3", "installed_by": ["fasta_ltrretriever_lai"] }, "custom/relabelfasta": { "branch": "main", - "git_sha": "0421bdeb1d7a71dce12e0af7dc18aea26e548074", + "git_sha": "775762619b57101ca800269b6ecda0b915fb9913", "installed_by": ["modules"] }, "custom/restoregffids": { "branch": "main", - "git_sha": "da7a50af5eaac9601e23f33e00bf24e61f9c27ab", + "git_sha": "490f8ab54c632d84f99edd6f208305ac5e283ab3", "installed_by": ["fasta_ltrretriever_lai"] }, "custom/shortenfastaids": { "branch": "main", - "git_sha": "e9ec2e4c48ead3d760c8e13950c568c19ae86b8b", + "git_sha": "490f8ab54c632d84f99edd6f208305ac5e283ab3", "installed_by": ["fasta_ltrretriever_lai"] }, "gffread": { "branch": "main", - "git_sha": "c3ef9317fe867609f5927588fbf17e3c3ebf389c", + "git_sha": "c04bf39d67027e044a6eaed0b7b0439fd8866fc7", "installed_by": ["fasta_gxf_busco_plot"] }, "gt/gff3": { "branch": "main", - "git_sha": "84f31d4be03e2ae6bee8e0b9fdea466be8e997bb", + "git_sha": "c68acf8c8993f85be6e417d0db1bbf3a919f9226", "installed_by": ["gff3_gt_gff3_gff3validator_stat"] }, "gt/gff3validator": { "branch": "main", - "git_sha": "84f31d4be03e2ae6bee8e0b9fdea466be8e997bb", + "git_sha": "49bbf276b8aeda94bf69a982cdb6d68d7dc5ea4e", "installed_by": ["gff3_gt_gff3_gff3validator_stat"] }, "gt/stat": { "branch": "main", - "git_sha": "ffd39a616c84c814fdfb2a865e9fbbb06e5343d9", - "installed_by": ["gff3_gt_gff3_gff3validator_stat", "modules"] + "git_sha": "c68acf8c8993f85be6e417d0db1bbf3a919f9226", + "installed_by": ["gff3_gt_gff3_gff3validator_stat"] }, "ltrfinder": { "branch": "main", - "git_sha": "10b046eaac396f279c08e7e2bb067482ccd9c74e", + "git_sha": "db7fb043c5557cf06a49a1edbed16e282a7dffb2", "installed_by": ["fasta_ltrretriever_lai"] }, "ltrharvest": { "branch": "main", - "git_sha": "10b046eaac396f279c08e7e2bb067482ccd9c74e", + "git_sha": "db7fb043c5557cf06a49a1edbed16e282a7dffb2", "installed_by": ["fasta_ltrretriever_lai"] }, "ltrretriever/lai": { "branch": "main", - "git_sha": "10b046eaac396f279c08e7e2bb067482ccd9c74e", + "git_sha": "490f8ab54c632d84f99edd6f208305ac5e283ab3", "installed_by": ["fasta_ltrretriever_lai"] }, "ltrretriever/ltrretriever": { "branch": "main", - "git_sha": "10b046eaac396f279c08e7e2bb067482ccd9c74e", + "git_sha": "490f8ab54c632d84f99edd6f208305ac5e283ab3", "installed_by": ["fasta_ltrretriever_lai"] }, - "merqury/hapmers": { - "branch": "main", - "git_sha": "46b70684b6ae0ac60cae154c61796b293707db64", - "installed_by": ["modules"] - }, "plotsr": { "branch": "main", - "git_sha": "0413d9b25b127f1c705349fb42de8ff54e83e1e9", + "git_sha": "665454056d9cc2a1e1a392505ca8bf975ae1b711", "installed_by": ["modules"] }, "samblaster": { "branch": "main", - "git_sha": "10b046eaac396f279c08e7e2bb067482ccd9c74e", + "git_sha": "53518187fb1f596f4779da061cd35ce9f973c06e", "installed_by": ["fastq_bwa_mem_samblaster"] }, "samtools/faidx": { "branch": "main", - "git_sha": "84f31d4be03e2ae6bee8e0b9fdea466be8e997bb", + "git_sha": "c68acf8c8993f85be6e417d0db1bbf3a919f9226", "installed_by": ["gff3_gt_gff3_gff3validator_stat"] }, + "seqkit/seq": { + "branch": "main", + "git_sha": "8ec55a2c8e4ce3af070393768f6c2c57f5c34076", + "installed_by": ["fasta_ltrretriever_lai"] + }, "syri": { "branch": "main", - "git_sha": "295e1d8666c746cb05e79563393035e81c9739fc", + "git_sha": "836bb223521eeaa08d65c1b7f4b82be1272a1964", "installed_by": ["modules"] } } }, "subworkflows": { - "pfr": { + "gallvp": { "fasta_gxf_busco_plot": { "branch": "main", - "git_sha": "0e4afaff4964485d2d93f1115c5254a99765b9c1", + "git_sha": "7bf6fbca23edc94490ffa6709f52b2f71c6fb130", "installed_by": ["subworkflows"] }, "fasta_ltrretriever_lai": { "branch": "main", - "git_sha": "e9ec2e4c48ead3d760c8e13950c568c19ae86b8b", + "git_sha": "8ec55a2c8e4ce3af070393768f6c2c57f5c34076", "installed_by": ["subworkflows"] }, "fastq_bwa_mem_samblaster": { "branch": "main", - "git_sha": "d158062346649b5d55bccef77f4bbd0468760aff", + "git_sha": "775762619b57101ca800269b6ecda0b915fb9913", "installed_by": ["subworkflows"] }, "gff3_gt_gff3_gff3validator_stat": { "branch": "main", - "git_sha": "84f31d4be03e2ae6bee8e0b9fdea466be8e997bb", + "git_sha": "775762619b57101ca800269b6ecda0b915fb9913", "installed_by": ["subworkflows"] } } @@ -152,13 +152,13 @@ }, "fastp": { "branch": "master", - "git_sha": "95cf5fe0194c7bf5cb0e3027a2eb7e7c89385080", - "installed_by": ["fastq_trim_fastp_fastqc"] + "git_sha": "1ceaa8ba4d0fd886dbca0e545815d905b7407de7", + "installed_by": ["fastq_fastqc_umitools_fastp"] }, "fastqc": { "branch": "master", - "git_sha": "285a50500f9e02578d90b3ce6382ea3c30216acd", - "installed_by": ["fastq_trim_fastp_fastqc"] + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", + "installed_by": ["fastq_fastqc_umitools_fastp"] }, "fcs/fcsadaptor": { "branch": "master", @@ -167,7 +167,12 @@ }, "gunzip": { "branch": "master", - "git_sha": "3a5fef109d113b4997c9822198664ca5f2716208", + "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", + "installed_by": ["modules"] + }, + "merqury/hapmers": { + "branch": "master", + "git_sha": "deadc7dfc8cd06aee6ab133df43242212ae1f8fb", "installed_by": ["modules"] }, "merqury/merqury": { @@ -177,7 +182,7 @@ }, "meryl/count": { "branch": "master", - "git_sha": "1c72d95476a2edf92ee4f08dc4321b3c50cd3c13", + "git_sha": "2910aa889fd3497727d87854148a0e0aa1105da3", "installed_by": ["modules"] }, "meryl/unionsum": { @@ -187,7 +192,7 @@ }, "minimap2/align": { "branch": "master", - "git_sha": "72e277acfd9e61a9f1368eafb4a9e83f5bcaa9f5", + "git_sha": "a33ef9475558c6b8da08c5f522ddaca1ec810306", "installed_by": ["modules"] }, "seqkit/rmdup": { @@ -198,7 +203,7 @@ "seqkit/seq": { "branch": "master", "git_sha": "2be41ca2cc780eca4293d1b0dd3850b0b7ac40a3", - "installed_by": ["fasta_explore_search_plot_tidk"] + "installed_by": ["fasta_explore_search_plot_tidk", "fasta_ltrretriever_lai"] }, "seqkit/sort": { "branch": "master", @@ -230,9 +235,14 @@ "git_sha": "669a329f4aa37f5b7f03776c2ed1cd0ef122c626", "installed_by": ["fasta_explore_search_plot_tidk"] }, + "umitools/extract": { + "branch": "master", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", + "installed_by": ["fastq_fastqc_umitools_fastp"] + }, "untar": { "branch": "master", - "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", "installed_by": ["modules"] } } @@ -249,9 +259,9 @@ "git_sha": "1fc29f92e439d5631fdf34b8ac4687297d70f5ec", "installed_by": ["subworkflows"] }, - "fastq_trim_fastp_fastqc": { + "fastq_fastqc_umitools_fastp": { "branch": "master", - "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["subworkflows"] }, "utils_nextflow_pipeline": { diff --git a/modules/pfr/busco/busco/environment.yml b/modules/gallvp/busco/busco/environment.yml similarity index 100% rename from modules/pfr/busco/busco/environment.yml rename to modules/gallvp/busco/busco/environment.yml diff --git a/modules/pfr/busco/busco/main.nf b/modules/gallvp/busco/busco/main.nf similarity index 100% rename from modules/pfr/busco/busco/main.nf rename to modules/gallvp/busco/busco/main.nf diff --git a/modules/pfr/busco/busco/meta.yml b/modules/gallvp/busco/busco/meta.yml similarity index 100% rename from modules/pfr/busco/busco/meta.yml rename to modules/gallvp/busco/busco/meta.yml diff --git a/modules/pfr/busco/busco/tests/main.nf.test b/modules/gallvp/busco/busco/tests/main.nf.test similarity index 91% rename from modules/pfr/busco/busco/tests/main.nf.test rename to modules/gallvp/busco/busco/tests/main.nf.test index 16b708b2..829bd285 100644 --- a/modules/pfr/busco/busco/tests/main.nf.test +++ b/modules/gallvp/busco/busco/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "BUSCO_BUSCO" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "busco" tag "busco/busco" @@ -18,7 +18,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ] input[1] = 'genome' input[2] = 'bacteria_odb10' // Launch with 'auto' to use --auto-lineage, and specified lineages // 'auto' removed from test due to memory issues @@ -80,8 +80,8 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map [ - file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true), - file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true) ] ] input[1] = 'genome' @@ -165,7 +165,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file( params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] input[1] = 'genome' input[2] = 'eukaryota_odb10' @@ -208,8 +208,6 @@ nextflow_process { with(path("${process.out.busco_dir[0][1]}/logs/busco.log").text) { assert contains('DEBUG:busco.run_BUSCO') - assert contains("'use_augustus', 'False'") - assert contains("'use_metaeuk', 'True'") // METAEUK assert contains('Results from dataset') assert contains('how to cite BUSCO') @@ -230,7 +228,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file( params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] input[1] = 'genome' input[2] = 'eukaryota_odb10' @@ -250,8 +248,6 @@ nextflow_process { with(path("${process.out.busco_dir[0][1]}/logs/busco.log").text) { assert contains('DEBUG:busco.run_BUSCO') - assert contains("'use_augustus', 'True'") - assert contains("'use_metaeuk', 'False'") // AUGUSTUS assert contains('Augustus did not recognize any genes') } @@ -275,7 +271,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['proteome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/proteome.fasta', checkIfExists: true) ] input[1] = 'proteins' input[2] = 'bacteria_odb10' @@ -337,7 +333,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file( params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/illumina/fasta/test1.contigs.fa.gz', checkIfExists: true) ] input[1] = 'transcriptome' input[2] = 'bacteria_odb10' @@ -398,7 +394,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ] input[1] = 'genome' input[2] = 'bacteria_odb10' diff --git a/modules/pfr/busco/busco/tests/main.nf.test.snap b/modules/gallvp/busco/busco/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/busco/busco/tests/main.nf.test.snap rename to modules/gallvp/busco/busco/tests/main.nf.test.snap diff --git a/modules/pfr/busco/busco/tests/nextflow.augustus.config b/modules/gallvp/busco/busco/tests/nextflow.augustus.config similarity index 100% rename from modules/pfr/busco/busco/tests/nextflow.augustus.config rename to modules/gallvp/busco/busco/tests/nextflow.augustus.config diff --git a/modules/pfr/busco/busco/tests/nextflow.config b/modules/gallvp/busco/busco/tests/nextflow.config similarity index 100% rename from modules/pfr/busco/busco/tests/nextflow.config rename to modules/gallvp/busco/busco/tests/nextflow.config diff --git a/modules/pfr/busco/busco/tests/nextflow.metaeuk.config b/modules/gallvp/busco/busco/tests/nextflow.metaeuk.config similarity index 100% rename from modules/pfr/busco/busco/tests/nextflow.metaeuk.config rename to modules/gallvp/busco/busco/tests/nextflow.metaeuk.config diff --git a/modules/pfr/busco/busco/tests/old_test.yml b/modules/gallvp/busco/busco/tests/old_test.yml similarity index 100% rename from modules/pfr/busco/busco/tests/old_test.yml rename to modules/gallvp/busco/busco/tests/old_test.yml diff --git a/modules/pfr/busco/busco/tests/tags.yml b/modules/gallvp/busco/busco/tests/tags.yml similarity index 100% rename from modules/pfr/busco/busco/tests/tags.yml rename to modules/gallvp/busco/busco/tests/tags.yml diff --git a/modules/pfr/busco/generateplot/environment.yml b/modules/gallvp/busco/generateplot/environment.yml similarity index 100% rename from modules/pfr/busco/generateplot/environment.yml rename to modules/gallvp/busco/generateplot/environment.yml diff --git a/modules/pfr/busco/generateplot/main.nf b/modules/gallvp/busco/generateplot/main.nf similarity index 100% rename from modules/pfr/busco/generateplot/main.nf rename to modules/gallvp/busco/generateplot/main.nf diff --git a/modules/pfr/busco/generateplot/meta.yml b/modules/gallvp/busco/generateplot/meta.yml similarity index 100% rename from modules/pfr/busco/generateplot/meta.yml rename to modules/gallvp/busco/generateplot/meta.yml diff --git a/modules/pfr/busco/generateplot/tests/main.nf.test b/modules/gallvp/busco/generateplot/tests/main.nf.test similarity index 82% rename from modules/pfr/busco/generateplot/tests/main.nf.test rename to modules/gallvp/busco/generateplot/tests/main.nf.test index 853dc5ed..6a43fa73 100644 --- a/modules/pfr/busco/generateplot/tests/main.nf.test +++ b/modules/gallvp/busco/generateplot/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "BUSCO_GENERATEPLOT" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "busco" tag "busco/busco" tag "busco/generateplot" @@ -19,7 +19,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ] input[1] = 'genome' input[2] = 'bacteria_odb10' @@ -55,7 +55,7 @@ nextflow_process { when { process { """ - input[0] = file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + input[0] = file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) """ } } diff --git a/modules/pfr/busco/generateplot/tests/main.nf.test.snap b/modules/gallvp/busco/generateplot/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/busco/generateplot/tests/main.nf.test.snap rename to modules/gallvp/busco/generateplot/tests/main.nf.test.snap diff --git a/modules/pfr/busco/generateplot/tests/tags.yml b/modules/gallvp/busco/generateplot/tests/tags.yml similarity index 100% rename from modules/pfr/busco/generateplot/tests/tags.yml rename to modules/gallvp/busco/generateplot/tests/tags.yml diff --git a/modules/pfr/bwa/index/environment.yml b/modules/gallvp/bwa/index/environment.yml similarity index 100% rename from modules/pfr/bwa/index/environment.yml rename to modules/gallvp/bwa/index/environment.yml diff --git a/modules/pfr/bwa/index/main.nf b/modules/gallvp/bwa/index/main.nf similarity index 100% rename from modules/pfr/bwa/index/main.nf rename to modules/gallvp/bwa/index/main.nf diff --git a/modules/pfr/bwa/index/meta.yml b/modules/gallvp/bwa/index/meta.yml similarity index 94% rename from modules/pfr/bwa/index/meta.yml rename to modules/gallvp/bwa/index/meta.yml index 4c7d30f3..6bbc87a6 100644 --- a/modules/pfr/bwa/index/meta.yml +++ b/modules/gallvp/bwa/index/meta.yml @@ -11,7 +11,7 @@ tools: BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome. homepage: http://bio-bwa.sourceforge.net/ - documentation: http://www.htslib.org/doc/samtools.html + documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] input: diff --git a/modules/pfr/bwa/index/tests/main.nf.test b/modules/gallvp/bwa/index/tests/main.nf.test similarity index 96% rename from modules/pfr/bwa/index/tests/main.nf.test rename to modules/gallvp/bwa/index/tests/main.nf.test index af33e73c..6a3b3671 100644 --- a/modules/pfr/bwa/index/tests/main.nf.test +++ b/modules/gallvp/bwa/index/tests/main.nf.test @@ -1,7 +1,7 @@ nextflow_process { name "Test Process BWA_INDEX" - tag "modules_nfcore" + tag "modules_gallvp" tag "modules" tag "bwa" tag "bwa/index" diff --git a/modules/pfr/bwa/index/tests/main.nf.test.snap b/modules/gallvp/bwa/index/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/bwa/index/tests/main.nf.test.snap rename to modules/gallvp/bwa/index/tests/main.nf.test.snap diff --git a/modules/pfr/bwa/index/tests/tags.yml b/modules/gallvp/bwa/index/tests/tags.yml similarity index 100% rename from modules/pfr/bwa/index/tests/tags.yml rename to modules/gallvp/bwa/index/tests/tags.yml diff --git a/modules/pfr/bwa/mem/environment.yml b/modules/gallvp/bwa/mem/environment.yml similarity index 100% rename from modules/pfr/bwa/mem/environment.yml rename to modules/gallvp/bwa/mem/environment.yml diff --git a/modules/pfr/bwa/mem/main.nf b/modules/gallvp/bwa/mem/main.nf similarity index 100% rename from modules/pfr/bwa/mem/main.nf rename to modules/gallvp/bwa/mem/main.nf diff --git a/modules/pfr/bwa/mem/meta.yml b/modules/gallvp/bwa/mem/meta.yml similarity index 96% rename from modules/pfr/bwa/mem/meta.yml rename to modules/gallvp/bwa/mem/meta.yml index 1532c261..b126dd86 100644 --- a/modules/pfr/bwa/mem/meta.yml +++ b/modules/gallvp/bwa/mem/meta.yml @@ -14,7 +14,7 @@ tools: BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome. homepage: http://bio-bwa.sourceforge.net/ - documentation: http://www.htslib.org/doc/samtools.html + documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] input: diff --git a/modules/pfr/bwa/mem/tests/main.nf.test b/modules/gallvp/bwa/mem/tests/main.nf.test similarity index 99% rename from modules/pfr/bwa/mem/tests/main.nf.test rename to modules/gallvp/bwa/mem/tests/main.nf.test index 463b76f8..a8f55e4f 100644 --- a/modules/pfr/bwa/mem/tests/main.nf.test +++ b/modules/gallvp/bwa/mem/tests/main.nf.test @@ -1,7 +1,7 @@ nextflow_process { name "Test Process BWA_MEM" - tag "modules_nfcore" + tag "modules_gallvp" tag "modules" tag "bwa" tag "bwa/mem" diff --git a/modules/pfr/bwa/mem/tests/main.nf.test.snap b/modules/gallvp/bwa/mem/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/bwa/mem/tests/main.nf.test.snap rename to modules/gallvp/bwa/mem/tests/main.nf.test.snap diff --git a/modules/pfr/bwa/mem/tests/tags.yml b/modules/gallvp/bwa/mem/tests/tags.yml similarity index 100% rename from modules/pfr/bwa/mem/tests/tags.yml rename to modules/gallvp/bwa/mem/tests/tags.yml diff --git a/modules/pfr/cat/cat/environment.yml b/modules/gallvp/cat/cat/environment.yml similarity index 100% rename from modules/pfr/cat/cat/environment.yml rename to modules/gallvp/cat/cat/environment.yml diff --git a/modules/pfr/cat/cat/main.nf b/modules/gallvp/cat/cat/main.nf similarity index 99% rename from modules/pfr/cat/cat/main.nf rename to modules/gallvp/cat/cat/main.nf index adbdbd7b..2862c64c 100644 --- a/modules/pfr/cat/cat/main.nf +++ b/modules/gallvp/cat/cat/main.nf @@ -76,4 +76,3 @@ def getFileSuffix(filename) { def match = filename =~ /^.*?((\.\w{1,5})?(\.\w{1,5}\.gz$))/ return match ? match[0][1] : filename.substring(filename.lastIndexOf('.')) } - diff --git a/modules/pfr/cat/cat/meta.yml b/modules/gallvp/cat/cat/meta.yml similarity index 100% rename from modules/pfr/cat/cat/meta.yml rename to modules/gallvp/cat/cat/meta.yml diff --git a/modules/pfr/cat/cat/tests/main.nf.test b/modules/gallvp/cat/cat/tests/main.nf.test similarity index 88% rename from modules/pfr/cat/cat/tests/main.nf.test rename to modules/gallvp/cat/cat/tests/main.nf.test index 0ac8549e..a0b9fd95 100644 --- a/modules/pfr/cat/cat/tests/main.nf.test +++ b/modules/gallvp/cat/cat/tests/main.nf.test @@ -4,7 +4,7 @@ nextflow_process { script "../main.nf" process "CAT_CAT" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "cat" tag "cat/cat" @@ -29,7 +29,8 @@ nextflow_process { then { assertAll( { assert !process.success }, - { assert process.stdout.toString().contains("The name of the input file can't be the same as for the output prefix") } + { assert process.stdout.toString().contains("The name of the input file can't be the same as for the output prefix") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -83,8 +84,12 @@ nextflow_process { def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot(lines[0..5]).match("test_cat_zipped_zipped_lines") }, - { assert snapshot(lines.size()).match("test_cat_zipped_zipped_size")} + { assert snapshot( + lines[0..5], + lines.size(), + process.out.versions + ).match() + } ) } } @@ -142,8 +147,12 @@ nextflow_process { def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot(lines[0..5]).match("test_cat_unzipped_zipped_lines") }, - { assert snapshot(lines.size()).match("test_cat_unzipped_zipped_size")} + { assert snapshot( + lines[0..5], + lines.size(), + process.out.versions + ).match() + } ) } } @@ -170,9 +179,13 @@ nextflow_process { def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot(lines[0..5]).match("test_cat_one_file_unzipped_zipped_lines") }, - { assert snapshot(lines.size()).match("test_cat_one_file_unzipped_zipped_size")} + { assert snapshot( + lines[0..5], + lines.size(), + process.out.versions + ).match() + } ) } } -} \ No newline at end of file +} diff --git a/modules/pfr/cat/cat/tests/main.nf.test.snap b/modules/gallvp/cat/cat/tests/main.nf.test.snap similarity index 77% rename from modules/pfr/cat/cat/tests/main.nf.test.snap rename to modules/gallvp/cat/cat/tests/main.nf.test.snap index 423571ba..b7623ee6 100644 --- a/modules/pfr/cat/cat/tests/main.nf.test.snap +++ b/modules/gallvp/cat/cat/tests/main.nf.test.snap @@ -1,10 +1,4 @@ { - "test_cat_unzipped_zipped_size": { - "content": [ - 375 - ], - "timestamp": "2023-10-16T14:33:08.049445686" - }, "test_cat_unzipped_unzipped": { "content": [ { @@ -34,6 +28,10 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, "timestamp": "2023-10-16T14:32:18.500464399" }, "test_cat_zipped_unzipped": { @@ -65,9 +63,13 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, "timestamp": "2023-10-16T14:32:49.642741302" }, - "test_cat_zipped_zipped_lines": { + "test_cat_zipped_zipped": { "content": [ [ "MT192765.1\tGenbank\ttranscript\t259\t29667\t.\t+\t.\tID=unknown_transcript_1;geneID=orf1ab;gene_name=orf1ab", @@ -76,11 +78,31 @@ "MT192765.1\tGenbank\tCDS\t13461\t21548\t.\t+\t0\tParent=unknown_transcript_1;exception=\"ribosomal slippage\";gbkey=CDS;gene=orf1ab;note=\"pp1ab;translated=by -1 ribosomal frameshift\";product=\"orf1ab polyprotein\";protein_id=QIK50426.1", "MT192765.1\tGenbank\tCDS\t21556\t25377\t.\t+\t0\tParent=unknown_transcript_1;gbkey=CDS;gene=S;note=\"structural protein\";product=\"surface glycoprotein\";protein_id=QIK50427.1", "MT192765.1\tGenbank\tgene\t21556\t25377\t.\t+\t.\tParent=unknown_transcript_1" + ], + 78, + [ + "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:51:46.802978" + }, + "test_cat_name_conflict": { + "content": [ + [ + ] ], - "timestamp": "2023-10-16T14:32:33.629048645" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:51:29.45394" }, - "test_cat_unzipped_zipped_lines": { + "test_cat_one_file_unzipped_zipped": { "content": [ [ ">MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome", @@ -89,11 +111,19 @@ "TAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGG", "GTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGCCTGTTTT", "ACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAG" + ], + 374, + [ + "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" ] ], - "timestamp": "2023-10-16T14:33:08.038830506" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:52:02.774016" }, - "test_cat_one_file_unzipped_zipped_lines": { + "test_cat_unzipped_zipped": { "content": [ [ ">MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome", @@ -102,20 +132,16 @@ "TAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGG", "GTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGCCTGTTTT", "ACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAG" + ], + 375, + [ + "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" ] ], - "timestamp": "2023-10-16T14:33:21.39642399" - }, - "test_cat_zipped_zipped_size": { - "content": [ - 78 - ], - "timestamp": "2023-10-16T14:32:33.641869244" - }, - "test_cat_one_file_unzipped_zipped_size": { - "content": [ - 374 - ], - "timestamp": "2023-10-16T14:33:21.4094373" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:51:57.581523" } } \ No newline at end of file diff --git a/modules/pfr/cat/cat/tests/nextflow_unzipped_zipped.config b/modules/gallvp/cat/cat/tests/nextflow_unzipped_zipped.config similarity index 100% rename from modules/pfr/cat/cat/tests/nextflow_unzipped_zipped.config rename to modules/gallvp/cat/cat/tests/nextflow_unzipped_zipped.config diff --git a/modules/pfr/cat/cat/tests/nextflow_zipped_unzipped.config b/modules/gallvp/cat/cat/tests/nextflow_zipped_unzipped.config similarity index 100% rename from modules/pfr/cat/cat/tests/nextflow_zipped_unzipped.config rename to modules/gallvp/cat/cat/tests/nextflow_zipped_unzipped.config diff --git a/modules/pfr/cat/cat/tests/tags.yml b/modules/gallvp/cat/cat/tests/tags.yml similarity index 100% rename from modules/pfr/cat/cat/tests/tags.yml rename to modules/gallvp/cat/cat/tests/tags.yml diff --git a/modules/pfr/custom/relabelfasta/environment.yml b/modules/gallvp/custom/relabelfasta/environment.yml similarity index 100% rename from modules/pfr/custom/relabelfasta/environment.yml rename to modules/gallvp/custom/relabelfasta/environment.yml diff --git a/modules/pfr/custom/relabelfasta/main.nf b/modules/gallvp/custom/relabelfasta/main.nf similarity index 100% rename from modules/pfr/custom/relabelfasta/main.nf rename to modules/gallvp/custom/relabelfasta/main.nf diff --git a/modules/pfr/custom/relabelfasta/meta.yml b/modules/gallvp/custom/relabelfasta/meta.yml similarity index 100% rename from modules/pfr/custom/relabelfasta/meta.yml rename to modules/gallvp/custom/relabelfasta/meta.yml diff --git a/modules/pfr/custom/relabelfasta/templates/relabelfasta.py b/modules/gallvp/custom/relabelfasta/templates/relabelfasta.py similarity index 79% rename from modules/pfr/custom/relabelfasta/templates/relabelfasta.py rename to modules/gallvp/custom/relabelfasta/templates/relabelfasta.py index 039941c6..d4af0547 100755 --- a/modules/pfr/custom/relabelfasta/templates/relabelfasta.py +++ b/modules/gallvp/custom/relabelfasta/templates/relabelfasta.py @@ -24,14 +24,10 @@ def create_name_mapping_from_tsv(file_path): orig_id, new_id = columns[0], columns[1] if orig_id in dictionary.keys(): - raise ValueError( - f"{orig_id} is repeated in {file_path}. Each sequence ID should be unique" - ) + raise ValueError(f"{orig_id} is repeated in {file_path}. Each sequence ID should be unique") if new_id in dictionary.values(): - raise ValueError( - f"{new_id} is repeated in {file_path}. Each sequence label should be unique" - ) + raise ValueError(f"{new_id} is repeated in {file_path}. Each sequence label should be unique") dictionary[orig_id] = new_id @@ -60,16 +56,10 @@ def write_fasta_with_new_ids(fasta_file_path, orig_to_new_id_map, file_prefix): ) selected_ids = [record.id for record in replaced_records] - missing_ids = [ - orig_id - for (orig_id, new_id) in orig_to_new_id_map.items() - if new_id not in selected_ids - ] + missing_ids = [orig_id for (orig_id, new_id) in orig_to_new_id_map.items() if new_id not in selected_ids] if len(missing_ids) > 0: - raise ValueError( - f"Some sequences {missing_ids} are missing from the fasta {fasta_file_path}" - ) + raise ValueError(f"Some sequences {missing_ids} are missing from the fasta {fasta_file_path}") SeqIO.write(replaced_records, f"{file_prefix}.fasta", "fasta") diff --git a/modules/pfr/custom/relabelfasta/tests/main.nf.test b/modules/gallvp/custom/relabelfasta/tests/main.nf.test similarity index 82% rename from modules/pfr/custom/relabelfasta/tests/main.nf.test rename to modules/gallvp/custom/relabelfasta/tests/main.nf.test index 64ccb08f..7097845f 100644 --- a/modules/pfr/custom/relabelfasta/tests/main.nf.test +++ b/modules/gallvp/custom/relabelfasta/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "CUSTOM_RELABELFASTA" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "custom" tag "custom/relabelfasta" @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.of('MT192765.1\tChr1').collectFile(name: 'id_map.tsv', newLine: true) """ @@ -38,7 +38,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.of('MT192765.1\\tChr1\\nMT19276\\tChr1').collectFile(name: 'id_map.tsv', newLine: true) """ @@ -61,7 +61,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.of('MT192765.1\\tChr1\\nMT192765.1\\tChr1').collectFile(name: 'id_map.tsv', newLine: true) """ @@ -84,7 +84,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.of('MT192765.1\\tChr1\\nMT192765.1').collectFile(name: 'id_map.tsv', newLine: true) """ @@ -107,7 +107,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.of('MT192765.1\\tChr1\\nMT192765.2\\tChr2').collectFile(name: 'id_map.tsv', newLine: true) """ @@ -133,7 +133,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.of('MT192765.1\tChr1').collectFile(name: 'id_map.tsv', newLine: true) """ diff --git a/modules/pfr/custom/relabelfasta/tests/main.nf.test.snap b/modules/gallvp/custom/relabelfasta/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/custom/relabelfasta/tests/main.nf.test.snap rename to modules/gallvp/custom/relabelfasta/tests/main.nf.test.snap diff --git a/modules/pfr/custom/restoregffids/environment.yml b/modules/gallvp/custom/restoregffids/environment.yml similarity index 100% rename from modules/pfr/custom/restoregffids/environment.yml rename to modules/gallvp/custom/restoregffids/environment.yml diff --git a/modules/pfr/custom/restoregffids/main.nf b/modules/gallvp/custom/restoregffids/main.nf similarity index 100% rename from modules/pfr/custom/restoregffids/main.nf rename to modules/gallvp/custom/restoregffids/main.nf diff --git a/modules/pfr/custom/restoregffids/meta.yml b/modules/gallvp/custom/restoregffids/meta.yml similarity index 100% rename from modules/pfr/custom/restoregffids/meta.yml rename to modules/gallvp/custom/restoregffids/meta.yml diff --git a/modules/pfr/custom/restoregffids/templates/restore_gff_ids.py b/modules/gallvp/custom/restoregffids/templates/restore_gff_ids.py similarity index 100% rename from modules/pfr/custom/restoregffids/templates/restore_gff_ids.py rename to modules/gallvp/custom/restoregffids/templates/restore_gff_ids.py diff --git a/modules/pfr/custom/restoregffids/tests/main.nf.test b/modules/gallvp/custom/restoregffids/tests/main.nf.test similarity index 85% rename from modules/pfr/custom/restoregffids/tests/main.nf.test rename to modules/gallvp/custom/restoregffids/tests/main.nf.test index 20aa85c9..2c248c99 100644 --- a/modules/pfr/custom/restoregffids/tests/main.nf.test +++ b/modules/gallvp/custom/restoregffids/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "CUSTOM_RESTOREGFFIDS" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "custom" tag "custom/restoregffids" @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ] input[1] = Channel.of('Chr1\tMT192765.1').collectFile(name: 'id_map.tsv', newLine: true) """ @@ -43,7 +43,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ] input[1] = Channel.of('Chr1\tMT192765.1').collectFile(name: 'id_map.tsv', newLine: true) """ diff --git a/modules/pfr/custom/restoregffids/tests/main.nf.test.snap b/modules/gallvp/custom/restoregffids/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/custom/restoregffids/tests/main.nf.test.snap rename to modules/gallvp/custom/restoregffids/tests/main.nf.test.snap diff --git a/modules/pfr/custom/shortenfastaids/environment.yml b/modules/gallvp/custom/shortenfastaids/environment.yml similarity index 100% rename from modules/pfr/custom/shortenfastaids/environment.yml rename to modules/gallvp/custom/shortenfastaids/environment.yml diff --git a/modules/pfr/custom/shortenfastaids/main.nf b/modules/gallvp/custom/shortenfastaids/main.nf similarity index 100% rename from modules/pfr/custom/shortenfastaids/main.nf rename to modules/gallvp/custom/shortenfastaids/main.nf diff --git a/modules/pfr/custom/shortenfastaids/meta.yml b/modules/gallvp/custom/shortenfastaids/meta.yml similarity index 100% rename from modules/pfr/custom/shortenfastaids/meta.yml rename to modules/gallvp/custom/shortenfastaids/meta.yml diff --git a/modules/pfr/custom/shortenfastaids/templates/shorten_fasta_ids.py b/modules/gallvp/custom/shortenfastaids/templates/shorten_fasta_ids.py similarity index 88% rename from modules/pfr/custom/shortenfastaids/templates/shorten_fasta_ids.py rename to modules/gallvp/custom/shortenfastaids/templates/shorten_fasta_ids.py index 0ce43903..9d9c6e16 100755 --- a/modules/pfr/custom/shortenfastaids/templates/shorten_fasta_ids.py +++ b/modules/gallvp/custom/shortenfastaids/templates/shorten_fasta_ids.py @@ -61,12 +61,7 @@ def do_id_need_to_change(id_and_description, silent=False): def do_ids_need_to_change(ids_and_descriptions, silent=False): - return any( - [ - do_id_need_to_change(id_and_description, silent) - for id_and_description in ids_and_descriptions - ] - ) + return any([do_id_need_to_change(id_and_description, silent) for id_and_description in ids_and_descriptions]) def extract_common_patterns(ids): @@ -76,9 +71,7 @@ def extract_common_patterns(ids): for pattern in set(patterns): pattern_counts[pattern] = pattern_counts.get(pattern, 0) + 1 - common_patterns = [ - pattern for pattern, count in pattern_counts.items() if count >= 2 - ] + common_patterns = [pattern for pattern, count in pattern_counts.items() if count >= 2] if len(common_patterns) < 1: return {} @@ -126,11 +119,7 @@ def shorten_id_by_pattern_replacement(patterns_dict, id): patterns_dict[pattern], shortened_id, ) - return ( - shortened_id - if shortened_id[len(shortened_id) - 1] != "_" - else shortened_id[0 : (len(shortened_id) - 1)] - ) + return shortened_id if shortened_id[len(shortened_id) - 1] != "_" else shortened_id[0 : (len(shortened_id) - 1)] def match_substrings(substrings, target_string): @@ -169,15 +158,11 @@ def fail_if_new_ids_not_valid(ids): f.write("IDs have acceptable length and character. No change required.") exit(0) - new_ids = shorten_ids( - input_ids_and_descriptions, extract_common_patterns(input_ids) - ) + new_ids = shorten_ids(input_ids_and_descriptions, extract_common_patterns(input_ids)) fail_if_new_ids_not_valid(new_ids) with open(f"{output_files_prefix}.short.ids.tsv", "w") as f: for input_id, new_id in zip(input_ids, new_ids): f.write(f"{input_id}\\t{new_id}\\n") - write_fasta_with_new_ids( - fasta_file_path, zip(input_ids, new_ids), output_files_prefix - ) + write_fasta_with_new_ids(fasta_file_path, zip(input_ids, new_ids), output_files_prefix) diff --git a/modules/pfr/custom/shortenfastaids/tests/main.nf.test b/modules/gallvp/custom/shortenfastaids/tests/main.nf.test similarity index 81% rename from modules/pfr/custom/shortenfastaids/tests/main.nf.test rename to modules/gallvp/custom/shortenfastaids/tests/main.nf.test index c87e8ebf..8eb2099c 100644 --- a/modules/pfr/custom/shortenfastaids/tests/main.nf.test +++ b/modules/gallvp/custom/shortenfastaids/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "CUSTOM_SHORTENFASTAIDS" tag "modules" - tag "modules_pfr" + tag "modules_gallvp" tag "custom" tag "custom/shortenfastaids" @@ -16,7 +16,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] """ } @@ -38,7 +38,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -60,7 +60,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true) ] """ } @@ -105,7 +105,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] """ } diff --git a/modules/pfr/custom/shortenfastaids/tests/main.nf.test.snap b/modules/gallvp/custom/shortenfastaids/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/custom/shortenfastaids/tests/main.nf.test.snap rename to modules/gallvp/custom/shortenfastaids/tests/main.nf.test.snap diff --git a/modules/pfr/gffread/environment.yml b/modules/gallvp/gffread/environment.yml similarity index 100% rename from modules/pfr/gffread/environment.yml rename to modules/gallvp/gffread/environment.yml diff --git a/modules/pfr/gffread/main.nf b/modules/gallvp/gffread/main.nf similarity index 100% rename from modules/pfr/gffread/main.nf rename to modules/gallvp/gffread/main.nf diff --git a/modules/pfr/gffread/meta.yml b/modules/gallvp/gffread/meta.yml similarity index 100% rename from modules/pfr/gffread/meta.yml rename to modules/gallvp/gffread/meta.yml diff --git a/modules/pfr/gffread/tests/main.nf.test b/modules/gallvp/gffread/tests/main.nf.test similarity index 99% rename from modules/pfr/gffread/tests/main.nf.test rename to modules/gallvp/gffread/tests/main.nf.test index 4cd13dcd..17b2ee64 100644 --- a/modules/pfr/gffread/tests/main.nf.test +++ b/modules/gallvp/gffread/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "GFFREAD" tag "gffread" - tag "modules_nfcore" + tag "modules_gallvp" tag "modules" test("sarscov2-gff3-gtf") { diff --git a/modules/pfr/gffread/tests/main.nf.test.snap b/modules/gallvp/gffread/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/gffread/tests/main.nf.test.snap rename to modules/gallvp/gffread/tests/main.nf.test.snap diff --git a/modules/pfr/gffread/tests/nextflow-fasta.config b/modules/gallvp/gffread/tests/nextflow-fasta.config similarity index 100% rename from modules/pfr/gffread/tests/nextflow-fasta.config rename to modules/gallvp/gffread/tests/nextflow-fasta.config diff --git a/modules/pfr/gffread/tests/nextflow-gff3.config b/modules/gallvp/gffread/tests/nextflow-gff3.config similarity index 100% rename from modules/pfr/gffread/tests/nextflow-gff3.config rename to modules/gallvp/gffread/tests/nextflow-gff3.config diff --git a/modules/pfr/gffread/tests/nextflow.config b/modules/gallvp/gffread/tests/nextflow.config similarity index 100% rename from modules/pfr/gffread/tests/nextflow.config rename to modules/gallvp/gffread/tests/nextflow.config diff --git a/modules/pfr/gffread/tests/tags.yml b/modules/gallvp/gffread/tests/tags.yml similarity index 100% rename from modules/pfr/gffread/tests/tags.yml rename to modules/gallvp/gffread/tests/tags.yml diff --git a/modules/pfr/gt/gff3/environment.yml b/modules/gallvp/gt/gff3/environment.yml similarity index 100% rename from modules/pfr/gt/gff3/environment.yml rename to modules/gallvp/gt/gff3/environment.yml diff --git a/modules/pfr/gt/gff3/main.nf b/modules/gallvp/gt/gff3/main.nf similarity index 100% rename from modules/pfr/gt/gff3/main.nf rename to modules/gallvp/gt/gff3/main.nf diff --git a/modules/pfr/gt/gff3/meta.yml b/modules/gallvp/gt/gff3/meta.yml similarity index 100% rename from modules/pfr/gt/gff3/meta.yml rename to modules/gallvp/gt/gff3/meta.yml diff --git a/modules/pfr/gt/gff3/tests/main.nf.test b/modules/gallvp/gt/gff3/tests/main.nf.test similarity index 91% rename from modules/pfr/gt/gff3/tests/main.nf.test rename to modules/gallvp/gt/gff3/tests/main.nf.test index cb44bc8f..f8e8c9fa 100644 --- a/modules/pfr/gt/gff3/tests/main.nf.test +++ b/modules/gallvp/gt/gff3/tests/main.nf.test @@ -6,7 +6,7 @@ nextflow_process { config "./nextflow.config" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "gt" tag "gt/gff3" @@ -16,7 +16,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ] """ } diff --git a/modules/pfr/gt/gff3/tests/main.nf.test.snap b/modules/gallvp/gt/gff3/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/gt/gff3/tests/main.nf.test.snap rename to modules/gallvp/gt/gff3/tests/main.nf.test.snap diff --git a/modules/pfr/gt/gff3/tests/nextflow.config b/modules/gallvp/gt/gff3/tests/nextflow.config similarity index 100% rename from modules/pfr/gt/gff3/tests/nextflow.config rename to modules/gallvp/gt/gff3/tests/nextflow.config diff --git a/modules/pfr/gt/gff3/tests/tags.yml b/modules/gallvp/gt/gff3/tests/tags.yml similarity index 100% rename from modules/pfr/gt/gff3/tests/tags.yml rename to modules/gallvp/gt/gff3/tests/tags.yml diff --git a/modules/pfr/gt/gff3validator/environment.yml b/modules/gallvp/gt/gff3validator/environment.yml similarity index 100% rename from modules/pfr/gt/gff3validator/environment.yml rename to modules/gallvp/gt/gff3validator/environment.yml diff --git a/modules/pfr/gt/gff3validator/main.nf b/modules/gallvp/gt/gff3validator/main.nf similarity index 100% rename from modules/pfr/gt/gff3validator/main.nf rename to modules/gallvp/gt/gff3validator/main.nf diff --git a/modules/pfr/gt/gff3validator/meta.yml b/modules/gallvp/gt/gff3validator/meta.yml similarity index 100% rename from modules/pfr/gt/gff3validator/meta.yml rename to modules/gallvp/gt/gff3validator/meta.yml diff --git a/modules/pfr/gt/gff3validator/tests/main.nf.test b/modules/gallvp/gt/gff3validator/tests/main.nf.test similarity index 81% rename from modules/pfr/gt/gff3validator/tests/main.nf.test rename to modules/gallvp/gt/gff3validator/tests/main.nf.test index 766e3e74..029517c2 100644 --- a/modules/pfr/gt/gff3validator/tests/main.nf.test +++ b/modules/gallvp/gt/gff3validator/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "GT_GFF3VALIDATOR" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "gt" tag "gt/gff3validator" tag "gt/gff3" @@ -16,13 +16,13 @@ nextflow_process { setup { run("GT_GFF3") { - script "../../../../nf-core/gt/gff3" + script "../../../gt/gff3" process { """ input[0] = [ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ] """ } @@ -57,7 +57,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ] """ } @@ -79,7 +79,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gff3', checkIfExists: true) ] """ } diff --git a/modules/pfr/gt/gff3validator/tests/main.nf.test.snap b/modules/gallvp/gt/gff3validator/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/gt/gff3validator/tests/main.nf.test.snap rename to modules/gallvp/gt/gff3validator/tests/main.nf.test.snap diff --git a/modules/pfr/gt/gff3validator/tests/nextflow.config b/modules/gallvp/gt/gff3validator/tests/nextflow.config similarity index 100% rename from modules/pfr/gt/gff3validator/tests/nextflow.config rename to modules/gallvp/gt/gff3validator/tests/nextflow.config diff --git a/modules/pfr/gt/gff3validator/tests/tags.yml b/modules/gallvp/gt/gff3validator/tests/tags.yml similarity index 100% rename from modules/pfr/gt/gff3validator/tests/tags.yml rename to modules/gallvp/gt/gff3validator/tests/tags.yml diff --git a/modules/pfr/gt/stat/environment.yml b/modules/gallvp/gt/stat/environment.yml similarity index 100% rename from modules/pfr/gt/stat/environment.yml rename to modules/gallvp/gt/stat/environment.yml diff --git a/modules/pfr/gt/stat/main.nf b/modules/gallvp/gt/stat/main.nf similarity index 100% rename from modules/pfr/gt/stat/main.nf rename to modules/gallvp/gt/stat/main.nf diff --git a/modules/pfr/gt/stat/meta.yml b/modules/gallvp/gt/stat/meta.yml similarity index 100% rename from modules/pfr/gt/stat/meta.yml rename to modules/gallvp/gt/stat/meta.yml diff --git a/modules/pfr/gt/stat/tests/main.nf.test b/modules/gallvp/gt/stat/tests/main.nf.test similarity index 81% rename from modules/pfr/gt/stat/tests/main.nf.test rename to modules/gallvp/gt/stat/tests/main.nf.test index d1fe2f0d..cdc5d5fd 100644 --- a/modules/pfr/gt/stat/tests/main.nf.test +++ b/modules/gallvp/gt/stat/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "GT_STAT" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "gt" tag "gt/stat" @@ -16,7 +16,7 @@ nextflow_process { """ input[0] = Channel.of( "##gff-version 3" + - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true).text.toLowerCase() + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true).text.toLowerCase() ) .collectFile(name: 'sample.gff3', newLine: true) .map { file -> [ [ id:'test' ], file ] } @@ -43,7 +43,7 @@ nextflow_process { """ input[0] = [ [ id: 'test' ], - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ] """ } diff --git a/modules/pfr/gt/stat/tests/main.nf.test.snap b/modules/gallvp/gt/stat/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/gt/stat/tests/main.nf.test.snap rename to modules/gallvp/gt/stat/tests/main.nf.test.snap diff --git a/modules/pfr/gt/stat/tests/tags.yml b/modules/gallvp/gt/stat/tests/tags.yml similarity index 100% rename from modules/pfr/gt/stat/tests/tags.yml rename to modules/gallvp/gt/stat/tests/tags.yml diff --git a/modules/pfr/ltrfinder/environment.yml b/modules/gallvp/ltrfinder/environment.yml similarity index 100% rename from modules/pfr/ltrfinder/environment.yml rename to modules/gallvp/ltrfinder/environment.yml diff --git a/modules/pfr/ltrfinder/main.nf b/modules/gallvp/ltrfinder/main.nf similarity index 100% rename from modules/pfr/ltrfinder/main.nf rename to modules/gallvp/ltrfinder/main.nf diff --git a/modules/pfr/ltrfinder/meta.yml b/modules/gallvp/ltrfinder/meta.yml similarity index 100% rename from modules/pfr/ltrfinder/meta.yml rename to modules/gallvp/ltrfinder/meta.yml diff --git a/modules/pfr/ltrfinder/tests/main.nf.test b/modules/gallvp/ltrfinder/tests/main.nf.test similarity index 54% rename from modules/pfr/ltrfinder/tests/main.nf.test rename to modules/gallvp/ltrfinder/tests/main.nf.test index 361e7324..c08af00a 100644 --- a/modules/pfr/ltrfinder/tests/main.nf.test +++ b/modules/gallvp/ltrfinder/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "LTRFINDER" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "ltrfinder" tag "gunzip/main" @@ -19,7 +19,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] """ } @@ -37,8 +37,29 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot(path(process.out.versions[0]).text).match("versions") } + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2-genome_fasta-no_ltr") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } @@ -53,7 +74,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] """ } @@ -62,11 +83,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot(path(process.out.versions[0]).text).match("stub_versions") } + { assert snapshot(process.out).match() } ) } } -} \ No newline at end of file +} diff --git a/modules/pfr/ltrfinder/tests/main.nf.test.snap b/modules/gallvp/ltrfinder/tests/main.nf.test.snap similarity index 68% rename from modules/pfr/ltrfinder/tests/main.nf.test.snap rename to modules/gallvp/ltrfinder/tests/main.nf.test.snap index 54a2cee1..0f1790fc 100644 --- a/modules/pfr/ltrfinder/tests/main.nf.test.snap +++ b/modules/gallvp/ltrfinder/tests/main.nf.test.snap @@ -48,15 +48,54 @@ }, "timestamp": "2024-02-16T09:14:38.509965" }, - "versions": { + "sarscov2-genome_fasta-no_ltr": { "content": [ - "\"LTRFINDER\":\n LTR_FINDER_parallel: v1.1\n ltr_finder: v1.07\n" + { + "0": [ + [ + { + "id": "test" + }, + "test.scn:md5,2ce449dff751e59dbc292b6888491954" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.gff3:md5,bddeb04277af08b5850e64708e8af02a" + ] + ], + "2": [ + "versions.yml:md5,7b24225b810fa88cfb2a887de11be333" + ], + "gff": [ + [ + { + "id": "test" + }, + "test.gff3:md5,bddeb04277af08b5850e64708e8af02a" + ] + ], + "scn": [ + [ + { + "id": "test" + }, + "test.scn:md5,2ce449dff751e59dbc292b6888491954" + ] + ], + "versions": [ + "versions.yml:md5,7b24225b810fa88cfb2a887de11be333" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-16T09:16:55.301422" + "timestamp": "2024-07-16T13:03:03.505263" }, "stub": { "content": [ @@ -106,15 +145,5 @@ "nextflow": "23.10.1" }, "timestamp": "2024-02-16T09:14:43.054758" - }, - "stub_versions": { - "content": [ - "\"LTRFINDER\":\n LTR_FINDER_parallel: v1.1\n ltr_finder: v1.07\n" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-16T09:16:59.800724" } } \ No newline at end of file diff --git a/modules/pfr/ltrharvest/environment.yml b/modules/gallvp/ltrharvest/environment.yml similarity index 100% rename from modules/pfr/ltrharvest/environment.yml rename to modules/gallvp/ltrharvest/environment.yml diff --git a/modules/pfr/ltrharvest/main.nf b/modules/gallvp/ltrharvest/main.nf similarity index 100% rename from modules/pfr/ltrharvest/main.nf rename to modules/gallvp/ltrharvest/main.nf diff --git a/modules/pfr/ltrharvest/meta.yml b/modules/gallvp/ltrharvest/meta.yml similarity index 100% rename from modules/pfr/ltrharvest/meta.yml rename to modules/gallvp/ltrharvest/meta.yml diff --git a/modules/gallvp/ltrharvest/tests/main.nf.test b/modules/gallvp/ltrharvest/tests/main.nf.test new file mode 100644 index 00000000..e53f347e --- /dev/null +++ b/modules/gallvp/ltrharvest/tests/main.nf.test @@ -0,0 +1,89 @@ +nextflow_process { + + name "Test Process LTRHARVEST" + script "../main.nf" + process "LTRHARVEST" + + tag "modules" + tag "modules_gallvp" + tag "ltrharvest" + + test("homo_sapiens - genome_21_fasta") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.gff3, + process.out.versions + ).match() + }, + { assert path(process.out.scn[0][1]).text.contains("46510803 46520182 9380 46510803 46510940 138 46520042 46520182 141 86.52 0 chr21") }, + ) + } + + } + + test("sarscov2 - genome_fasta - no_ltr") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.gff3, + process.out.versions + ).match() + }, + { assert path(process.out.scn[0][1]).text.contains("predictions are reported in the following way") }, + ) + } + + } + + test("homo_sapiens - genome_fasta - stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/pfr/ltrharvest/tests/main.nf.test.snap b/modules/gallvp/ltrharvest/tests/main.nf.test.snap similarity index 69% rename from modules/pfr/ltrharvest/tests/main.nf.test.snap rename to modules/gallvp/ltrharvest/tests/main.nf.test.snap index ad47c4ae..f3a8da8c 100644 --- a/modules/pfr/ltrharvest/tests/main.nf.test.snap +++ b/modules/gallvp/ltrharvest/tests/main.nf.test.snap @@ -1,5 +1,25 @@ { - "homo_sapiens-genome_fasta-stub": { + "sarscov2 - genome_fasta - no_ltr": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.gff3:md5,bddeb04277af08b5850e64708e8af02a" + ] + ], + [ + "versions.yml:md5,51e82185b713482d1d48b6f15abe7fcc" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-17T10:40:36.380052" + }, + "homo_sapiens - genome_fasta - stub": { "content": [ { "0": [ @@ -44,21 +64,11 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-22T14:44:30.682167" + "timestamp": "2024-07-17T10:40:40.967557" }, - "script_versions": { - "content": [ - "\"LTRHARVEST\":\n LTR_HARVEST_parallel: v1.1\n genometools: 1.6.5\n" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-22T14:44:26.672478" - }, - "gff3": { + "homo_sapiens - genome_21_fasta": { "content": [ [ [ @@ -67,22 +77,15 @@ }, "test.gff3:md5,da13c4ba22e44ef944ddec38aa72c468" ] + ], + [ + "versions.yml:md5,51e82185b713482d1d48b6f15abe7fcc" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-22T19:29:33.962761" - }, - "stub_versions": { - "content": [ - "\"LTRHARVEST\":\n LTR_HARVEST_parallel: v1.1\n genometools: 1.6.5\n" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-22T14:44:30.729166" + "timestamp": "2024-07-17T10:40:30.946" } } \ No newline at end of file diff --git a/modules/pfr/ltrretriever/lai/environment.yml b/modules/gallvp/ltrretriever/lai/environment.yml similarity index 100% rename from modules/pfr/ltrretriever/lai/environment.yml rename to modules/gallvp/ltrretriever/lai/environment.yml diff --git a/modules/pfr/ltrretriever/lai/main.nf b/modules/gallvp/ltrretriever/lai/main.nf similarity index 100% rename from modules/pfr/ltrretriever/lai/main.nf rename to modules/gallvp/ltrretriever/lai/main.nf diff --git a/modules/pfr/ltrretriever/lai/meta.yml b/modules/gallvp/ltrretriever/lai/meta.yml similarity index 100% rename from modules/pfr/ltrretriever/lai/meta.yml rename to modules/gallvp/ltrretriever/lai/meta.yml diff --git a/modules/pfr/ltrretriever/lai/tests/main.nf.test b/modules/gallvp/ltrretriever/lai/tests/main.nf.test similarity index 89% rename from modules/pfr/ltrretriever/lai/tests/main.nf.test rename to modules/gallvp/ltrretriever/lai/tests/main.nf.test index a617811b..e4289189 100644 --- a/modules/pfr/ltrretriever/lai/tests/main.nf.test +++ b/modules/gallvp/ltrretriever/lai/tests/main.nf.test @@ -6,7 +6,7 @@ nextflow_process { config "./nextflow.config" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "gunzip" tag "ltrretriever" tag "ltrretriever/ltrretriever" @@ -26,7 +26,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] """ } @@ -114,7 +114,7 @@ nextflow_process { input[0] = [ [ id:'test' ], - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] input[1] = pass_list.toPath() input[2] = out_file.toPath() @@ -145,7 +145,7 @@ nextflow_process { input[0] = [ [ id:'test' ], - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] input[1] = pass_list.toPath() input[2] = out_file.toPath() @@ -163,4 +163,4 @@ nextflow_process { } -} \ No newline at end of file +} diff --git a/modules/pfr/ltrretriever/lai/tests/main.nf.test.snap b/modules/gallvp/ltrretriever/lai/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/ltrretriever/lai/tests/main.nf.test.snap rename to modules/gallvp/ltrretriever/lai/tests/main.nf.test.snap diff --git a/modules/pfr/ltrretriever/lai/tests/nextflow.config b/modules/gallvp/ltrretriever/lai/tests/nextflow.config similarity index 100% rename from modules/pfr/ltrretriever/lai/tests/nextflow.config rename to modules/gallvp/ltrretriever/lai/tests/nextflow.config diff --git a/modules/pfr/ltrretriever/lai/tests/tags.yml b/modules/gallvp/ltrretriever/lai/tests/tags.yml similarity index 100% rename from modules/pfr/ltrretriever/lai/tests/tags.yml rename to modules/gallvp/ltrretriever/lai/tests/tags.yml diff --git a/modules/pfr/ltrretriever/ltrretriever/environment.yml b/modules/gallvp/ltrretriever/ltrretriever/environment.yml similarity index 100% rename from modules/pfr/ltrretriever/ltrretriever/environment.yml rename to modules/gallvp/ltrretriever/ltrretriever/environment.yml diff --git a/modules/pfr/ltrretriever/ltrretriever/main.nf b/modules/gallvp/ltrretriever/ltrretriever/main.nf similarity index 62% rename from modules/pfr/ltrretriever/ltrretriever/main.nf rename to modules/gallvp/ltrretriever/ltrretriever/main.nf index f4577920..8e1e2beb 100644 --- a/modules/pfr/ltrretriever/ltrretriever/main.nf +++ b/modules/gallvp/ltrretriever/ltrretriever/main.nf @@ -16,9 +16,9 @@ process LTRRETRIEVER_LTRRETRIEVER { output: tuple val(meta), path("*.log") , emit: log - tuple val(meta), path("${prefix}.pass.list"), emit: pass_list - tuple val(meta), path("*.pass.list.gff3") , emit: pass_list_gff - tuple val(meta), path("*.LTRlib.fa") , emit: ltrlib + tuple val(meta), path("${prefix}.pass.list"), emit: pass_list , optional: true + tuple val(meta), path("*.pass.list.gff3") , emit: pass_list_gff , optional: true + tuple val(meta), path("*.LTRlib.fa") , emit: ltrlib , optional: true tuple val(meta), path("${prefix}.out") , emit: annotation_out , optional: true tuple val(meta), path("*.out.gff3") , emit: annotation_gff , optional: true path "versions.yml" , emit: versions @@ -33,22 +33,39 @@ process LTRRETRIEVER_LTRRETRIEVER { def infinder = finder ? "-infinder $finder" : '' def inmgescan = mgescan ? "-inmgescan $mgescan" : '' def non_tgca_file = non_tgca ? "-nonTGCA $non_tgca" : '' + def writable_genome = "${genome.baseName}.writable.${genome.extension}" + // writable_genome: + // This is needed to avoid LTR_retriever:2.9.9 failure when the input `genome` is + // readonly. LTR_retriever triggers a 'die' if the genome is readonly. + // See: https://github.com/oushujun/LTR_retriever/blob/4039eb7778fd9cbc60021e99a8693285e0fa2daf/LTR_retriever#L312 + // + // This copy with permissions logic can be removed once https://github.com/oushujun/LTR_retriever/issues/176 + // has been resolved. """ + cp \\ + $genome \\ + $writable_genome + + chmod \\ + a+w \\ + $writable_genome + LTR_retriever \\ - -genome $genome \\ + -genome $writable_genome \\ $inharvest \\ $infinder \\ $inmgescan \\ $non_tgca_file \\ -threads $task.cpus \\ $args \\ - &> >(tee "${prefix}.log" 2>&1) + &> >(tee "${prefix}.log" 2>&1) \\ + || echo "Errors from LTR_retriever printed to ${prefix}.log" - mv "${genome}.pass.list" "${prefix}.pass.list" - mv "${genome}.pass.list.gff3" "${prefix}.pass.list.gff3" - mv "${genome}.LTRlib.fa" "${prefix}.LTRlib.fa" - mv "${genome}.out" "${prefix}.out" || echo ".out was not produced" - mv "${genome}.out.gff3" "${prefix}.out.gff3" || echo ".out.gff3 was not produced" + mv "${writable_genome}.pass.list" "${prefix}.pass.list" || echo ".pass.list was not produced" + mv "${writable_genome}.pass.list.gff3" "${prefix}.pass.list.gff3" || echo ".pass.list.gff3 was not produced" + mv "${writable_genome}.LTRlib.fa" "${prefix}.LTRlib.fa" || echo ".LTRlib.fa was not produced" + mv "${writable_genome}.out" "${prefix}.out" || echo ".out was not produced" + mv "${writable_genome}.out.gff3" "${prefix}.out.gff3" || echo ".out.gff3 was not produced" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/pfr/ltrretriever/ltrretriever/meta.yml b/modules/gallvp/ltrretriever/ltrretriever/meta.yml similarity index 100% rename from modules/pfr/ltrretriever/ltrretriever/meta.yml rename to modules/gallvp/ltrretriever/ltrretriever/meta.yml diff --git a/modules/pfr/ltrretriever/ltrretriever/tests/main.nf.test b/modules/gallvp/ltrretriever/ltrretriever/tests/main.nf.test similarity index 53% rename from modules/pfr/ltrretriever/ltrretriever/tests/main.nf.test rename to modules/gallvp/ltrretriever/ltrretriever/tests/main.nf.test index e8e13a60..91b1a104 100644 --- a/modules/pfr/ltrretriever/ltrretriever/tests/main.nf.test +++ b/modules/gallvp/ltrretriever/ltrretriever/tests/main.nf.test @@ -6,49 +6,103 @@ nextflow_process { config "./nextflow.config" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "ltrretriever" tag "ltrretriever/ltrretriever" tag "gunzip/main" - tag "gt/ltrharvest" - tag "gt/suffixerator" + tag "ltrharvest" tag "ltrfinder" tag "cat/cat" - test("actinidia_chinensis-genome_21_fasta_gz-success") { + test("sarscov2-genome-no_ltr") { setup { - run('GUNZIP') { - script "../../../gunzip/main" + run("LTRHARVEST") { + script "../../../ltrharvest" process { """ input[0] = [ - [ id:'test' ], // meta map - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } } - run("GT_SUFFIXERATOR") { - script "../../../gt/suffixerator" + run("LTRFINDER") { + script "../../../ltrfinder" process { """ - input[0] = GUNZIP.out.gunzip - input[1] = 'dna' + input[0] = [ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + run("CAT_CAT") { + script "../../../cat/cat" + + process { + """ + input[0] = LTRHARVEST.out.scn.mix(LTRFINDER.out.scn).groupTuple() + """ + } + } + } + + when { + process { + """ + input[0] = input[0] = [ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[1] = CAT_CAT.out.file_out.map { meta, tabout -> tabout } + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.log[0][1]).text.contains("ERROR: No candidate is found in the file(s) you specified.") }, + { assert snapshot(process.out.versions).match("versions_no_ltr") } + ) + } + + } + + test("actinidia_chinensis-genome_21_fasta_gz-success") { + + setup { + + run('GUNZIP') { + script "../../../gunzip/main" + + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) + ] """ } } - run("GT_LTRHARVEST") { - script "../../../gt/ltrharvest" + run("LTRHARVEST") { + script "../../../ltrharvest" process { """ - input[0] = GT_SUFFIXERATOR.out.index + input[0] = GUNZIP.out.gunzip """ } } @@ -68,7 +122,7 @@ nextflow_process { process { """ - input[0] = GT_LTRHARVEST.out.tabout.mix(LTRFINDER.out.scn).groupTuple() + input[0] = LTRHARVEST.out.scn.mix(LTRFINDER.out.scn).groupTuple() """ } } @@ -90,7 +144,7 @@ nextflow_process { assertAll( { assert process.success }, { assert path(process.out.log[0][1]).text.contains("####### Result files #########") }, - { assert snapshot(process.out.pass_list).match("pass_list") }, + { assert path(process.out.pass_list[0][1]).text.contains("Copia\tLTR") }, { assert path(process.out.pass_list_gff[0][1]).text.contains("chr1\tLTR_retriever\ttarget_site_duplication") }, { assert path(process.out.ltrlib[0][1]).text.contains("LTR#LTR/Copia") }, { assert snapshot(process.out.annotation_out).match("annotation_out") }, @@ -110,7 +164,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -123,11 +177,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot(path(process.out.versions[0]).text).match("versions_stub") } + { assert snapshot(process.out).match() } ) } } -} \ No newline at end of file +} diff --git a/modules/pfr/ltrretriever/ltrretriever/tests/main.nf.test.snap b/modules/gallvp/ltrretriever/ltrretriever/tests/main.nf.test.snap similarity index 85% rename from modules/pfr/ltrretriever/ltrretriever/tests/main.nf.test.snap rename to modules/gallvp/ltrretriever/ltrretriever/tests/main.nf.test.snap index bcf98638..825b1e59 100644 --- a/modules/pfr/ltrretriever/ltrretriever/tests/main.nf.test.snap +++ b/modules/gallvp/ltrretriever/ltrretriever/tests/main.nf.test.snap @@ -1,31 +1,4 @@ { - "versions_stub": { - "content": [ - "\"LTRRETRIEVER_LTRRETRIEVER\":\n LTR_retriever: v2.9.9\n" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-19T11:04:16.007262" - }, - "pass_list": { - "content": [ - [ - [ - { - "id": "test" - }, - "test.pass.list:md5,0c96ee3b48691e65da2235786a926160" - ] - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-19T11:17:50.087449" - }, "versions": { "content": [ "\"LTRRETRIEVER_LTRRETRIEVER\":\n LTR_retriever: v2.9.9\n" @@ -156,14 +129,26 @@ { "id": "test" }, - "test.out:md5,4ecf9226cbd7a3aaf7cf5cfa575fcc6a" + "test.out:md5,33d89bea9031f25de8f0d3591ab94d87" ] ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-16T14:18:02.458476" + }, + "versions_no_ltr": { + "content": [ + [ + "versions.yml:md5,3ab159acaee06b342b56e2d35e5e669b" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" }, - "timestamp": "2024-02-19T11:17:50.150622" + "timestamp": "2024-07-16T14:03:52.324194" } -} \ No newline at end of file +} diff --git a/modules/gallvp/ltrretriever/ltrretriever/tests/nextflow.config b/modules/gallvp/ltrretriever/ltrretriever/tests/nextflow.config new file mode 100644 index 00000000..7f675565 --- /dev/null +++ b/modules/gallvp/ltrretriever/ltrretriever/tests/nextflow.config @@ -0,0 +1,15 @@ +process { + + withName: LTRFINDER { + ext.args = '-harvest_out' + // LTRRETRIEVER_LTRRETRIEVER requires -harvest_out + } + + withName: LTRHARVEST { + ext.prefix = { "${meta.id}_ltrharvest" } + } + + withName: CAT_CAT { + ext.prefix = { "${meta.id}_ltrharvest_ltrfinder.tabout" } + } +} diff --git a/modules/pfr/plotsr/environment.yml b/modules/gallvp/plotsr/environment.yml similarity index 100% rename from modules/pfr/plotsr/environment.yml rename to modules/gallvp/plotsr/environment.yml diff --git a/modules/pfr/plotsr/main.nf b/modules/gallvp/plotsr/main.nf similarity index 100% rename from modules/pfr/plotsr/main.nf rename to modules/gallvp/plotsr/main.nf diff --git a/modules/pfr/plotsr/meta.yml b/modules/gallvp/plotsr/meta.yml similarity index 100% rename from modules/pfr/plotsr/meta.yml rename to modules/gallvp/plotsr/meta.yml diff --git a/modules/pfr/plotsr/tests/main.nf.test b/modules/gallvp/plotsr/tests/main.nf.test similarity index 69% rename from modules/pfr/plotsr/tests/main.nf.test rename to modules/gallvp/plotsr/tests/main.nf.test index f02b8ebf..b85b2660 100644 --- a/modules/pfr/plotsr/tests/main.nf.test +++ b/modules/gallvp/plotsr/tests/main.nf.test @@ -6,43 +6,44 @@ nextflow_process { process "PLOTSR" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "plotsr" tag "minimap2/align" tag "syri" setup { run("MINIMAP2_ALIGN") { - script "modules/pfr/minimap2/align/main.nf" + script "../../minimap2/align" process { """ def genome2_cleanid = file('genome2_cleanid.fasta') - genome2_cleanid.text = file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true).text.replace(/>chr22:16600000-16800000/, '>chr22') + genome2_cleanid.text = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true).text.replace(/>chr22:16600000-16800000/, '>chr22') input[0] = [ [id: 'test'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] input[1] = [ [id: 'reference'], genome2_cleanid ] input[2] = true // bam_format - input[3] = false // cigar_paf_format - input[4] = false // cigar_bam + input[3] = 'bai' // bam_index_extension + input[4] = false // cigar_paf_format + input[5] = false // cigar_bam """ } } run("SYRI") { - script "modules/pfr/syri/main.nf" + script "../../syri" process { """ def genome2_cleanid = file('genome2_cleanid.fasta') - genome2_cleanid.text = file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true).text.replace(/>chr22:16600000-16800000/, '>chr22') + genome2_cleanid.text = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true).text.replace(/>chr22:16600000-16800000/, '>chr22') input[0] = MINIMAP2_ALIGN.out.bam - input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) input[2] = genome2_cleanid input[3] = 'B' """ @@ -59,7 +60,7 @@ nextflow_process { input[0] = SYRI.out.syri input[1] = [ - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), genome2_cleanid ] @@ -94,7 +95,7 @@ nextflow_process { input[0] = SYRI.out.syri input[1] = [ - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), genome2_cleanid ] diff --git a/modules/pfr/plotsr/tests/main.nf.test.snap b/modules/gallvp/plotsr/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/plotsr/tests/main.nf.test.snap rename to modules/gallvp/plotsr/tests/main.nf.test.snap diff --git a/modules/pfr/plotsr/tests/nextflow.config b/modules/gallvp/plotsr/tests/nextflow.config similarity index 100% rename from modules/pfr/plotsr/tests/nextflow.config rename to modules/gallvp/plotsr/tests/nextflow.config diff --git a/modules/pfr/samblaster/environment.yml b/modules/gallvp/samblaster/environment.yml similarity index 100% rename from modules/pfr/samblaster/environment.yml rename to modules/gallvp/samblaster/environment.yml diff --git a/modules/pfr/samblaster/main.nf b/modules/gallvp/samblaster/main.nf similarity index 100% rename from modules/pfr/samblaster/main.nf rename to modules/gallvp/samblaster/main.nf diff --git a/modules/pfr/samblaster/meta.yml b/modules/gallvp/samblaster/meta.yml similarity index 100% rename from modules/pfr/samblaster/meta.yml rename to modules/gallvp/samblaster/meta.yml diff --git a/modules/pfr/samblaster/tests/main.nf.test b/modules/gallvp/samblaster/tests/main.nf.test similarity index 62% rename from modules/pfr/samblaster/tests/main.nf.test rename to modules/gallvp/samblaster/tests/main.nf.test index 06bb9162..9ffac186 100644 --- a/modules/pfr/samblaster/tests/main.nf.test +++ b/modules/gallvp/samblaster/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "SAMBLASTER" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "samblaster" test("homo_sapiens-test_paired_end_umi_unsorted_bam") { @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_unsorted_bam'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_unsorted.bam', checkIfExists: true) ] """ } @@ -24,7 +24,12 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5(), + process.out.versions + ).match() + } ) } @@ -39,7 +44,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_unsorted_bam'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_unsorted.bam', checkIfExists: true) ] """ } @@ -54,4 +59,4 @@ nextflow_process { } -} \ No newline at end of file +} diff --git a/modules/pfr/samblaster/tests/main.nf.test.snap b/modules/gallvp/samblaster/tests/main.nf.test.snap similarity index 56% rename from modules/pfr/samblaster/tests/main.nf.test.snap rename to modules/gallvp/samblaster/tests/main.nf.test.snap index 917c8f1f..1a1481a1 100644 --- a/modules/pfr/samblaster/tests/main.nf.test.snap +++ b/modules/gallvp/samblaster/tests/main.nf.test.snap @@ -36,37 +36,16 @@ }, "homo_sapiens-test_paired_end_umi_unsorted_bam": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,634a6bd541478e970f0a4c279f399889" - ] - ], - "1": [ - "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,634a6bd541478e970f0a4c279f399889" - ] - ], - "versions": [ - "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" - ] - } + "e21efac7a4734b9b16f7210901cf02af", + "c1b74864f32583faf7d9bcd82217ff4c", + [ + "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-26T14:04:38.118875" + "timestamp": "2024-07-29T20:15:04.264504" } } \ No newline at end of file diff --git a/modules/pfr/samblaster/tests/nextflow.config b/modules/gallvp/samblaster/tests/nextflow.config similarity index 100% rename from modules/pfr/samblaster/tests/nextflow.config rename to modules/gallvp/samblaster/tests/nextflow.config diff --git a/modules/pfr/samblaster/tests/tags.yml b/modules/gallvp/samblaster/tests/tags.yml similarity index 100% rename from modules/pfr/samblaster/tests/tags.yml rename to modules/gallvp/samblaster/tests/tags.yml diff --git a/modules/pfr/samtools/faidx/environment.yml b/modules/gallvp/samtools/faidx/environment.yml similarity index 60% rename from modules/pfr/samtools/faidx/environment.yml rename to modules/gallvp/samtools/faidx/environment.yml index 9c24eb0a..f8450fa5 100644 --- a/modules/pfr/samtools/faidx/environment.yml +++ b/modules/gallvp/samtools/faidx/environment.yml @@ -6,5 +6,5 @@ channels: - defaults dependencies: - - bioconda::htslib=1.19.1 - - bioconda::samtools=1.19.2 + - bioconda::htslib=1.20 + - bioconda::samtools=1.20 diff --git a/modules/pfr/samtools/faidx/main.nf b/modules/gallvp/samtools/faidx/main.nf similarity index 94% rename from modules/pfr/samtools/faidx/main.nf rename to modules/gallvp/samtools/faidx/main.nf index cfe7ad95..bdcdbc95 100644 --- a/modules/pfr/samtools/faidx/main.nf +++ b/modules/gallvp/samtools/faidx/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_FAIDX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/pfr/samtools/faidx/meta.yml b/modules/gallvp/samtools/faidx/meta.yml similarity index 100% rename from modules/pfr/samtools/faidx/meta.yml rename to modules/gallvp/samtools/faidx/meta.yml diff --git a/modules/pfr/samtools/faidx/tests/main.nf.test b/modules/gallvp/samtools/faidx/tests/main.nf.test similarity index 99% rename from modules/pfr/samtools/faidx/tests/main.nf.test rename to modules/gallvp/samtools/faidx/tests/main.nf.test index 17244ef2..350f26e0 100644 --- a/modules/pfr/samtools/faidx/tests/main.nf.test +++ b/modules/gallvp/samtools/faidx/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "SAMTOOLS_FAIDX" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "samtools" tag "samtools/faidx" diff --git a/modules/pfr/samtools/faidx/tests/main.nf.test.snap b/modules/gallvp/samtools/faidx/tests/main.nf.test.snap similarity index 86% rename from modules/pfr/samtools/faidx/tests/main.nf.test.snap rename to modules/gallvp/samtools/faidx/tests/main.nf.test.snap index 3e651ef6..3223b72b 100644 --- a/modules/pfr/samtools/faidx/tests/main.nf.test.snap +++ b/modules/gallvp/samtools/faidx/tests/main.nf.test.snap @@ -18,7 +18,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ @@ -36,7 +36,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -44,7 +44,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:22:39.412601" + "timestamp": "2024-05-28T15:42:14.779784761" }, "test_samtools_faidx_bgzip": { "content": [ @@ -71,7 +71,7 @@ ] ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ @@ -95,7 +95,7 @@ ] ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -103,7 +103,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:23:22.427966" + "timestamp": "2024-05-28T15:42:20.256633877" }, "test_samtools_faidx_fasta": { "content": [ @@ -124,7 +124,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ [ @@ -142,7 +142,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -150,7 +150,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:24:04.107537" + "timestamp": "2024-05-28T15:42:25.632577273" }, "test_samtools_faidx_stub_fasta": { "content": [ @@ -171,7 +171,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ [ @@ -189,7 +189,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -197,7 +197,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:24:45.868463" + "timestamp": "2024-05-28T15:42:31.058424849" }, "test_samtools_faidx_stub_fai": { "content": [ @@ -218,7 +218,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ @@ -236,7 +236,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -244,6 +244,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:25:27.550554" + "timestamp": "2024-05-28T15:42:36.479929617" } } \ No newline at end of file diff --git a/modules/pfr/samtools/faidx/tests/nextflow.config b/modules/gallvp/samtools/faidx/tests/nextflow.config similarity index 100% rename from modules/pfr/samtools/faidx/tests/nextflow.config rename to modules/gallvp/samtools/faidx/tests/nextflow.config diff --git a/modules/pfr/samtools/faidx/tests/nextflow2.config b/modules/gallvp/samtools/faidx/tests/nextflow2.config similarity index 100% rename from modules/pfr/samtools/faidx/tests/nextflow2.config rename to modules/gallvp/samtools/faidx/tests/nextflow2.config diff --git a/modules/pfr/samtools/faidx/tests/tags.yml b/modules/gallvp/samtools/faidx/tests/tags.yml similarity index 100% rename from modules/pfr/samtools/faidx/tests/tags.yml rename to modules/gallvp/samtools/faidx/tests/tags.yml diff --git a/modules/gallvp/seqkit/seq/environment.yml b/modules/gallvp/seqkit/seq/environment.yml new file mode 100644 index 00000000..74e0dd76 --- /dev/null +++ b/modules/gallvp/seqkit/seq/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "seqkit_seq" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::seqkit=2.8.1" diff --git a/modules/gallvp/seqkit/seq/main.nf b/modules/gallvp/seqkit/seq/main.nf new file mode 100644 index 00000000..d7d38fc8 --- /dev/null +++ b/modules/gallvp/seqkit/seq/main.nf @@ -0,0 +1,63 @@ +process SEQKIT_SEQ { + tag "$meta.id" + label 'process_low' + // File IO can be a bottleneck. See: https://bioinf.shenwei.me/seqkit/usage/#parallelization-of-cpu-intensive-jobs + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqkit:2.8.1--h9ee0642_0': + 'biocontainers/seqkit:2.8.1--h9ee0642_0' }" + + input: + tuple val(meta), path(fastx) + + output: + tuple val(meta), path("${prefix}.*") , emit: fastx + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def extension = "fastq" + if ("$fastx" ==~ /.+\.fasta|.+\.fasta.gz|.+\.fa|.+\.fa.gz|.+\.fas|.+\.fas.gz|.+\.fna|.+\.fna.gz|.+\.fsa|.+\.fsa.gz/ ) { + extension = "fasta" + } + extension = fastx.toString().endsWith('.gz') ? "${extension}.gz" : extension + def call_gzip = extension.endsWith('.gz') ? "| gzip -c $args2" : '' + if("${prefix}.${extension}" == "$fastx") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + seqkit \\ + seq \\ + --threads $task.cpus \\ + $args \\ + $fastx \\ + $call_gzip \\ + > ${prefix}.${extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqkit: \$(seqkit version | cut -d' ' -f2) + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + def extension = "fastq" + if ("$fastx" ==~ /.+\.fasta|.+\.fasta.gz|.+\.fa|.+\.fa.gz|.+\.fas|.+\.fas.gz|.+\.fna|.+\.fna.gz|.+\.fsa|.+\.fsa.gz/ ) { + extension = "fasta" + } + extension = fastx.toString().endsWith('.gz') ? "${extension}.gz" : extension + if("${prefix}.${extension}" == "$fastx") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + touch ${prefix}.${extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqkit: \$(seqkit version | cut -d' ' -f2) + END_VERSIONS + """ +} diff --git a/modules/gallvp/seqkit/seq/meta.yml b/modules/gallvp/seqkit/seq/meta.yml new file mode 100644 index 00000000..8d4e2b16 --- /dev/null +++ b/modules/gallvp/seqkit/seq/meta.yml @@ -0,0 +1,48 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "seqkit_seq" +description: Transforms sequences (extract ID, filter by length, remove gaps, reverse complement...) +keywords: + - genomics + - fasta + - fastq + - transform + - filter + - gaps + - complement +tools: + - "seqkit": + description: "A cross-platform and ultrafast toolkit for FASTA/Q file manipulation" + homepage: "https://bioinf.shenwei.me/seqkit/" + documentation: "https://bioinf.shenwei.me/seqkit/usage/" + tool_dev_url: "https://github.com/shenwei356/seqkit" + doi: "10.1371/journal.pone.0163962" + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fastx: + type: file + description: Input fasta/fastq file + pattern: "*.{fsa,fas,fa,fasta,fastq,fq,fsa.gz,fas.gz,fa.gz,fasta.gz,fastq.gz,fq.gz}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fastx: + type: file + description: Output fasta/fastq file + pattern: "*.{fasta,fasta.gz,fastq,fastq.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@GallVp" +maintainers: + - "@GallVp" diff --git a/modules/gallvp/seqkit/seq/tests/main.nf.test b/modules/gallvp/seqkit/seq/tests/main.nf.test new file mode 100644 index 00000000..cff90067 --- /dev/null +++ b/modules/gallvp/seqkit/seq/tests/main.nf.test @@ -0,0 +1,145 @@ +nextflow_process { + + name "Test Process SEQKIT_SEQ" + script "../main.nf" + process "SEQKIT_SEQ" + config './nextflow.config' + + tag "modules" + tag "modules_gallvp" + tag "seqkit" + tag "seqkit/seq" + + test("sarscov2-genome_fasta") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + + } + + test("sarscov2-genome_fasta_gz") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + + } + + test("sarscov2-test_1_fastq_gz") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + + } + + test("file_name_conflict-fail_with_error") { + when { + process { + """ + input[0] = [ + [ id:'test_1' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert !process.success }, + { assert process.stdout.toString().contains("Input and output names are the same") } + ) + } + + } + + test("sarscov2-genome_fasta-stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + + } + + test("file_name_conflict-fail_with_error-stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'genome' ], // meta map + 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/gallvp/seqkit/seq/tests/main.nf.test.snap b/modules/gallvp/seqkit/seq/tests/main.nf.test.snap new file mode 100644 index 00000000..e6910966 --- /dev/null +++ b/modules/gallvp/seqkit/seq/tests/main.nf.test.snap @@ -0,0 +1,134 @@ +{ + "sarscov2-genome_fasta-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ], + "fastx": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-08T08:52:18.220051903" + }, + "sarscov2-test_1_fastq_gz": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ], + "fastx": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-08T08:51:55.607826581" + }, + "sarscov2-genome_fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fasta:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + "1": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ], + "fastx": [ + [ + { + "id": "test" + }, + "test.fasta:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + "versions": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-08T08:51:27.717072933" + }, + "sarscov2-genome_fasta_gz": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fasta.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + "1": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ], + "fastx": [ + [ + { + "id": "test" + }, + "test.fasta.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + "versions": [ + "versions.yml:md5,34894c4efa5e10a923e78975a3d260dd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-08T08:51:37.917560104" + } +} \ No newline at end of file diff --git a/modules/gallvp/seqkit/seq/tests/nextflow.config b/modules/gallvp/seqkit/seq/tests/nextflow.config new file mode 100644 index 00000000..d8e3c66a --- /dev/null +++ b/modules/gallvp/seqkit/seq/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args2 = '-n' +} diff --git a/modules/gallvp/seqkit/seq/tests/tags.yml b/modules/gallvp/seqkit/seq/tests/tags.yml new file mode 100644 index 00000000..5eeca7e3 --- /dev/null +++ b/modules/gallvp/seqkit/seq/tests/tags.yml @@ -0,0 +1,2 @@ +seqkit/seq: + - "modules/nf-core/seqkit/seq/**" diff --git a/modules/pfr/syri/environment.yml b/modules/gallvp/syri/environment.yml similarity index 88% rename from modules/pfr/syri/environment.yml rename to modules/gallvp/syri/environment.yml index 45eafb1f..0a34f206 100644 --- a/modules/pfr/syri/environment.yml +++ b/modules/gallvp/syri/environment.yml @@ -6,4 +6,4 @@ channels: - bioconda - defaults dependencies: - - "bioconda::syri=1.6.3" + - "bioconda::syri=1.7.0" diff --git a/modules/pfr/syri/main.nf b/modules/gallvp/syri/main.nf similarity index 92% rename from modules/pfr/syri/main.nf rename to modules/gallvp/syri/main.nf index 0a10ae19..655018b5 100644 --- a/modules/pfr/syri/main.nf +++ b/modules/gallvp/syri/main.nf @@ -4,8 +4,8 @@ process SYRI { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/syri:1.6.3--py38hdbdd923_2': - 'biocontainers/syri:1.6.3--py38hdbdd923_2' }" + 'https://depot.galaxyproject.org/singularity/syri:1.7.0--py310hdbdd923_0': + 'biocontainers/syri:1.7.0--py310hdbdd923_0' }" input: tuple val(meta), path(infile) diff --git a/modules/pfr/syri/meta.yml b/modules/gallvp/syri/meta.yml similarity index 100% rename from modules/pfr/syri/meta.yml rename to modules/gallvp/syri/meta.yml diff --git a/modules/pfr/syri/tests/main.nf.test b/modules/gallvp/syri/tests/main.nf.test similarity index 56% rename from modules/pfr/syri/tests/main.nf.test rename to modules/gallvp/syri/tests/main.nf.test index baa8555c..27f4f8b3 100644 --- a/modules/pfr/syri/tests/main.nf.test +++ b/modules/gallvp/syri/tests/main.nf.test @@ -6,26 +6,27 @@ nextflow_process { process "SYRI" tag "modules" - tag "modules_nfcore" + tag "modules_gallvp" tag "syri" tag "minimap2/align" setup { run("MINIMAP2_ALIGN") { - script "modules/pfr/minimap2/align/main.nf" + script "../../minimap2/align" process { """ input[0] = [ [id: 'test'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] input[1] = [ [id: 'reference'], - file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true) ] input[2] = true // bam_format - input[3] = false // cigar_paf_format - input[4] = false // cigar_bam + input[3] = 'bai' // bam_index_extension + input[4] = false // cigar_paf_format + input[5] = false // cigar_bam """ } } @@ -37,8 +38,8 @@ nextflow_process { process { """ input[0] = MINIMAP2_ALIGN.out.bam - input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - input[2] = file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true) input[3] = 'B' """ } @@ -61,8 +62,8 @@ nextflow_process { process { """ input[0] = MINIMAP2_ALIGN.out.bam - input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - input[2] = file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true) input[3] = 'B' """ } diff --git a/modules/pfr/syri/tests/main.nf.test.snap b/modules/gallvp/syri/tests/main.nf.test.snap similarity index 79% rename from modules/pfr/syri/tests/main.nf.test.snap rename to modules/gallvp/syri/tests/main.nf.test.snap index 8d09bf33..dd39565b 100644 --- a/modules/pfr/syri/tests/main.nf.test.snap +++ b/modules/gallvp/syri/tests/main.nf.test.snap @@ -14,7 +14,7 @@ ], "2": [ - "versions.yml:md5,05cf55e24c29c2661a2b9301d3c7c2a0" + "versions.yml:md5,0c85b0fa3d80a73807daf08b7e4c51f6" ], "error": [ @@ -28,15 +28,15 @@ ] ], "versions": [ - "versions.yml:md5,05cf55e24c29c2661a2b9301d3c7c2a0" + "versions.yml:md5,0c85b0fa3d80a73807daf08b7e4c51f6" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-05-25T21:30:50.653501" + "timestamp": "2024-07-22T14:11:06.589243" }, "homo_sapiens - genome - stub": { "content": [ @@ -53,7 +53,7 @@ ], "2": [ - "versions.yml:md5,05cf55e24c29c2661a2b9301d3c7c2a0" + "versions.yml:md5,0c85b0fa3d80a73807daf08b7e4c51f6" ], "error": [ @@ -67,14 +67,14 @@ ] ], "versions": [ - "versions.yml:md5,05cf55e24c29c2661a2b9301d3c7c2a0" + "versions.yml:md5,0c85b0fa3d80a73807daf08b7e4c51f6" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-05-25T21:22:31.028411" + "timestamp": "2024-07-22T14:11:12.583161" } } \ No newline at end of file diff --git a/modules/pfr/syri/tests/nextflow.config b/modules/gallvp/syri/tests/nextflow.config similarity index 100% rename from modules/pfr/syri/tests/nextflow.config rename to modules/gallvp/syri/tests/nextflow.config diff --git a/modules/local/assemblathon_stats.nf b/modules/local/assemblathon_stats.nf index 3ef37de5..363a0e21 100644 --- a/modules/local/assemblathon_stats.nf +++ b/modules/local/assemblathon_stats.nf @@ -28,7 +28,7 @@ process ASSEMBLATHON_STATS { | xargs ) - falite_path="\$(find \$paths_to_check -name FAlite_a93cba2.pm)" + falite_path="\$(find \$paths_to_check -name FAlite_a93cba2.pm | head -n 1)" ln -s "\$falite_path" FAlite_a93cba2.pm diff --git a/modules/local/ncbi_fcs_gx_screen_samples.nf b/modules/local/ncbi_fcs_gx_screen_samples.nf index f9ed5cc8..24276f61 100644 --- a/modules/local/ncbi_fcs_gx_screen_samples.nf +++ b/modules/local/ncbi_fcs_gx_screen_samples.nf @@ -2,10 +2,10 @@ process NCBI_FCS_GX_SCREEN_SAMPLES { tag 'all samples' label 'process_high' - conda "bioconda::ncbi-fcs-gx=0.5.0" + conda "bioconda::ncbi-fcs-gx=0.5.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ncbi-fcs-gx:0.5.0--h4ac6f70_3': - 'biocontainers/ncbi-fcs-gx:0.5.0--h4ac6f70_3' }" + 'https://depot.galaxyproject.org/singularity/ncbi-fcs-gx:0.5.4--h4ac6f70_0': + 'biocontainers/ncbi-fcs-gx:0.5.4--h4ac6f70_0' }" input: path samples @@ -21,12 +21,20 @@ process NCBI_FCS_GX_SCREEN_SAMPLES { task.ext.when == null || task.ext.when script: - def VERSION = 0.5 + def VERSION = '0.5.4' """ + export GX_NUM_CORES=$task.cpus + for sample_fasta in $samples; do sample_tag=\$(echo "\$sample_fasta" | sed 's/fasta.file.for.//g' | sed 's/.fasta//g') - run_gx.py --fasta ./\$sample_fasta --out-dir ./ --gx-db $db_path --tax-id "${tax_id}" + + run_gx.py \\ + --fasta ./\$sample_fasta \\ + --out-dir ./ \\ + --gx-db $db_path \\ + --tax-id "${tax_id}" \\ + --phone-home-label github/$workflow.manifest.name mv "\${sample_fasta%.fasta}.${tax_id}.fcs_gx_report.txt" "\${sample_tag}.fcs_gx_report.txt" mv "\${sample_fasta%.fasta}.${tax_id}.taxonomy.rpt" "\${sample_tag}.taxonomy.rpt" @@ -39,7 +47,7 @@ process NCBI_FCS_GX_SCREEN_SAMPLES { """ stub: - def VERSION = 0.5 + def VERSION = '0.5.4' """ for sample_fasta in $samples; do diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index 4fc19b74..e1b9f565 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -10,6 +10,7 @@ process FASTP { input: tuple val(meta), path(reads) path adapter_fasta + val discard_trimmed_pass val save_trimmed_fail val save_merged @@ -18,9 +19,9 @@ process FASTP { tuple val(meta), path('*.json') , emit: json tuple val(meta), path('*.html') , emit: html tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: versions tuple val(meta), path('*.fail.fastq.gz') , optional:true, emit: reads_fail tuple val(meta), path('*.merged.fastq.gz'), optional:true, emit: reads_merged + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -30,6 +31,8 @@ process FASTP { def prefix = task.ext.prefix ?: "${meta.id}" def adapter_list = adapter_fasta ? "--adapter_fasta ${adapter_fasta}" : "" def fail_fastq = save_trimmed_fail && meta.single_end ? "--failed_out ${prefix}.fail.fastq.gz" : save_trimmed_fail && !meta.single_end ? "--failed_out ${prefix}.paired.fail.fastq.gz --unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' + def out_fq1 = discard_trimmed_pass ?: ( meta.single_end ? "--out1 ${prefix}.fastp.fastq.gz" : "--out1 ${prefix}_1.fastp.fastq.gz" ) + def out_fq2 = discard_trimmed_pass ?: "--out2 ${prefix}_2.fastp.fastq.gz" // Added soft-links to original fastqs for consistent naming in MultiQC // Use single ended for interleaved. Add --interleaved_in in config. if ( task.ext.args?.contains('--interleaved_in') ) { @@ -59,7 +62,7 @@ process FASTP { fastp \\ --in1 ${prefix}.fastq.gz \\ - --out1 ${prefix}.fastp.fastq.gz \\ + $out_fq1 \\ --thread $task.cpus \\ --json ${prefix}.fastp.json \\ --html ${prefix}.fastp.html \\ @@ -81,8 +84,8 @@ process FASTP { fastp \\ --in1 ${prefix}_1.fastq.gz \\ --in2 ${prefix}_2.fastq.gz \\ - --out1 ${prefix}_1.fastp.fastq.gz \\ - --out2 ${prefix}_2.fastp.fastq.gz \\ + $out_fq1 \\ + $out_fq2 \\ --json ${prefix}.fastp.json \\ --html ${prefix}.fastp.html \\ $adapter_list \\ @@ -103,14 +106,16 @@ process FASTP { stub: def prefix = task.ext.prefix ?: "${meta.id}" def is_single_output = task.ext.args?.contains('--interleaved_in') || meta.single_end - def touch_reads = is_single_output ? "${prefix}.fastp.fastq.gz" : "${prefix}_1.fastp.fastq.gz ${prefix}_2.fastp.fastq.gz" - def touch_merged = (!is_single_output && save_merged) ? "touch ${prefix}.merged.fastq.gz" : "" + def touch_reads = (discard_trimmed_pass) ? "" : (is_single_output) ? "echo '' | gzip > ${prefix}.fastp.fastq.gz" : "echo '' | gzip > ${prefix}_1.fastp.fastq.gz ; echo '' | gzip > ${prefix}_2.fastp.fastq.gz" + def touch_merged = (!is_single_output && save_merged) ? "echo '' | gzip > ${prefix}.merged.fastq.gz" : "" + def touch_fail_fastq = (!save_trimmed_fail) ? "" : meta.single_end ? "echo '' | gzip > ${prefix}.fail.fastq.gz" : "echo '' | gzip > ${prefix}.paired.fail.fastq.gz ; echo '' | gzip > ${prefix}_1.fail.fastq.gz ; echo '' | gzip > ${prefix}_2.fail.fastq.gz" """ - touch $touch_reads + $touch_reads + $touch_fail_fastq + $touch_merged touch "${prefix}.fastp.json" touch "${prefix}.fastp.html" touch "${prefix}.fastp.log" - $touch_merged cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/fastp/meta.yml b/modules/nf-core/fastp/meta.yml index c22a16ab..8dfecc18 100644 --- a/modules/nf-core/fastp/meta.yml +++ b/modules/nf-core/fastp/meta.yml @@ -27,12 +27,16 @@ input: type: file description: File in FASTA format containing possible adapters to remove. pattern: "*.{fasta,fna,fas,fa}" + - discard_trimmed_pass: + type: boolean + description: Specify true to not write any reads that pass trimming thresholds. | + This can be used to use fastp for the output report only. - save_trimmed_fail: type: boolean description: Specify true to save files that failed to pass trimming thresholds ending in `*.fail.fastq.gz` - save_merged: type: boolean - description: Specify true to save all merged reads to the a file ending in `*.merged.fastq.gz` + description: Specify true to save all merged reads to a file ending in `*.merged.fastq.gz` output: - meta: type: map diff --git a/modules/nf-core/fastp/tests/main.nf.test b/modules/nf-core/fastp/tests/main.nf.test index 6f1f4897..30dbb8aa 100644 --- a/modules/nf-core/fastp/tests/main.nf.test +++ b/modules/nf-core/fastp/tests/main.nf.test @@ -10,221 +10,290 @@ nextflow_process { test("test_fastp_single_end") { when { - params { - outdir = "$outputDir" - } + process { """ - adapter_fasta = [] - save_trimmed_fail = false - save_merged = false - input[0] = Channel.of([ [ id:'test', single_end:true ], [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = false + input[4] = false """ } } then { - def html_text = [ "Q20 bases:12.922000 K (92.984097%)", - "single end (151 cycles)" ] - def log_text = [ "Q20 bases: 12922(92.9841%)", - "reads passed filter: 99" ] - def read_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", - "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", - "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE - { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { assert snapshot(process.out.json).match("test_fastp_single_end_json") }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { file(it[1]).getName() } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_single_end-_match") - }, - { assert snapshot(process.out.versions).match("versions_single_end") } + { assert path(process.out.html.get(0).get(1)).getText().contains("single end (151 cycles)") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("reads passed filter: 99") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads_fail, + process.out.reads_merged, + process.out.versions).match() } ) } } - test("test_fastp_single_end-stub") { - - options '-stub' + test("test_fastp_paired_end") { when { - params { - outdir = "$outputDir" - } + process { """ adapter_fasta = [] + save_trimmed_pass = true save_trimmed_fail = false save_merged = false input[0] = Channel.of([ - [ id:'test', single_end:true ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + [ 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = false + input[4] = false """ } } then { + assertAll( + { assert process.success }, + { assert path(process.out.html.get(0).get(1)).getText().contains("The input has little adapter percentage (~0.000000%), probably it's trimmed before.") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("Q30 bases: 12281(88.3716%)") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads_fail, + process.out.reads_merged, + process.out.versions).match() } + ) + } + } + test("fastp test_fastp_interleaved") { + + config './nextflow.interleaved.config' + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) ] + ]) + input[1] = [] + input[2] = false + input[3] = false + input[4] = false + """ + } + } + + then { assertAll( { assert process.success }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { file(it[1]).getName() } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_single_end-for_stub_match") - }, - { assert snapshot(process.out.versions).match("versions_single_end_stub") } + { assert path(process.out.html.get(0).get(1)).getText().contains("paired end (151 cycles + 151 cycles)") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("reads passed filter: 162") }, + { assert process.out.reads_fail == [] }, + { assert process.out.reads_merged == [] }, + { assert snapshot( + process.out.reads, + process.out.json, + process.out.versions).match() } ) } } - test("test_fastp_paired_end") { + test("test_fastp_single_end_trim_fail") { 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] = [] + input[2] = false + input[3] = true + input[4] = false + """ } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.html.get(0).get(1)).getText().contains("single end (151 cycles)") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("reads passed filter: 99") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads_fail, + process.out.reads_merged, + process.out.versions).match() } + ) + } + } + + test("test_fastp_paired_end_trim_fail") { + + config './nextflow.save_failed.config' + when { process { """ - adapter_fasta = [] - save_trimmed_fail = false - save_merged = false + 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)] + ]) + input[1] = [] + input[2] = false + input[3] = true + input[4] = false + """ + } + } + then { + assertAll( + { assert process.success }, + { assert path(process.out.html.get(0).get(1)).getText().contains("The input has little adapter percentage (~0.000000%), probably it's trimmed before.") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("reads passed filter: 162") }, + { assert snapshot( + process.out.reads, + process.out.reads_fail, + process.out.reads_merged, + process.out.json, + process.out.versions).match() } + ) + } + } + + test("test_fastp_paired_end_merged") { + + when { + 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = false + input[4] = true """ } } then { - def html_text = [ "Q20 bases:25.719000 K (93.033098%)", - "The input has little adapter percentage (~0.000000%), probably it's trimmed before."] - def log_text = [ "No adapter detected for read1", - "Q30 bases: 12281(88.3716%)"] - def json_text = ['"passed_filter_reads": 198'] - def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", - "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", - "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE - { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } - } - }, - { read2_lines.each { read2_line -> - { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { json_text.each { json_part -> - { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } - } - }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_paired_end_match") - }, - { assert snapshot(process.out.versions).match("versions_paired_end") } + { assert path(process.out.html.get(0).get(1)).getText().contains("The input has little adapter percentage (~0.000000%), probably it's trimmed before.") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("total reads: 75") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads_fail, + process.out.reads_merged, + process.out.versions).match() }, ) } } - test("test_fastp_paired_end-stub") { - - options '-stub' + test("test_fastp_paired_end_merged_adapterlist") { 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) ] + ]) + input[1] = Channel.of([ file(params.modules_testdata_base_path + 'delete_me/fastp/adapters.fasta', checkIfExists: true) ]) + input[2] = false + input[3] = false + input[4] = true + """ } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.html.get(0).get(1)).getText().contains("
") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("total bases: 13683") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads_fail, + process.out.reads_merged, + process.out.versions).match() } + ) + } + } + + test("test_fastp_single_end_qc_only") { + + when { process { """ - adapter_fasta = [] - save_trimmed_fail = false - save_merged = false + input[0] = Channel.of([ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + input[1] = [] + input[2] = true + input[3] = false + input[4] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.html.get(0).get(1)).getText().contains("single end (151 cycles)") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("reads passed filter: 99") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads, + process.out.reads_fail, + process.out.reads_fail, + process.out.reads_merged, + process.out.reads_merged, + process.out.versions).match() } + ) + } + } + test("test_fastp_paired_end_qc_only") { + + when { + 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = true + input[3] = false + input[4] = false """ } } @@ -232,114 +301,99 @@ nextflow_process { then { assertAll( { assert process.success }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_paired_end-for_stub_match") - }, - { assert snapshot(process.out.versions).match("versions_paired_end-stub") } + { assert path(process.out.html.get(0).get(1)).getText().contains("The input has little adapter percentage (~0.000000%), probably it's trimmed before.") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("Q30 bases: 12281(88.3716%)") }, + { assert snapshot( + process.out.json, + process.out.reads, + process.out.reads, + process.out.reads_fail, + process.out.reads_fail, + process.out.reads_merged, + process.out.reads_merged, + process.out.versions).match() } ) } } - test("fastp test_fastp_interleaved") { + test("test_fastp_single_end - stub") { + + options "-stub" - config './nextflow.interleaved.config' when { - params { - outdir = "$outputDir" + + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + input[1] = [] + input[2] = false + input[3] = false + input[4] = false + """ } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_fastp_paired_end - stub") { + + options "-stub" + + when { + process { """ adapter_fasta = [] + save_trimmed_pass = true save_trimmed_fail = false save_merged = false input[0] = Channel.of([ - [ id:'test', single_end:true ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) ] + [ 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = false + input[4] = false """ } } then { - def html_text = [ "Q20 bases:25.719000 K (93.033098%)", - "paired end (151 cycles + 151 cycles)"] - def log_text = [ "Q20 bases: 12922(92.9841%)", - "reads passed filter: 162"] - def read_lines = [ "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", - "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", - "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE - { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { assert snapshot(process.out.json).match("fastp test_fastp_interleaved_json") }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { file(it[1]).getName() } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_interleaved-_match") - }, - { assert snapshot(process.out.versions).match("versions_interleaved") } + { assert snapshot(process.out).match() } ) } } - test("fastp test_fastp_interleaved-stub") { + test("fastp - stub test_fastp_interleaved") { - options '-stub' + options "-stub" config './nextflow.interleaved.config' when { - params { - outdir = "$outputDir" - } process { """ - adapter_fasta = [] - save_trimmed_fail = false - save_merged = false - input[0] = Channel.of([ [ id:'test', single_end:true ], // meta map [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = false + input[4] = false """ } } @@ -347,277 +401,112 @@ nextflow_process { then { assertAll( { assert process.success }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { file(it[1]).getName() } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_interleaved-for_stub_match") - }, - { assert snapshot(process.out.versions).match("versions_interleaved-stub") } + { assert snapshot(process.out).match() } ) } } - test("test_fastp_single_end_trim_fail") { + test("test_fastp_single_end_trim_fail - stub") { + + options "-stub" when { - params { - outdir = "$outputDir" - } + process { """ - adapter_fasta = [] - save_trimmed_fail = true - save_merged = false - 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] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = true + input[4] = false """ } } then { - def html_text = [ "Q20 bases:12.922000 K (92.984097%)", - "single end (151 cycles)"] - def log_text = [ "Q20 bases: 12922(92.9841%)", - "reads passed filter: 99" ] - def read_lines = [ "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", - "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", - "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE - { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } - } - }, - { failed_read_lines.each { failed_read_line -> - { assert path(process.out.reads_fail.get(0).get(1)).linesGzip.contains(failed_read_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { assert snapshot(process.out.json).match("test_fastp_single_end_trim_fail_json") }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { assert snapshot(process.out.versions).match("versions_single_end_trim_fail") } + { assert snapshot(process.out).match() } ) } } - test("test_fastp_paired_end_trim_fail") { + test("test_fastp_paired_end_trim_fail - stub") { + + options "-stub" config './nextflow.save_failed.config' when { - params { - outdir = "$outputDir" - } process { """ - adapter_fasta = [] - save_trimmed_fail = true - save_merged = false - 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)] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = true + input[4] = false """ } } then { - def html_text = [ "Q20 bases:25.719000 K (93.033098%)", - "The input has little adapter percentage (~0.000000%), probably it's trimmed before."] - def log_text = [ "No adapter detected for read1", - "Q30 bases: 12281(88.3716%)"] - def json_text = ['"passed_filter_reads": 162'] - def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", - "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", - "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE - { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } - } - }, - { read2_lines.each { read2_line -> - { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } - } - }, - { failed_read2_lines.each { failed_read2_line -> - { assert path(process.out.reads_fail.get(0).get(1).get(2)).linesGzip.contains(failed_read2_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { json_text.each { json_part -> - { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } - } - }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { assert snapshot(process.out.versions).match("versions_paired_end_trim_fail") } + { assert snapshot(process.out).match() } ) } } - test("test_fastp_paired_end_merged") { + test("test_fastp_paired_end_merged - stub") { + + options "-stub" when { - params { - outdir = "$outputDir" - } process { """ - adapter_fasta = [] - save_trimmed_fail = false - save_merged = true 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = false + input[3] = false + input[4] = true """ } } then { - def html_text = [ "
"] - def log_text = [ "Merged and filtered:", - "total reads: 75", - "total bases: 13683"] - def json_text = ['"merged_and_filtered": {', '"total_reads": 75', '"total_bases": 13683'] - def read1_lines = [ "@ERR5069949.1066259 NS500628:121:HK3MMAFX2:1:11312:18369:8333/1", - "CCTTATGACAGCAAGAACTGTGTATGATGATGGTGCTAGGAGAGTGTGGACACTTATGAATGTCTTGACACTCGTTTATAAAGTTTATTATGGTAATGCTTTAGATCAAGCCATTTCCATGTGGGCTCTTATAATCTCTGTTACTTC", - "AAAAAEAEEAEEEEEEEEEEEEEEEEAEEEEAEEEEEEEEAEEEEEEEEEEEEEEEEE/EAEEEEEE/6EEEEEEEEEEAEEAEEE/EE/AEEAEEEEEAEEEA/EEAAEAE - { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } - } - }, - { read2_lines.each { read2_line -> - { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } - } - }, - { read_merged_lines.each { read_merged_line -> - { assert path(process.out.reads_merged.get(0).get(1)).linesGzip.contains(read_merged_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { json_text.each { json_part -> - { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } - } - }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_paired_end_merged_match") - }, - { assert snapshot(process.out.versions).match("versions_paired_end_merged") } + { assert snapshot(process.out).match() } ) } } - test("test_fastp_paired_end_merged-stub") { + test("test_fastp_paired_end_merged_adapterlist - stub") { - options '-stub' + options "-stub" when { - params { - outdir = "$outputDir" - } process { """ - adapter_fasta = [] - save_trimmed_fail = false - save_merged = true - 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = Channel.of([ file(params.modules_testdata_base_path + 'delete_me/fastp/adapters.fasta', checkIfExists: true) ]) + input[2] = false + input[3] = false + input[4] = true """ } } @@ -625,101 +514,63 @@ nextflow_process { then { assertAll( { assert process.success }, - { - assert snapshot( - ( - [process.out.reads[0][0].toString()] + // meta - process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + - process.out.json.collect { file(it[1]).getName() } + - process.out.html.collect { file(it[1]).getName() } + - process.out.log.collect { file(it[1]).getName() } + - process.out.reads_fail.collect { file(it[1]).getName() } + - process.out.reads_merged.collect { file(it[1]).getName() } - ).sort() - ).match("test_fastp_paired_end_merged-for_stub_match") - }, - { assert snapshot(process.out.versions).match("versions_paired_end_merged_stub") } + { assert snapshot(process.out).match() } ) } } - test("test_fastp_paired_end_merged_adapterlist") { + test("test_fastp_single_end_qc_only - stub") { + + options "-stub" when { - params { - outdir = "$outputDir" - } process { """ - adapter_fasta = Channel.of([ file(params.modules_testdata_base_path + 'delete_me/fastp/adapters.fasta', checkIfExists: true) ]) - save_trimmed_fail = false - save_merged = true + input[0] = Channel.of([ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + input[1] = [] + input[2] = true + input[3] = false + input[4] = false + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_fastp_paired_end_qc_only - stub") { + + options "-stub" + + when { + 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) ] ]) - input[1] = adapter_fasta - input[2] = save_trimmed_fail - input[3] = save_merged + input[1] = [] + input[2] = true + input[3] = false + input[4] = false """ } } then { - def html_text = [ "
"] - def log_text = [ "Merged and filtered:", - "total reads: 75", - "total bases: 13683"] - def json_text = ['"merged_and_filtered": {', '"total_reads": 75', '"total_bases": 13683',"--adapter_fasta"] - def read1_lines = ["@ERR5069949.1066259 NS500628:121:HK3MMAFX2:1:11312:18369:8333/1", - "CCTTATGACAGCAAGAACTGTGTATGATGATGGTGCTAGGAGAGTGTGGACACTTATGAATGTCTTGACACTCGTTTATAAAGTTTATTATGGTAATGCTTTAGATCAAGCCATTTCCATGTGGGCTCTTATAATCTCTGTTACTTC", - "AAAAAEAEEAEEEEEEEEEEEEEEEEAEEEEAEEEEEEEEAEEEEEEEEEEEEEEEEE/EAEEEEEE/6EEEEEEEEEEAEEAEEE/EE/AEEAEEEEEAEEEA/EEAAEAE - { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } - } - }, - { read2_lines.each { read2_line -> - { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } - } - }, - { read_merged_lines.each { read_merged_line -> - { assert path(process.out.reads_merged.get(0).get(1)).linesGzip.contains(read_merged_line) } - } - }, - { html_text.each { html_part -> - { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } - } - }, - { json_text.each { json_part -> - { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } - } - }, - { log_text.each { log_part -> - { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } - } - }, - { assert snapshot(process.out.versions).match("versions_paired_end_merged_adapterlist") } + { assert snapshot(process.out).match() } ) } } -} +} \ No newline at end of file diff --git a/modules/nf-core/fastp/tests/main.nf.test.snap b/modules/nf-core/fastp/tests/main.nf.test.snap index 3e876288..54be7e45 100644 --- a/modules/nf-core/fastp/tests/main.nf.test.snap +++ b/modules/nf-core/fastp/tests/main.nf.test.snap @@ -1,55 +1,178 @@ { - "fastp test_fastp_interleaved_json": { + "test_fastp_single_end_qc_only - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": true - }, - "test.fastp.json:md5,b24e0624df5cc0b11cd5ba21b726fb22" + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + + ], + "reads_fail": [ + + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] - ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-03-18T16:19:15.063001" + "timestamp": "2024-07-05T14:31:10.841098" }, - "test_fastp_paired_end_merged-for_stub_match": { + "test_fastp_paired_end": { "content": [ [ [ - "test_1.fastp.fastq.gz", - "test_2.fastp.fastq.gz" - ], - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "test.merged.fastq.gz", - "{id=test, single_end=false}" + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,1e0f8e27e71728e2b63fc64086be95cd" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7", + "test_2.fastp.fastq.gz:md5,25cbdca08e2083dbd4f0502de6b62f39" + ] + ] + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-01-17T18:10:13.467574" + "timestamp": "2024-07-05T13:43:28.665779" }, - "versions_interleaved": { + "test_fastp_paired_end_merged_adapterlist": { "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,5914ca3f21ce162123a824e33e8564f6" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,54b726a55e992a869fd3fa778afe1672", + "test_2.fastp.fastq.gz:md5,29d3b33b869f7b63417b8ff07bb128ba" + ] + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,c873bb1ab3fa859dcc47306465e749d5" + ] + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:56:24.615634793" + "timestamp": "2024-07-05T13:44:18.210375" }, - "test_fastp_single_end_json": { + "test_fastp_single_end_qc_only": { "content": [ [ [ @@ -57,274 +180,1152 @@ "id": "test", "single_end": true }, - "test.fastp.json:md5,c852d7a6dba5819e4ac8d9673bedcacc" + "test.fastp.json:md5,5cc5f01e449309e0e689ed6f51a2294a" ] - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-18T16:18:43.526412" - }, - "versions_paired_end": { - "content": [ + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:55:42.333545689" + "timestamp": "2024-07-05T13:44:27.380974" }, - "test_fastp_paired_end_match": { + "test_fastp_paired_end_trim_fail": { "content": [ [ [ - "test_1.fastp.fastq.gz", - "test_2.fastp.fastq.gz" - ], - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "{id=test, single_end=false}" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-01T12:03:06.431833729" - }, - "test_fastp_interleaved-_match": { - "content": [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,6ff32a64c5188b9a9192be1398c262c7", + "test_2.fastp.fastq.gz:md5,db0cb7c9977e94ac2b4b446ebd017a8a" + ] + ] + ], [ - "test.fastp.fastq.gz", - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "{id=test, single_end=true}" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-18T16:19:15.111894" - }, - "test_fastp_paired_end_merged_match": { - "content": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.fail.fastq.gz:md5,409b687c734cedd7a1fec14d316e1366", + "test_1.fail.fastq.gz:md5,4f273cf3159c13f79e8ffae12f5661f6", + "test_2.fail.fastq.gz:md5,f97b9edefb5649aab661fbc9e71fc995" + ] + ] + ], + [ + + ], [ [ - "test_1.fastp.fastq.gz", - "test_2.fastp.fastq.gz" - ], - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "test.merged.fastq.gz", - "{id=test, single_end=false}" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-01T12:08:44.496251446" - }, - "versions_single_end_stub": { - "content": [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,4c3268ddb50ea5b33125984776aa3519" + ] + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:55:27.354051299" + "timestamp": "2024-07-05T13:43:58.749589" }, - "versions_interleaved-stub": { + "fastp - stub test_fastp_interleaved": { "content": [ - [ - "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "reads_fail": [ + + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:56:46.535528418" + "timestamp": "2024-07-05T13:50:00.270029" }, - "versions_single_end_trim_fail": { + "test_fastp_single_end - stub": { "content": [ - [ - "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "reads_fail": [ + + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:59:03.724591407" + "timestamp": "2024-07-05T13:49:42.502789" }, - "test_fastp_paired_end-for_stub_match": { + "test_fastp_paired_end_merged_adapterlist - stub": { "content": [ - [ - [ - "test_1.fastp.fastq.gz", - "test_2.fastp.fastq.gz" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] ], - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "{id=test, single_end=false}" - ] + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "reads_fail": [ + + ], + "reads_merged": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-01-17T18:07:15.398827" + "timestamp": "2024-07-05T13:54:53.458252" }, - "versions_paired_end-stub": { + "test_fastp_paired_end_merged - stub": { "content": [ - [ - "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "reads_fail": [ + + ], + "reads_merged": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:56:06.50017282" + "timestamp": "2024-07-05T13:50:27.689379" }, - "versions_single_end": { + "test_fastp_paired_end_merged": { "content": [ [ - "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-01T11:55:07.67921647" - }, - "versions_paired_end_merged_stub": { - "content": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,b712fd68ed0322f4bec49ff2a5237fcc" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,54b726a55e992a869fd3fa778afe1672", + "test_2.fastp.fastq.gz:md5,29d3b33b869f7b63417b8ff07bb128ba" + ] + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,c873bb1ab3fa859dcc47306465e749d5" + ] + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:59:47.350653154" + "timestamp": "2024-07-05T13:44:08.68476" }, - "test_fastp_interleaved-for_stub_match": { + "test_fastp_paired_end - stub": { "content": [ - [ - "test.fastp.fastq.gz", - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "{id=test, single_end=true}" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "reads_fail": [ + + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-01-17T18:08:06.127974" + "timestamp": "2024-07-05T13:49:51.679221" }, - "versions_paired_end_trim_fail": { + "test_fastp_single_end": { "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,c852d7a6dba5819e4ac8d9673bedcacc" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7" + ] + ], + [ + + ], + [ + + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:59:18.140484878" + "timestamp": "2024-07-05T13:43:18.834322" }, - "test_fastp_single_end-for_stub_match": { + "test_fastp_single_end_trim_fail - stub": { "content": [ - [ - "test.fastp.fastq.gz", - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "{id=test, single_end=true}" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "reads_fail": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-01-17T18:06:00.244202" + "timestamp": "2024-07-05T14:05:36.898142" }, - "test_fastp_single_end-_match": { + "test_fastp_paired_end_trim_fail - stub": { "content": [ - [ - "test.fastp.fastq.gz", - "test.fastp.html", - "test.fastp.json", - "test.fastp.log", - "{id=test, single_end=true}" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_1.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "reads_fail": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_1.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-03-18T16:18:43.580336" + "timestamp": "2024-07-05T14:05:49.212847" }, - "versions_paired_end_merged_adapterlist": { + "fastp test_fastp_interleaved": { "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,217d62dc13a23e92513a1bd8e1bcea39" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,b24e0624df5cc0b11cd5ba21b726fb22" + ] + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T12:05:37.845370554" + "timestamp": "2024-07-05T13:43:38.910832" }, - "versions_paired_end_merged": { + "test_fastp_single_end_trim_fail": { "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,9a7ee180f000e8d00c7fb67f06293eb5" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fail.fastq.gz:md5,3e4aaadb66a5b8fc9b881bf39c227abd" + ] + ], + [ + + ], [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-01T11:59:32.860543858" + "timestamp": "2024-07-05T13:43:48.22378" }, - "test_fastp_single_end_trim_fail_json": { + "test_fastp_paired_end_qc_only": { "content": [ [ [ { "id": "test", - "single_end": true + "single_end": false }, - "test.fastp.json:md5,9a7ee180f000e8d00c7fb67f06293eb5" + "test.fastp.json:md5,623064a45912dac6f2b64e3f2e9901df" ] + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-05T13:44:36.334938" + }, + "test_fastp_paired_end_qc_only - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + + ], + "reads_fail": [ + + ], + "reads_merged": [ + + ], + "versions": [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" }, - "timestamp": "2024-01-17T18:08:41.942317" + "timestamp": "2024-07-05T14:31:27.096468" } } \ No newline at end of file diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index 70edae4d..e9d79a07 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -23,17 +23,14 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. - // looks like this:
Mon 2 Oct 2023
test.gz
- // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 - - { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_single") } + { assert process.success }, + // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. + // looks like this:
Mon 2 Oct 2023
test.gz
+ // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -54,16 +51,14 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, - { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, - { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, - { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, - { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_paired") } + { assert process.success }, + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -83,13 +78,11 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_interleaved") } + { assert process.success }, + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -109,13 +102,11 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_bam") } + { assert process.success }, + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -138,22 +129,20 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, - { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, - { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, - { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, - { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, - { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, - { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, - { assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" }, - { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_multiple") } + { assert process.success }, + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, + { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, + { assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -173,21 +162,18 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_custom_prefix") } + { assert process.success }, + { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } test("sarscov2 single-end [fastq] - stub") { - options "-stub" - + options "-stub" when { process { """ @@ -201,12 +187,123 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out.html.collect { file(it[1]).getName() } + - process.out.zip.collect { file(it[1]).getName() } + - process.out.versions ).match("fastqc_stub") } + { assert process.success }, + { assert snapshot(process.out).match() } ) } } + test("sarscov2 paired-end [fastq] - stub") { + + options "-stub" + when { + 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) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 interleaved [fastq] - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 paired-end [bam] - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 multiple [fastq] - stub") { + + options "-stub" + when { + 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) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 custom_prefix - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'mysample', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap index 86f7c311..d5db3092 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test.snap +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -1,88 +1,392 @@ { - "fastqc_versions_interleaved": { + "sarscov2 custom_prefix": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:07.293713" + "timestamp": "2024-07-22T11:02:16.374038" }, - "fastqc_stub": { + "sarscov2 single-end [fastq] - stub": { "content": [ - [ - "test.html", - "test.zip", - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:24.993809" + }, + "sarscov2 custom_prefix - stub": { + "content": [ + { + "0": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:31:01.425198" + "timestamp": "2024-07-22T11:03:10.93942" }, - "fastqc_versions_multiple": { + "sarscov2 interleaved [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:55.797907" + "timestamp": "2024-07-22T11:01:42.355718" }, - "fastqc_versions_bam": { + "sarscov2 paired-end [bam]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:26.795862" + "timestamp": "2024-07-22T11:01:53.276274" }, - "fastqc_versions_single": { + "sarscov2 multiple [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:39:27.043675" + "timestamp": "2024-07-22T11:02:05.527626" }, - "fastqc_versions_paired": { + "sarscov2 paired-end [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:01:31.188871" + }, + "sarscov2 paired-end [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:34.273566" + }, + "sarscov2 multiple [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:39:47.584191" + "timestamp": "2024-07-22T11:03:02.304411" }, - "fastqc_versions_custom_prefix": { + "sarscov2 single-end [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:01:19.095607" + }, + "sarscov2 interleaved [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:44.640184" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:41:14.576531" + "timestamp": "2024-07-22T11:02:53.550742" } } \ No newline at end of file diff --git a/modules/nf-core/gunzip/environment.yml b/modules/nf-core/gunzip/environment.yml index 3c723b21..dfc02a7b 100644 --- a/modules/nf-core/gunzip/environment.yml +++ b/modules/nf-core/gunzip/environment.yml @@ -4,4 +4,6 @@ channels: - bioconda - defaults dependencies: - - bioconda::multiqc=1.21 + - conda-forge::grep=3.11 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 diff --git a/modules/nf-core/gunzip/main.nf b/modules/nf-core/gunzip/main.nf index 468a6f28..5e67e3b9 100644 --- a/modules/nf-core/gunzip/main.nf +++ b/modules/nf-core/gunzip/main.nf @@ -4,8 +4,8 @@ process GUNZIP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'nf-core/ubuntu:20.04' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : + 'nf-core/ubuntu:22.04' }" input: tuple val(meta), path(archive) @@ -18,8 +18,11 @@ process GUNZIP { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - gunzip = archive.toString() - '.gz' + def args = task.ext.args ?: '' + def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1] + def name = archive.toString() - '.gz' - ".$extension" + def prefix = task.ext.prefix ?: name + gunzip = prefix + ".$extension" """ # Not calling gunzip itself because it creates files # with the original group ownership rather than the @@ -37,7 +40,11 @@ process GUNZIP { """ stub: - gunzip = archive.toString() - '.gz' + def args = task.ext.args ?: '' + def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1] + def name = archive.toString() - '.gz' - ".$extension" + def prefix = task.ext.prefix ?: name + gunzip = prefix + ".$extension" """ touch $gunzip cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/gunzip/meta.yml b/modules/nf-core/gunzip/meta.yml index 231034f2..f32973a0 100644 --- a/modules/nf-core/gunzip/meta.yml +++ b/modules/nf-core/gunzip/meta.yml @@ -37,3 +37,4 @@ maintainers: - "@joseespinosa" - "@drpatelh" - "@jfy133" + - "@gallvp" diff --git a/modules/nf-core/gunzip/tests/main.nf.test b/modules/nf-core/gunzip/tests/main.nf.test index 6406008e..776211ad 100644 --- a/modules/nf-core/gunzip/tests/main.nf.test +++ b/modules/nf-core/gunzip/tests/main.nf.test @@ -33,4 +33,89 @@ nextflow_process { } + test("Should run without failures - prefix") { + + config './nextflow.config' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("Should run without failures - stub") { + + options '-stub' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("Should run without failures - prefix - stub") { + + options '-stub' + config './nextflow.config' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + } diff --git a/modules/nf-core/gunzip/tests/main.nf.test.snap b/modules/nf-core/gunzip/tests/main.nf.test.snap index 720fd9ff..069967e7 100644 --- a/modules/nf-core/gunzip/tests/main.nf.test.snap +++ b/modules/nf-core/gunzip/tests/main.nf.test.snap @@ -1,4 +1,70 @@ { + "Should run without failures - prefix - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-25T11:35:10.861293" + }, + "Should run without failures - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + "test_1.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + [ + + ], + "test_1.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-25T11:35:05.857145" + }, "Should run without failures": { "content": [ { @@ -26,6 +92,43 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-10-17T15:35:37.690477896" + }, + "Should run without failures - prefix": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-25T11:33:32.921739" } } \ No newline at end of file diff --git a/modules/nf-core/gunzip/tests/nextflow.config b/modules/nf-core/gunzip/tests/nextflow.config new file mode 100644 index 00000000..dec77642 --- /dev/null +++ b/modules/nf-core/gunzip/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GUNZIP { + ext.prefix = { "${meta.id}.xyz" } + } +} diff --git a/modules/pfr/merqury/hapmers/environment.yml b/modules/nf-core/merqury/hapmers/environment.yml similarity index 100% rename from modules/pfr/merqury/hapmers/environment.yml rename to modules/nf-core/merqury/hapmers/environment.yml diff --git a/modules/pfr/merqury/hapmers/main.nf b/modules/nf-core/merqury/hapmers/main.nf similarity index 100% rename from modules/pfr/merqury/hapmers/main.nf rename to modules/nf-core/merqury/hapmers/main.nf diff --git a/modules/pfr/merqury/hapmers/meta.yml b/modules/nf-core/merqury/hapmers/meta.yml similarity index 100% rename from modules/pfr/merqury/hapmers/meta.yml rename to modules/nf-core/merqury/hapmers/meta.yml diff --git a/modules/pfr/merqury/hapmers/tests/main.nf.test b/modules/nf-core/merqury/hapmers/tests/main.nf.test similarity index 100% rename from modules/pfr/merqury/hapmers/tests/main.nf.test rename to modules/nf-core/merqury/hapmers/tests/main.nf.test diff --git a/modules/pfr/merqury/hapmers/tests/main.nf.test.snap b/modules/nf-core/merqury/hapmers/tests/main.nf.test.snap similarity index 100% rename from modules/pfr/merqury/hapmers/tests/main.nf.test.snap rename to modules/nf-core/merqury/hapmers/tests/main.nf.test.snap diff --git a/modules/nf-core/merqury/hapmers/tests/tags.yml b/modules/nf-core/merqury/hapmers/tests/tags.yml new file mode 100644 index 00000000..473bd269 --- /dev/null +++ b/modules/nf-core/merqury/hapmers/tests/tags.yml @@ -0,0 +1,2 @@ +merqury/hapmers: + - "modules/nf-core/merqury/hapmers/**" diff --git a/modules/nf-core/meryl/count/main.nf b/modules/nf-core/meryl/count/main.nf index 0f1ff0af..c1540cc8 100644 --- a/modules/nf-core/meryl/count/main.nf +++ b/modules/nf-core/meryl/count/main.nf @@ -1,6 +1,6 @@ process MERYL_COUNT { tag "$meta.id" - label 'process_medium' + label 'process_high' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? diff --git a/modules/nf-core/minimap2/align/environment.yml b/modules/nf-core/minimap2/align/environment.yml index 051ca8ef..41e8fe9f 100644 --- a/modules/nf-core/minimap2/align/environment.yml +++ b/modules/nf-core/minimap2/align/environment.yml @@ -1,9 +1,11 @@ name: minimap2_align + channels: - conda-forge - bioconda - defaults + dependencies: + - bioconda::htslib=1.20 - bioconda::minimap2=2.28 - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::samtools=1.20 diff --git a/modules/nf-core/minimap2/align/main.nf b/modules/nf-core/minimap2/align/main.nf index 62349edc..d82dc14d 100644 --- a/modules/nf-core/minimap2/align/main.nf +++ b/modules/nf-core/minimap2/align/main.nf @@ -5,21 +5,22 @@ process MINIMAP2_ALIGN { // Note: the versions here need to match the versions used in the mulled container below and minimap2/index conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:3a70f8bc7e17b723591f6132418640cfdbc88246-0' : - 'biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:3a70f8bc7e17b723591f6132418640cfdbc88246-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:3161f532a5ea6f1dec9be5667c9efc2afdac6104-0' : + 'biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:3161f532a5ea6f1dec9be5667c9efc2afdac6104-0' }" input: tuple val(meta), path(reads) tuple val(meta2), path(reference) val bam_format + val bam_index_extension val cigar_paf_format val cigar_bam output: - tuple val(meta), path("*.paf"), optional: true, emit: paf - tuple val(meta), path("*.bam"), optional: true, emit: bam - tuple val(meta), path("*.csi"), optional: true, emit: csi - path "versions.yml" , emit: versions + tuple val(meta), path("*.paf") , optional: true, emit: paf + tuple val(meta), path("*.bam") , optional: true, emit: bam + tuple val(meta), path("*.bam.${bam_index_extension}"), optional: true, emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -27,16 +28,25 @@ process MINIMAP2_ALIGN { script: def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' + def args4 = task.ext.args4 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def bam_output = bam_format ? "-a | samtools sort -@ ${task.cpus-1} -o ${prefix}.bam ${args2}" : "-o ${prefix}.paf" + def bam_index = bam_index_extension ? "${prefix}.bam##idx##${prefix}.bam.${bam_index_extension} --write-index" : "${prefix}.bam" + def bam_output = bam_format ? "-a | samtools sort -@ ${task.cpus-1} -o ${bam_index} ${args2}" : "-o ${prefix}.paf" def cigar_paf = cigar_paf_format && !bam_format ? "-c" : '' def set_cigar_bam = cigar_bam && bam_format ? "-L" : '' + def bam_input = "${reads.extension}".matches('sam|bam|cram') + def samtools_reset_fastq = bam_input ? "samtools reset --threads ${task.cpus-1} $args3 $reads | samtools fastq --threads ${task.cpus-1} $args4 |" : '' + def query = bam_input ? "-" : reads + def target = reference ?: (bam_input ? error("BAM input requires reference") : reads) + """ + $samtools_reset_fastq \\ minimap2 \\ $args \\ -t $task.cpus \\ - ${reference ?: reads} \\ - $reads \\ + $target \\ + $query \\ $cigar_paf \\ $set_cigar_bam \\ $bam_output @@ -45,15 +55,20 @@ process MINIMAP2_ALIGN { cat <<-END_VERSIONS > versions.yml "${task.process}": minimap2: \$(minimap2 --version 2>&1) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" def output_file = bam_format ? "${prefix}.bam" : "${prefix}.paf" + def bam_index = bam_index_extension ? "touch ${prefix}.bam.${bam_index_extension}" : "" + def bam_input = "${reads.extension}".matches('sam|bam|cram') + def target = reference ?: (bam_input ? error("BAM input requires reference") : reads) + """ touch $output_file - touch ${prefix}.csi + ${bam_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/minimap2/align/meta.yml b/modules/nf-core/minimap2/align/meta.yml index 408522d5..8996f881 100644 --- a/modules/nf-core/minimap2/align/meta.yml +++ b/modules/nf-core/minimap2/align/meta.yml @@ -37,6 +37,9 @@ input: - bam_format: type: boolean description: Specify that output should be in BAM format + - bam_index_extension: + type: string + description: BAM alignment index extension (e.g. "bai") - cigar_paf_format: type: boolean description: Specify that output CIGAR should be in PAF format @@ -59,6 +62,10 @@ output: type: file description: Alignment in BAM format pattern: "*.bam" + - index: + type: file + description: BAM alignment index + pattern: "*.bam.*" - versions: type: file description: File containing software versions @@ -68,8 +75,10 @@ authors: - "@sofstam" - "@sateeshperi" - "@jfy133" + - "@fellen31" maintainers: - "@heuermh" - "@sofstam" - "@sateeshperi" - "@jfy133" + - "@fellen31" diff --git a/modules/nf-core/minimap2/align/tests/main.nf.test b/modules/nf-core/minimap2/align/tests/main.nf.test index 83cceeab..4072c171 100644 --- a/modules/nf-core/minimap2/align/tests/main.nf.test +++ b/modules/nf-core/minimap2/align/tests/main.nf.test @@ -9,22 +9,23 @@ nextflow_process { tag "minimap2" tag "minimap2/align" - test("sarscov2 - fastq, fasta, true, false, false") { + test("sarscov2 - fastq, fasta, true, [], false, false") { when { process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = [ [ id:'test_ref' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = true - input[3] = false + input[3] = [] input[4] = false + input[5] = false """ } } @@ -33,7 +34,43 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - file(process.out.bam[0][1]).name, + bam(process.out.bam[0][1]).getHeader(), + bam(process.out.bam[0][1]).getReadsMD5(), + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - fastq, fasta, true, 'bai', false, false") { + + when { + process { + """ + input[0] = [ + [ 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] = [ + [ id:'test_ref' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = true + input[3] = 'bai' + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + bam(process.out.bam[0][1]).getHeader(), + bam(process.out.bam[0][1]).getReadsMD5(), + file(process.out.index[0][1]).name, process.out.versions ).match() } ) @@ -49,17 +86,18 @@ nextflow_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) + 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] = [ [ id:'test_ref' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = true - input[3] = false + input[3] = [] input[4] = false + input[5] = false """ } } @@ -68,7 +106,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - file(process.out.bam[0][1]).name, + bam(process.out.bam[0][1]).getHeader(), + bam(process.out.bam[0][1]).getReadsMD5(), process.out.versions ).match() } ) @@ -83,15 +122,16 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), ] input[1] = [ [ id:'test_ref' ], // meta map [] ] input[2] = true - input[3] = false + input[3] = [] input[4] = false + input[5] = false """ } } @@ -100,7 +140,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - file(process.out.bam[0][1]).name, + bam(process.out.bam[0][1]).getHeader(), + bam(process.out.bam[0][1]).getReadsMD5(), process.out.versions ).match() } ) @@ -108,24 +149,57 @@ nextflow_process { } - test("sarscov2 - fastq, fasta, true, false, false - stub") { + test("sarscov2 - bam, fasta, true, [], false, false") { - options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'test_ref' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = true + input[3] = [] + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + bam(process.out.bam[0][1]).getHeader(), + bam(process.out.bam[0][1]).getReadsMD5(), + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - bam, fasta, true, 'bai', false, false") { when { process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true) ] input[1] = [ [ id:'test_ref' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = true - input[3] = false + input[3] = 'bai' input[4] = false + input[5] = false """ } } @@ -134,8 +208,9 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - file(process.out.bam[0][1]).name, - file(process.out.csi[0][1]).name, + bam(process.out.bam[0][1]).getHeader(), + bam(process.out.bam[0][1]).getReadsMD5(), + file(process.out.index[0][1]).name, process.out.versions ).match() } ) @@ -143,7 +218,36 @@ nextflow_process { } - test("sarscov2 - fastq, fasta, false, false, false - stub") { + test("sarscov2 - bam, [], true, false, false") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'test_ref' ], // meta map + [] + ] + input[2] = true + input[3] = [] + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.failed } + ) + } + + } + + test("sarscov2 - fastq, fasta, true, [], false, false - stub") { options "-stub" @@ -152,15 +256,80 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = [ [ id:'test_ref' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = true + input[3] = [] + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - fastq, fasta, true, 'bai', false, false - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ 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] = [ + [ id:'test_ref' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = true + input[3] = 'bai' + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - fastq, fasta, false, [], false, false - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ 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] = [ + [ id:'test_ref' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = false - input[3] = false + input[3] = [] input[4] = false + input[5] = false """ } } @@ -168,11 +337,102 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.paf[0][1]).name, - file(process.out.csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam, fasta, true, [], false, false - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'test_ref' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = true + input[3] = [] + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam, fasta, true, 'bai', false, false - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'test_ref' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = true + input[3] = 'bai' + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam, [], true, false, false - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'test_ref' ], // meta map + [] + ] + input[2] = true + input[3] = [] + input[4] = false + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.failed } ) } diff --git a/modules/nf-core/minimap2/align/tests/main.nf.test.snap b/modules/nf-core/minimap2/align/tests/main.nf.test.snap index 19a8f204..12264a85 100644 --- a/modules/nf-core/minimap2/align/tests/main.nf.test.snap +++ b/modules/nf-core/minimap2/align/tests/main.nf.test.snap @@ -1,69 +1,476 @@ { - "sarscov2 - fastq, fasta, true, false, false": { + "sarscov2 - bam, fasta, true, 'bai', false, false": { "content": [ - "test.bam", [ - "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:MT192765.1\tLN:29829", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.28-r1209\tCL:minimap2 -t 2 -a genome.fasta -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.20\tCL:samtools sort -@ 1 -o test.bam##idx##test.bam.bai --write-index" + ], + "5d426b9a5f5b2c54f1d7f1e4c238ae94", + "test.bam.bai", + [ + "versions.yml:md5,3548eeba9066efbf8d78ea99f8d813fd" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-25T09:03:00.827260362" + }, + "sarscov2 - bam, fasta, true, 'bai', false, false - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "index": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "paf": [ + + ], + "versions": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-23T11:21:37.92353539" + }, + "sarscov2 - fastq, fasta, true, 'bai', false, false - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "index": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "paf": [ + + ], + "versions": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:29:44.669021368" + }, + "sarscov2 - fastq, fasta, false, [], false, false - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.paf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ], + "bam": [ + + ], + "index": [ + + ], + "paf": [ + [ + { + "id": "test", + "single_end": true + }, + "test.paf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:15:52.738781039" + }, + "sarscov2 - fastq, fasta, true, [], false, false - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "index": [ + + ], + "paf": [ + + ], + "versions": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:15:23.033808223" + }, + "sarscov2 - [fastq1, fastq2], fasta, true, false, false": { + "content": [ + [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:MT192765.1\tLN:29829", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.28-r1209\tCL:minimap2 -t 2 -a genome.fasta test_1.fastq.gz test_2.fastq.gz", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.20\tCL:samtools sort -@ 1 -o test.bam" + ], + "1bc392244f228bf52cf0b5a8f6a654c9", + [ + "versions.yml:md5,3548eeba9066efbf8d78ea99f8d813fd" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-04-05T10:14:18.939731126" + "timestamp": "2024-07-23T11:18:18.964586894" }, - "sarscov2 - fastq, fasta, true, false, false - stub": { + "sarscov2 - fastq, fasta, true, [], false, false": { "content": [ - "test.bam", - "test.csi", [ - "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:MT192765.1\tLN:29829", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.28-r1209\tCL:minimap2 -t 2 -a genome.fasta test_1.fastq.gz", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.20\tCL:samtools sort -@ 1 -o test.bam" + ], + "f194745c0ccfcb2a9c0aee094a08750", + [ + "versions.yml:md5,3548eeba9066efbf8d78ea99f8d813fd" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-04-05T10:14:34.275879844" + "timestamp": "2024-07-23T11:17:48.667488325" }, - "sarscov2 - fastq, fasta, false, false, false - stub": { + "sarscov2 - fastq, fasta, true, 'bai', false, false": { "content": [ - "test.paf", - "test.csi", [ - "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:MT192765.1\tLN:29829", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.28-r1209\tCL:minimap2 -t 2 -a genome.fasta test_1.fastq.gz", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.20\tCL:samtools sort -@ 1 -o test.bam##idx##test.bam.bai --write-index" + ], + "f194745c0ccfcb2a9c0aee094a08750", + "test.bam.bai", + [ + "versions.yml:md5,3548eeba9066efbf8d78ea99f8d813fd" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-04-05T10:14:39.227958138" + "timestamp": "2024-07-23T11:18:02.517416733" }, - "sarscov2 - [fastq1, fastq2], fasta, true, false, false": { + "sarscov2 - bam, fasta, true, [], false, false": { "content": [ - "test.bam", [ - "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:MT192765.1\tLN:29829", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.28-r1209\tCL:minimap2 -t 2 -a genome.fasta -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.20\tCL:samtools sort -@ 1 -o test.bam" + ], + "5d426b9a5f5b2c54f1d7f1e4c238ae94", + [ + "versions.yml:md5,3548eeba9066efbf8d78ea99f8d813fd" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-04-05T10:14:24.265054877" + "timestamp": "2024-07-25T09:02:49.64829488" + }, + "sarscov2 - bam, fasta, true, [], false, false - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "index": [ + + ], + "paf": [ + + ], + "versions": [ + "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-23T11:21:22.162291795" }, "sarscov2 - fastq, [], true, false, false": { "content": [ - "test.bam", [ - "versions.yml:md5,98b8f5f36aa54b82210094f0b0d11938" + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:ERR5069949.2151832\tLN:150", + "@SQ\tSN:ERR5069949.576388\tLN:77", + "@SQ\tSN:ERR5069949.501486\tLN:146", + "@SQ\tSN:ERR5069949.1331889\tLN:132", + "@SQ\tSN:ERR5069949.2161340\tLN:80", + "@SQ\tSN:ERR5069949.973930\tLN:79", + "@SQ\tSN:ERR5069949.2417063\tLN:150", + "@SQ\tSN:ERR5069949.376959\tLN:151", + "@SQ\tSN:ERR5069949.1088785\tLN:149", + "@SQ\tSN:ERR5069949.1066259\tLN:147", + "@SQ\tSN:ERR5069949.2832676\tLN:139", + "@SQ\tSN:ERR5069949.2953930\tLN:151", + "@SQ\tSN:ERR5069949.324865\tLN:151", + "@SQ\tSN:ERR5069949.2185111\tLN:150", + "@SQ\tSN:ERR5069949.937422\tLN:151", + "@SQ\tSN:ERR5069949.2431709\tLN:150", + "@SQ\tSN:ERR5069949.1246538\tLN:148", + "@SQ\tSN:ERR5069949.1189252\tLN:98", + "@SQ\tSN:ERR5069949.2216307\tLN:147", + "@SQ\tSN:ERR5069949.3273002\tLN:148", + "@SQ\tSN:ERR5069949.3277445\tLN:151", + "@SQ\tSN:ERR5069949.3022231\tLN:147", + "@SQ\tSN:ERR5069949.184542\tLN:151", + "@SQ\tSN:ERR5069949.540529\tLN:149", + "@SQ\tSN:ERR5069949.686090\tLN:150", + "@SQ\tSN:ERR5069949.2787556\tLN:106", + "@SQ\tSN:ERR5069949.2650879\tLN:150", + "@SQ\tSN:ERR5069949.2064910\tLN:149", + "@SQ\tSN:ERR5069949.2328704\tLN:150", + "@SQ\tSN:ERR5069949.1067032\tLN:150", + "@SQ\tSN:ERR5069949.3338256\tLN:151", + "@SQ\tSN:ERR5069949.1412839\tLN:147", + "@SQ\tSN:ERR5069949.1538968\tLN:150", + "@SQ\tSN:ERR5069949.147998\tLN:94", + "@SQ\tSN:ERR5069949.366975\tLN:106", + "@SQ\tSN:ERR5069949.1372331\tLN:151", + "@SQ\tSN:ERR5069949.1709367\tLN:129", + "@SQ\tSN:ERR5069949.2388984\tLN:150", + "@SQ\tSN:ERR5069949.1132353\tLN:150", + "@SQ\tSN:ERR5069949.1151736\tLN:151", + "@SQ\tSN:ERR5069949.479807\tLN:150", + "@SQ\tSN:ERR5069949.2176303\tLN:151", + "@SQ\tSN:ERR5069949.2772897\tLN:151", + "@SQ\tSN:ERR5069949.1020777\tLN:122", + "@SQ\tSN:ERR5069949.465452\tLN:151", + "@SQ\tSN:ERR5069949.1704586\tLN:149", + "@SQ\tSN:ERR5069949.1258508\tLN:151", + "@SQ\tSN:ERR5069949.986441\tLN:119", + "@SQ\tSN:ERR5069949.2674295\tLN:148", + "@SQ\tSN:ERR5069949.885966\tLN:79", + "@SQ\tSN:ERR5069949.2342766\tLN:151", + "@SQ\tSN:ERR5069949.3122970\tLN:127", + "@SQ\tSN:ERR5069949.3279513\tLN:72", + "@SQ\tSN:ERR5069949.309410\tLN:151", + "@SQ\tSN:ERR5069949.532979\tLN:149", + "@SQ\tSN:ERR5069949.2888794\tLN:151", + "@SQ\tSN:ERR5069949.2205229\tLN:150", + "@SQ\tSN:ERR5069949.786562\tLN:151", + "@SQ\tSN:ERR5069949.919671\tLN:151", + "@SQ\tSN:ERR5069949.1328186\tLN:151", + "@SQ\tSN:ERR5069949.870926\tLN:149", + "@SQ\tSN:ERR5069949.2257580\tLN:151", + "@SQ\tSN:ERR5069949.3249622\tLN:77", + "@SQ\tSN:ERR5069949.611123\tLN:125", + "@SQ\tSN:ERR5069949.651338\tLN:142", + "@SQ\tSN:ERR5069949.169513\tLN:92", + "@SQ\tSN:ERR5069949.155944\tLN:150", + "@SQ\tSN:ERR5069949.2033605\tLN:150", + "@SQ\tSN:ERR5069949.2730382\tLN:142", + "@SQ\tSN:ERR5069949.2125592\tLN:150", + "@SQ\tSN:ERR5069949.1062611\tLN:151", + "@SQ\tSN:ERR5069949.1778133\tLN:151", + "@SQ\tSN:ERR5069949.3057020\tLN:95", + "@SQ\tSN:ERR5069949.2972968\tLN:141", + "@SQ\tSN:ERR5069949.2734474\tLN:149", + "@SQ\tSN:ERR5069949.856527\tLN:151", + "@SQ\tSN:ERR5069949.2098070\tLN:151", + "@SQ\tSN:ERR5069949.1552198\tLN:150", + "@SQ\tSN:ERR5069949.2385514\tLN:150", + "@SQ\tSN:ERR5069949.2270078\tLN:151", + "@SQ\tSN:ERR5069949.114870\tLN:150", + "@SQ\tSN:ERR5069949.2668880\tLN:147", + "@SQ\tSN:ERR5069949.257821\tLN:139", + "@SQ\tSN:ERR5069949.2243023\tLN:150", + "@SQ\tSN:ERR5069949.2605155\tLN:146", + "@SQ\tSN:ERR5069949.1340552\tLN:151", + "@SQ\tSN:ERR5069949.1561137\tLN:150", + "@SQ\tSN:ERR5069949.2361683\tLN:149", + "@SQ\tSN:ERR5069949.2521353\tLN:150", + "@SQ\tSN:ERR5069949.1261808\tLN:149", + "@SQ\tSN:ERR5069949.2734873\tLN:98", + "@SQ\tSN:ERR5069949.3017828\tLN:107", + "@SQ\tSN:ERR5069949.573706\tLN:150", + "@SQ\tSN:ERR5069949.1980512\tLN:151", + "@SQ\tSN:ERR5069949.1014693\tLN:150", + "@SQ\tSN:ERR5069949.3184655\tLN:150", + "@SQ\tSN:ERR5069949.29668\tLN:89", + "@SQ\tSN:ERR5069949.3258358\tLN:151", + "@SQ\tSN:ERR5069949.1476386\tLN:151", + "@SQ\tSN:ERR5069949.2415814\tLN:150", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.28-r1209\tCL:minimap2 -t 2 -a test_1.fastq.gz test_1.fastq.gz", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.20\tCL:samtools sort -@ 1 -o test.bam" + ], + "16c1c651f8ec67383bcdee3c55aed94f", + [ + "versions.yml:md5,3548eeba9066efbf8d78ea99f8d813fd" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-04-05T10:14:29.27901773" + "timestamp": "2024-07-23T11:18:34.246998277" } } \ No newline at end of file diff --git a/modules/nf-core/umitools/extract/environment.yml b/modules/nf-core/umitools/extract/environment.yml new file mode 100644 index 00000000..aab452d1 --- /dev/null +++ b/modules/nf-core/umitools/extract/environment.yml @@ -0,0 +1,7 @@ +name: umitools_extract +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::umi_tools=1.1.5 diff --git a/modules/nf-core/umitools/extract/main.nf b/modules/nf-core/umitools/extract/main.nf new file mode 100644 index 00000000..b97900e0 --- /dev/null +++ b/modules/nf-core/umitools/extract/main.nf @@ -0,0 +1,74 @@ +process UMITOOLS_EXTRACT { + tag "$meta.id" + label "process_single" + label "process_long" + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/umi_tools:1.1.5--py39hf95cd2a_0' : + 'biocontainers/umi_tools:1.1.5--py39hf95cd2a_0' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.fastq.gz"), emit: reads + 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}" + if (meta.single_end) { + """ + umi_tools \\ + extract \\ + -I $reads \\ + -S ${prefix}.umi_extract.fastq.gz \\ + $args \\ + > ${prefix}.umi_extract.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) + END_VERSIONS + """ + } else { + """ + umi_tools \\ + extract \\ + -I ${reads[0]} \\ + --read2-in=${reads[1]} \\ + -S ${prefix}.umi_extract_1.fastq.gz \\ + --read2-out=${prefix}.umi_extract_2.fastq.gz \\ + $args \\ + > ${prefix}.umi_extract.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) + END_VERSIONS + """ + } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}.umi_extract.fastq.gz" + } else { + output_command = "echo '' | gzip > ${prefix}.umi_extract_1.fastq.gz ;" + output_command += "echo '' | gzip > ${prefix}.umi_extract_2.fastq.gz" + } + """ + touch ${prefix}.umi_extract.log + ${output_command} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/umitools/extract/meta.yml b/modules/nf-core/umitools/extract/meta.yml new file mode 100644 index 00000000..7695b271 --- /dev/null +++ b/modules/nf-core/umitools/extract/meta.yml @@ -0,0 +1,48 @@ +name: umitools_extract +description: Extracts UMI barcode from a read and add it to the read name, leaving any sample barcode in place +keywords: + - UMI + - barcode + - extract + - umitools +tools: + - umi_tools: + description: > + UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) and single cell RNA-Seq cell barcodes + documentation: https://umi-tools.readthedocs.io/en/latest/ + license: "MIT" +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: list + description: | + List of input FASTQ files whose UMIs will be extracted. +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: > + Extracted FASTQ files. | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. + pattern: "*.{fastq.gz}" + - log: + type: file + description: Logfile for umi_tools + pattern: "*.{log}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@drpatelh" + - "@grst" +maintainers: + - "@drpatelh" + - "@grst" diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test b/modules/nf-core/umitools/extract/tests/main.nf.test new file mode 100644 index 00000000..bb8a0658 --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/main.nf.test @@ -0,0 +1,106 @@ +nextflow_process { + + name "Test Process UMITOOLS_EXTRACT" + script "../main.nf" + process "UMITOOLS_EXTRACT" + config "./nextflow.config" + tag "modules_nfcore" + tag "modules" + tag "umitools" + tag "umitools/extract" + + test("single end") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.reads.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.log.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + } + + test("single end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("pair end") { + + when { + process { + """ + input[0] = [ [ 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) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.reads[0][1][0]).name, + file(process.out.reads[0][1][1]).name, + process.out.log.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + } + + test("pair end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ 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) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test.snap b/modules/nf-core/umitools/extract/tests/main.nf.test.snap new file mode 100644 index 00000000..b1159054 --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/main.nf.test.snap @@ -0,0 +1,167 @@ +{ + "pair end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.umi_extract_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.umi_extract_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.umi_extract_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.umi_extract_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:05:20.008312" + }, + "single end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:04:12.145999" + }, + "pair end": { + "content": [ + "test.umi_extract_1.fastq.gz", + "test.umi_extract_2.fastq.gz", + [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log" + ] + ], + [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:21:09.578031" + }, + "single end": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log" + ] + ], + [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:03:52.464606" + } +} \ No newline at end of file diff --git a/modules/nf-core/umitools/extract/tests/nextflow.config b/modules/nf-core/umitools/extract/tests/nextflow.config new file mode 100644 index 00000000..c866f5a0 --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN"' + } + +} diff --git a/modules/nf-core/umitools/extract/tests/tags.yml b/modules/nf-core/umitools/extract/tests/tags.yml new file mode 100644 index 00000000..c3fb23de --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/tags.yml @@ -0,0 +1,2 @@ +umitools/extract: + - modules/nf-core/umitools/extract/** diff --git a/modules/nf-core/untar/environment.yml b/modules/nf-core/untar/environment.yml index 0c9cbb10..4f498244 100644 --- a/modules/nf-core/untar/environment.yml +++ b/modules/nf-core/untar/environment.yml @@ -1,11 +1,9 @@ name: untar - channels: - conda-forge - bioconda - defaults - dependencies: - conda-forge::grep=3.11 - - conda-forge::sed=4.7 + - conda-forge::sed=4.8 - conda-forge::tar=1.34 diff --git a/modules/nf-core/untar/main.nf b/modules/nf-core/untar/main.nf index 8a75bb95..9bd8f554 100644 --- a/modules/nf-core/untar/main.nf +++ b/modules/nf-core/untar/main.nf @@ -4,8 +4,8 @@ process UNTAR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'nf-core/ubuntu:20.04' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : + 'nf-core/ubuntu:22.04' }" input: tuple val(meta), path(archive) @@ -52,8 +52,29 @@ process UNTAR { stub: prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.toString().replaceFirst(/\.[^\.]+(.gz)?$/, "")) """ - mkdir $prefix - touch ${prefix}/file.txt + mkdir ${prefix} + ## Dry-run untaring the archive to get the files and place all in prefix + if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then + for i in `tar -tf ${archive}`; + do + if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; + then + touch \${i} + else + mkdir -p \${i} + fi + done + else + for i in `tar -tf ${archive}`; + do + if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; + then + touch ${prefix}/\${i} + else + mkdir -p ${prefix}/\${i} + fi + done + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/untar/tests/main.nf.test b/modules/nf-core/untar/tests/main.nf.test index 2a7c97bf..c957517a 100644 --- a/modules/nf-core/untar/tests/main.nf.test +++ b/modules/nf-core/untar/tests/main.nf.test @@ -6,6 +6,7 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "untar" + test("test_untar") { when { @@ -19,10 +20,9 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.untar).match("test_untar") }, + { assert snapshot(process.out).match() }, ) } - } test("test_untar_onlyfiles") { @@ -38,10 +38,48 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.untar).match("test_untar_onlyfiles") }, + { assert snapshot(process.out).match() }, ) } + } + + test("test_untar - stub") { + + options "-stub" + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } } + test("test_untar_onlyfiles - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + } } diff --git a/modules/nf-core/untar/tests/main.nf.test.snap b/modules/nf-core/untar/tests/main.nf.test.snap index 64550292..ceb91b79 100644 --- a/modules/nf-core/untar/tests/main.nf.test.snap +++ b/modules/nf-core/untar/tests/main.nf.test.snap @@ -1,42 +1,158 @@ { "test_untar_onlyfiles": { "content": [ - [ - [ + { + "0": [ [ - - ], + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:28.231047" + }, + "test_untar_onlyfiles - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hello.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ [ - "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + [ + + ], + [ + "hello.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" ] - ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-28T11:49:41.320643" + "timestamp": "2024-07-10T12:04:45.773103" + }, + "test_untar - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:36.777441" }, "test_untar": { "content": [ - [ - [ + { + "0": [ [ - - ], + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ [ - "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", - "opts.k2d:md5,a033d00cf6759407010b21700938f543", - "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" ] - ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-28T11:49:33.795172" + "timestamp": "2024-07-10T12:04:19.377674" } } \ No newline at end of file diff --git a/modules/pfr/custom/relabelfasta/tests/tags.yml b/modules/pfr/custom/relabelfasta/tests/tags.yml deleted file mode 100644 index 2db1f658..00000000 --- a/modules/pfr/custom/relabelfasta/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom/relabelfasta: - - "modules/pfr/custom/relabelfasta/**" diff --git a/modules/pfr/custom/restoregffids/tests/tags.yml b/modules/pfr/custom/restoregffids/tests/tags.yml deleted file mode 100644 index 1d4b9a83..00000000 --- a/modules/pfr/custom/restoregffids/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom/restoregffids: - - "modules/pfr/custom/restoregffids/**" diff --git a/modules/pfr/custom/shortenfastaids/tests/tags.yml b/modules/pfr/custom/shortenfastaids/tests/tags.yml deleted file mode 100644 index 4715b64c..00000000 --- a/modules/pfr/custom/shortenfastaids/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom/shortenfastaids: - - "modules/pfr/custom/shortenfastaids/**" diff --git a/modules/pfr/ltrfinder/tests/tags.yml b/modules/pfr/ltrfinder/tests/tags.yml deleted file mode 100644 index 006ded2c..00000000 --- a/modules/pfr/ltrfinder/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -ltrfinder: - - "modules/nf-core/ltrfinder/**" diff --git a/modules/pfr/ltrharvest/tests/main.nf.test b/modules/pfr/ltrharvest/tests/main.nf.test deleted file mode 100644 index 76b49476..00000000 --- a/modules/pfr/ltrharvest/tests/main.nf.test +++ /dev/null @@ -1,60 +0,0 @@ -nextflow_process { - - name "Test Process LTRHARVEST" - script "../main.nf" - process "LTRHARVEST" - - tag "modules" - tag "modules_nfcore" - tag "ltrharvest" - - test("homo_sapiens-genome_21_fasta") { - - when { - process { - """ - input[0] = [ - [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out.gff3).match("gff3") }, - { assert path(process.out.scn[0][1]).text.contains("46510803 46520182 9380 46510803 46510940 138 46520042 46520182 141 86.52 0 chr21") }, - { assert snapshot(path(process.out.versions[0]).text).match("script_versions") } - ) - } - - } - - test("homo_sapiens-genome_fasta-stub") { - - options '-stub' - - when { - process { - """ - input[0] = [ - [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot(path(process.out.versions[0]).text).match("stub_versions") } - ) - } - - } - -} \ No newline at end of file diff --git a/modules/pfr/ltrharvest/tests/tags.yml b/modules/pfr/ltrharvest/tests/tags.yml deleted file mode 100644 index 92de225e..00000000 --- a/modules/pfr/ltrharvest/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -ltrharvest: - - "modules/nf-core/ltrharvest/**" diff --git a/modules/pfr/ltrretriever/ltrretriever/tests/nextflow.config b/modules/pfr/ltrretriever/ltrretriever/tests/nextflow.config deleted file mode 100644 index 11499594..00000000 --- a/modules/pfr/ltrretriever/ltrretriever/tests/nextflow.config +++ /dev/null @@ -1,21 +0,0 @@ -process { - - withName: GT_SUFFIXERATOR { - ext.args = '-suf -lcp' - // GT_LTRHARVEST requires -suf, -lcp - } - - withName: LTRFINDER { - ext.args = '-harvest_out' - // LTRRETRIEVER requires -harvest_out - } - - withName: GT_LTRHARVEST { - ext.args = '-minlenltr 100 -maxlenltr 7000 -mintsd 4 -maxtsd 6 -motif TGCA -motifmis 1 -similar 85 -vic 10 -seed 20 -seqids yes' - // recommended parameters: https://github.com/oushujun/LTR_retriever#usage - } - - withName: CAT_CAT { - ext.prefix = { "${meta.id}_ltrharvest_ltrfinder.tabout" } - } -} diff --git a/modules/pfr/ltrretriever/ltrretriever/tests/tags.yml b/modules/pfr/ltrretriever/ltrretriever/tests/tags.yml deleted file mode 100644 index 67241ccb..00000000 --- a/modules/pfr/ltrretriever/ltrretriever/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -ltrretriever/ltrretriever: - - "modules/nf-core/ltrretriever/ltrretriever/**" diff --git a/modules/pfr/merqury/hapmers/tests/tags.yml b/modules/pfr/merqury/hapmers/tests/tags.yml deleted file mode 100644 index 553f09d8..00000000 --- a/modules/pfr/merqury/hapmers/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -merqury/hapmers: - - "modules/pfr/merqury/hapmers/**" diff --git a/modules/pfr/plotsr/tests/tags.yml b/modules/pfr/plotsr/tests/tags.yml deleted file mode 100644 index 0a8616fd..00000000 --- a/modules/pfr/plotsr/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -plotsr: - - "modules/pfr/plotsr/**" diff --git a/modules/pfr/syri/tests/tags.yml b/modules/pfr/syri/tests/tags.yml deleted file mode 100644 index 3afda524..00000000 --- a/modules/pfr/syri/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -syri: - - "modules/pfr/syri/**" diff --git a/nextflow.config b/nextflow.config index 1f445720..88c9454a 100644 --- a/nextflow.config +++ b/nextflow.config @@ -280,11 +280,11 @@ manifest { name = 'plant-food-research-open/assemblyqc' author = """Usman Rashid, Ken Smith, Ross Crowhurst, Chen Wu, Marcus Davy""" homePage = 'https://github.com/plant-food-research-open/assemblyqc' - description = """A NextFlow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report.""" + description = """A Nextflow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report.""" mainScript = 'main.nf' nextflowVersion = '!>=23.04.0' - version = '2.0.0' - doi = 'https://doi.org/10.5281/zenodo.10647870' + version = '2.1.0' + doi = 'https://doi.org/10.1093/bioinformatics/btae477' } // Load modules.config for DSL2 module specific options diff --git a/nextflow_schema.json b/nextflow_schema.json index 1fee6de3..04dd3634 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -1,8 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/master/nextflow_schema.json", + "$id": "https://raw.githubusercontent.com/plant-food-research-open/assemblyqc/main/nextflow_schema.json", "title": "plant-food-research-open/assemblyqc pipeline parameters", - "description": "A NextFlow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report.", + "description": "A Nextflow pipeline which evaluates assembly quality with multiple QC tools and presents the results in a unified html report.", "type": "object", "definitions": { "input_output_options": { diff --git a/subworkflows/pfr/fasta_gxf_busco_plot/main.nf b/subworkflows/gallvp/fasta_gxf_busco_plot/main.nf similarity index 98% rename from subworkflows/pfr/fasta_gxf_busco_plot/main.nf rename to subworkflows/gallvp/fasta_gxf_busco_plot/main.nf index 555087d4..3e8ad287 100644 --- a/subworkflows/pfr/fasta_gxf_busco_plot/main.nf +++ b/subworkflows/gallvp/fasta_gxf_busco_plot/main.nf @@ -1,8 +1,8 @@ -include { BUSCO_BUSCO as BUSCO_ASSEMBLY } from '../../../modules/pfr/busco/busco/main' -include { BUSCO_GENERATEPLOT as PLOT_ASSEMBLY } from '../../../modules/pfr/busco/generateplot/main' -include { GFFREAD as EXTRACT_PROTEINS } from '../../../modules/pfr/gffread/main' -include { BUSCO_BUSCO as BUSCO_ANNOTATION } from '../../../modules/pfr/busco/busco/main' -include { BUSCO_GENERATEPLOT as PLOT_ANNOTATION } from '../../../modules/pfr/busco/generateplot/main' +include { BUSCO_BUSCO as BUSCO_ASSEMBLY } from '../../../modules/gallvp/busco/busco/main' +include { BUSCO_GENERATEPLOT as PLOT_ASSEMBLY } from '../../../modules/gallvp/busco/generateplot/main' +include { GFFREAD as EXTRACT_PROTEINS } from '../../../modules/gallvp/gffread/main' +include { BUSCO_BUSCO as BUSCO_ANNOTATION } from '../../../modules/gallvp/busco/busco/main' +include { BUSCO_GENERATEPLOT as PLOT_ANNOTATION } from '../../../modules/gallvp/busco/generateplot/main' workflow FASTA_GXF_BUSCO_PLOT { @@ -166,3 +166,4 @@ workflow FASTA_GXF_BUSCO_PLOT { annotation_png = ch_annotation_png // channel: [ png ] versions = ch_versions // channel: [ versions.yml ] } + diff --git a/subworkflows/pfr/fasta_gxf_busco_plot/meta.yml b/subworkflows/gallvp/fasta_gxf_busco_plot/meta.yml similarity index 100% rename from subworkflows/pfr/fasta_gxf_busco_plot/meta.yml rename to subworkflows/gallvp/fasta_gxf_busco_plot/meta.yml diff --git a/subworkflows/pfr/fasta_gxf_busco_plot/tests/main.nf.test b/subworkflows/gallvp/fasta_gxf_busco_plot/tests/main.nf.test similarity index 73% rename from subworkflows/pfr/fasta_gxf_busco_plot/tests/main.nf.test rename to subworkflows/gallvp/fasta_gxf_busco_plot/tests/main.nf.test index 8c8ac7b0..783be862 100644 --- a/subworkflows/pfr/fasta_gxf_busco_plot/tests/main.nf.test +++ b/subworkflows/gallvp/fasta_gxf_busco_plot/tests/main.nf.test @@ -6,7 +6,7 @@ nextflow_workflow { config './nextflow.config' tag "subworkflows" - tag "subworkflows_nfcore" + tag "subworkflows_gallvp" tag "subworkflows/fasta_gxf_busco_plot" tag "busco" tag "busco/busco" @@ -21,17 +21,17 @@ nextflow_workflow { input[0] = Channel.of( [ [ id:'test' ], // meta map - file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true) ], [ [ id:'test2' ], // meta map - file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ] ) input[1] = Channel.of( [ [ id:'test' ], // meta map - file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test1_gff'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test1.gff', checkIfExists: true) ] ) input[2] = 'genome' @@ -73,17 +73,17 @@ nextflow_workflow { input[0] = Channel.of( [ [ id:'test' ], // meta map - file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true) ], [ [ id:'test2' ], // meta map - file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ] ) input[1] = Channel.of( [ [ id:'test' ], // meta map - file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test1_gff'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test1.gff', checkIfExists: true) ] ) input[2] = 'genome' diff --git a/subworkflows/pfr/fasta_gxf_busco_plot/tests/main.nf.test.snap b/subworkflows/gallvp/fasta_gxf_busco_plot/tests/main.nf.test.snap similarity index 100% rename from subworkflows/pfr/fasta_gxf_busco_plot/tests/main.nf.test.snap rename to subworkflows/gallvp/fasta_gxf_busco_plot/tests/main.nf.test.snap diff --git a/subworkflows/pfr/fasta_gxf_busco_plot/tests/nextflow.config b/subworkflows/gallvp/fasta_gxf_busco_plot/tests/nextflow.config similarity index 100% rename from subworkflows/pfr/fasta_gxf_busco_plot/tests/nextflow.config rename to subworkflows/gallvp/fasta_gxf_busco_plot/tests/nextflow.config diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/main.nf b/subworkflows/gallvp/fasta_ltrretriever_lai/main.nf similarity index 83% rename from subworkflows/pfr/fasta_ltrretriever_lai/main.nf rename to subworkflows/gallvp/fasta_ltrretriever_lai/main.nf index 3820e69c..655fb1f4 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/main.nf +++ b/subworkflows/gallvp/fasta_ltrretriever_lai/main.nf @@ -1,10 +1,11 @@ -include { CUSTOM_SHORTENFASTAIDS } from '../../../modules/pfr/custom/shortenfastaids/main' -include { LTRHARVEST } from '../../../modules/pfr/ltrharvest/main' -include { LTRFINDER } from '../../../modules/pfr/ltrfinder/main' -include { LTRRETRIEVER_LTRRETRIEVER } from '../../../modules/pfr/ltrretriever/ltrretriever/main' -include { CAT_CAT } from '../../../modules/pfr/cat/cat/main' -include { LTRRETRIEVER_LAI } from '../../../modules/pfr/ltrretriever/lai/main' -include { CUSTOM_RESTOREGFFIDS } from '../../../modules/pfr/custom/restoregffids/main' +include { SEQKIT_SEQ as UNMASK_IF_ANY } from '../../../modules/gallvp/seqkit/seq/main' +include { CUSTOM_SHORTENFASTAIDS } from '../../../modules/gallvp/custom/shortenfastaids/main' +include { LTRHARVEST } from '../../../modules/gallvp/ltrharvest/main' +include { LTRFINDER } from '../../../modules/gallvp/ltrfinder/main' +include { LTRRETRIEVER_LTRRETRIEVER } from '../../../modules/gallvp/ltrretriever/ltrretriever/main' +include { CAT_CAT } from '../../../modules/gallvp/cat/cat/main' +include { LTRRETRIEVER_LAI } from '../../../modules/gallvp/ltrretriever/lai/main' +include { CUSTOM_RESTOREGFFIDS } from '../../../modules/gallvp/custom/restoregffids/main' workflow FASTA_LTRRETRIEVER_LAI { @@ -24,8 +25,15 @@ workflow FASTA_LTRRETRIEVER_LAI { // Cater to channel: [ meta2, [] ] | map { meta2, seqs -> [ meta2.id, seqs ] } + + // MODULE: SEQKIT_SEQ as UNMASK_IF_ANY + UNMASK_IF_ANY ( ch_fasta ) + + ch_unmasked_fasta = UNMASK_IF_ANY.out.fastx + ch_versions = ch_versions.mix(UNMASK_IF_ANY.out.versions.first()) + // MOUDLE: CUSTOM_SHORTENFASTAIDS - CUSTOM_SHORTENFASTAIDS ( ch_fasta ) + CUSTOM_SHORTENFASTAIDS ( ch_unmasked_fasta ) ch_short_ids_tsv = CUSTOM_SHORTENFASTAIDS.out.short_ids_tsv ch_shortenfastaids_branch = ch_short_ids_tsv @@ -36,7 +44,7 @@ workflow FASTA_LTRRETRIEVER_LAI { ch_short_ids_fasta = ch_shortenfastaids_branch.nonchange | join( - ch_fasta + ch_unmasked_fasta ) | map { meta, tsv, fasta -> [ meta, fasta ] } | mix( @@ -102,6 +110,7 @@ workflow FASTA_LTRRETRIEVER_LAI { [] ) + ch_ltrretriever_log = LTRRETRIEVER_LTRRETRIEVER.out.log ch_pass_list = LTRRETRIEVER_LTRRETRIEVER.out.pass_list ch_annotation_out = LTRRETRIEVER_LTRRETRIEVER.out.annotation_out ch_pass_out = ch_pass_list.join(ch_annotation_out) @@ -164,11 +173,12 @@ workflow FASTA_LTRRETRIEVER_LAI { ch_versions = ch_versions.mix(CUSTOM_RESTOREGFFIDS.out.versions.first()) emit: - ltrlib = ch_ltrlib // channel: [ val(meta), fasta ] - annotation_gff = ch_restored_gff // channel: [ val(meta), gff ] - lai_log = ch_lai_log // channel: [ val(meta), log ] - lai_out = ch_lai_out // channel: [ val(meta), out ] - versions = ch_versions // channel: [ versions.yml ] + ltrretriever_log = ch_ltrretriever_log // channel: [ val(meta), fasta ] + ltrlib = ch_ltrlib // channel: [ val(meta), fasta ] + annotation_gff = ch_restored_gff // channel: [ val(meta), gff ] + lai_log = ch_lai_log // channel: [ val(meta), log ] + lai_out = ch_lai_out // channel: [ val(meta), out ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/meta.yml b/subworkflows/gallvp/fasta_ltrretriever_lai/meta.yml similarity index 99% rename from subworkflows/pfr/fasta_ltrretriever_lai/meta.yml rename to subworkflows/gallvp/fasta_ltrretriever_lai/meta.yml index 5ba17303..57d6852b 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/meta.yml +++ b/subworkflows/gallvp/fasta_ltrretriever_lai/meta.yml @@ -13,6 +13,7 @@ keywords: - stats - qc components: + - seqkit/seq - custom/shortenfastaids - ltrharvest - ltrfinder diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test b/subworkflows/gallvp/fasta_ltrretriever_lai/tests/main.nf.test similarity index 65% rename from subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test rename to subworkflows/gallvp/fasta_ltrretriever_lai/tests/main.nf.test index a7fc65eb..7b4cf9fe 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test +++ b/subworkflows/gallvp/fasta_ltrretriever_lai/tests/main.nf.test @@ -6,10 +6,11 @@ nextflow_workflow { config "./nextflow.config" tag "subworkflows" - tag "subworkflows_pfr" + tag "subworkflows_gallvp" tag "subworkflows/fasta_ltrretriever_lai" tag "fasta_ltrretriever_lai" tag "modules/nf-core/gunzip" + tag "seqkit/seq" tag "custom/shortenfastaids" tag "ltrharvest" tag "ltrfinder" @@ -26,7 +27,7 @@ nextflow_workflow { """ input[0] = [ [ id:'test' ], - file(params.test_data['actinidia_chinensis']['genome']['genome_1_fasta_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/eukaryotes/actinidia_chinensis/genome/chr1/genome.fasta.gz', checkIfExists: true) ] """ } @@ -53,7 +54,7 @@ nextflow_workflow { { assert file(workflow.out.lai_log[0][1]).text.contains('Done!') }, { assert Math.abs(Float.parseFloat(path(workflow.out.lai_out[0][1]).text.split("\n")[1].split("\t")[6]) - 31.29) <= 1.0 }, { assert file(workflow.out.ltrlib[0][1]).text.contains('#LTR/Copia') }, - { assert snapshot(workflow.out.versions).match("fasta_gz_versions") } + { assert snapshot(workflow.out.versions).match() } ) } } @@ -89,7 +90,7 @@ nextflow_workflow { { assert file(workflow.out.lai_log[0][1]).text.contains('Done!') }, { assert Math.abs(Float.parseFloat(path(workflow.out.lai_out[0][1]).text.split("\n")[1].split("\t")[6]) - 31.29) <= 1.0 }, { assert file(workflow.out.ltrlib[0][1]).text.contains('#LTR/Copia') }, - { assert snapshot(workflow.out.versions).match("with_mono_versions") } + { assert snapshot(workflow.out.versions).match() } ) } } @@ -122,7 +123,7 @@ nextflow_workflow { { assert file(workflow.out.lai_log[0][1]).text.contains('Done!') }, { assert Math.abs(Float.parseFloat(path(workflow.out.lai_out[0][1]).text.split("\n")[1].split("\t")[6]) - 31.29) <= 1.0 }, { assert file(workflow.out.ltrlib[0][1]).text.contains('#LTR/Copia') }, - { assert snapshot(workflow.out.versions).match("with_empty_mono_versions") } + { assert snapshot(workflow.out.versions).match() } ) } } @@ -151,4 +152,66 @@ nextflow_workflow { ) } } + + test("sarscov2 - fasta - noltr") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[1] = [] + input[2] = false + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { path(workflow.out.ltrretriever_log[0][1]).text.contains('ERROR: No candidate is found in the file(s) you specified.') }, + { assert snapshot( + workflow.out.annotation_gff, + workflow.out.lai_log, + workflow.out.lai_out, + workflow.out.ltrlib, + workflow.out.versions + ).match() + } + ) + } + } + + test("homo_sapiens - fasta") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome2.fasta', checkIfExists: true) + ]) + input[1] = [] + input[2] = false + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert file(workflow.out.annotation_gff[0][1]).text.contains('Gypsy_LTR_retrotransposon') }, + { assert file(workflow.out.lai_log[0][1]).text.contains('Calculate LAI:') }, + { assert file(workflow.out.lai_log[0][1]).text.contains('Sorry, LAI is not applicable on the current genome assembly.') }, + { assert file(workflow.out.ltrlib[0][1]).text.contains('#LTR/Gypsy') }, + { assert snapshot( + workflow.out.versions, + workflow.out.lai_out + ).match() + } + ) + } + } } \ No newline at end of file diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap b/subworkflows/gallvp/fasta_ltrretriever_lai/tests/main.nf.test.snap similarity index 61% rename from subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap rename to subworkflows/gallvp/fasta_ltrretriever_lai/tests/main.nf.test.snap index e827219f..d1dcff99 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap +++ b/subworkflows/gallvp/fasta_ltrretriever_lai/tests/main.nf.test.snap @@ -1,43 +1,97 @@ { - "fasta_gz_versions": { + "actinidia_chinensis-genome_1_fasta_gz-with_empty_mono": { "content": [ [ "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", "versions.yml:md5,608d746d45680f025562c4be455db461", "versions.yml:md5,8468404805dddec679524e75b4fa51e8", + "versions.yml:md5,9b2d5d76add82441b1e950d333e31307", "versions.yml:md5,fb42c6cc5c28b6f9d3384171c7b6b143" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-06-02T20:28:52.168753" + "timestamp": "2024-07-29T09:23:40.519096" }, - "with_empty_mono_versions": { + "sarscov2 - fasta - noltr": { "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + + ], [ "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", + "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", + "versions.yml:md5,608d746d45680f025562c4be455db461", + "versions.yml:md5,8468404805dddec679524e75b4fa51e8", + "versions.yml:md5,fb42c6cc5c28b6f9d3384171c7b6b143" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-29T09:24:10.73061" + }, + "homo_sapiens - fasta": { + "content": [ + [ + "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", "versions.yml:md5,608d746d45680f025562c4be455db461", "versions.yml:md5,8468404805dddec679524e75b4fa51e8", "versions.yml:md5,9b2d5d76add82441b1e950d333e31307", "versions.yml:md5,fb42c6cc5c28b6f9d3384171c7b6b143" + ], + [ + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-06-02T20:35:11.879068" + "timestamp": "2024-07-29T09:36:15.230271" }, - "with_mono_versions": { + "actinidia_chinensis-genome_1_fasta_gz": { "content": [ [ "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", + "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", + "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", + "versions.yml:md5,608d746d45680f025562c4be455db461", + "versions.yml:md5,8468404805dddec679524e75b4fa51e8", + "versions.yml:md5,fb42c6cc5c28b6f9d3384171c7b6b143" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-29T09:17:04.823488" + }, + "actinidia_chinensis-genome_1_fasta_gz-with_mono": { + "content": [ + [ + "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", "versions.yml:md5,608d746d45680f025562c4be455db461", @@ -48,9 +102,9 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-06-02T20:30:58.393054" + "timestamp": "2024-07-29T09:20:22.223941" }, "empty_fasta_stub": { "content": [ @@ -60,7 +114,7 @@ { "id": "test" }, - "test.LTRlib.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -68,7 +122,7 @@ { "id": "test" }, - "test.out.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.LTRlib.fa:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ @@ -76,7 +130,7 @@ { "id": "test" }, - "test.LAI.log:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.out.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "3": [ @@ -84,11 +138,20 @@ { "id": "test" }, - "test.LAI.out:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.LAI.log:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "4": [ + [ + { + "id": "test" + }, + "test.LAI.out:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", "versions.yml:md5,608d746d45680f025562c4be455db461", @@ -127,8 +190,17 @@ "test.LTRlib.fa:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], + "ltrretriever_log": [ + [ + { + "id": "test" + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], "versions": [ "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,4b491828a96bf34cfac8268152ac7a77", "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", "versions.yml:md5,608d746d45680f025562c4be455db461", @@ -139,8 +211,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nextflow": "24.04.3" }, - "timestamp": "2024-06-04T13:50:48.75158" + "timestamp": "2024-07-29T09:23:53.423404" } } \ No newline at end of file diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/tests/nextflow.config b/subworkflows/gallvp/fasta_ltrretriever_lai/tests/nextflow.config similarity index 75% rename from subworkflows/pfr/fasta_ltrretriever_lai/tests/nextflow.config rename to subworkflows/gallvp/fasta_ltrretriever_lai/tests/nextflow.config index 617b1160..fb642818 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/tests/nextflow.config +++ b/subworkflows/gallvp/fasta_ltrretriever_lai/tests/nextflow.config @@ -11,4 +11,8 @@ process { withName: CAT_CAT { ext.prefix = { "${meta.id}_ltrharvest_ltrfinder.tabout" } } + + withName: UNMASK_IF_ANY { + ext.args = '-u' // Change lowercase to uppercase + } } diff --git a/subworkflows/pfr/fastq_bwa_mem_samblaster/main.nf b/subworkflows/gallvp/fastq_bwa_mem_samblaster/main.nf similarity index 89% rename from subworkflows/pfr/fastq_bwa_mem_samblaster/main.nf rename to subworkflows/gallvp/fastq_bwa_mem_samblaster/main.nf index 456f36c7..3d8d705d 100644 --- a/subworkflows/pfr/fastq_bwa_mem_samblaster/main.nf +++ b/subworkflows/gallvp/fastq_bwa_mem_samblaster/main.nf @@ -1,6 +1,6 @@ -include { BWA_INDEX } from '../../../modules/pfr/bwa/index/main' -include { BWA_MEM } from '../../../modules/pfr/bwa/mem/main' -include { SAMBLASTER } from '../../../modules/pfr/samblaster/main' +include { BWA_INDEX } from '../../../modules/gallvp/bwa/index/main' +include { BWA_MEM } from '../../../modules/gallvp/bwa/mem/main' +include { SAMBLASTER } from '../../../modules/gallvp/samblaster/main' workflow FASTQ_BWA_MEM_SAMBLASTER { diff --git a/subworkflows/pfr/fastq_bwa_mem_samblaster/meta.yml b/subworkflows/gallvp/fastq_bwa_mem_samblaster/meta.yml similarity index 100% rename from subworkflows/pfr/fastq_bwa_mem_samblaster/meta.yml rename to subworkflows/gallvp/fastq_bwa_mem_samblaster/meta.yml diff --git a/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/main.nf.test b/subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/main.nf.test similarity index 61% rename from subworkflows/pfr/fastq_bwa_mem_samblaster/tests/main.nf.test rename to subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/main.nf.test index 0a84fd8c..e36282d9 100644 --- a/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/main.nf.test +++ b/subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/main.nf.test @@ -6,7 +6,7 @@ nextflow_workflow { config './nextflow.config' tag "subworkflows" - tag "subworkflows_nfcore" + tag "subworkflows_gallvp" tag "subworkflows/fastq_bwa_mem_samblaster" tag "samblaster" tag "bwa/index" @@ -22,13 +22,13 @@ nextflow_workflow { [ [ id:'test' ], [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + 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] = Channel.of( - [ [ id: 'genome' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), [] ] + [ [ id: 'genome' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), [] ] ) """ } @@ -53,13 +53,13 @@ nextflow_workflow { [ [ id:'test' ], [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + 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] = Channel.of( - [ [ id: 'genome' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), [] ] + [ [ id: 'genome' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), [] ] ) """ } diff --git a/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/main.nf.test.snap b/subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/main.nf.test.snap similarity index 100% rename from subworkflows/pfr/fastq_bwa_mem_samblaster/tests/main.nf.test.snap rename to subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/main.nf.test.snap diff --git a/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/nextflow.config b/subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/nextflow.config similarity index 100% rename from subworkflows/pfr/fastq_bwa_mem_samblaster/tests/nextflow.config rename to subworkflows/gallvp/fastq_bwa_mem_samblaster/tests/nextflow.config diff --git a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/main.nf b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/main.nf similarity index 97% rename from subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/main.nf rename to subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/main.nf index 3891fc81..07608710 100644 --- a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/main.nf +++ b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/main.nf @@ -1,7 +1,7 @@ -include { GT_GFF3 } from '../../../modules/pfr/gt/gff3/main' -include { SAMTOOLS_FAIDX } from '../../../modules/pfr/samtools/faidx/main' -include { GT_GFF3VALIDATOR } from '../../../modules/pfr/gt/gff3validator/main' -include { GT_STAT } from '../../../modules/pfr/gt/stat/main' +include { GT_GFF3 } from '../../../modules/gallvp/gt/gff3/main' +include { SAMTOOLS_FAIDX } from '../../../modules/gallvp/samtools/faidx/main' +include { GT_GFF3VALIDATOR } from '../../../modules/gallvp/gt/gff3validator/main' +include { GT_STAT } from '../../../modules/gallvp/gt/stat/main' workflow GFF3_GT_GFF3_GFF3VALIDATOR_STAT { diff --git a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/meta.yml b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/meta.yml similarity index 100% rename from subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/meta.yml rename to subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/meta.yml diff --git a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test similarity index 77% rename from subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test rename to subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test index f15972fa..6098d7da 100644 --- a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test +++ b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test @@ -6,7 +6,7 @@ nextflow_workflow { config "./nextflow.config" tag "subworkflows" - tag "subworkflows_nfcore" + tag "subworkflows_gallvp" tag "subworkflows/gff3_gt_gff3_gff3validator_stat" tag "gff3_gt_gff3_gff3validator_stat" tag "gt" @@ -22,10 +22,10 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ]) input[1] = Channel.of([ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) """ } @@ -45,10 +45,10 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ]) input[1] = Channel.of([ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) """ } @@ -68,10 +68,10 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ]) input[1] = Channel.of([ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) """ } @@ -98,7 +98,7 @@ nextflow_workflow { test_fasta.text = '>MT192765.1\\nAGCTAGCT' input[0] = Channel.of([ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) ]) input[1] = Channel.of([ [ id:'test' ], test_fasta.toPath() diff --git a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test.snap b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test.snap similarity index 82% rename from subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test.snap rename to subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test.snap index 57aadb93..e81b4459 100644 --- a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test.snap +++ b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/main.nf.test.snap @@ -18,7 +18,7 @@ ], "3": [ "versions.yml:md5,0cb9519e626e5128d8495cf29b7d59ff", - "versions.yml:md5,d81758cb7178ee32a1fb78f8639504d8" + "versions.yml:md5,8a418ac34d045b0cdac812eb2dc9c106" ], "gff3_stats": [ @@ -36,15 +36,15 @@ ], "versions": [ "versions.yml:md5,0cb9519e626e5128d8495cf29b7d59ff", - "versions.yml:md5,d81758cb7178ee32a1fb78f8639504d8" + "versions.yml:md5,8a418ac34d045b0cdac812eb2dc9c106" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-05-09T19:41:05.240982" + "timestamp": "2024-07-29T16:21:54.482267" }, "sarscov2-genome_gff3-test_fasta-correspondence_fail-out_of_bounds": { "content": [ @@ -53,15 +53,15 @@ ], [ "versions.yml:md5,0cb9519e626e5128d8495cf29b7d59ff", - "versions.yml:md5,c89b081a13c68acc5326e43ca9104344", - "versions.yml:md5,d81758cb7178ee32a1fb78f8639504d8" + "versions.yml:md5,8a418ac34d045b0cdac812eb2dc9c106", + "versions.yml:md5,c89b081a13c68acc5326e43ca9104344" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-05-09T19:41:16.606045" + "timestamp": "2024-07-29T16:22:06.684959" }, "sarscov2-genome_gff3-homo_sapiens-genome_fasta-correspondence_fail": { "content": [ @@ -70,15 +70,15 @@ ], [ "versions.yml:md5,0cb9519e626e5128d8495cf29b7d59ff", - "versions.yml:md5,c89b081a13c68acc5326e43ca9104344", - "versions.yml:md5,d81758cb7178ee32a1fb78f8639504d8" + "versions.yml:md5,8a418ac34d045b0cdac812eb2dc9c106", + "versions.yml:md5,c89b081a13c68acc5326e43ca9104344" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-05-09T19:41:11.28855" + "timestamp": "2024-07-29T16:22:00.684573" }, "sarscov2-genome_gff3-all_pass": { "content": [ @@ -105,8 +105,8 @@ "3": [ "versions.yml:md5,0cb9519e626e5128d8495cf29b7d59ff", "versions.yml:md5,80555fe6e28e9564cb534f5478842286", - "versions.yml:md5,c89b081a13c68acc5326e43ca9104344", - "versions.yml:md5,d81758cb7178ee32a1fb78f8639504d8" + "versions.yml:md5,8a418ac34d045b0cdac812eb2dc9c106", + "versions.yml:md5,c89b081a13c68acc5326e43ca9104344" ], "gff3_stats": [ [ @@ -130,15 +130,15 @@ "versions": [ "versions.yml:md5,0cb9519e626e5128d8495cf29b7d59ff", "versions.yml:md5,80555fe6e28e9564cb534f5478842286", - "versions.yml:md5,c89b081a13c68acc5326e43ca9104344", - "versions.yml:md5,d81758cb7178ee32a1fb78f8639504d8" + "versions.yml:md5,8a418ac34d045b0cdac812eb2dc9c106", + "versions.yml:md5,c89b081a13c68acc5326e43ca9104344" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-05-10T09:03:38.938037" + "timestamp": "2024-07-29T16:21:49.138904" } } \ No newline at end of file diff --git a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/nextflow.config b/subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/nextflow.config similarity index 100% rename from subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/nextflow.config rename to subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/tests/nextflow.config diff --git a/subworkflows/local/fasta_synteny.nf b/subworkflows/local/fasta_synteny.nf index 0ca879f5..6418d7e6 100644 --- a/subworkflows/local/fasta_synteny.nf +++ b/subworkflows/local/fasta_synteny.nf @@ -11,10 +11,10 @@ include { RELABELFASTALENGTH } from '../../modules/local/relabelfasta include { GENERATEKARYOTYPE } from '../../modules/local/generatekaryotype' include { CIRCOS } from '../../modules/local/circos' include { LINEARSYNTENY } from '../../modules/local/linearsynteny' -include { CUSTOM_RELABELFASTA } from '../../modules/pfr/custom/relabelfasta/main' +include { CUSTOM_RELABELFASTA } from '../../modules/gallvp/custom/relabelfasta/main' include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/main' -include { SYRI } from '../../modules/pfr/syri/main' -include { PLOTSR } from '../../modules/pfr/plotsr/main' +include { SYRI } from '../../modules/gallvp/syri/main' +include { PLOTSR } from '../../modules/gallvp/plotsr/main' workflow FASTA_SYNTENY { take: @@ -306,6 +306,7 @@ workflow FASTA_SYNTENY { ch_minimap_inputs.map { meta, tfa, rfa -> [ meta, tfa ] }, ch_minimap_inputs.map { meta, tfa, rfa -> [ meta, rfa ] }, true, // bam_format + 'bai', // bam_index_extension false, // cigar_paf_format false // cigar_bam ) @@ -342,7 +343,7 @@ workflow FASTA_SYNTENY { | groupTuple | map { meta, syri, fastas -> def fasta_list = fastas.flatten() - def syri_tags = syri.collect { it.name.replace('syri.out', '').tokenize('.on.') }.flatten().unique() + def syri_tags = syri.collect { it.name.replace('syri.out', '').split(/\.on\./).toList() }.flatten().unique() def proposed_order = plotsr_assembly_order ? plotsr_assembly_order.tokenize(' ') : syri_tags.sort(false) def available_tags = [] diff --git a/subworkflows/local/fq2hic.nf b/subworkflows/local/fq2hic.nf index 38761473..34a7fa4e 100644 --- a/subworkflows/local/fq2hic.nf +++ b/subworkflows/local/fq2hic.nf @@ -1,14 +1,14 @@ -include { FASTQ_TRIM_FASTP_FASTQC } from '../nf-core/fastq_trim_fastp_fastqc/main' -include { FASTQ_BWA_MEM_SAMBLASTER } from '../pfr/fastq_bwa_mem_samblaster/main' -include { SEQKIT_SORT } from '../../modules/nf-core/seqkit/sort/main' -include { HICQC } from '../../modules/local/hicqc' -include { MAKEAGPFROMFASTA } from '../../modules/local/makeagpfromfasta' -include { AGP2ASSEMBLY } from '../../modules/local/agp2assembly' -include { ASSEMBLY2BEDPE } from '../../modules/local/assembly2bedpe' -include { MATLOCK_BAM2_JUICER } from '../../modules/local/matlock_bam2_juicer' -include { JUICER_SORT } from '../../modules/local/juicer_sort' -include { RUNASSEMBLYVISUALIZER } from '../../modules/local/runassemblyvisualizer' -include { HIC2HTML } from '../../modules/local/hic2html' +include { FASTQ_FASTQC_UMITOOLS_FASTP } from '../nf-core/fastq_fastqc_umitools_fastp/main' +include { FASTQ_BWA_MEM_SAMBLASTER } from '../gallvp/fastq_bwa_mem_samblaster/main' +include { SEQKIT_SORT } from '../../modules/nf-core/seqkit/sort/main' +include { HICQC } from '../../modules/local/hicqc' +include { MAKEAGPFROMFASTA } from '../../modules/local/makeagpfromfasta' +include { AGP2ASSEMBLY } from '../../modules/local/agp2assembly' +include { ASSEMBLY2BEDPE } from '../../modules/local/assembly2bedpe' +include { MATLOCK_BAM2_JUICER } from '../../modules/local/matlock_bam2_juicer' +include { JUICER_SORT } from '../../modules/local/juicer_sort' +include { RUNASSEMBLYVISUALIZER } from '../../modules/local/runassemblyvisualizer' +include { HIC2HTML } from '../../modules/local/hic2html' workflow FQ2HIC { take: @@ -20,18 +20,22 @@ workflow FQ2HIC { main: ch_versions = Channel.empty() - // SUBWORKFLOW: FASTQ_TRIM_FASTP_FASTQC - FASTQ_TRIM_FASTP_FASTQC( + // SUBWORKFLOW: FASTQ_FASTQC_UMITOOLS_FASTP + FASTQ_FASTQC_UMITOOLS_FASTP( reads, - [], - true, // val_save_trimmed_fail - false, // val_save_merged + hic_skip_fastqc, + false, // with_umi + true, // skip_umi_extract + 0, // umi_discard_read hic_skip_fastp, - hic_skip_fastqc + [], // adapter_fasta + true, // save_trimmed_fail + false, // save_merged + 1 // min_trimmed_reads ) - ch_trim_reads = FASTQ_TRIM_FASTP_FASTQC.out.reads - ch_versions = ch_versions.mix(FASTQ_TRIM_FASTP_FASTQC.out.versions) + ch_trim_reads = FASTQ_FASTQC_UMITOOLS_FASTP.out.reads + ch_versions = ch_versions.mix(FASTQ_FASTQC_UMITOOLS_FASTP.out.versions) // MODULE: SEQKIT_SORT SEQKIT_SORT ( ref ) diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf new file mode 100644 index 00000000..ab6cbb32 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf @@ -0,0 +1,164 @@ +// +// Read QC, UMI extraction and trimming +// + +include { FASTQC as FASTQC_RAW } from '../../../modules/nf-core/fastqc/main' +include { FASTQC as FASTQC_TRIM } from '../../../modules/nf-core/fastqc/main' +include { UMITOOLS_EXTRACT } from '../../../modules/nf-core/umitools/extract/main' +include { FASTP } from '../../../modules/nf-core/fastp/main' + +// +// Function that parses fastp json output file to get total number of reads after trimming +// +import groovy.json.JsonSlurper + +def getFastpReadsAfterFiltering(json_file, min_num_reads) { + + if ( workflow.stubRun ) { return min_num_reads } + + def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') + return json['after_filtering']['total_reads'].toLong() +} + +def getFastpAdapterSequence(json_file){ + + if ( workflow.stubRun ) { return "" } + + def Map json = (Map) new JsonSlurper().parseText(json_file.text) + try{ + adapter = json['adapter_cutting']['read1_adapter_sequence'] + } catch(Exception ex){ + adapter = "" + } + return adapter +} + +workflow FASTQ_FASTQC_UMITOOLS_FASTP { + take: + reads // channel: [ val(meta), [ reads ] ] + skip_fastqc // boolean: true/false + with_umi // boolean: true/false + skip_umi_extract // boolean: true/false + umi_discard_read // integer: 0, 1 or 2 + skip_trimming // boolean: true/false + adapter_fasta // file: adapter.fasta + save_trimmed_fail // boolean: true/false + save_merged // boolean: true/false + min_trimmed_reads // integer: > 0 + + main: + ch_versions = Channel.empty() + fastqc_raw_html = Channel.empty() + fastqc_raw_zip = Channel.empty() + if (!skip_fastqc) { + FASTQC_RAW ( + reads + ) + fastqc_raw_html = FASTQC_RAW.out.html + fastqc_raw_zip = FASTQC_RAW.out.zip + ch_versions = ch_versions.mix(FASTQC_RAW.out.versions.first()) + } + + umi_reads = reads + umi_log = Channel.empty() + if (with_umi && !skip_umi_extract) { + UMITOOLS_EXTRACT ( + reads + ) + umi_reads = UMITOOLS_EXTRACT.out.reads + umi_log = UMITOOLS_EXTRACT.out.log + ch_versions = ch_versions.mix(UMITOOLS_EXTRACT.out.versions.first()) + + // Discard R1 / R2 if required + if (umi_discard_read in [1,2]) { + UMITOOLS_EXTRACT + .out + .reads + .map { + meta, reads -> + meta.single_end ? [ meta, reads ] : [ meta + [single_end: true], reads[umi_discard_read % 2] ] + } + .set { umi_reads } + } + } + + trim_reads = umi_reads + trim_json = Channel.empty() + trim_html = Channel.empty() + trim_log = Channel.empty() + trim_reads_fail = Channel.empty() + trim_reads_merged = Channel.empty() + fastqc_trim_html = Channel.empty() + fastqc_trim_zip = Channel.empty() + trim_read_count = Channel.empty() + adapter_seq = Channel.empty() + + if (!skip_trimming) { + FASTP ( + umi_reads, + adapter_fasta, + false, // don't want to set discard_trimmed_pass, else there will be no reads output + save_trimmed_fail, + save_merged + ) + trim_json = FASTP.out.json + trim_html = FASTP.out.html + trim_log = FASTP.out.log + trim_reads_fail = FASTP.out.reads_fail + trim_reads_merged = FASTP.out.reads_merged + ch_versions = ch_versions.mix(FASTP.out.versions.first()) + + // + // Filter FastQ files based on minimum trimmed read count after adapter trimming + // + FASTP + .out + .reads + .join(trim_json) + .map { meta, reads, json -> [ meta, reads, getFastpReadsAfterFiltering(json, min_trimmed_reads.toLong()) ] } + .set { ch_num_trimmed_reads } + + ch_num_trimmed_reads + .filter { meta, reads, num_reads -> num_reads >= min_trimmed_reads.toLong() } + .map { meta, reads, num_reads -> [ meta, reads ] } + .set { trim_reads } + + ch_num_trimmed_reads + .map { meta, reads, num_reads -> [ meta, num_reads ] } + .set { trim_read_count } + + trim_json + .map { meta, json -> [meta, getFastpAdapterSequence(json)] } + .set { adapter_seq } + + if (!skip_fastqc) { + FASTQC_TRIM ( + trim_reads + ) + fastqc_trim_html = FASTQC_TRIM.out.html + fastqc_trim_zip = FASTQC_TRIM.out.zip + ch_versions = ch_versions.mix(FASTQC_TRIM.out.versions.first()) + } + } + + emit: + reads = trim_reads // channel: [ val(meta), [ reads ] ] + + fastqc_raw_html // channel: [ val(meta), [ html ] ] + fastqc_raw_zip // channel: [ val(meta), [ zip ] ] + + umi_log // channel: [ val(meta), [ log ] ] + adapter_seq // channel: [ val(meta), [ adapter_seq] ] + + trim_json // channel: [ val(meta), [ json ] ] + trim_html // channel: [ val(meta), [ html ] ] + trim_log // channel: [ val(meta), [ log ] ] + trim_reads_fail // channel: [ val(meta), [ fastq.gz ] ] + trim_reads_merged // channel: [ val(meta), [ fastq.gz ] ] + trim_read_count // channel: [ val(meta), val(count) ] + + fastqc_trim_html // channel: [ val(meta), [ html ] ] + fastqc_trim_zip // channel: [ val(meta), [ zip ] ] + + versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml new file mode 100644 index 00000000..9308fe9b --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml @@ -0,0 +1,129 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +# yaml-language-server: $schema=yaml-schema.json +name: "fastq_fastqc_umitools_fastp" +description: Read QC, UMI extraction and trimming +keywords: + - fastq + - fastqc + - qc + - UMI + - trimming + - fastp +components: + - fastqc + - umitools/extract + - fastp +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - skip_fastqc: + type: boolean + description: | + Skip fastqc process + - with_umi: + type: boolean + description: | + With or without umi detection + - skip_umi_extract: + type: boolean + description: | + With or without umi extrection + - umi_discard_read: + type: integer + description: | + Discard R1 / R2 if required + - skip_trimming: + type: boolean + description: | + Allows to skip FastP execution + - adapter_fasta: + type: file + description: | + Fasta file of adapter sequences + - save_trimmed_fail: + type: boolean + description: | + Save trimmed fastqs of failed samples + - save_merged: + type: boolean + description: | + Save merged fastqs + - min_trimmed_reads: + type: integer + description: | + Inputs with fewer than this reads will be filtered out of the "reads" output channel +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - reads: + type: file + description: > + Extracted FASTQ files. | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | + For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. + pattern: "*.{fastq.gz}" + - fastqc_html: + type: file + description: FastQC report + pattern: "*_{fastqc.html}" + - fastqc_zip: + type: file + description: FastQC report archive + pattern: "*_{fastqc.zip}" + - log: + type: file + description: Logfile for umi_tools + pattern: "*.{log}" + - trim_json: + type: file + description: FastP Trimming report + pattern: "*.{fastp.json}" + - trim_html: + type: file + description: FastP Trimming report + pattern: "*.{fastp.html}" + - log: + type: file + description: Logfile FastP + pattern: "*.{fastp.log}" + - trim_reads_fail: + type: file + description: Trimmed fastq files failing QC + pattern: "*.{fastq.gz}" + - trim_reads_merged: + type: file + description: Trimmed and merged fastq files + pattern: "*.{fastq.gz}" + - trim_read_count: + type: integer + description: Number of reads after trimming + - fastqc_trim_html: + type: file + description: FastQC report + pattern: "*_{fastqc.html}" + - fastqc_trim_zip: + type: file + description: FastQC report archive + pattern: "*_{fastqc.zip}" + - adapter_seq: + type: string + description: | + Adapter Sequence found in read1 + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@robsyme" +maintainers: + - "@robsyme" diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test new file mode 100644 index 00000000..48ba5f48 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test @@ -0,0 +1,973 @@ +nextflow_workflow { + + name "Test Workflow FASTQ_FASTQC_UMITOOLS_FASTP" + script "../main.nf" + workflow "FASTQ_FASTQC_UMITOOLS_FASTP" + config './nextflow.config' + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_fastqc_umitools_fastp" + tag "fastq_fastqc_umitools_fastp" + tag "fastqc" + tag "umitools/extract" + tag "fastp" + + + test("sarscov2 paired-end [fastq]") { + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("skip_fastqc") { + + when { + workflow { + """ + skip_fastqc = true + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert !workflow.out.fastqc_raw_html }, + { assert !workflow.out.fastqc_raw_zip }, + { assert !workflow.out.fastqc_trim_html }, + { assert !workflow.out.fastqc_trim_zip }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("with_umi") { + + when { + workflow { + """ + skip_fastqc = false + with_umi = true + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.versions + ).match() + } + ) + } + } + + + test("skip_umi_extract") { + + when { + workflow { + """ + skip_fastqc = false + with_umi = true + skip_umi_extract = true + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("umi_discard_read = 2") { + + when { + workflow { + """ + skip_fastqc = false + with_umi = true + skip_umi_extract = true + umi_discard_read = 2 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("skip_trimming") { + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = true + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert !workflow.out.fastqc_trim_html }, + { assert !workflow.out.fastqc_trim_zip }, + { assert !workflow.out.trim_html }, + { assert !workflow.out.trim_log }, + { assert snapshot( + // If we skip trimming then input is output, so not snapshotting + workflow.out.adapter_seq, + workflow.out.reads.get(0).get(0), // Reads meta map + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("save_trimmed_fail") { + + config './nextflow.save_trimmed.config' + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = true + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("save_merged") { + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = true + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("min_trimmed_reads = 26") { + // Subworkflow should stop after FASTP which trims down to 25 reads + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = true + min_trimmed_reads = 26 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.reads, + workflow.out.trim_json, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions + ).match() + } + ) + } + } + + test("sarscov2 paired-end [fastq] - stub") { + + options '-stub' + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("skip_fastqc - stub") { + + options "-stub" + + when { + workflow { + """ + skip_fastqc = true + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("with_umi - stub") { + + options "-stub" + + when { + workflow { + """ + skip_fastqc = false + with_umi = true + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + + test("skip_umi_extract - stub") { + + options "-stub" + + when { + workflow { + """ + skip_fastqc = false + with_umi = true + skip_umi_extract = true + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("umi_discard_read = 2 - stub") { + + options "-stub" + + when { + workflow { + """ + skip_fastqc = false + with_umi = true + skip_umi_extract = true + umi_discard_read = 2 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("skip_trimming - stub") { + + options "-stub" + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = true + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.adapter_seq, + workflow.out.fastqc_raw_html, + workflow.out.fastqc_raw_zip, + workflow.out.fastqc_trim_html, + workflow.out.fastqc_trim_zip, + workflow.out.trim_html, + workflow.out.trim_json, + workflow.out.trim_log, + workflow.out.trim_read_count, + workflow.out.trim_reads_fail, + workflow.out.trim_reads_merged, + workflow.out.umi_log, + workflow.out.versions).match() } + ) + } + } + + test("save_trimmed_fail - stub") { + + options "-stub" + + config './nextflow.save_trimmed.config' + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = true + save_merged = false + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("save_merged - stub") { + + options "-stub" + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = true + min_trimmed_reads = 1 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("min_trimmed_reads = 26 - stub") { + // Subworkflow should stop after FASTP which trims down to 25 reads + + options "-stub" + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = true + min_trimmed_reads = 26 + + 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap new file mode 100644 index 00000000..e7d1f51e --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap @@ -0,0 +1,2407 @@ +{ + "skip_fastqc": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7", + "test_2.fastp.fastq.gz:md5,25cbdca08e2083dbd4f0502de6b62f39" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,1e0f8e27e71728e2b63fc64086be95cd" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 198 + ] + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:56:01.933832" + }, + "save_trimmed_fail": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,6ff32a64c5188b9a9192be1398c262c7", + "test_2.fastp.fastq.gz:md5,db0cb7c9977e94ac2b4b446ebd017a8a" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,4c3268ddb50ea5b33125984776aa3519" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 162 + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.fail.fastq.gz:md5,409b687c734cedd7a1fec14d316e1366", + "test_1.fail.fastq.gz:md5,4f273cf3159c13f79e8ffae12f5661f6", + "test_2.fail.fastq.gz:md5,f97b9edefb5649aab661fbc9e71fc995" + ] + ] + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:57:38.736" + }, + "skip_umi_extract": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7", + "test_2.fastp.fastq.gz:md5,25cbdca08e2083dbd4f0502de6b62f39" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,1e0f8e27e71728e2b63fc64086be95cd" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 198 + ] + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:56:47.905105" + }, + "umi_discard_read = 2": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7", + "test_2.fastp.fastq.gz:md5,25cbdca08e2083dbd4f0502de6b62f39" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,1e0f8e27e71728e2b63fc64086be95cd" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 198 + ] + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:57:05.436744" + }, + "umi_discard_read = 2 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:59:27.273892" + }, + "skip_trimming - stub": { + "content": [ + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:59:39.247758" + }, + "save_merged": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,54b726a55e992a869fd3fa778afe1672", + "test_2.fastp.fastq.gz:md5,29d3b33b869f7b63417b8ff07bb128ba" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,b712fd68ed0322f4bec49ff2a5237fcc" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 75 + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,c873bb1ab3fa859dcc47306465e749d5" + ] + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:57:57.472342" + }, + "skip_trimming": { + "content": [ + [ + + ], + { + "id": "test", + "single_end": false + }, + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:57:19.875543" + }, + "with_umi": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,ba8c6c3a7ce718d9a2c5857e2edf53bc" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d39c5c6d9a2e35fb60d26ced46569af6" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + 99 + ] + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,01f264f78de3c6d893c449cc6d3cd721", + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:56:26.778625" + }, + "min_trimmed_reads = 26": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,54b726a55e992a869fd3fa778afe1672", + "test_2.fastp.fastq.gz:md5,29d3b33b869f7b63417b8ff07bb128ba" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,b712fd68ed0322f4bec49ff2a5237fcc" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 75 + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,c873bb1ab3fa859dcc47306465e749d5" + ] + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:58:16.36697" + }, + "min_trimmed_reads = 26 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 26 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 26 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:00:16.524361" + }, + "with_umi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": true + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,01f264f78de3c6d893c449cc6d3cd721", + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": true + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": true + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,01f264f78de3c6d893c449cc6d3cd721", + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:58:56.42517" + }, + "skip_fastqc - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad" + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + + ], + "fastqc_raw_zip": [ + + ], + "fastqc_trim_html": [ + + ], + "fastqc_trim_zip": [ + + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:58:41.207281" + }, + "save_merged - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + [ + { + "id": "test", + "single_end": false + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:00:03.695409" + }, + "sarscov2 paired-end [fastq]": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "unspecified" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7", + "test_2.fastp.fastq.gz:md5,25cbdca08e2083dbd4f0502de6b62f39" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,1e0f8e27e71728e2b63fc64086be95cd" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 198 + ] + ], + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:55:50.614571" + }, + "sarscov2 paired-end [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:58:29.296468" + }, + "save_trimmed_fail - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_1.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.paired.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_1.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fail.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:59:51.615894" + }, + "skip_umi_extract - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:59:12.592278" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/nextflow.config b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/nextflow.config new file mode 100644 index 00000000..0174cae5 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/nextflow.config @@ -0,0 +1,11 @@ +process { + + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN" --bc-pattern2="NNNN"' + } + + withName: UMICOLLAPSE { + ext.prefix = { "${meta.id}.dedup" } + } + +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/nextflow.save_trimmed.config b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/nextflow.save_trimmed.config new file mode 100644 index 00000000..21207add --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/nextflow.save_trimmed.config @@ -0,0 +1,6 @@ +process { + // Make filtering more aggressive to make more reads fail + withName: FASTP { + ext.args = "-e 30" + } +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml new file mode 100644 index 00000000..84a4b567 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/fastq_fastqc_umitools_fastp: + - subworkflows/nf-core/fastq_fastqc_umitools_fastp/** diff --git a/subworkflows/nf-core/fastq_trim_fastp_fastqc/main.nf b/subworkflows/nf-core/fastq_trim_fastp_fastqc/main.nf deleted file mode 100644 index 4f1c84fc..00000000 --- a/subworkflows/nf-core/fastq_trim_fastp_fastqc/main.nf +++ /dev/null @@ -1,103 +0,0 @@ -// -// Read QC and trimming -// - -include { FASTQC as FASTQC_RAW } from '../../../modules/nf-core/fastqc/main' -include { FASTQC as FASTQC_TRIM } from '../../../modules/nf-core/fastqc/main' -include { FASTP } from '../../../modules/nf-core/fastp/main' - -// -// Function that parses fastp json output file to get total number of reads after trimming -// -import groovy.json.JsonSlurper - -def getFastpReadsAfterFiltering(json_file) { - def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') - return json['after_filtering']['total_reads'].toLong() -} - -workflow FASTQ_TRIM_FASTP_FASTQC { - take: - ch_reads // channel: [ val(meta), path(reads) ] - ch_adapter_fasta // channel: [ path(fasta) ] - val_save_trimmed_fail // value: boolean - val_save_merged // value: boolean - val_skip_fastp // value: boolean - val_skip_fastqc // value: boolean - - main: - - ch_versions = Channel.empty() - - ch_fastqc_raw_html = Channel.empty() - ch_fastqc_raw_zip = Channel.empty() - if (!val_skip_fastqc) { - FASTQC_RAW ( - ch_reads - ) - ch_fastqc_raw_html = FASTQC_RAW.out.html - ch_fastqc_raw_zip = FASTQC_RAW.out.zip - ch_versions = ch_versions.mix(FASTQC_RAW.out.versions.first()) - } - - ch_trim_reads = ch_reads - ch_trim_json = Channel.empty() - ch_trim_html = Channel.empty() - ch_trim_log = Channel.empty() - ch_trim_reads_fail = Channel.empty() - ch_trim_reads_merged = Channel.empty() - ch_fastqc_trim_html = Channel.empty() - ch_fastqc_trim_zip = Channel.empty() - if (!val_skip_fastp) { - FASTP ( - ch_reads, - ch_adapter_fasta, - val_save_trimmed_fail, - val_save_merged - ) - ch_trim_reads = FASTP.out.reads - ch_trim_json = FASTP.out.json - ch_trim_html = FASTP.out.html - ch_trim_log = FASTP.out.log - ch_trim_reads_fail = FASTP.out.reads_fail - ch_trim_reads_merged = FASTP.out.reads_merged - ch_versions = ch_versions.mix(FASTP.out.versions.first()) - - // - // Filter empty FastQ files after adapter trimming so FastQC doesn't fail - // - ch_trim_reads - .join(ch_trim_json) - .map { - meta, reads, json -> - if (getFastpReadsAfterFiltering(json) > 0) { - [ meta, reads ] - } - } - .set { ch_trim_reads } - - if (!val_skip_fastqc) { - FASTQC_TRIM ( - ch_trim_reads - ) - ch_fastqc_trim_html = FASTQC_TRIM.out.html - ch_fastqc_trim_zip = FASTQC_TRIM.out.zip - ch_versions = ch_versions.mix(FASTQC_TRIM.out.versions.first()) - } - } - - emit: - reads = ch_trim_reads // channel: [ val(meta), path(reads) ] - trim_json = ch_trim_json // channel: [ val(meta), path(json) ] - trim_html = ch_trim_html // channel: [ val(meta), path(html) ] - trim_log = ch_trim_log // channel: [ val(meta), path(log) ] - trim_reads_fail = ch_trim_reads_fail // channel: [ val(meta), path(fastq.gz) ] - trim_reads_merged = ch_trim_reads_merged // channel: [ val(meta), path(fastq.gz) ] - - fastqc_raw_html = ch_fastqc_raw_html // channel: [ val(meta), path(html) ] - fastqc_raw_zip = ch_fastqc_raw_zip // channel: [ val(meta), path(zip) ] - fastqc_trim_html = ch_fastqc_trim_html // channel: [ val(meta), path(html) ] - fastqc_trim_zip = ch_fastqc_trim_zip // channel: [ val(meta), path(zip) ] - - versions = ch_versions.ifEmpty(null) // channel: [ path(versions.yml) ] -} diff --git a/subworkflows/nf-core/fastq_trim_fastp_fastqc/meta.yml b/subworkflows/nf-core/fastq_trim_fastp_fastqc/meta.yml deleted file mode 100644 index 9f4e12e0..00000000 --- a/subworkflows/nf-core/fastq_trim_fastp_fastqc/meta.yml +++ /dev/null @@ -1,108 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: "fastq_trim_fastp_fastqc" -description: Read QC, fastp trimming and read qc -keywords: - - qc - - quality_control - - adapters - - trimming - - fastq -components: - - fastqc - - fastp -input: - - ch_reads: - type: file - description: | - Structure: [ val(meta), path (reads) ] - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ], List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. If you wish to run interleaved paired-end data, supply as single-end data - but with `--interleaved_in` in your `modules.conf`'s `ext.args` for the module. - - ch_adapter_fasta: - type: file - description: | - Structure: path(adapter_fasta) - File in FASTA format containing possible adapters to remove. - - val_save_trimmed_fail: - type: boolean - description: | - Structure: val(save_trimmed_fail) - Specify true to save files that failed to pass trimming thresholds ending in `*.fail.fastq.gz` - - val_save_merged: - type: boolean - description: | - Structure: val(save_merged) - Specify true to save all merged reads to the a file ending in `*.merged.fastq.gz` - - val_skip_fastqc: - type: boolean - description: | - Structure: val(skip_fastqc) - skip the fastqc process if true - - val_skip_fastp: - type: boolean - description: | - Structure: val(skip_fastp) - skip the fastp process if true -output: - - meta: - type: value - description: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: | - Structure: [ val(meta), path(reads) ] - The trimmed/modified/unmerged fastq reads - - trim_json: - type: file - description: | - Structure: [ val(meta), path(trim_json) ] - Results in JSON format - - trim_html: - type: file - description: | - Structure: [ val(meta), path(trim_html) ] - Results in HTML format - - trim_log: - type: file - description: | - Structure: [ val(meta), path(trim_log) ] - fastq log file - - trim_reads_fail: - type: file - description: | - Structure: [ val(meta), path(trim_reads_fail) ] - Reads the failed the preprocessing - - trim_reads_merged: - type: file - description: | - Structure: [ val(meta), path(trim_reads_merged) ] - Reads that were successfully merged - - fastqc_raw_html: - type: file - description: | - Structure: [ val(meta), path(fastqc_raw_html) ] - Raw fastQC report - - fastqc_raw_zip: - type: file - description: | - Structure: [ val(meta), path(fastqc_raw_zip) ] - Raw fastQC report archive - - fastqc_trim_html: - type: file - description: | - Structure: [ val(meta), path(fastqc_trim_html) ] - Trimmed fastQC report - - fastqc_trim_zip: - type: file - description: | - Structure: [ val(meta), path(fastqc_trim_zip) ] - Trimmed fastQC report archive - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@Joon-Klaps" -maintainers: - - "@Joon-Klaps" diff --git a/subworkflows/pfr/fasta_gxf_busco_plot/tests/tags.yml b/subworkflows/pfr/fasta_gxf_busco_plot/tests/tags.yml deleted file mode 100644 index b8786a59..00000000 --- a/subworkflows/pfr/fasta_gxf_busco_plot/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/fasta_gxf_busco_plot: - - subworkflows/pfr/fasta_gxf_busco_plot/** diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/tests/tags.yml b/subworkflows/pfr/fasta_ltrretriever_lai/tests/tags.yml deleted file mode 100644 index 9c15c67e..00000000 --- a/subworkflows/pfr/fasta_ltrretriever_lai/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/fasta_ltrretriever_lai: - - subworkflows/pfr/fasta_ltrretriever_lai/** diff --git a/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/tags.yml b/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/tags.yml deleted file mode 100644 index 810ecdd8..00000000 --- a/subworkflows/pfr/fastq_bwa_mem_samblaster/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/fastq_bwa_mem_samblaster: - - subworkflows/pfr/fastq_bwa_mem_samblaster/** diff --git a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/tags.yml b/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/tags.yml deleted file mode 100644 index 2b0b9279..00000000 --- a/subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/gff3_gt_gff3_gff3validator_stat: - - subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/** diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..257defe3 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,27 @@ +# **plant-food-research-open/assemblyqc** Tests + +## Minimal Testing + +If [Nextflow](https://www.nextflow.io/docs/latest/install.html#install-nextflow) and [Docker](https://docs.docker.com/install) are installed on the system, the pipeline can be minimally tested with the following command: + +```bash +nextflow run plant-food-research-open/assemblyqc -r main -profile docker,test --outdir results +``` + +Or using [singularity](https://docs.sylabs.io/guides/3.0/user-guide/installation.html): + +```bash +nextflow run plant-food-research-open/assemblyqc -r main -profile singularity,test --outdir results +``` + +## Local Testing + +The test sets included in this directory can be executed by first downloading the pipeline from GitHub and then executing the following command: + +```bash +./main.nf -profile docker -params-file tests/minimal/params.json --outdir results +``` + +## Continuous Integration (CI) + +The GitHub [CI action](../.github/workflows/ci.yml) included with the pipeline continuously tests the pipeline with the various test sets listed in this directory. diff --git a/tests/noltr/assemblysheet.csv b/tests/noltr/assemblysheet.csv new file mode 100644 index 00000000..9769e377 --- /dev/null +++ b/tests/noltr/assemblysheet.csv @@ -0,0 +1,3 @@ +tag,fasta +sarscov2,https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/genome.fasta +FI1,https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/003/814/445/GCA_003814445.1_ASM381444v1/GCA_003814445.1_ASM381444v1_genomic.fna.gz diff --git a/tests/noltr/params.json b/tests/noltr/params.json new file mode 100644 index 00000000..a46bd34d --- /dev/null +++ b/tests/noltr/params.json @@ -0,0 +1,9 @@ +{ + "config_profile_name": "No LTRs assembly profile", + "config_profile_description": "Profile to test an assembly without LTRs", + "input": "tests/noltr/assemblysheet.csv", + "lai_skip": false, + "max_cpus": 2, + "max_memory": "6.GB", + "max_time": "6.h" +} diff --git a/workflows/assemblyqc.nf b/workflows/assemblyqc.nf index 1fa329ae..8f615b3e 100644 --- a/workflows/assemblyqc.nf +++ b/workflows/assemblyqc.nf @@ -11,15 +11,15 @@ include { GUNZIP as GUNZIP_GFF3 } from '../modules/nf-core/gunzip/ma include { FASTAVALIDATOR } from '../modules/nf-core/fastavalidator/main' include { SEQKIT_RMDUP } from '../modules/nf-core/seqkit/rmdup/main' include { FASTA_EXPLORE_SEARCH_PLOT_TIDK } from '../subworkflows/nf-core/fasta_explore_search_plot_tidk/main' -include { GFF3_GT_GFF3_GFF3VALIDATOR_STAT } from '../subworkflows/pfr/gff3_gt_gff3_gff3validator_stat/main' +include { GFF3_GT_GFF3_GFF3VALIDATOR_STAT } from '../subworkflows/gallvp/gff3_gt_gff3_gff3validator_stat/main' include { FCS_FCSADAPTOR } from '../modules/nf-core/fcs/fcsadaptor/main' include { NCBI_FCS_GX } from '../subworkflows/local/ncbi_fcs_gx' include { ASSEMBLATHON_STATS } from '../modules/local/assemblathon_stats' -include { FASTA_GXF_BUSCO_PLOT } from '../subworkflows/pfr/fasta_gxf_busco_plot/main' -include { FASTA_LTRRETRIEVER_LAI } from '../subworkflows/pfr/fasta_ltrretriever_lai/main' +include { FASTA_GXF_BUSCO_PLOT } from '../subworkflows/gallvp/fasta_gxf_busco_plot/main' +include { FASTA_LTRRETRIEVER_LAI } from '../subworkflows/gallvp/fasta_ltrretriever_lai/main' include { FASTA_KRAKEN2 } from '../subworkflows/local/fasta_kraken2' include { FQ2HIC } from '../subworkflows/local/fq2hic' -include { CAT_CAT as TAG_ASSEMBLY } from '../modules/pfr/cat/cat/main' +include { CAT_CAT as TAG_ASSEMBLY } from '../modules/gallvp/cat/cat/main' include { FASTA_SYNTENY } from '../subworkflows/local/fasta_synteny' include { MERYL_COUNT } from '../modules/nf-core/meryl/count/main' include { MERYL_UNIONSUM } from '../modules/nf-core/meryl/unionsum/main' @@ -27,7 +27,7 @@ include { MERYL_COUNT as MAT_MERYL_COUNT } from '../modules/nf-core/meryl/cou include { MERYL_UNIONSUM as MAT_UNIONSUM } from '../modules/nf-core/meryl/unionsum/main' include { MERYL_COUNT as PAT_MERYL_COUNT } from '../modules/nf-core/meryl/count/main' include { MERYL_UNIONSUM as PAT_UNIONSUM } from '../modules/nf-core/meryl/unionsum/main' -include { MERQURY_HAPMERS } from '../modules/pfr/merqury/hapmers/main' +include { MERQURY_HAPMERS } from '../modules/nf-core/merqury/hapmers/main' include { MERQURY_MERQURY } from '../modules/nf-core/merqury/merqury/main' include { CREATEREPORT } from '../modules/local/createreport' @@ -535,6 +535,10 @@ workflow ASSEMBLYQC { // This partial join can't fail because both outputs are // from the same process | map { meta, log, out -> out ? [ log, out ] : [log] } + | mix( + FASTA_LTRRETRIEVER_LAI.out.ltrretriever_log + | map { meta, log -> log } + ) ch_versions = ch_versions.mix(FASTA_LTRRETRIEVER_LAI.out.versions)