diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ff962c93..bc81c6e1 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/nf-core/diseasemodulediscovery/tree/main/docs/CONTRIBUTING.md) +Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/diseasemodulediscovery/tree/master/.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/nf-core/diseasemodulediscovery/tree/main/docs/CONTRIBUTING.md) +- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/diseasemodulediscovery/tree/master/.github/CONTRIBUTING.md) - [ ] If necessary, also make a PR on the nf-core/diseasemodulediscovery _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. - [ ] Make sure your code lints (`nf-core pipelines lint`). - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 7f637962..73149348 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -21,7 +21,7 @@ jobs: # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets - name: Post PR comment if: failure() - uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0 # v3 + uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 8738ffc9..7a527a34 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,31 +11,33 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - - name: Install Nextflow - uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 + - name: Set up Python 3.14 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6 + with: + python-version: "3.14" - - name: Run prek - uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2 + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files nf-core: runs-on: ubuntu-latest steps: - name: Check out pipeline code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - name: Install Nextflow - uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 + uses: nf-core/setup-nextflow@v2 - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 + - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6 with: python-version: "3.14" architecture: "x64" - - name: Setup uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - - name: read .nf-core.yml uses: pietrobolcato/action-read-yaml@9f13718d61111b69f30ab4ac683e67a56d254e1d # 1.1.0 id: read_yml @@ -43,10 +45,12 @@ jobs: config: ${{ github.workspace }}/.nf-core.yml - name: Install dependencies - run: uv tool install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} + run: | + python -m pip install --upgrade pip + pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} - name: Run nf-core pipelines lint - if: ${{ github.base_ref != 'master' || github.base_ref != 'main' }} + if: ${{ github.base_ref != 'master' }} env: GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -54,7 +58,7 @@ jobs: run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md - name: Run nf-core pipelines lint --release - if: ${{ github.base_ref == 'master' || github.base_ref == 'main' }} + if: ${{ github.base_ref == 'master' }} env: GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -67,7 +71,7 @@ jobs: - name: Upload linting log file artifact if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: linting-logs path: | diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index 5b0c24f7..e6e9bc26 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21 + uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11 with: workflow: linting.yml workflow_conclusion: completed @@ -21,7 +21,7 @@ jobs: run: echo "pr_number=$(cat linting-logs/PR_number.txt)" >> $GITHUB_OUTPUT - name: Post PR comment - uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3 + uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} number: ${{ steps.pr_number.outputs.pr_number }} diff --git a/.prettierignore b/.prettierignore index 63cde500..dd749d43 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,6 @@ email_template.html +adaptivecard.json +slackreport.json .nextflow* work/ data/ diff --git a/assets/nf-core-diseasemodulediscovery_logo_light.png b/assets/nf-core-diseasemodulediscovery_logo_light.png index 55d9882d..02cd6491 100644 Binary files a/assets/nf-core-diseasemodulediscovery_logo_light.png and b/assets/nf-core-diseasemodulediscovery_logo_light.png differ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3453d5cc..6ca2fce7 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,185 +1,17 @@ ---- -title: Contributing -markdownPlugin: checklist ---- - -# `nf-core/diseasemodulediscovery`: Contributing guidelines - -Hi there! -Thanks for taking an interest in improving nf-core/diseasemodulediscovery. - -This page describes the recommended nf-core way to contribute to both nf-core/diseasemodulediscovery and nf-core pipelines in general, including: - -- [General contribution guidelines](#general-contribution-guidelines): common procedures or guides across all nf-core pipelines. -- [Pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines): procedures or guides specific to the development conventions of nf-core/diseasemodulediscovery. - -> [!NOTE] -> If you need help using or modifying nf-core/diseasemodulediscovery, ask on the nf-core Slack [#diseasemodulediscovery](https://nfcore.slack.com/channels/diseasemodulediscovery) channel ([join our Slack here](https://nf-co.re/join/slack)). - -## General contribution guidelines - -### Contribution quick start - -To contribute code to any nf-core pipeline: - -- [ ] Ensure you have Nextflow, nf-core tools, and nf-test installed. See the [nf-core/tools repository](https://github.com/nf-core/tools) for instructions. -- [ ] Check whether a GitHub [issue](https://github.com/nf-core/diseasemodulediscovery/issues) about your idea already exists. If an issue does not exist, create one so that others are aware you are working on it. -- [ ] [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/diseasemodulediscovery repository](https://github.com/nf-core/diseasemodulediscovery) to your GitHub account. -- [ ] Create a branch on your forked repository and make your changes following [pipeline conventions](#pipeline-contribution-conventions) (if applicable). -- [ ] To fix major bugs, name your branch `patch` and follow the [patch release](#patch-release) process. -- [ ] Update relevant documentation within the `docs/` folder, use nf-core/tools to update `nextflow_schema.json`, and update `CITATIONS.md`. -- [ ] Run and/or update tests. See [Testing](#testing) for more information. -- [ ] [Lint](#lint-tests) your code with nf-core/tools. -- [ ] Submit a pull request (PR) against the `dev` branch and request a review. - -If you are not used to this workflow with Git, see the [GitHub documentation](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or [Git resources](https://try.github.io/) for more information. - -## Use of AI and LLMs - -The nf-core stance on the use of AI and LLMs is that humans are still ultimately responsible for their submitted code, regardless of the tools they use. - -If you’re using AI tools, try to stick by these guidelines: - -- Keep PRs as small and focussed as possible -- Avoid any unnecessary changes, such as moving or refactoring code (unless that is the explicit intention of the PR) -- Review all generated code yourself before opening a PR, and ensure that you understand it -- Engage with the community review process and expect to make revisions - -For more detail, see the the [blog post](https://nf-co.re/blog/2026/statement-on-ai) for a statement from the nf-core/core team. - -### Getting help - -For further information and help, see the [nf-core/diseasemodulediscovery documentation](https://nf-co.re/diseasemodulediscovery/usage) or ask on the nf-core [#diseasemodulediscovery](https://nfcore.slack.com/channels/diseasemodulediscovery) Slack channel ([join our Slack here](https://nf-co.re/join/slack)). - -### GitHub Codespaces - -You can contribute to nf-core/diseasemodulediscovery without installing a local development environment on your machine by using [GitHub Codespaces](https://github.com/codespaces). - -[GitHub Codespaces](https://github.com/codespaces) is an online developer environment that runs in your browser, complete with VS Code and a terminal. -Most nf-core repositories include a devcontainer configuration, which creates a GitHub Codespaces environment specifically for Nextflow development. -The environment includes pre-installed nf-core tools, Nextflow, and a few other helpful utilities via a Docker container. - -To get started, open the repository in [Codespaces](https://github.com/nf-core/diseasemodulediscovery/codespaces). - -### Testing - -Once you have made your changes, run the pipeline with nf-test to test them locally. -For additional information, use the `--verbose` flag to view the Nextflow console log output. - -```bash -nf-test test --tag test --profile +docker --verbose -``` - -If you have added new functionality, ensure you update the test assertions in the `.nf.test` files in the `tests/` directory. -Update the snapshots with the following command: - -```bash -nf-test test --tag test --profile +docker --verbose --update-snapshots -``` - -When you create a pull request with changes, GitHub Actions will run automatic tests. -Pull requests are typically reviewed when these tests are passing. - -Two types of tests are typically run: - -#### Lint tests - -nf-core has a [set of guidelines](https://nf-co.re/docs/specifications/overview) which all pipelines must follow. -To enforce these, run linting with nf-core/tools: - -```bash -nf-core pipelines lint -``` - -If you encounter failures or warnings, follow the linked documentation printed to screen. -For more information about linting tests, see [nf-core/tools API documentation](https://nf-co.re/docs/nf-core-tools/api_reference/latest/pipeline_lint_tests/actions_awsfulltest). - -#### Pipeline tests - -Each nf-core pipeline should be set up with a minimal set of test data. -GitHub Actions runs the pipeline on this data to ensure it runs through and exits successfully. -If there are any failures then the automated tests fail. -These tests are run with the latest available version of Nextflow and the minimum required version specified in the pipeline code. - -### Patch release - -> [!WARNING] -> Only in the unlikely event of a release that contains a critical bug. - -- [ ] Create a new branch `patch` on your fork based on `upstream/main` or `upstream/master`. -- [ ] Fix the bug and use nf-core/tools to bump the version to the next semantic version, for example, `1.2.3` → `1.2.4`. -- [ ] Open a Pull Request from `patch` directly to `main`/`master` with the changes. - -### Pipeline contribution conventions - -nf-core semi-standardises how you write code and other contributions to make the nf-core/diseasemodulediscovery code and processing logic more understandable for new contributors and to ensure quality. - -#### Add a new pipeline step - -To contribute a new step to the pipeline, follow the general nf-core coding procedure. -Please also refer to the [pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines): - -- [ ] Define the corresponding [input channel](#channel-naming-schemes) into your new process from the expected previous process channel. -- [ ] Install a module with nf-core/tools, or write a local module (see [default processes resource requirements](#default-processes-resource-requirements)), and add it to the target `.nf`. -- [ ] Define the output channel if needed. Mix the version output channel into `ch_versions` and relevant files into `ch_multiqc`. -- [ ] Add new or updated parameters to `nextflow.config` with a [default value](#default-parameter-values). -- [ ] Add new or updated parameters and relevant help text to `nextflow_schema.json` with [nf-core/tools](#default-parameter-values). -- [ ] Add validation for relevant parameters to the pipeline utilisation section of `utils_nfcore_\_pipeline/main.nf` subworkflow. -- [ ] Perform local tests to validate that the new code works as expected. - - [ ] If applicable, add a new test in the `tests` directory. -- [ ] Update `usage.md`, `output.md`, and `citation.md` as appropriate. -- [ ] [Lint](lint) the code with nf-core/tools. -- [ ] Update any diagrams or pipeline images as necessary. -- [ ] Update MultiQC config `assets/multiqc_config.yml` so relevant suffixes, file name cleanup, and module plots are in the appropriate order. -- [ ] If applicable, create a [MultiQC](https://seqera.io/multiqc/) module. -- [ ] Add a description of the output files and, if relevant, images from the MultiQC report to `docs/output.md`. - -To update the minimum required Nextflow version, see the [Nextflow version bumping](#nextflow-version-bumping) section below. For more information about pipeline contributions, see [pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines). - -#### Channel naming schemes - -Use the following naming schemes for channels to make the channel flow easier to understand: - -- Initial process channel: `ch_output_from_` -- Intermediate and terminal channels: `ch__for_` - -#### Default parameter values - -Parameters should be initialised and defined with default values within the `params` scope in `nextflow.config`. -They should also be documented in the pipeline JSON schema. - -To update `nextflow_schema.json`, run: - -```bash -nf-core pipelines schema build -``` - -The schema builder interface that loads in your browser should automatically update the defaults in the parameter documentation. - -#### Default processes resource requirements - -If you write a local module, specify a default set of resource requirements for the process. - -Sensible defaults for process resource requirements (CPUs, memory, time) should be defined in `conf/base.config`. -Specify these with generic `withLabel:` selectors, so they can be shared across multiple processes and steps of the pipeline. - -nf-core provides a set of standard labels that you should follow where possible, as seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config). -These labels define resource defaults for single-core processes, modules that require a GPU, and different levels of multi-core configurations with increasing memory requirements. - -Values assigned within these labels can be dynamically passed to a tool using the the `${task.cpus}` and `${task.memory}` Nextflow variables in the `script:` block of a module (see an example in the [modules repository](https://github.com/nf-core/modules/blob/bd1b6a40f55933d94b8c9ca94ec8c1ea0eaf4b82/modules/nf-core/samtools/bam2fq/main.nf#L30)). - -#### Nextflow version bumping - -If you use a new feature from core Nextflow, bump the minimum required Nextflow version in the pipeline with: - -```bash -nf-core pipelines bump-version --nextflow . -``` - -#### Images and figures guidelines - -If you update images or graphics, follow the nf-core [style guidelines](https://nf-co.re/docs/community/brand/workflow-schematics). - -## Pipeline specific contribution guidelines - - +# Including a new active module detection tool + +1. Create a new branch for your tool. +2. Add a function to the bin/graph_tool_parser.py script for preparing the tool-specific network input format. The script is built around the [graph-tool](https://graph-tool.skewed.de/) Python package. An example is the safe_diamond() function, which saves a simple edge list in CSV format. Add the function as an option in the save() function and a command line option for `--format` in parse_args(). The output file name has to include the option specified with `--format` since nextflow uses this pattern to check whether the output file was successfully generated. The script expects a .gt file as input. Run the pipeline with the "test" profile to generate a .gt example file in `/graphtoolparser`, which you can use to test the parsing function by executing the parsing script directly via the command line. +3. Create a module for the tool. (Example with comments: `modules/local/diamond/main.nf` and `modules/local/domino/`) +4. Create a subworkflow wrapping the tool together with the input parser. (Example with comments: `subworkflows/local/gt_diamond/main.nf` and `subworkflows/local/gt_domino/main.nf`) +5. Include the subworkflow in the `workflows/modulediscovery.nf` file. Again, DIAMOnD and DOMINO are included as examples. +6. Test checks locally: + 1. Run tests via, e.g., `nextflow run main.nf -profile singularity,test --outdir results`. + 2. Run `nf-core lint`. + 3. Check your code style. This will automatically happen before you commit, if you use pre-commit, which can be set up with: `pre-commit install`. After each commit, it will automatically check your code style and fix it where possible. If changes were made, you have to commit again. +7. Create a pull request against the dev branch. + +Further information + +- [FAQ sheet](https://docs.google.com/document/d/1WgBIFrrcxFKN0I-zJbuS7PUCmyCLPTWx6xAHg1zi4FA/edit?usp=sharing) +- [Workflow schema](https://docs.google.com/drawings/d/1X7U79dAZaeRdGdIsXoEKw74MNqjxCHq3RuNASBYCiB4/edit?usp=sharing) diff --git a/docs/images/nf-core-diseasemodulediscovery_logo_dark.png b/docs/images/nf-core-diseasemodulediscovery_logo_dark.png index 8d5ee4f9..45c30ba8 100644 Binary files a/docs/images/nf-core-diseasemodulediscovery_logo_dark.png and b/docs/images/nf-core-diseasemodulediscovery_logo_dark.png differ diff --git a/docs/images/nf-core-diseasemodulediscovery_logo_light.png b/docs/images/nf-core-diseasemodulediscovery_logo_light.png index d7ff60b4..28c36266 100644 Binary files a/docs/images/nf-core-diseasemodulediscovery_logo_light.png and b/docs/images/nf-core-diseasemodulediscovery_logo_light.png differ diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index 73f8b7bc..467905e0 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -23,7 +23,7 @@ "@type": "Dataset", "creativeWorkStatus": "InProgress", "datePublished": "2026-04-30T13:32:39+00:00", - "description": "

\n \n \n \"nf-core/diseasemodulediscovery\"\n \n

\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/nf-core/diseasemodulediscovery)\n[![GitHub Actions CI Status](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/diseasemodulediscovery/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.10.4-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-4.0.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/4.0.2)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/diseasemodulediscovery)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23diseasemodulediscovery-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/diseasemodulediscovery)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/diseasemodulediscovery** is a bioinformatics pipeline for network medicine hypothesis generation, designed for identifying active/disease modules. Developed and maintained by the [RePo4EU](https://repo4.eu/) consortium, it aims to characterize the molecular mechanisms of diseases by analyzing the local neighborhood of disease-associated genes or proteins (seeds) within the interactome. This approach can help identify potential drug targets for drug repurposing.\n\n![REPO4EU/modulediscovery metro map](docs/images/nf-core-diseasemodulediscovery_metro_map.png)\n\n- Module inference (all enabled by default):\n - [`DOMINO`](https://github.com/Shamir-Lab/DOMINO)\n - [`DIAMOnD`](https://github.com/dinaghiassian/DIAMOnD)\n - [`ROBUST`](https://github.com/bionetslab/robust)\n - [`ROBUST (bias-aware)`](https://github.com/bionetslab/robust_bias_aware)\n - `1st Neighbors`\n - `random walk with restart (RWR)`\n- Evaluation\n - Over-representation analysis ([`g:Profiler`](https://cran.r-project.org/web/packages/gprofiler2/index.html))\n - Functional coherence analysis ([`DIGEST`](https://pypi.org/project/biodigest/))\n - Network topology analysis ([`graph-tool`](https://graph-tool.skewed.de/))\n - Overlaps between different disease modules\n - Seed set perturbation-based evaluation (robustness and seed rediscovery, enabled by `--run_seed_perturbation`)\n - Network perturbation-based evaluation (robustness, enabled by `--run_network_perturbation`)\n- Export to the network medicine web visualization tool [`Drugst.One`](https://drugst.one/)\n- Drug prioritization using the API of [`Drugst.One`](https://drugst.one/)\n- Visualization of the module networks ([`graph-tool`](https://graph-tool.skewed.de/), [`pyvis`](https://github.com/WestHealth/pyvis))\n- Annotation with biological data (targeting drugs, side effects, associated disorders, cellular localization) queried from [`NeDRexDB`](https://nedrex.net/) and conversion to [`BioPAX`](https://www.biopax.org/) format.\n- Result and evaluation summary ([`MultiQC`](https://seqera.io/multiqc/))\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/get_started/environment_setup/overview) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/get_started/run-your-first-pipeline) with `-profile test` before running the workflow on actual data.\n\n> [!WARNING]\n> The pipeline is still under development. In order to run it, please use the option `-r dev`\n\n### Test your setup\n\n```bash\nnextflow run nf-core/diseasemodulediscovery \\\n -profile ,test \\\n --outdir \n```\n\nThis will run the pipeline with a small test dataset. Results will be saved to the specified ``. Use `-profile` to set whether docker or singularity should be used for software deployment.\n\n### Running the pipeline\n\nNow, you can run the pipeline with your own data using:\n\n```bash\nnextflow run nf-core/diseasemodulediscovery \\\n -profile \\\n --seeds \\\n --network \\\n --outdir \n```\n\nThis will run the pipeline based on the provided `` and ``. Results will be saved to the specified ``. Use `-profile` to set whether docker or singularity should be used for software deployment.\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/running/run-pipelines#using-parameter-files).\n\nFor more details and further functionality, please refer to the [usage documentation](https://nf-co.re/diseasemodulediscovery/usage) and the [parameter documentation](https://nf-co.re/diseasemodulediscovery/parameters).\n\n> [!TIP]\n> **OS specifics**\n> \n> The pipeline works best in combination with Linux. Furthermore, some Docker images in the pipeline are natively only available for `amd64` but not the `arm` architecture.\n> Here are some tips to get the pipeline running with a different OS or architecture:\n>\n> **macOS**\n> \n> With macOS and Apple silicon, we had better experiences using the free version of [orbstack](https://orbstack.dev/download) instead of Docker Desktop for deploying the containers.\n>\n> **Windows**\n>\n> The most reliable solution is to work with the [Windows Subsystem for Linux (WSL)](https://documentation.ubuntu.com/wsl/latest/howto/install-ubuntu-wsl2/).\n> \n> **What if it keeps failing?**\n>\n> Most pipeline steps are not essential. If the pipeline keeps failing because of a specific process, you may be able to just [skip](https://nf-co.re/diseasemodulediscovery/dev/docs/usage/#skipping-steps) that one.\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/diseasemodulediscovery/results) tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\n[output documentation](https://nf-co.re/diseasemodulediscovery/output).\n\n## Credits\n\nnf-core/diseasemodulediscovery was originally written by the [RePo4EU](https://repo4.eu/) consortium.\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- [Johannes Kersting](https://github.com/JohannesKersting) (TUM)\n- [Lisa Spindler](https://github.com/lspindler2509) (TUM)\n- [Quirin Manz](https://github.com/quirinmanz) (TUM)\n- [Quim Aguirre](https://github.com/quimaguirre) (STALICLA)\n- [Chlo\u00e9 Bucheron](https://github.com/ChloeBubu) (University Vienna)\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](docs/CONTRIBUTING.md).\n\nIf you want to include an additional module identification approach, please see [this guide](docs/contributing.md).\nFor further information or help, don't hesitate to get in touch on the [Slack `#diseasemodulediscovery` channel](https://nfcore.slack.com/channels/diseasemodulediscovery) (you can join with [this invite](https://nf-co.re/join/slack)).\n\n## Citations\n\nIf you use `nf-core/diseasemodulediscovery` for your analysis, please cite the preprint as follows:\n\n> Johannes Kersting, Chlo\u00e9 Bucheron, Lisa M. Spindler, Joaquim Aguirre-Plans, Quirin Manz, Tanja Pock, Mo Tan, Fernando M. Delgado-Chaves, Cristian Nogales, Harald H. H. W. Schmidt, J\u00f6rg Menche, Andreas Maier, Jan Baumbach, Emre Guney, Markus List **Inferring and Evaluating Network Medicine-Based Disease Modules with Nextflow** _bioRxiv_ , 2025, [doi: 10.1101/2025.11.20.687681](https://doi.org/10.1101/2025.11.20.687681).\n\n\n\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", + "description": "

\n \n \n \"nf-core/diseasemodulediscovery\"\n \n

\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/nf-core/diseasemodulediscovery)\n[![GitHub Actions CI Status](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/diseasemodulediscovery/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/diseasemodulediscovery/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.10.4-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-4.0.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/4.0.2)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/diseasemodulediscovery)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23diseasemodulediscovery-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/diseasemodulediscovery)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/diseasemodulediscovery** is a bioinformatics pipeline for network medicine hypothesis generation, designed for identifying active/disease modules. Developed and maintained by the [RePo4EU](https://repo4.eu/) consortium, it aims to characterize the molecular mechanisms of diseases by analyzing the local neighborhood of disease-associated genes or proteins (seeds) within the interactome. This approach can help identify potential drug targets for drug repurposing.\n\n![REPO4EU/modulediscovery metro map](docs/images/nf-core-diseasemodulediscovery_metro_map.png)\n\n- Module inference (all enabled by default):\n - [`DOMINO`](https://github.com/Shamir-Lab/DOMINO)\n - [`DIAMOnD`](https://github.com/dinaghiassian/DIAMOnD)\n - [`ROBUST`](https://github.com/bionetslab/robust)\n - [`ROBUST (bias-aware)`](https://github.com/bionetslab/robust_bias_aware)\n - `1st Neighbors`\n - `random walk with restart (RWR)`\n- Evaluation\n - Over-representation analysis ([`g:Profiler`](https://cran.r-project.org/web/packages/gprofiler2/index.html))\n - Functional coherence analysis ([`DIGEST`](https://pypi.org/project/biodigest/))\n - Network topology analysis ([`graph-tool`](https://graph-tool.skewed.de/))\n - Overlaps between different disease modules\n - Seed set perturbation-based evaluation (robustness and seed rediscovery, enabled by `--run_seed_perturbation`)\n - Network perturbation-based evaluation (robustness, enabled by `--run_network_perturbation`)\n- Export to the network medicine web visualization tool [`Drugst.One`](https://drugst.one/)\n- Drug prioritization using the API of [`Drugst.One`](https://drugst.one/)\n- Visualization of the module networks ([`graph-tool`](https://graph-tool.skewed.de/), [`pyvis`](https://github.com/WestHealth/pyvis))\n- Annotation with biological data (targeting drugs, side effects, associated disorders, cellular localization) queried from [`NeDRexDB`](https://nedrex.net/) and conversion to [`BioPAX`](https://www.biopax.org/) format.\n- Result and evaluation summary ([`MultiQC`](https://seqera.io/multiqc/))\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/get_started/environment_setup/overview) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/get_started/run-your-first-pipeline) with `-profile test` before running the workflow on actual data.\n\n> [!WARNING]\n> The pipeline is still under development. In order to run it, please use the option `-r dev`\n\n### Test your setup\n\n```bash\nnextflow run nf-core/diseasemodulediscovery \\\n -profile ,test \\\n --outdir \n```\n\nThis will run the pipeline with a small test dataset. Results will be saved to the specified ``. Use `-profile` to set whether docker or singularity should be used for software deployment.\n\n### Running the pipeline\n\nNow, you can run the pipeline with your own data using:\n\n```bash\nnextflow run nf-core/diseasemodulediscovery \\\n -profile \\\n --seeds \\\n --network \\\n --outdir \n```\n\nThis will run the pipeline based on the provided `` and ``. Results will be saved to the specified ``. Use `-profile` to set whether docker or singularity should be used for software deployment.\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/running/run-pipelines#using-parameter-files).\n\nFor more details and further functionality, please refer to the [usage documentation](https://nf-co.re/diseasemodulediscovery/usage) and the [parameter documentation](https://nf-co.re/diseasemodulediscovery/parameters).\n\n> [!TIP]\n> **OS specifics**\n>\n> The pipeline works best in combination with Linux. Furthermore, some Docker images in the pipeline are natively only available for `amd64` but not the `arm` architecture.\n> Here are some tips to get the pipeline running with a different OS or architecture:\n>\n> **macOS**\n>\n> With macOS and Apple silicon, we had better experiences using the free version of [orbstack](https://orbstack.dev/download) instead of Docker Desktop for deploying the containers.\n>\n> **Windows**\n>\n> The most reliable solution is to work with the [Windows Subsystem for Linux (WSL)](https://documentation.ubuntu.com/wsl/latest/howto/install-ubuntu-wsl2/).\n>\n> **What if it keeps failing?**\n>\n> Most pipeline steps are not essential. If the pipeline keeps failing because of a specific process, you may be able to just [skip](https://nf-co.re/diseasemodulediscovery/dev/docs/usage/#skipping-steps) that one.\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/diseasemodulediscovery/results) tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\n[output documentation](https://nf-co.re/diseasemodulediscovery/output).\n\n## Credits\n\nnf-core/diseasemodulediscovery was originally written by the [RePo4EU](https://repo4.eu/) consortium.\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- [Johannes Kersting](https://github.com/JohannesKersting) (TUM)\n- [Lisa Spindler](https://github.com/lspindler2509) (TUM)\n- [Quirin Manz](https://github.com/quirinmanz) (TUM)\n- [Quim Aguirre](https://github.com/quimaguirre) (STALICLA)\n- [Chlo\u00e9 Bucheron](https://github.com/ChloeBubu) (University Vienna)\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](docs/CONTRIBUTING.md).\n\nIf you want to include an additional module identification approach, please see [this guide](docs/contributing.md).\nFor further information or help, don't hesitate to get in touch on the [Slack `#diseasemodulediscovery` channel](https://nfcore.slack.com/channels/diseasemodulediscovery) (you can join with [this invite](https://nf-co.re/join/slack)).\n\n## Citations\n\nIf you use `nf-core/diseasemodulediscovery` for your analysis, please cite the preprint as follows:\n\n> Johannes Kersting, Chlo\u00e9 Bucheron, Lisa M. Spindler, Joaquim Aguirre-Plans, Quirin Manz, Tanja Pock, Mo Tan, Fernando M. Delgado-Chaves, Cristian Nogales, Harald H. H. W. Schmidt, J\u00f6rg Menche, Andreas Maier, Jan Baumbach, Emre Guney, Markus List **Inferring and Evaluating Network Medicine-Based Disease Modules with Nextflow** _bioRxiv_ , 2025, [doi: 10.1101/2025.11.20.687681](https://doi.org/10.1101/2025.11.20.687681).\n\n\n\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", "hasPart": [ { "@id": "main.nf" diff --git a/subworkflows/local/utils_nfcore_diseasemodulediscovery_pipeline/main.nf b/subworkflows/local/utils_nfcore_diseasemodulediscovery_pipeline/main.nf index efeffe22..cb632d12 100644 --- a/subworkflows/local/utils_nfcore_diseasemodulediscovery_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_diseasemodulediscovery_pipeline/main.nf @@ -108,15 +108,13 @@ workflow PIPELINE_INITIALISATION { shortest_paths_param_set = (params.shortest_paths != null) perturbed_networks_param_set = (params.perturbed_networks != null) - // prepare network channel, if parameter is set - if(network_param_set){ - ch_network = Channel.fromList(params.network.split(',').flatten()) - .map{network -> mapPreparedNetwork(network, params.id_space)} - .map{ it -> [ [ id: it.baseName, network_id: it.baseName ], it ] } - } - if(params.input){ + // check if seeds or network parameters are set and if so, throw an error since they cannot be used together with the sample sheet + if (seed_param_set || network_param_set || shortest_paths_param_set || perturbed_networks_param_set){ + error("You need to specify either a sample sheet (--input) OR the seeds (--seeds) and network (--network) files (including the shortest paths and perturbed networks if the network is set via the sample sheet). You cannot specify both at the same time.") + } + // // Create channel from input file provided through params.input // @@ -125,105 +123,45 @@ workflow PIPELINE_INITIALISATION { ch_input = Channel .fromList(samplesheetToList(params.input, "${projectDir}/assets/schema_input.json")) .map{seeds, network, shortest_paths, perturbed_networks -> - if((seeds.size()==0) ^ seed_param_set ){ - error("Seed genes have to specified through either the sample sheet OR the --seeds parameter") - } - if((network.size()==0) ^ network_param_set){ - error("Networks have to specified through either the sample sheet OR the --network parameter") - } - if(!(shortest_paths.size()==0) && shortest_paths_param_set ){ - error("Shortest paths have to specified through either the sample sheet OR the --shortest_path parameter") + if((seeds.size()==0)){ + error("No seeds files specified in the sample sheet") } - if(!(perturbed_networks.size()==0) && perturbed_networks_param_set ){ - error("Precomputed network perturbations have to specified through either the sample sheet OR the --perturbed_networks parameter") - } - if(!(network.size()==0) && (shortest_paths_param_set || perturbed_networks_param_set) ){ - error("If the network is set via the sample sheet, shortest_paths or perturbed_networks must also be set via the sample sheet") - } - if((! shortest_paths.size()==0 || ! perturbed_networks.size()==0) && network_param_set ){ - error("If the shortest_paths or perturbed_networks are set via the sample sheet, the network must also be set via the sample sheet") + if((network.size()==0)){ + error("No network file specified in the sample sheet") } [seeds, network, shortest_paths, perturbed_networks] } - // prepare network channel, if parameter is not set - if (!network_param_set){ - ch_network = ch_input - .map{ it -> [it[1], it[2], it[3]]} - .map{ network, sp, perturbed_networks -> - [ mapPreparedNetwork(network, params.id_space), sp, perturbed_networks ] - } - .map{ network, sp, perturbed_networks -> - [ [ id: network.baseName, network_id: network.baseName ], network, sp, perturbed_networks ] - } - .unique() - } - - if (seed_param_set && network_param_set) { - - error("You need to specify either a sample sheet (--input) OR the seeds (--seeds) and network (--network) files") - - } else if (!seed_param_set && !network_param_set) { - - log.info("Creating network and seeds channels based on tuples in the sample sheet") + log.info("Creating network and seeds channels based on tuples in the sample sheet") - ch_seeds = ch_input - .map{ it -> - def seeds = it[0] - def network = it[1] - def network_id = mapPreparedNetwork(network, params.id_space).baseName - [ [ id: seeds.baseName + "." + network_id, seeds_id: seeds.baseName, network_id: network_id ] , seeds ] - } - - } else if (seed_param_set && !network_param_set) { - - log.info("Creating network channel based on the sample sheet and seeds channel based on the seeds parameter") - - ch_seeds = Channel - .fromPath(params.seeds.split(',').flatten(), checkIfExists: true) - .combine(ch_network.map{meta, network, sp, perturbed_networks -> meta.network_id}) - .map{seeds, network_id -> - [ [ id: seeds.baseName + "." + network_id, seeds_id: seeds.baseName, network_id: network_id ] , seeds ] - } - - } else if (!seed_param_set && network_param_set) { - - log.info("Creating network channel based on the network parameter and seeds channel based on the sample sheet") - - ch_seeds = ch_input - .map{ it -> it[0]} - .combine(ch_network.map{meta, network -> meta.network_id}) - .map{seeds, network_id -> - [ [ id: seeds.baseName + "." + network_id, seeds_id: seeds.baseName, network_id: network_id ] , seeds ] - } - - // Add sp files, if provided (currently does not check if the number of the shortest paths matches the number of the networks and does not work with missing values) - if(shortest_paths_param_set){ - ch_network = ch_network.merge( - Channel - .fromPath(params.shortest_paths.split(',').flatten()) - ) - } else{ - ch_network = ch_network.map{meta, network -> [meta, network, file("${projectDir}/assets/NO_FILE", checkIfExists: true)]} + ch_network = ch_input + .map{ it -> [it[1], it[2], it[3]]} + .map{ network, sp, perturbed_networks -> + [ mapPreparedNetwork(network, params.id_space), sp, perturbed_networks ] } - - // Add perturbed network folders, if provided (currently does not check if the number of the shortest paths matches the number of the networks and does not work with missing values) - if(perturbed_networks_param_set){ - ch_network = ch_network.merge( - Channel - .fromPath(params.perturbed_networks.split(',').flatten()) - ) - } else{ - ch_network = ch_network.map{meta, network, sp -> [meta, network, sp, []]} + .map{ network, sp, perturbed_networks -> + [ [ id: network.baseName, network_id: network.baseName ], network, sp, perturbed_networks ] } + .unique() - } + ch_seeds = ch_input + .map{ it -> + def seeds = it[0] + def network = it[1] + def network_id = mapPreparedNetwork(network, params.id_space).baseName + [ [ id: seeds.baseName + "." + network_id, seeds_id: seeds.baseName, network_id: network_id ] , seeds ] + } } else if (seed_param_set && network_param_set){ log.info("Creating network and seeds channels based on the combination of all seed and network files provided") + //create network channel from the provided argument + ch_network = Channel.fromList(params.network.split(',').flatten()) + .map{network -> mapPreparedNetwork(network, params.id_space)} + .map{ it -> [ [ id: it.baseName, network_id: it.baseName ], it ] } + //create seeds channel from the provided argument and combine with network channel to create an ID for each seed-network combination ch_seeds = Channel .fromPath(params.seeds.split(',').flatten(), checkIfExists: true) .combine(ch_network.map{meta, network -> meta.network_id})