├── .prettierrc.yml ├── .coverage ├── modules ├── nf-core │ ├── gawk │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ ├── main.nf.test.snap │ │ │ └── main.nf.test │ │ ├── environment.yml │ │ ├── meta.yml │ │ └── main.nf │ ├── csvtk │ │ └── concat │ │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── main.nf.test.snap │ │ │ └── main.nf.test │ │ │ ├── environment.yml │ │ │ ├── meta.yml │ │ │ └── main.nf │ ├── bedtools │ │ ├── getfasta │ │ │ ├── tests │ │ │ │ ├── tags.yml │ │ │ │ ├── main.nf.test │ │ │ │ └── main.nf.test.snap │ │ │ ├── environment.yml │ │ │ ├── meta.yml │ │ │ └── main.nf │ │ ├── shift │ │ │ ├── tests │ │ │ │ ├── nextflow.config │ │ │ │ ├── main.nf.test │ │ │ │ └── main.nf.test.snap │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ │ ├── shuffle │ │ │ ├── tests │ │ │ │ └── nextflow.config │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ │ ├── slop │ │ │ ├── tests │ │ │ │ ├── nextflow.config │ │ │ │ ├── main.nf.test │ │ │ │ └── main.nf.test.snap │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ │ └── subtract │ │ │ ├── environment.yml │ │ │ ├── tests │ │ │ ├── main.nf.test │ │ │ └── main.nf.test.snap │ │ │ ├── main.nf │ │ │ └── meta.yml │ └── custom │ │ └── getchromsizes │ │ ├── tests │ │ ├── tags.yml │ │ └── main.nf.test │ │ ├── environment.yml │ │ ├── main.nf │ │ └── meta.yml └── local │ ├── awk │ └── extract │ │ ├── environment.yml │ │ └── main.nf │ ├── bedtools │ └── random │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ └── main.nf.test │ ├── stimulus │ ├── check_model │ │ └── main.nf │ ├── encode │ │ └── main.nf │ ├── split_csv │ │ └── main.nf │ ├── transform_csv │ │ └── main.nf │ ├── predict │ │ └── main.nf │ ├── split_yaml │ │ └── main.nf │ ├── compare_tensors │ │ └── main.nf │ └── tune │ │ └── main.nf │ └── custom │ └── modify_model_config │ └── main.nf ├── .vscode └── settings.json ├── assets ├── metromap.png ├── metromap_light.png ├── stimulus_overview.png ├── nf-core-deepmodeloptim_logo_light.png ├── samplesheet.csv ├── sendmail_template.txt ├── email_template.txt ├── schema_input.json ├── slackreport.json ├── schema_preprocessing.json ├── email_template.html └── adaptivecard.json ├── tower.yml ├── subworkflows ├── nf-core │ ├── utils_nfcore_pipeline │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ ├── main.workflow.nf.test.snap │ │ │ ├── main.workflow.nf.test │ │ │ ├── main.function.nf.test │ │ │ └── main.function.nf.test.snap │ │ └── meta.yml │ ├── utils_nextflow_pipeline │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ ├── main.function.nf.test.snap │ │ │ ├── main.function.nf.test │ │ │ └── main.workflow.nf.test │ │ ├── meta.yml │ │ └── main.nf │ └── utils_nfschema_plugin │ │ ├── tests │ │ ├── nextflow.config │ │ └── main.nf.test │ │ ├── meta.yml │ │ └── main.nf └── local │ ├── check_model │ └── main.nf │ ├── split_csv │ └── main.nf │ ├── split_data_config_unified │ └── main.nf │ ├── transform_csv │ └── main.nf │ ├── tune │ └── main.nf │ └── evaluation │ └── main.nf ├── docs ├── images │ ├── nf-core-deepmodeloptim_logo_dark.png │ └── nf-core-deepmodeloptim_logo_light.png ├── README.md └── output.md ├── .gitattributes ├── .github ├── .dockstore.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug_report.yml ├── workflows │ ├── linting_comment.yml │ ├── clean-up.yml │ ├── awstest.yml │ ├── release-announcements.yml │ ├── template_version_comment.yml │ ├── branch.yml │ ├── linting.yml │ ├── awsfulltest.yml │ ├── ci.yml │ ├── fix-linting.yml │ └── download_pipeline.yml └── PULL_REQUEST_TEMPLATE.md ├── .prettierignore ├── conf ├── dev.config ├── local.config ├── test_stub.config ├── test.config ├── test_ibis.config ├── test_ibis_with_preprocessing.config ├── test_noise_eval.config └── base.config ├── .gitpod.yml ├── .gitignore ├── .pre-commit-config.yaml ├── nf-test.config ├── CHANGELOG.md ├── bin ├── background_foreground_to_stimulus_csv.sh └── center_around_peak.sh ├── .devcontainer └── devcontainer.json ├── .editorconfig ├── LICENSE ├── .nf-core.yml ├── CITATIONS.md ├── modules.json └── main.nf /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | printWidth: 120 2 | -------------------------------------------------------------------------------- /.coverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/.coverage -------------------------------------------------------------------------------- /modules/nf-core/gawk/tests/tags.yml: -------------------------------------------------------------------------------- 1 | gawk: 2 | - "modules/nf-core/gawk/**" 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdown.styles": ["public/vscode_markdown.css"] 3 | } 4 | -------------------------------------------------------------------------------- /assets/metromap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/assets/metromap.png -------------------------------------------------------------------------------- /modules/nf-core/csvtk/concat/tests/tags.yml: -------------------------------------------------------------------------------- 1 | csvtk/concat: 2 | - "modules/nf-core/csvtk/concat/**" 3 | -------------------------------------------------------------------------------- /assets/metromap_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/assets/metromap_light.png -------------------------------------------------------------------------------- /assets/stimulus_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/assets/stimulus_overview.png -------------------------------------------------------------------------------- /modules/nf-core/bedtools/getfasta/tests/tags.yml: -------------------------------------------------------------------------------- 1 | bedtools/getfasta: 2 | - "modules/nf-core/bedtools/getfasta/**" 3 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/tests/tags.yml: -------------------------------------------------------------------------------- 1 | custom/getchromsizes: 2 | - modules/nf-core/custom/getchromsizes/** 3 | -------------------------------------------------------------------------------- /tower.yml: -------------------------------------------------------------------------------- 1 | reports: 2 | samplesheet.csv: 3 | display: "Auto-created samplesheet with collated metadata and FASTQ paths" 4 | -------------------------------------------------------------------------------- /assets/nf-core-deepmodeloptim_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/assets/nf-core-deepmodeloptim_logo_light.png -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml: -------------------------------------------------------------------------------- 1 | subworkflows/utils_nfcore_pipeline: 2 | - subworkflows/nf-core/utils_nfcore_pipeline/** 3 | -------------------------------------------------------------------------------- /docs/images/nf-core-deepmodeloptim_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/docs/images/nf-core-deepmodeloptim_logo_dark.png -------------------------------------------------------------------------------- /docs/images/nf-core-deepmodeloptim_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/deepmodeloptim/HEAD/docs/images/nf-core-deepmodeloptim_logo_light.png -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml: -------------------------------------------------------------------------------- 1 | subworkflows/utils_nextflow_pipeline: 2 | - subworkflows/nf-core/utils_nextflow_pipeline/** 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.config linguist-language=nextflow 2 | *.nf.test linguist-language=nextflow 3 | modules/nf-core/** linguist-generated 4 | subworkflows/nf-core/** linguist-generated 5 | -------------------------------------------------------------------------------- /modules/nf-core/gawk/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: GAWK { 3 | ext.suffix = params.gawk_suffix 4 | ext.args2 = params.gawk_args2 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shift/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: BEDTOOLS_SHIFT { 3 | ext.args = '-s 5' 4 | ext.prefix = { "${meta.id}_out" } 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shuffle/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: "BEDTOOLS_SHUFFLE" { 3 | ext.args = "-seed 42" 4 | ext.prefix = "test_file" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/slop/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: BEDTOOLS_SLOP { 3 | ext.args = '-l 15 -r 30' 4 | ext.prefix = { "${meta.id}_out" } 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.github/.dockstore.yml: -------------------------------------------------------------------------------- 1 | # Dockstore config version, not pipeline version 2 | version: 1.2 3 | workflows: 4 | - subclass: nfl 5 | primaryDescriptorPath: /nextflow.config 6 | publish: True 7 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | email_template.html 2 | adaptivecard.json 3 | slackreport.json 4 | .nextflow* 5 | work/ 6 | data/ 7 | results/ 8 | .DS_Store 9 | testing/ 10 | testing* 11 | *.pyc 12 | bin/ 13 | ro-crate-metadata.json 14 | -------------------------------------------------------------------------------- /assets/samplesheet.csv: -------------------------------------------------------------------------------- 1 | sample,fastq_1,fastq_2 2 | SAMPLE_PAIRED_END,/path/to/fastq/files/AEG588A1_S1_L002_R1_001.fastq.gz,/path/to/fastq/files/AEG588A1_S1_L002_R2_001.fastq.gz 3 | SAMPLE_SINGLE_END,/path/to/fastq/files/AEG588A4_S4_L003_R1_001.fastq.gz, 4 | -------------------------------------------------------------------------------- /conf/dev.config: -------------------------------------------------------------------------------- 1 | params { 2 | config_profile_name = 'Development profile' 3 | config_profile_description = 'Params needed during development' 4 | 5 | // container 6 | container_dev = "docker.io/mathysgrapotte/stimulus-py:dev" 7 | } 8 | -------------------------------------------------------------------------------- /modules/nf-core/gawk/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - conda-forge::gawk=5.3.0 8 | -------------------------------------------------------------------------------- /modules/local/awk/extract/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - conda-forge::gawk=5.3.0 8 | -------------------------------------------------------------------------------- /modules/nf-core/csvtk/concat/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - bioconda 5 | - conda-forge 6 | dependencies: 7 | - bioconda::csvtk=0.31.0 8 | -------------------------------------------------------------------------------- /modules/local/bedtools/random/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::bedtools=2.31.1" 8 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shift/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bedtools=2.31.1 8 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/slop/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bedtools=2.31.1 8 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "nf-schema@2.1.0" 3 | } 4 | 5 | validation { 6 | parametersSchema = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 7 | monochromeLogs = true 8 | } -------------------------------------------------------------------------------- /modules/nf-core/bedtools/getfasta/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bedtools=2.31.1 8 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shuffle/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bedtools=2.31.1 8 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/subtract/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bedtools=2.31.1 8 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | 7 | dependencies: 8 | - bioconda::htslib=1.21 9 | - bioconda::samtools=1.21 10 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: nfcore/gitpod:latest 2 | tasks: 3 | - name: Update Nextflow and setup pre-commit 4 | command: | 5 | pre-commit install --install-hooks 6 | nextflow self-update 7 | 8 | vscode: 9 | extensions: 10 | - nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Join nf-core 3 | url: https://nf-co.re/join 4 | about: Please join the nf-core community here 5 | - name: "Slack #deepmodeloptim channel" 6 | url: https://nfcore.slack.com/channels/deepmodeloptim 7 | about: Discussion about the nf-core/deepmodeloptim pipeline 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nextflow* 2 | work/ 3 | data/ 4 | results/ 5 | .DS_Store 6 | testing/ 7 | testing* 8 | *.pyc 9 | null/ 10 | bin/**/__pycache__/ 11 | /.ipynb_checkpoints 12 | /notebook/.ipynb_checkpoints 13 | .ipynb_checkpoints 14 | /singularity_cache 15 | .coverage 16 | .vscode/ 17 | bin/.vscode/ 18 | *.log 19 | .nf-test/ 20 | prototype/ 21 | *.ipynb 22 | CLAUDE.md 23 | .claude 24 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | manifest { 2 | name = 'nextflow_workflow' 3 | author = """nf-core""" 4 | homePage = 'https://127.0.0.1' 5 | description = """Dummy pipeline""" 6 | nextflowVersion = '!>=23.04.0' 7 | version = '9.9.9' 8 | doi = 'https://doi.org/10.5281/zenodo.5070524' 9 | } 10 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | manifest { 2 | name = 'nextflow_workflow' 3 | author = """nf-core""" 4 | homePage = 'https://127.0.0.1' 5 | description = """Dummy pipeline""" 6 | nextflowVersion = '!>=23.04.0' 7 | version = '9.9.9' 8 | doi = 'https://doi.org/10.5281/zenodo.5070524' 9 | } 10 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/mirrors-prettier 3 | rev: "v3.1.0" 4 | hooks: 5 | - id: prettier 6 | additional_dependencies: 7 | - prettier@3.2.5 8 | 9 | - repo: https://github.com/editorconfig-checker/editorconfig-checker.python 10 | rev: "3.1.2" 11 | hooks: 12 | - id: editorconfig-checker 13 | alias: ec 14 | -------------------------------------------------------------------------------- /nf-test.config: -------------------------------------------------------------------------------- 1 | config { 2 | // Location of nf-tests 3 | testsDir "." 4 | 5 | // nf-test directory used to create temporary files for each test 6 | workDir System.getenv("NFT_WORKDIR") ?: ".nf-test" 7 | 8 | // Location of an optional nextflow.config file specific for executing pipeline tests 9 | configFile "tests/nextflow.config" 10 | 11 | // use a given profile for input specifications 12 | profile "test" 13 | } 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # nf-core/deepmodeloptim: Changelog 2 | 3 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) 4 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 5 | 6 | ## v1.0.0dev - [date] 7 | 8 | Initial release of nf-core/deepmodeloptim, created with the [nf-core](https://nf-co.re/) template. 9 | 10 | ### `Added` 11 | 12 | ### `Fixed` 13 | 14 | ### `Dependencies` 15 | 16 | ### `Deprecated` 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for the nf-core/deepmodeloptim pipeline 3 | labels: enhancement 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description of feature 9 | description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered. 10 | validations: 11 | required: true 12 | -------------------------------------------------------------------------------- /bin/background_foreground_to_stimulus_csv.sh: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | print "dna,binding," column_name 3 | } 4 | 5 | # Process background file (first file) 6 | FNR==NR { 7 | if (!/^>/) { 8 | gsub(/[[:space:]]/,"") 9 | if (length($0) > 0) { 10 | print $0 ",0," 11 | } 12 | } 13 | next 14 | } 15 | 16 | # Process foreground file (second file) 17 | !/^>/ { 18 | gsub(/[[:space:]]/,"") 19 | if (length($0) > 0) { 20 | print $0 ",1," column_value 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Should run without failures": { 3 | "content": [ 4 | { 5 | "0": [ 6 | true 7 | ], 8 | "valid_config": [ 9 | true 10 | ] 11 | } 12 | ], 13 | "meta": { 14 | "nf-test": "0.8.4", 15 | "nextflow": "23.10.1" 16 | }, 17 | "timestamp": "2024-02-28T12:03:25.726491" 18 | } 19 | } -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # nf-core/deepmodeloptim: Documentation 2 | 3 | The nf-core/deepmodeloptim documentation is split into the following pages: 4 | 5 | - [Usage](usage.md) 6 | - An overview of how the pipeline works, how to run it and a description of all of the different command-line flags. 7 | - [Output](output.md) 8 | - An overview of the different results produced by the pipeline and how to interpret them. 9 | 10 | You can find a lot more documentation about installing, configuring and running nf-core pipelines on the website: [https://nf-co.re](https://nf-co.re) 11 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Test Function getWorkflowVersion": { 3 | "content": [ 4 | "v9.9.9" 5 | ], 6 | "meta": { 7 | "nf-test": "0.8.4", 8 | "nextflow": "23.10.1" 9 | }, 10 | "timestamp": "2024-02-28T12:02:05.308243" 11 | }, 12 | "Test Function checkCondaChannels": { 13 | "content": null, 14 | "meta": { 15 | "nf-test": "0.8.4", 16 | "nextflow": "23.10.1" 17 | }, 18 | "timestamp": "2024-02-28T12:02:12.425833" 19 | } 20 | } -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "UTILS_NFCORE_PIPELINE" 3 | description: Subworkflow with utility functions specific to the nf-core pipeline template 4 | keywords: 5 | - utility 6 | - pipeline 7 | - initialise 8 | - version 9 | components: [] 10 | input: 11 | - nextflow_cli_args: 12 | type: list 13 | description: | 14 | Nextflow CLI positional arguments 15 | output: 16 | - success: 17 | type: boolean 18 | description: | 19 | Dummy output to indicate success 20 | authors: 21 | - "@adamrtalbot" 22 | maintainers: 23 | - "@adamrtalbot" 24 | - "@maxulysse" 25 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nfcore", 3 | "image": "nfcore/gitpod:latest", 4 | "remoteUser": "gitpod", 5 | "runArgs": ["--privileged"], 6 | 7 | // Configure tool-specific properties. 8 | "customizations": { 9 | // Configure properties specific to VS Code. 10 | "vscode": { 11 | // Set *default* container specific settings.json values on container create. 12 | "settings": { 13 | "python.defaultInterpreterPath": "/opt/conda/bin/python" 14 | }, 15 | 16 | // Add the IDs of extensions you want installed when the container is created. 17 | "extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"] 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /conf/local.config: -------------------------------------------------------------------------------- 1 | params { 2 | config_profile_name = 'Local profile' 3 | config_profile_description = 'Configuration to run on local machine' 4 | 5 | } 6 | 7 | 8 | process { 9 | maxRetries = params.max_retries 10 | errorStrategy = params.err_start 11 | 12 | withLabel:process_low { 13 | cpus = { 1 } 14 | memory = { 4.GB * task.attempt } 15 | time = { 1.h * task.attempt } 16 | } 17 | withLabel:process_medium{ 18 | cpus = { 4 } 19 | memory = { 10.GB * task.attempt } 20 | time = { 6.h * task.attempt } 21 | } 22 | withLabel:process_medium_high { 23 | cpus = { 12 } 24 | memory = { 50.GB * task.attempt } 25 | time = { 12.h * task.attempt } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /assets/sendmail_template.txt: -------------------------------------------------------------------------------- 1 | To: $email 2 | Subject: $subject 3 | Mime-Version: 1.0 4 | Content-Type: multipart/related;boundary="nfcoremimeboundary" 5 | 6 | --nfcoremimeboundary 7 | Content-Type: text/html; charset=utf-8 8 | 9 | $email_html 10 | 11 | --nfcoremimeboundary 12 | Content-Type: image/png;name="nf-core-deepmodeloptim_logo.png" 13 | Content-Transfer-Encoding: base64 14 | Content-ID: 15 | Content-Disposition: inline; filename="nf-core-deepmodeloptim_logo_light.png" 16 | 17 | <% out << new File("$projectDir/assets/nf-core-deepmodeloptim_logo_light.png"). 18 | bytes. 19 | encodeBase64(). 20 | toString(). 21 | tokenize( '\n' )*. 22 | toList()*. 23 | collate( 76 )*. 24 | collect { it.join() }. 25 | flatten(). 26 | join( '\n' ) %> 27 | 28 | <% 29 | %> 30 | 31 | --nfcoremimeboundary-- 32 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Workflow UTILS_NFCORE_PIPELINE" 4 | script "../main.nf" 5 | config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" 6 | workflow "UTILS_NFCORE_PIPELINE" 7 | tag "subworkflows" 8 | tag "subworkflows_nfcore" 9 | tag "utils_nfcore_pipeline" 10 | tag "subworkflows/utils_nfcore_pipeline" 11 | 12 | test("Should run without failures") { 13 | 14 | when { 15 | workflow { 16 | """ 17 | input[0] = [] 18 | """ 19 | } 20 | } 21 | 22 | then { 23 | assertAll( 24 | { assert workflow.success }, 25 | { assert snapshot(workflow.out).match() } 26 | ) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_size = 4 9 | indent_style = space 10 | 11 | [*.{md,yml,yaml,html,css,scss,js}] 12 | indent_size = 2 13 | 14 | # These files are edited and tested upstream in nf-core/modules 15 | [/modules/nf-core/**] 16 | charset = unset 17 | end_of_line = unset 18 | insert_final_newline = unset 19 | trim_trailing_whitespace = unset 20 | indent_style = unset 21 | [/subworkflows/nf-core/**] 22 | charset = unset 23 | end_of_line = unset 24 | insert_final_newline = unset 25 | trim_trailing_whitespace = unset 26 | indent_style = unset 27 | 28 | [/assets/email*] 29 | indent_size = unset 30 | 31 | # ignore python and markdown 32 | [*.{py,md}] 33 | indent_style = unset 34 | 35 | # ignore ro-crate metadata files 36 | [**/ro-crate-metadata.json] 37 | insert_final_newline = unset 38 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/slop/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_process { 3 | 4 | name "Test Process BEDTOOLS_SLOP" 5 | script "../main.nf" 6 | process "BEDTOOLS_SLOP" 7 | config "./nextflow.config" 8 | 9 | tag "modules" 10 | tag "modules_nfcore" 11 | tag "bedtools" 12 | tag "bedtools/slop" 13 | 14 | test("test-bedtools-slop") { 15 | 16 | when { 17 | process { 18 | """ 19 | input[0] = [ [ id:'test'], 20 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) 21 | ] 22 | input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.sizes', checkIfExists: true) 23 | 24 | """ 25 | } 26 | } 27 | 28 | then { 29 | assertAll( 30 | { assert process.success }, 31 | { assert snapshot(process.out).match() } 32 | ) 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/subtract/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_process { 3 | 4 | name "Test Process BEDTOOLS_SUBTRACT" 5 | script "../main.nf" 6 | process "BEDTOOLS_SUBTRACT" 7 | 8 | tag "modules" 9 | tag "modules_nfcore" 10 | tag "bedtools" 11 | tag "bedtools/subtract" 12 | 13 | test("test-bedtools-subtract") { 14 | 15 | when { 16 | process { 17 | """ 18 | input[0] = [ 19 | [ id:'test_subtract' ], 20 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/baits.bed', checkIfExists: true), 21 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) 22 | ] 23 | 24 | """ 25 | } 26 | } 27 | 28 | then { 29 | assertAll( 30 | { assert process.success }, 31 | { assert snapshot(process.out).match() } 32 | ) 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /bin/center_around_peak.sh: -------------------------------------------------------------------------------- 1 | # First file (ex. chrom_sizes.txt): Load chromosome sizes into an array 2 | NR==FNR { chrom_sizes[$1] = $2; next; } 3 | 4 | # Second file (ex. input.bed): Process BED data 5 | # Print header lines as they are 6 | /^#/ { print; next; } 7 | { 8 | mid = $4; # extract peak piosition 9 | left = int(N/2); # Floor division for left padding 10 | right = N - left; # Ensures total length is exactly N 11 | 12 | # the new start and end values 13 | start = mid - left; 14 | ends = mid + right; 15 | 16 | # Ensure start is not negative 17 | if (start < 0) start = 0; 18 | 19 | # Ensure end does not exceed chromosome size 20 | if ($1 in chrom_sizes && ends > chrom_sizes[$1]) { 21 | ends = chrom_sizes[$1]; 22 | } 23 | 24 | # Print updated start, end, and ALL remaining columns 25 | printf "%s\t%d\t%d", $1, start, ends; 26 | for (i=4; i<=NF; i++) { 27 | printf "\t%s", $i; 28 | } 29 | print ""; # Newline 30 | } 31 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shift/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_process { 3 | 4 | name "Test Process BEDTOOLS_SHIFT" 5 | script "../main.nf" 6 | process "BEDTOOLS_SHIFT" 7 | config "./nextflow.config" 8 | 9 | tag "modules" 10 | tag "modules_nfcore" 11 | tag "bedtools" 12 | tag "bedtools/shift" 13 | 14 | test("test-bedtools-shift") { 15 | 16 | when { 17 | process { 18 | """ 19 | input[0] = [ [ id:'test'], 20 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) 21 | ] 22 | input[1] = [[id:'sizes'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.sizes', checkIfExists: true)] 23 | 24 | """ 25 | } 26 | } 27 | 28 | then { 29 | assertAll( 30 | { assert process.success }, 31 | { assert snapshot(process.out).match() } 32 | ) 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /.github/workflows/linting_comment.yml: -------------------------------------------------------------------------------- 1 | name: nf-core linting comment 2 | # This workflow is triggered after the linting action is complete 3 | # It posts an automated comment to the PR, even if the PR is coming from a fork 4 | 5 | on: 6 | workflow_run: 7 | workflows: ["nf-core linting"] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Download lint results 14 | uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8 15 | with: 16 | workflow: linting.yml 17 | workflow_conclusion: completed 18 | 19 | - name: Get PR number 20 | id: pr_number 21 | run: echo "pr_number=$(cat linting-logs/PR_number.txt)" >> $GITHUB_OUTPUT 22 | 23 | - name: Post PR comment 24 | uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2 25 | with: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | number: ${{ steps.pr_number.outputs.pr_number }} 28 | path: linting-logs/lint_results.md 29 | -------------------------------------------------------------------------------- /modules/local/stimulus/check_model/main.nf: -------------------------------------------------------------------------------- 1 | process CHECK_MODEL { 2 | 3 | tag "${meta.id}" 4 | label 'process_medium' 5 | // TODO: push image to nf-core quay.io 6 | container "docker.io/mathysgrapotte/stimulus-py:dev" 7 | 8 | input: 9 | tuple val(meta1), path(data) 10 | tuple val(meta2), path(model) 11 | tuple val(meta3), path(model_config) 12 | tuple val(meta4), path(initial_weights) 13 | 14 | output: 15 | stdout emit: standardout 16 | 17 | script: 18 | def args = task.ext.args ?: '' 19 | """ 20 | stimulus check-model \ 21 | -d ${data} \ 22 | -m ${model} \ 23 | -c ${model_config} \ 24 | -r "\${PWD}" \ 25 | $args 26 | 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 30 | END_VERSIONS 31 | """ 32 | 33 | stub: 34 | """ 35 | echo passing check-model stub 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) The nf-core/deepmodeloptim team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /modules/local/stimulus/encode/main.nf: -------------------------------------------------------------------------------- 1 | process ENCODE_CSV { 2 | 3 | tag "${meta.id}" 4 | label 'process_medium' 5 | // TODO: push image to nf-core quay.io 6 | container "docker.io/mathysgrapotte/stimulus-py:dev" 7 | 8 | input: 9 | tuple val(meta), path(data) 10 | tuple val(meta2), path(config) 11 | 12 | output: 13 | tuple val(meta2), path("${prefix}_encoded"), emit: encoded 14 | path "versions.yml" , emit: versions 15 | 16 | script: 17 | def args = task.ext.args ?: '' 18 | prefix = task.ext.prefix ?: "${meta.split_id}-${meta2.transform_id}" 19 | """ 20 | stimulus encode-csv \ 21 | -d ${data} \ 22 | -y ${config} \ 23 | -o ${prefix}_encoded \ 24 | $args 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 29 | END_VERSIONS 30 | """ 31 | 32 | stub: 33 | """ 34 | echo passing check-model stub 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 39 | END_VERSIONS 40 | """ 41 | } 42 | -------------------------------------------------------------------------------- /.nf-core.yml: -------------------------------------------------------------------------------- 1 | lint: 2 | files_exist: 3 | - conf/igenomes.config 4 | - conf/igenomes_ignored.config 5 | - assets/multiqc_config.yml 6 | - conf/igenomes.config 7 | - conf/igenomes_ignored.config 8 | - assets/multiqc_config.yml 9 | - conf/test_full.config 10 | files_unchanged: 11 | - .github/CONTRIBUTING.md 12 | - assets/sendmail_template.txt 13 | - .github/CONTRIBUTING.md 14 | - assets/sendmail_template.txt 15 | - assets/nf-core-deepmodeloptim_logo_light.png 16 | - docs/images/nf-core-deepmodeloptim_logo_light.png 17 | - docs/images/nf-core-deepmodeloptim_logo_dark.png 18 | multiqc_config: false 19 | nextflow_config: 20 | - params.input 21 | nf_core_version: 3.2.0 22 | repository_type: pipeline 23 | template: 24 | author: Mathys Grapotte 25 | description: nf-core/deepmodeloptim is an end-to-end pipeline designed to 26 | facilitate the testing and development of deep learning models for genomics. 27 | force: false 28 | is_nfcore: true 29 | name: deepmodeloptim 30 | org: nf-core 31 | outdir: . 32 | skip_features: 33 | - igenomes 34 | - multiqc 35 | - fastqc 36 | version: 1.0.0dev 37 | -------------------------------------------------------------------------------- /modules/local/stimulus/split_csv/main.nf: -------------------------------------------------------------------------------- 1 | process STIMULUS_SPLIT_DATA { 2 | 3 | tag "${meta.id}-${meta2.id}" 4 | label 'process_low' 5 | // TODO: push image to nf-core quay.io 6 | container "docker.io/mathysgrapotte/stimulus-py:dev" 7 | 8 | input: 9 | tuple val(meta), path(data) 10 | tuple val(meta2), path(sub_config) 11 | 12 | output: 13 | tuple val(meta2), path("${prefix}_split"), emit: csv_with_split 14 | path "versions.yml" , emit: versions 15 | 16 | script: 17 | prefix = task.ext.prefix ?: "${meta.id}-split-${meta2.id}" 18 | """ 19 | stimulus split-csv \ 20 | -c ${data} \ 21 | -y ${sub_config} \ 22 | -o ${prefix}_split 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 27 | END_VERSIONS 28 | """ 29 | 30 | stub: 31 | prefix = task.ext.prefix ?: "${meta.id}-split-${meta2.id}" 32 | """ 33 | touch ${prefix}_split 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 38 | END_VERSIONS 39 | """ 40 | } 41 | -------------------------------------------------------------------------------- /modules/local/stimulus/transform_csv/main.nf: -------------------------------------------------------------------------------- 1 | 2 | process STIMULUS_TRANSFORM_CSV { 3 | 4 | tag "${meta.id}-${meta2.id}" 5 | label 'process_medium' 6 | // TODO: push image to nf-core quay.io 7 | container "docker.io/mathysgrapotte/stimulus-py:dev" 8 | 9 | input: 10 | tuple val(meta), path(data) 11 | tuple val(meta2), path(config) 12 | 13 | output: 14 | tuple val(meta), path("${prefix}"), emit: transformed_data 15 | path "versions.yml" , emit: versions 16 | 17 | script: 18 | prefix = task.ext.prefix ?: "${meta.id}-${meta2.id}-trans" 19 | """ 20 | stimulus transform-csv \ 21 | -c ${data} \ 22 | -y ${config} \ 23 | -o ${prefix} 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 28 | END_VERSIONS 29 | """ 30 | 31 | stub: 32 | prefix = task.ext.prefix ?: "${meta.id}-${meta2.id}-trans" 33 | """ 34 | touch ${prefix}.csv 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 39 | END_VERSIONS 40 | """ 41 | } 42 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shift/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "test-bedtools-shift": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | "test_out.bed:md5,fdfa2c33084f1f8e42505076a449afdc" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,1a2d22a8a7a1de74d4316895e2d97701" 15 | ], 16 | "bed": [ 17 | [ 18 | { 19 | "id": "test" 20 | }, 21 | "test_out.bed:md5,fdfa2c33084f1f8e42505076a449afdc" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,1a2d22a8a7a1de74d4316895e2d97701" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.8.4", 31 | "nextflow": "24.04.4" 32 | }, 33 | "timestamp": "2024-08-26T13:53:47.543861" 34 | } 35 | } -------------------------------------------------------------------------------- /modules/nf-core/bedtools/slop/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "test-bedtools-slop": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | "test_out.bed:md5,4f1d8924925fe5d205c9e1981fe290a4" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,ee6210f0a2c4a60d9cad324bfe18e0cf" 15 | ], 16 | "bed": [ 17 | [ 18 | { 19 | "id": "test" 20 | }, 21 | "test_out.bed:md5,4f1d8924925fe5d205c9e1981fe290a4" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,ee6210f0a2c4a60d9cad324bfe18e0cf" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.8.4", 31 | "nextflow": "24.04.4" 32 | }, 33 | "timestamp": "2024-08-26T13:52:04.945029" 34 | } 35 | } -------------------------------------------------------------------------------- /conf/test_stub.config: -------------------------------------------------------------------------------- 1 | // for now it needs either crg config or local config to be given by the user 2 | // TODO make this config stand alone. No need for other configs. 3 | 4 | stubRun = true 5 | 6 | params { 7 | config_profile_name = 'Test stub profile' 8 | config_profile_description = 'stub run to check pipeline function' 9 | 10 | // Input data 11 | data = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/deepmodeloptim/testdata/titanic/titanic_stimulus.csv" 12 | data_config = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/deepmodeloptim/testdata/titanic/titanic.yaml" 13 | model = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/deepmodeloptim/testdata/titanic/titanic_model.py" 14 | model_config = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/deepmodeloptim/testdata/titanic/titanic_model_cpu.yaml" 15 | 16 | } 17 | 18 | process { 19 | // Limit resources so that this can run on GitHub Actions 20 | resourceLimits = [ 21 | cpus: 2, 22 | memory: 6.GB, 23 | time: 6.h 24 | ] 25 | container = 'quay.io/biocontainers/gawk:5.1.0' 26 | } 27 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/subtract/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "test-bedtools-subtract": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test_subtract" 9 | }, 10 | "test_subtract.bed:md5,63513c4dc69e8b481ce3b4b2a9f24259" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,1424765d0d00cc3f44f5e7745607effe" 15 | ], 16 | "bed": [ 17 | [ 18 | { 19 | "id": "test_subtract" 20 | }, 21 | "test_subtract.bed:md5,63513c4dc69e8b481ce3b4b2a9f24259" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,1424765d0d00cc3f44f5e7745607effe" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.8.4", 31 | "nextflow": "24.04.4" 32 | }, 33 | "timestamp": "2024-08-26T13:47:34.662548" 34 | } 35 | } -------------------------------------------------------------------------------- /modules/local/stimulus/predict/main.nf: -------------------------------------------------------------------------------- 1 | process STIMULUS_PREDICT { 2 | tag "${meta.id}" 3 | label 'process_medium' 4 | container "docker.io/mathysgrapotte/stimulus-py:dev" 5 | 6 | input: 7 | tuple val(meta) , path(model), path(model_config), path(weigths) 8 | tuple val(meta2), path(data) 9 | 10 | output: 11 | tuple val(meta), path("${prefix}-pred.safetensors"), emit: predictions 12 | path "versions.yml" , emit: versions 13 | 14 | script: 15 | prefix = task.ext.prefix ?: meta.id 16 | def args = task.ext.args ?: "" 17 | """ 18 | stimulus predict \ 19 | -d ${data} \ 20 | -m ${model} \ 21 | -c ${model_config} \ 22 | -w ${weigths} \ 23 | -o ${prefix}-pred.safetensors \ 24 | ${args} 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 29 | END_VERSIONS 30 | """ 31 | 32 | stub: 33 | prefix = task.ext.prefix ?: meta.id 34 | """ 35 | touch ${prefix}-pred.safetensors 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "UTILS_NEXTFLOW_PIPELINE" 3 | description: Subworkflow with functionality that may be useful for any Nextflow pipeline 4 | keywords: 5 | - utility 6 | - pipeline 7 | - initialise 8 | - version 9 | components: [] 10 | input: 11 | - print_version: 12 | type: boolean 13 | description: | 14 | Print the version of the pipeline and exit 15 | - dump_parameters: 16 | type: boolean 17 | description: | 18 | Dump the parameters of the pipeline to a JSON file 19 | - output_directory: 20 | type: directory 21 | description: Path to output dir to write JSON file to. 22 | pattern: "results/" 23 | - check_conda_channel: 24 | type: boolean 25 | description: | 26 | Check if the conda channel priority is correct. 27 | output: 28 | - dummy_emit: 29 | type: boolean 30 | description: | 31 | Dummy emit to make nf-core subworkflows lint happy 32 | authors: 33 | - "@adamrtalbot" 34 | - "@drpatelh" 35 | maintainers: 36 | - "@adamrtalbot" 37 | - "@drpatelh" 38 | - "@maxulysse" 39 | -------------------------------------------------------------------------------- /subworkflows/local/check_model/main.nf: -------------------------------------------------------------------------------- 1 | // Start of Selection 2 | /* 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | IMPORT NF-CORE MODULES/SUBWORKFLOWS 5 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 | */ 7 | 8 | include { CHECK_MODEL } from '../../../modules/local/stimulus/check_model' 9 | 10 | /* 11 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12 | RUN MAIN SUBWORKFLOW 13 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 | */ 15 | 16 | workflow CHECK_MODEL_WF { 17 | 18 | take: 19 | ch_data 20 | ch_model 21 | ch_model_config 22 | ch_initial_weights 23 | 24 | main: 25 | 26 | ch_versions = Channel.empty() 27 | 28 | CHECK_MODEL( 29 | ch_data, 30 | ch_model, 31 | ch_model_config, 32 | ch_initial_weights 33 | ) 34 | emit: 35 | CHECK_MODEL.out 36 | } 37 | 38 | /* 39 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | THE END 41 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | */ 43 | // End of Selection 44 | 45 | -------------------------------------------------------------------------------- /.github/workflows/clean-up.yml: -------------------------------------------------------------------------------- 1 | name: "Close user-tagged issues and PRs" 2 | on: 3 | schedule: 4 | - cron: "0 0 * * 0" # Once a week 5 | 6 | jobs: 7 | clean-up: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 14 | with: 15 | stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days." 16 | stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful." 17 | close-issue-message: "This issue was closed because it has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor and then staled for 20 days with no activity." 18 | days-before-stale: 30 19 | days-before-close: 20 20 | days-before-pr-close: -1 21 | any-of-labels: "awaiting-changes,awaiting-feedback" 22 | exempt-issue-labels: "WIP" 23 | exempt-pr-labels: "WIP" 24 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 25 | -------------------------------------------------------------------------------- /.github/workflows/awstest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS test 2 | # This workflow can be triggered manually with the GitHub actions workflow dispatch button. 3 | # It runs the -profile 'test' on AWS batch 4 | 5 | on: 6 | workflow_dispatch: 7 | jobs: 8 | run-platform: 9 | name: Run AWS tests 10 | if: github.repository == 'nf-core/deepmodeloptim' 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Launch workflow using Seqera Platform CLI tool action 14 | - name: Launch workflow via Seqera Platform 15 | uses: seqeralabs/action-tower-launch@v2 16 | with: 17 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 18 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 19 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 20 | revision: ${{ github.sha }} 21 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/deepmodeloptim/work-${{ github.sha }} 22 | parameters: | 23 | { 24 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/deepmodeloptim/results-test-${{ github.sha }}" 25 | } 26 | profiles: test 27 | 28 | - uses: actions/upload-artifact@v4 29 | with: 30 | name: Seqera Platform debug log file 31 | path: | 32 | seqera_platform_action_*.log 33 | seqera_platform_action_*.json 34 | -------------------------------------------------------------------------------- /assets/email_template.txt: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------- 2 | ,--./,-. 3 | ___ __ __ __ ___ /,-._.--~\\ 4 | |\\ | |__ __ / ` / \\ |__) |__ } { 5 | | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, 6 | `._,._,' 7 | nf-core/deepmodeloptim ${version} 8 | ---------------------------------------------------- 9 | Run Name: $runName 10 | 11 | <% if (success){ 12 | out << "## nf-core/deepmodeloptim execution completed successfully! ##" 13 | } else { 14 | out << """#################################################### 15 | ## nf-core/deepmodeloptim execution completed unsuccessfully! ## 16 | #################################################### 17 | The exit status of the task that caused the workflow execution to fail was: $exitStatus. 18 | The full error message was: 19 | 20 | ${errorReport} 21 | """ 22 | } %> 23 | 24 | 25 | The workflow was completed at $dateComplete (duration: $duration) 26 | 27 | The command used to launch the workflow was as follows: 28 | 29 | $commandLine 30 | 31 | 32 | 33 | Pipeline Configuration: 34 | ----------------------- 35 | <% out << summary.collect{ k,v -> " - $k: $v" }.join("\n") %> 36 | 37 | -- 38 | nf-core/deepmodeloptim 39 | https://github.com/nf-core/deepmodeloptim 40 | -------------------------------------------------------------------------------- /modules/local/stimulus/split_yaml/main.nf: -------------------------------------------------------------------------------- 1 | process STIMULUS_SPLIT_YAML { 2 | 3 | tag "$meta.id" 4 | label 'process_low' 5 | // TODO: push image to nf-core quay.io 6 | container "docker.io/mathysgrapotte/stimulus-py:dev" 7 | 8 | input: 9 | tuple val(meta), path(data_config) 10 | 11 | output: 12 | tuple val(meta), path("*_encode.yaml") , emit: encode_config 13 | tuple val(meta), path("*_split.yaml") , emit: split_config 14 | tuple val(meta), path("*_transform.yaml") , emit: transform_config 15 | path "versions.yml" , emit: versions 16 | 17 | script: 18 | """ 19 | stimulus split-yaml -y ${data_config} --out-dir ./ 20 | 21 | cat <<-END_VERSIONS > versions.yml 22 | "${task.process}": 23 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 24 | END_VERSIONS 25 | """ 26 | 27 | stub: 28 | def prefix = data_config.baseName 29 | """ 30 | touch ${prefix}_encode.yaml 31 | touch ${prefix}_RandomSplit_70-30_split.yaml 32 | touch ${prefix}_noise_std0.1_transform.yaml 33 | touch ${prefix}_noise_std0.2_transform.yaml 34 | touch ${prefix}_noise_std0.3_transform.yaml 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 39 | END_VERSIONS 40 | """ 41 | } 42 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "utils_nfschema_plugin" 3 | description: Run nf-schema to validate parameters and create a summary of changed parameters 4 | keywords: 5 | - validation 6 | - JSON schema 7 | - plugin 8 | - parameters 9 | - summary 10 | components: [] 11 | input: 12 | - input_workflow: 13 | type: object 14 | description: | 15 | The workflow object of the used pipeline. 16 | This object contains meta data used to create the params summary log 17 | - validate_params: 18 | type: boolean 19 | description: Validate the parameters and error if invalid. 20 | - parameters_schema: 21 | type: string 22 | description: | 23 | Path to the parameters JSON schema. 24 | This has to be the same as the schema given to the `validation.parametersSchema` config 25 | option. When this input is empty it will automatically use the configured schema or 26 | "${projectDir}/nextflow_schema.json" as default. The schema should not be given in this way 27 | for meta pipelines. 28 | output: 29 | - dummy_emit: 30 | type: boolean 31 | description: Dummy emit to make nf-core subworkflows lint happy 32 | authors: 33 | - "@nvnieuwk" 34 | maintainers: 35 | - "@nvnieuwk" 36 | -------------------------------------------------------------------------------- /assets/schema_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/nf-core/deepmodeloptim/master/assets/schema_input.json", 4 | "title": "nf-core/deepmodeloptim pipeline - params.input schema", 5 | "description": "Schema for the file provided with params.input", 6 | "type": "array", 7 | "items": { 8 | "type": "object", 9 | "properties": { 10 | "sample": { 11 | "type": "string", 12 | "pattern": "^\\S+$", 13 | "errorMessage": "Sample name must be provided and cannot contain spaces", 14 | "meta": ["id"] 15 | }, 16 | "fastq_1": { 17 | "type": "string", 18 | "format": "file-path", 19 | "exists": true, 20 | "pattern": "^\\S+\\.f(ast)?q\\.gz$", 21 | "errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'" 22 | }, 23 | "fastq_2": { 24 | "type": "string", 25 | "format": "file-path", 26 | "exists": true, 27 | "pattern": "^\\S+\\.f(ast)?q\\.gz$", 28 | "errorMessage": "FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'" 29 | } 30 | }, 31 | "required": ["sample", "fastq_1"] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/bedtools/random/main.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_RANDOM_SAMPLING { 2 | tag "${meta.id}" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--h13024bc_3': 8 | 'biocontainers/bedtools:2.31.1--h13024bc_3' }" 9 | 10 | input: 11 | tuple val(meta), path(genome_file) 12 | tuple val(number_sequences), val(length_sequences) 13 | 14 | output: 15 | tuple val(meta), path "*.bed", emit: bed 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | """ 25 | bedtools random \\ 26 | -l $length_sequences \\ 27 | -n $number_sequences \\ 28 | -g $genome_file \\ 29 | $args \\ 30 | > ${prefix}.bed 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | bedtools: \$(bedtools --version |& sed '1!d ; s/bedtools v//') 35 | END_VERSIONS 36 | """ 37 | 38 | stub: 39 | def prefix = task.ext.prefix ?: "${meta.id}" 40 | """ 41 | touch ${prefix}.bed 42 | 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | bedtools: \$(bedtools --version |& sed '1!d ; s/bedtools v//') 46 | END_VERSIONS 47 | """ 48 | } 49 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_function { 3 | 4 | name "Test Functions" 5 | script "subworkflows/nf-core/utils_nextflow_pipeline/main.nf" 6 | config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" 7 | tag 'subworkflows' 8 | tag 'utils_nextflow_pipeline' 9 | tag 'subworkflows/utils_nextflow_pipeline' 10 | 11 | test("Test Function getWorkflowVersion") { 12 | 13 | function "getWorkflowVersion" 14 | 15 | then { 16 | assertAll( 17 | { assert function.success }, 18 | { assert snapshot(function.result).match() } 19 | ) 20 | } 21 | } 22 | 23 | test("Test Function dumpParametersToJSON") { 24 | 25 | function "dumpParametersToJSON" 26 | 27 | when { 28 | function { 29 | """ 30 | // define inputs of the function here. Example: 31 | input[0] = "$outputDir" 32 | """.stripIndent() 33 | } 34 | } 35 | 36 | then { 37 | assertAll( 38 | { assert function.success } 39 | ) 40 | } 41 | } 42 | 43 | test("Test Function checkCondaChannels") { 44 | 45 | function "checkCondaChannels" 46 | 47 | then { 48 | assertAll( 49 | { assert function.success }, 50 | { assert snapshot(function.result).match() } 51 | ) 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /modules/local/stimulus/compare_tensors/main.nf: -------------------------------------------------------------------------------- 1 | process STIMULUS_COMPARE_TENSORS { 2 | tag "${meta.id1}" 3 | label 'process_medium' 4 | container "docker.io/mathysgrapotte/stimulus-py:dev" 5 | 6 | input: 7 | tuple val(meta), path(tensors) 8 | 9 | output: 10 | tuple val(meta), path("${prefix}_scores.csv"), emit: csv 11 | path "versions.yml" , emit: versions 12 | 13 | script: 14 | prefix = task.ext.prefix ?: meta.id 15 | def args = task.ext.args ?: "" 16 | def header = meta.keySet().join(",") 17 | def values = meta.values().join(",") 18 | """ 19 | stimulus compare-tensors \ 20 | ${tensors} \ 21 | -o scores.csv \ 22 | ${args} 23 | 24 | # Extract first row of scores.csv 25 | header_scores=\$(head -n 1 scores.csv) 26 | 27 | # Add metadata info to output file 28 | echo "${header},\$header_scores" > "${prefix}_scores.csv" 29 | 30 | # Add values 31 | scores=\$(awk 'NR==2 {sub(/[[:space:]]+\$/, "")} NR==2' scores.csv | tr -s '[:blank:]' ',') 32 | echo "${values},\$scores" >> "${prefix}_scores.csv" 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 37 | END_VERSIONS 38 | """ 39 | 40 | stub: 41 | prefix = task.ext.prefix ?: meta.id 42 | """ 43 | touch ${prefix}.csv 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/slop/main.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_SLOP { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--hf5e1c6e_0' : 8 | 'biocontainers/bedtools:2.31.1--hf5e1c6e_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bed) 12 | path sizes 13 | 14 | output: 15 | tuple val(meta), path("*.bed"), emit: bed 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | if ("$bed" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 25 | """ 26 | bedtools \\ 27 | slop \\ 28 | -i $bed \\ 29 | -g $sizes \\ 30 | $args \\ 31 | > ${prefix}.bed 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def prefix = task.ext.prefix ?: "${meta.id}" 41 | """ 42 | touch ${prefix}.bed 43 | 44 | cat <<-END_VERSIONS > versions.yml 45 | "${task.process}": 46 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 47 | END_VERSIONS 48 | """ 49 | } 50 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/main.nf: -------------------------------------------------------------------------------- 1 | process CUSTOM_GETCHROMSIZES { 2 | tag "$fasta" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : 8 | 'biocontainers/samtools:1.21--h50ea8bc_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path ("*.sizes"), emit: sizes 15 | tuple val(meta), path ("*.fai") , emit: fai 16 | tuple val(meta), path ("*.gzi") , emit: gzi, optional: true 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | """ 25 | samtools faidx $fasta 26 | cut -f 1,2 ${fasta}.fai > ${fasta}.sizes 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | getchromsizes: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 31 | END_VERSIONS 32 | """ 33 | 34 | stub: 35 | """ 36 | touch ${fasta}.fai 37 | touch ${fasta}.sizes 38 | if [[ "${fasta.extension}" == "gz" ]]; then 39 | touch ${fasta}.gzi 40 | fi 41 | 42 | cat <<-END_VERSIONS > versions.yml 43 | "${task.process}": 44 | getchromsizes: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 45 | END_VERSIONS 46 | """ 47 | } 48 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shift/main.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_SHIFT { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--hf5e1c6e_0' : 8 | 'biocontainers/bedtools:2.31.1--hf5e1c6e_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bed) 12 | tuple val(meta2), path(chrom_sizes) 13 | 14 | output: 15 | tuple val(meta), path("*.bed"), emit: bed 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | if ("$bed" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 25 | """ 26 | bedtools \\ 27 | shift \\ 28 | -i $bed \\ 29 | -g $chrom_sizes \\ 30 | $args \\ 31 | > ${prefix}.bed 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def prefix = task.ext.prefix ?: "${meta.id}" 41 | """ 42 | touch ${prefix}.bed 43 | 44 | cat <<-END_VERSIONS > versions.yml 45 | "${task.process}": 46 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 47 | END_VERSIONS 48 | """ 49 | } 50 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 13 | 14 | ## PR checklist 15 | 16 | - [ ] This comment contains a description of changes (with reason). 17 | - [ ] If you've fixed a bug or added code that should be tested, add tests! 18 | - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/deepmodeloptim/tree/master/.github/CONTRIBUTING.md) 19 | - [ ] If necessary, also make a PR on the nf-core/deepmodeloptim _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. 20 | - [ ] Make sure your code lints (`nf-core pipelines lint`). 21 | - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). 22 | - [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). 23 | - [ ] Usage Documentation in `docs/usage.md` is updated. 24 | - [ ] Output Documentation in `docs/output.md` is updated. 25 | - [ ] `CHANGELOG.md` is updated. 26 | - [ ] `README.md` is updated (including new tool citations and authors/contributors). 27 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/getfasta/meta.yml: -------------------------------------------------------------------------------- 1 | name: bedtools_getfasta 2 | description: extract sequences in a FASTA file based on intervals defined in a feature 3 | file. 4 | keywords: 5 | - bed 6 | - fasta 7 | - getfasta 8 | tools: 9 | - bedtools: 10 | description: | 11 | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. 12 | documentation: https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html 13 | licence: ["MIT"] 14 | identifier: biotools:bedtools 15 | input: 16 | - - meta: 17 | type: map 18 | description: | 19 | Groovy Map containing sample information 20 | e.g. [ id:'test', single_end:false ] 21 | - bed: 22 | type: file 23 | description: Bed feature file 24 | pattern: "*.{bed}" 25 | - - fasta: 26 | type: file 27 | description: Input fasta file 28 | pattern: "*.{fa,fasta}" 29 | output: 30 | - fasta: 31 | - meta: 32 | type: map 33 | description: | 34 | Groovy Map containing sample information 35 | e.g. [ id:'test', single_end:false ] 36 | - "*.fa": 37 | type: file 38 | description: Output fasta file with extracted sequences 39 | pattern: "*.{fa}" 40 | - versions: 41 | - versions.yml: 42 | type: file 43 | description: File containing software versions 44 | pattern: "versions.yml" 45 | authors: 46 | - "@joseespinosa" 47 | - "@drpatelh" 48 | maintainers: 49 | - "@joseespinosa" 50 | - "@drpatelh" 51 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/slop/meta.yml: -------------------------------------------------------------------------------- 1 | name: bedtools_slop 2 | description: Adds a specified number of bases in each direction (unique values may 3 | be specified for either -l or -r) 4 | keywords: 5 | - bed 6 | - slopBed 7 | - bedtools 8 | tools: 9 | - bedtools: 10 | description: | 11 | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. 12 | documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html 13 | licence: ["MIT"] 14 | identifier: biotools:bedtools 15 | input: 16 | - - meta: 17 | type: map 18 | description: | 19 | Groovy Map containing sample information 20 | e.g. [ id:'test', single_end:false ] 21 | - bed: 22 | type: file 23 | description: Input BED file 24 | pattern: "*.{bed}" 25 | - - sizes: 26 | type: file 27 | description: Chromosome sizes file 28 | output: 29 | - bed: 30 | - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing sample information 34 | e.g. [ id:'test', single_end:false ] 35 | - "*.bed": 36 | type: file 37 | description: Slopped BED file 38 | pattern: "*.{bed}" 39 | - versions: 40 | - versions.yml: 41 | type: file 42 | description: File containing software versions 43 | pattern: "versions.yml" 44 | authors: 45 | - "@edmundmiller" 46 | - "@sruthipsuresh" 47 | - "@drpatelh" 48 | maintainers: 49 | - "@edmundmiller" 50 | - "@sruthipsuresh" 51 | - "@drpatelh" 52 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/subtract/main.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_SUBTRACT { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--hf5e1c6e_0' : 8 | 'biocontainers/bedtools:2.31.1--hf5e1c6e_0' }" 9 | 10 | input: 11 | tuple val(meta), path(intervals1), path(intervals2) 12 | 13 | output: 14 | tuple val(meta), path("*.bed"), emit: bed 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | if ("$intervals1" == "${prefix}.bed" || 24 | "$intervals2" == "${prefix}.bed") 25 | error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 26 | """ 27 | bedtools \\ 28 | subtract \\ 29 | -a $intervals1 \\ 30 | -b $intervals2 \\ 31 | $args \\ 32 | > ${prefix}.bed 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 37 | END_VERSIONS 38 | """ 39 | 40 | stub: 41 | def prefix = task.ext.prefix ?: "${meta.id}" 42 | """ 43 | touch ${prefix}.bed 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/local/custom/modify_model_config/main.nf: -------------------------------------------------------------------------------- 1 | process CUSTOM_MODIFY_MODEL_CONFIG { 2 | 3 | tag "${meta.id} - #trial ${n_trials}" 4 | label 'process_low' 5 | 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : 8 | 'nf-core/ubuntu:22.04' }" 9 | 10 | input: 11 | tuple val(meta), path(config) 12 | val(n_trials) 13 | 14 | output: 15 | tuple val(meta_updated), path("${prefix}.yaml"), emit: config 16 | path "versions.yml" , emit: versions 17 | 18 | script: 19 | prefix = task.ext.prefix ?: "${config.baseName}-trials_updated" 20 | meta_updated = meta + ["n_trials": "${n_trials}"] 21 | """ 22 | # substitte the line containing n_trials in the config file with n_trials: \${n_trials} 23 | if [ "${n_trials}" = "[]" ]; then 24 | cp "${config}" "${prefix}.yaml" 25 | else 26 | awk -v n_trials="${n_trials}" '/n_trials: [0-9]+/ {gsub(/n_trials: [0-9]+/, "n_trials: " n_trials)}1' "${config}" > "${prefix}.yaml" 27 | fi 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | bash: \$(echo \$(bash --version | grep -Eo 'version [[:alnum:].]+' | sed 's/version //')) 32 | END_VERSIONS 33 | """ 34 | 35 | stub: 36 | prefix = task.ext.prefix ?: "${meta.id}" 37 | """ 38 | touch ${prefix}.yaml 39 | 40 | cat <<-END_VERSIONS > versions.yml 41 | "${task.process}": 42 | bash: \$(echo \$(bash --version | grep -Eo 'version [[:alnum:].]+' | sed 's/version //')) 43 | END_VERSIONS 44 | 45 | """ 46 | } 47 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/subtract/meta.yml: -------------------------------------------------------------------------------- 1 | name: bedtools_subtract 2 | description: Finds overlaps between two sets of regions (A and B), removes the overlaps 3 | from A and reports the remaining portion of A. 4 | keywords: 5 | - bed 6 | - gff 7 | - vcf 8 | - subtract 9 | tools: 10 | - bedtools: 11 | description: | 12 | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. 13 | documentation: https://bedtools.readthedocs.io/en/latest/content/tools/subtract.html 14 | licence: ["MIT"] 15 | identifier: biotools:bedtools 16 | input: 17 | - - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - intervals1: 23 | type: file 24 | description: BED/GFF/VCF 25 | pattern: "*.{bed|gff|vcf}" 26 | - intervals2: 27 | type: file 28 | description: BED/GFF/VCF 29 | pattern: "*.{bed|gff|vcf}" 30 | output: 31 | - bed: 32 | - meta: 33 | type: map 34 | description: | 35 | Groovy Map containing sample information 36 | e.g. [ id:'test', single_end:false ] 37 | - "*.bed": 38 | type: file 39 | description: File containing the difference between the two sets of features 40 | patters: "*.bed" 41 | - versions: 42 | - versions.yml: 43 | type: file 44 | description: File containing software versions 45 | pattern: "versions.yml" 46 | authors: 47 | - "@sidorov-si" 48 | maintainers: 49 | - "@sidorov-si" 50 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/getfasta/main.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_GETFASTA { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--hf5e1c6e_0' : 8 | 'biocontainers/bedtools:2.31.1--hf5e1c6e_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bed) 12 | path fasta 13 | 14 | output: 15 | tuple val(meta), path("*.fa"), emit: fasta 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | if ("$fasta" == "${prefix}.fa") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 25 | """ 26 | bedtools \\ 27 | getfasta \\ 28 | $args \\ 29 | -fi $fasta \\ 30 | -bed $bed \\ 31 | -fo ${prefix}.fa 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def prefix = task.ext.prefix ?: "${meta.id}" 41 | if ("$fasta" == "${prefix}.fa") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 42 | """ 43 | touch ${prefix}.fa 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/nf-core/csvtk/concat/meta.yml: -------------------------------------------------------------------------------- 1 | name: csvtk_concat 2 | description: Concatenate two or more CSV (or TSV) tables into a single table 3 | keywords: 4 | - concatenate 5 | - tsv 6 | - csv 7 | tools: 8 | - csvtk: 9 | description: A cross-platform, efficient, practical CSV/TSV toolkit 10 | homepage: http://bioinf.shenwei.me/csvtk 11 | documentation: http://bioinf.shenwei.me/csvtk 12 | tool_dev_url: https://github.com/shenwei356/csvtk 13 | licence: ["MIT"] 14 | identifier: "" 15 | input: 16 | - - meta: 17 | type: map 18 | description: | 19 | Groovy Map containing sample information 20 | e.g. [ id:'test', single_end:false ] 21 | - csv: 22 | type: file 23 | description: CSV/TSV formatted files 24 | pattern: "*.{csv,tsv}" 25 | - - in_format: 26 | type: string 27 | description: Input format (csv, tab, or a delimiting character) 28 | pattern: "*" 29 | - - out_format: 30 | type: string 31 | description: Output format (csv, tab, or a delimiting character) 32 | pattern: "*" 33 | output: 34 | - csv: 35 | - meta: 36 | type: map 37 | description: | 38 | Groovy Map containing sample information 39 | e.g. [ id:'test', single_end:false ] 40 | - ${prefix}.${out_extension}: 41 | type: file 42 | description: Concatenated CSV/TSV file 43 | pattern: "*.{csv,tsv}" 44 | - versions: 45 | - versions.yml: 46 | type: file 47 | description: File containing software versions 48 | pattern: "version.yml" 49 | authors: 50 | - "@rpetit3" 51 | maintainers: 52 | - "@rpetit3" 53 | -------------------------------------------------------------------------------- /docs/output.md: -------------------------------------------------------------------------------- 1 | # nf-core/deepmodeloptim: Output 2 | 3 | ## Introduction 4 | 5 | This document describes the output produced by the pipeline. 6 | 7 | The directories listed below will be created in the results directory after the pipeline has finished. All paths are relative to the top-level results directory. 8 | 9 | 10 | 11 | ## Pipeline overview 12 | 13 | The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes data using the following steps: 14 | 15 | - [Pipeline information](#pipeline-information) - Report metrics generated during the workflow execution 16 | 17 | ### Pipeline information 18 | 19 |
20 | Output files 21 | 22 | - `pipeline_info/` 23 | - Reports generated by Nextflow: `execution_report.html`, `execution_timeline.html`, `execution_trace.txt` and `pipeline_dag.dot`/`pipeline_dag.svg`. 24 | - Reports generated by the pipeline: `pipeline_report.html`, `pipeline_report.txt` and `software_versions.yml`. The `pipeline_report*` files will only be present if the `--email` / `--email_on_fail` parameter's are used when running the pipeline. 25 | - Reformatted samplesheet files used as input to the pipeline: `samplesheet.valid.csv`. 26 | - Parameters used by the pipeline run: `params.json`. 27 | 28 |
29 | 30 | [Nextflow](https://www.nextflow.io/docs/latest/tracing.html) provides excellent functionality for generating various reports relevant to the running and execution of the pipeline. This will allow you to troubleshoot errors with the running of the pipeline, and also provide you with other information such as launch commands, run times and resource usage. 31 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shift/meta.yml: -------------------------------------------------------------------------------- 1 | name: bedtools_shift 2 | description: Shifts each feature by specific number of bases 3 | keywords: 4 | - bed 5 | - shiftBed 6 | - region 7 | - fai 8 | - sizes 9 | - genome 10 | - bases 11 | tools: 12 | - bedtools: 13 | description: | 14 | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. 15 | documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html 16 | licence: ["MIT"] 17 | identifier: biotools:bedtools 18 | input: 19 | - - meta: 20 | type: map 21 | description: | 22 | Groovy Map containing sample information 23 | e.g. [ id:'test', single_end:false ] 24 | - bed: 25 | type: file 26 | description: Input BED file 27 | pattern: "*.{bed}" 28 | - - meta2: 29 | type: map 30 | description: | 31 | Groovy Map containing sample information 32 | e.g. [ id:'test', single_end:false ] 33 | - chrom_sizes: 34 | type: file 35 | description: Chromosome sizes file 36 | pattern: "*{.sizes,.txt,.fai}" 37 | output: 38 | - bed: 39 | - meta: 40 | type: map 41 | description: | 42 | Groovy Map containing sample information 43 | e.g. [ id:'test', single_end:false ] 44 | - "*.bed": 45 | type: file 46 | description: Shift BED file 47 | pattern: "*.{bed}" 48 | - versions: 49 | - versions.yml: 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | authors: 54 | - "@ekushele" 55 | maintainers: 56 | - "@ekushele" 57 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Subworkflow that uses the nf-schema plugin to validate parameters and render the parameter summary 3 | // 4 | 5 | include { paramsSummaryLog } from 'plugin/nf-schema' 6 | include { validateParameters } from 'plugin/nf-schema' 7 | 8 | workflow UTILS_NFSCHEMA_PLUGIN { 9 | 10 | take: 11 | input_workflow // workflow: the workflow object used by nf-schema to get metadata from the workflow 12 | validate_params // boolean: validate the parameters 13 | parameters_schema // string: path to the parameters JSON schema. 14 | // this has to be the same as the schema given to `validation.parametersSchema` 15 | // when this input is empty it will automatically use the configured schema or 16 | // "${projectDir}/nextflow_schema.json" as default. This input should not be empty 17 | // for meta pipelines 18 | 19 | main: 20 | 21 | // 22 | // Print parameter summary to stdout. This will display the parameters 23 | // that differ from the default given in the JSON schema 24 | // 25 | if(parameters_schema) { 26 | log.info paramsSummaryLog(input_workflow, parameters_schema:parameters_schema) 27 | } else { 28 | log.info paramsSummaryLog(input_workflow) 29 | } 30 | 31 | // 32 | // Validate the parameters using nextflow_schema.json or the schema 33 | // given via the validation.parametersSchema configuration option 34 | // 35 | if(validate_params) { 36 | if(parameters_schema) { 37 | validateParameters(parameters_schema:parameters_schema) 38 | } else { 39 | validateParameters() 40 | } 41 | } 42 | 43 | emit: 44 | dummy_emit = true 45 | } 46 | 47 | -------------------------------------------------------------------------------- /.github/workflows/release-announcements.yml: -------------------------------------------------------------------------------- 1 | name: release-announcements 2 | # Automatic release toot and tweet anouncements 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | toot: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: get topics and convert to hashtags 13 | id: get_topics 14 | run: | 15 | echo "topics=$(curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ')" | sed 's/-//g' >> $GITHUB_OUTPUT 16 | 17 | - uses: rzr/fediverse-action@master 18 | with: 19 | access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} 20 | host: "mstdn.science" # custom host if not "mastodon.social" (default) 21 | # GitHub event payload 22 | # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release 23 | message: | 24 | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! 25 | 26 | Please see the changelog: ${{ github.event.release.html_url }} 27 | 28 | ${{ steps.get_topics.outputs.topics }} #nfcore #openscience #nextflow #bioinformatics 29 | 30 | bsky-post: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: zentered/bluesky-post-action@80dbe0a7697de18c15ad22f4619919ceb5ccf597 # v0.1.0 34 | with: 35 | post: | 36 | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! 37 | 38 | Please see the changelog: ${{ github.event.release.html_url }} 39 | env: 40 | BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} 41 | BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} 42 | # 43 | -------------------------------------------------------------------------------- /assets/slackreport.json: -------------------------------------------------------------------------------- 1 | { 2 | "attachments": [ 3 | { 4 | "fallback": "Plain-text summary of the attachment.", 5 | "color": "<% if (success) { %>good<% } else { %>danger<%} %>", 6 | "author_name": "nf-core/deepmodeloptim ${version} - ${runName}", 7 | "author_icon": "https://www.nextflow.io/docs/latest/_static/favicon.ico", 8 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors<% } %>", 9 | "fields": [ 10 | { 11 | "title": "Command used to launch the workflow", 12 | "value": "```${commandLine}```", 13 | "short": false 14 | } 15 | <% 16 | if (!success) { %> 17 | , 18 | { 19 | "title": "Full error message", 20 | "value": "```${errorReport}```", 21 | "short": false 22 | }, 23 | { 24 | "title": "Pipeline configuration", 25 | "value": "<% out << summary.collect{ k,v -> k == "hook_url" ? "_${k}_: (_hidden_)" : ( ( v.class.toString().contains('Path') || ( v.class.toString().contains('String') && v.contains('/') ) ) ? "_${k}_: `${v}`" : (v.class.toString().contains('DateTime') ? ("_${k}_: " + v.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM))) : "_${k}_: ${v}") ) }.join(",\n") %>", 26 | "short": false 27 | } 28 | <% } 29 | %> 30 | ], 31 | "footer": "Completed at <% out << dateComplete.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM)) %> (duration: ${duration})" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/getfasta/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process BEDTOOLS_GETFASTA" 4 | script "../main.nf" 5 | process "BEDTOOLS_GETFASTA" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "bedtools" 10 | tag "bedtools/getfasta" 11 | 12 | test("sarscov2 - bed - fasta") { 13 | 14 | when { 15 | process { 16 | """ 17 | input[0] = [ 18 | [ id:'test', single_end:false], 19 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true), 20 | ] 21 | 22 | input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) 23 | """ 24 | } 25 | } 26 | 27 | then { 28 | assertAll( 29 | { assert process.success }, 30 | { assert snapshot(process.out).match() } 31 | ) 32 | } 33 | 34 | } 35 | 36 | test("sarscov2 - bed - fasta - stub") { 37 | 38 | options "-stub" 39 | 40 | when { 41 | process { 42 | """ 43 | input[0] = [ 44 | [ id:'test', single_end:false], 45 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true), 46 | ] 47 | 48 | input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) 49 | """ 50 | } 51 | } 52 | 53 | then { 54 | assertAll( 55 | { assert process.success }, 56 | { assert snapshot(process.out).match() } 57 | ) 58 | } 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /modules/nf-core/csvtk/concat/main.nf: -------------------------------------------------------------------------------- 1 | process CSVTK_CONCAT { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/csvtk:0.31.0--h9ee0642_0' : 8 | 'biocontainers/csvtk:0.31.0--h9ee0642_0' }" 9 | 10 | input: 11 | tuple val(meta), path(csv, name: 'inputs/csv*/*') 12 | val in_format 13 | val out_format 14 | 15 | output: 16 | tuple val(meta), path("${prefix}.${out_extension}"), emit: csv 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | prefix = task.ext.prefix ?: "${meta.id}" 25 | def delimiter = in_format == "tsv" ? "\t" : (in_format == "csv" ? "," : in_format) 26 | def out_delimiter = out_format == "tsv" ? "\t" : (out_format == "csv" ? "," : out_format) 27 | out_extension = out_format == "tsv" ? 'tsv' : 'csv' 28 | """ 29 | csvtk \\ 30 | concat \\ 31 | $args \\ 32 | --num-cpus $task.cpus \\ 33 | --delimiter "${delimiter}" \\ 34 | --out-delimiter "${out_delimiter}" \\ 35 | --out-file ${prefix}.${out_extension} \\ 36 | $csv 37 | 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | csvtk: \$(echo \$( csvtk version | sed -e "s/csvtk v//g" )) 41 | END_VERSIONS 42 | """ 43 | 44 | stub: 45 | prefix = task.ext.prefix ?: "${meta.id}" 46 | out_extension = out_format == "tsv" ? 'tsv' : 'csv' 47 | """ 48 | touch ${prefix}.${out_extension} 49 | 50 | cat <<-END_VERSIONS > versions.yml 51 | "${task.process}": 52 | csvtk: \$(echo \$( csvtk version | sed -e "s/csvtk v//g" )) 53 | END_VERSIONS 54 | """ 55 | } 56 | -------------------------------------------------------------------------------- /subworkflows/local/split_csv/main.nf: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | IMPORT NF-CORE MODULES/SUBWORKFLOWS 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | */ 6 | 7 | include { STIMULUS_SPLIT_DATA } from '../../../modules/local/stimulus/split_csv' 8 | 9 | /* 10 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11 | RUN MAIN SUBWORKFLOW 12 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13 | */ 14 | 15 | workflow SPLIT_CSV_WF { 16 | 17 | take: 18 | ch_data 19 | ch_config_split 20 | 21 | main: 22 | 23 | ch_versions = Channel.empty() 24 | 25 | // ============================================================================== 26 | // Split csv data using stimulus 27 | // ============================================================================== 28 | 29 | // combine each data with each split config 30 | ch_input = ch_data 31 | .combine(ch_config_split) 32 | .multiMap { meta_data, data, meta_config, config -> 33 | def meta = meta_data + [split_id: meta_config.split_id] 34 | data: 35 | [meta, data] 36 | config: 37 | [meta, config] 38 | } 39 | 40 | // run stimulus split 41 | STIMULUS_SPLIT_DATA( 42 | ch_input.data, 43 | ch_input.config 44 | ) 45 | ch_split_data = STIMULUS_SPLIT_DATA.out.csv_with_split 46 | ch_versions = ch_versions.mix(STIMULUS_SPLIT_DATA.out.versions) 47 | 48 | emit: 49 | split_data = ch_split_data 50 | versions = ch_versions // channel: [ versions.yml ] 51 | } 52 | 53 | 54 | /* 55 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | THE END 57 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 58 | */ 59 | -------------------------------------------------------------------------------- /conf/test.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/rnaseq -profile test, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Test profile' 15 | config_profile_description = 'Minimal test dataset to check pipeline functions' 16 | 17 | // Input data 18 | data = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_stimulus.csv' 19 | data_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic.yaml' 20 | model = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_model.py' 21 | model_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_model.yaml' 22 | 23 | // output 24 | save_data = true 25 | } 26 | 27 | // Limit resources so that this can run on GitHub Actions 28 | process { 29 | maxRetries = params.max_retries 30 | errorStrategy = params.err_start 31 | 32 | withLabel:process_low { 33 | cpus = { 1 } 34 | memory = { 4.GB * task.attempt } 35 | time = { 10.m * task.attempt } 36 | } 37 | withLabel:process_medium { 38 | cpus = { 2 } 39 | memory = { 6.GB * task.attempt } 40 | time = { 30.m * task.attempt } 41 | } 42 | withLabel:process_high { 43 | cpus = { 4 } 44 | memory = { 8.GB * task.attempt } 45 | time = { 1.h * task.attempt } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /modules/local/bedtools/random/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "bedtools" 4 | ## TODO nf-core: Add a description of the module and list keywords 5 | description: write your description here 6 | keywords: 7 | - sort 8 | - example 9 | - genomics 10 | tools: 11 | - "bedtools": 12 | ## TODO nf-core: Add a description and other details for the software below 13 | description: "A powerful toolset for genome arithmetic" 14 | homepage: "None" 15 | documentation: "None" 16 | tool_dev_url: "None" 17 | doi: "" 18 | licence: ["MIT"] 19 | identifier: biotools:bedtools 20 | 21 | ## TODO nf-core: Add a description of all of the variables used as input 22 | input: 23 | # 24 | ## TODO nf-core: Delete / customise this example input 25 | - bam: 26 | type: file 27 | description: Sorted BAM/CRAM/SAM file 28 | pattern: "*.{bam,cram,sam}" 29 | ontologies: 30 | - edam: "http://edamontology.org/format_25722" 31 | - edam: "http://edamontology.org/format_2573" 32 | - edam: "http://edamontology.org/format_3462" 33 | 34 | ## TODO nf-core: Add a description of all of the variables used as output 35 | output: 36 | - bam: 37 | # 38 | ## TODO nf-core: Delete / customise this example output 39 | - "*.bam": 40 | type: file 41 | description: Sorted BAM/CRAM/SAM file 42 | pattern: "*.{bam,cram,sam}" 43 | ontologies: 44 | - edam: "http://edamontology.org/format_25722" 45 | - edam: "http://edamontology.org/format_2573" 46 | - edam: "http://edamontology.org/format_3462" 47 | 48 | - versions: 49 | - "versions.yml": 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | 54 | authors: 55 | - "@mathysgrapotte" 56 | maintainers: 57 | - "@mathysgrapotte" 58 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shuffle/main.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_SHUFFLE { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--h13024bc_3': 8 | 'biocontainers/bedtools:2.31.1--h13024bc_3' }" 9 | 10 | input: 11 | tuple val(meta) , path(intervals) 12 | tuple val(meta2), path(chrom_sizes) 13 | path exclude_file 14 | path include_file 15 | 16 | output: 17 | tuple val(meta), path("*.bed"), emit: bed 18 | path "versions.yml" , emit: versions 19 | 20 | when: 21 | task.ext.when == null || task.ext.when 22 | 23 | script: 24 | def args = task.ext.args ?: '' 25 | def prefix = task.ext.prefix ?: "${meta.id}" 26 | def exclude_arg = exclude_file ? "-excl $exclude_file" : '' 27 | def include_arg = include_file ? "-incl $include_file" : '' 28 | if ("$intervals" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 29 | """ 30 | bedtools \\ 31 | shuffle \\ 32 | $args \\ 33 | -i $intervals \\ 34 | -g $chrom_sizes \\ 35 | $exclude_arg \\ 36 | $include_arg \\ 37 | > ${prefix}.bed 38 | 39 | cat <<-END_VERSIONS > versions.yml 40 | "${task.process}": 41 | bedtools: \$(bedtools --version |& sed '1!d ; s/bedtools //') 42 | END_VERSIONS 43 | """ 44 | 45 | stub: 46 | def prefix = task.ext.prefix ?: "${meta.id}" 47 | if ("$intervals" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 48 | """ 49 | touch ${prefix}.bed 50 | 51 | cat <<-END_VERSIONS > versions.yml 52 | "${task.process}": 53 | bedtools: \$(bedtools --version |& sed '1!d ; s/bedtools //') 54 | END_VERSIONS 55 | """ 56 | } 57 | -------------------------------------------------------------------------------- /modules/local/stimulus/tune/main.nf: -------------------------------------------------------------------------------- 1 | process STIMULUS_TUNE { 2 | tag "${meta.id}" 3 | label 'process_high' 4 | container "docker.io/mathysgrapotte/stimulus-py:dev" 5 | 6 | input: 7 | tuple val(meta), path(transformed_data) 8 | tuple val(meta2), path(model), path(model_config), path(initial_weights) 9 | 10 | output: 11 | tuple val(meta), path("${prefix}-best-model.safetensors") , emit: model 12 | tuple val(meta), path("${prefix}-best-optimizer.opt") , emit: optimizer 13 | tuple val(meta), path("optuna_results/artifacts") , emit: artifacts 14 | tuple val(meta), path("optuna_results/optuna_journal_storage.log"), emit: journal 15 | path "versions.yml" , emit: versions 16 | // now we need to output these in this format for the predict module - thiw will have to be changed! 17 | tuple val(meta), path(model), path("best_config.json"), path("${prefix}-best-model.safetensors"), emit: model_tmp 18 | 19 | script: 20 | prefix = task.ext.prefix ?: meta.id 21 | def args = task.ext.args ?: "" 22 | def use_initial_weights = initial_weights != [] ? "-w ${initial_weights}" : "" 23 | """ 24 | stimulus tune \ 25 | -d ${transformed_data} \ 26 | -m ${model} \ 27 | -c ${model_config} \ 28 | -o ${prefix}-best-model.safetensors \ 29 | -bo ${prefix}-best-optimizer.opt \ 30 | ${args} 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 35 | END_VERSIONS 36 | """ 37 | 38 | stub: 39 | prefix = task.ext.prefix ?: meta.id 40 | """ 41 | touch ${prefix}-best-model.safetensors 42 | touch ${prefix}-best-optimizer.opt 43 | touch best_config.json 44 | touch TuneModel_stub.txt 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | stimulus: \$(stimulus -v | cut -d ' ' -f 3) 49 | END_VERSIONS 50 | """ 51 | } 52 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Report something that is broken or incorrect 3 | labels: bug 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Before you post this issue, please check the documentation: 9 | 10 | - [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) 11 | - [nf-core/deepmodeloptim pipeline documentation](https://nf-co.re/deepmodeloptim/usage) 12 | - type: textarea 13 | id: description 14 | attributes: 15 | label: Description of the bug 16 | description: A clear and concise description of what the bug is. 17 | validations: 18 | required: true 19 | 20 | - type: textarea 21 | id: command_used 22 | attributes: 23 | label: Command used and terminal output 24 | description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal. 25 | render: console 26 | placeholder: | 27 | $ nextflow run ... 28 | 29 | Some output where something broke 30 | 31 | - type: textarea 32 | id: files 33 | attributes: 34 | label: Relevant files 35 | description: | 36 | Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed. 37 | Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files. 38 | 39 | - type: textarea 40 | id: system 41 | attributes: 42 | label: System information 43 | description: | 44 | * Nextflow version _(eg. 23.04.0)_ 45 | * Hardware _(eg. HPC, Desktop, Cloud)_ 46 | * Executor _(eg. slurm, local, awsbatch)_ 47 | * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_ 48 | * OS _(eg. CentOS Linux, macOS, Linux Mint)_ 49 | * Version of nf-core/deepmodeloptim _(eg. 1.1, 1.5, 1.8.2)_ 50 | -------------------------------------------------------------------------------- /conf/test_ibis.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run main.nf -profile test_ibis, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Test ibis profile' 15 | config_profile_description = 'Minimal ibis test dataset to check pipeline functions' 16 | 17 | // Input data 18 | data = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ibis_SP140/SP140_shade.stimulus.csv' 19 | data_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/data.yaml' 20 | model = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ConvBasic_withEfficientKAN.py' 21 | model_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ConvBasic_withEfficientKAN.yaml' 22 | 23 | // output 24 | save_data = true 25 | } 26 | 27 | // Limit resources so that this can run on GitHub Actions 28 | process { 29 | maxRetries = params.max_retries 30 | errorStrategy = params.err_start 31 | 32 | withLabel:process_low { 33 | cpus = { 1 } 34 | memory = { 4.GB * task.attempt } 35 | time = { 10.m * task.attempt } 36 | } 37 | withLabel:process_medium { 38 | cpus = { 2 } 39 | memory = { 6.GB * task.attempt } 40 | time = { 30.m * task.attempt } 41 | } 42 | withLabel:process_high { 43 | cpus = { 4 } 44 | memory = { 8.GB * task.attempt } 45 | time = { 1.h * task.attempt } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.github/workflows/template_version_comment.yml: -------------------------------------------------------------------------------- 1 | name: nf-core template version comment 2 | # This workflow is triggered on PRs to check if the pipeline template version matches the latest nf-core version. 3 | # It posts a comment to the PR, even if it comes from a fork. 4 | 5 | on: pull_request_target 6 | 7 | jobs: 8 | template_version: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Check out pipeline code 12 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 13 | with: 14 | ref: ${{ github.event.pull_request.head.sha }} 15 | 16 | - name: Read template version from .nf-core.yml 17 | uses: nichmor/minimal-read-yaml@v0.0.2 18 | id: read_yml 19 | with: 20 | config: ${{ github.workspace }}/.nf-core.yml 21 | 22 | - name: Install nf-core 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} 26 | 27 | - name: Check nf-core outdated 28 | id: nf_core_outdated 29 | run: echo "OUTPUT=$(pip list --outdated | grep nf-core)" >> ${GITHUB_ENV} 30 | 31 | - name: Post nf-core template version comment 32 | uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 33 | if: | 34 | contains(env.OUTPUT, 'nf-core') 35 | with: 36 | repo-token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }} 37 | allow-repeats: false 38 | message: | 39 | > [!WARNING] 40 | > Newer version of the nf-core template is available. 41 | > 42 | > Your pipeline is using an old version of the nf-core template: ${{ steps.read_yml.outputs['nf_core_version'] }}. 43 | > Please update your pipeline to the latest version. 44 | > 45 | > For more documentation on how to update your pipeline, please see the [nf-core documentation](https://github.com/nf-core/tools?tab=readme-ov-file#sync-a-pipeline-with-the-template) and [Synchronisation documentation](https://nf-co.re/docs/contributing/sync). 46 | # 47 | -------------------------------------------------------------------------------- /modules/nf-core/gawk/meta.yml: -------------------------------------------------------------------------------- 1 | name: "gawk" 2 | description: | 3 | If you are like many computer users, you would frequently like to make changes in various text files 4 | wherever certain patterns appear, or extract data from parts of certain lines while discarding the rest. 5 | The job is easy with awk, especially the GNU implementation gawk. 6 | keywords: 7 | - gawk 8 | - awk 9 | - txt 10 | - text 11 | - file parsing 12 | tools: 13 | - "gawk": 14 | description: "GNU awk" 15 | homepage: "https://www.gnu.org/software/gawk/" 16 | documentation: "https://www.gnu.org/software/gawk/manual/" 17 | tool_dev_url: "https://www.gnu.org/prep/ftp.html" 18 | licence: ["GPL v3"] 19 | identifier: "" 20 | input: 21 | - - meta: 22 | type: map 23 | description: | 24 | Groovy Map containing sample information 25 | e.g. [ id:'test', single_end:false ] 26 | - input: 27 | type: file 28 | description: The input file - Specify the logic that needs to be executed on 29 | this file on the `ext.args2` or in the program file. 30 | If the files have a `.gz` extension, they will be unzipped using `zcat`. 31 | pattern: "*" 32 | - - program_file: 33 | type: file 34 | description: Optional file containing logic for awk to execute. If you don't 35 | wish to use a file, you can use `ext.args2` to specify the logic. 36 | pattern: "*" 37 | output: 38 | - output: 39 | - meta: 40 | type: map 41 | description: | 42 | Groovy Map containing sample information 43 | e.g. [ id:'test', single_end:false ] 44 | - ${prefix}.${suffix}: 45 | type: file 46 | description: The output file - specify the name of this file using `ext.prefix` 47 | and the extension using `ext.suffix` 48 | pattern: "*" 49 | - versions: 50 | - versions.yml: 51 | type: file 52 | description: File containing software versions 53 | pattern: "versions.yml" 54 | authors: 55 | - "@nvnieuwk" 56 | maintainers: 57 | - "@nvnieuwk" 58 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/meta.yml: -------------------------------------------------------------------------------- 1 | name: custom_getchromsizes 2 | description: Generates a FASTA file of chromosome sizes and a fasta index file 3 | keywords: 4 | - fasta 5 | - chromosome 6 | - indexing 7 | tools: 8 | - samtools: 9 | description: Tools for dealing with SAM, BAM and CRAM files 10 | homepage: http://www.htslib.org/ 11 | documentation: http://www.htslib.org/doc/samtools.html 12 | tool_dev_url: https://github.com/samtools/samtools 13 | doi: 10.1093/bioinformatics/btp352 14 | licence: ["MIT"] 15 | identifier: "" 16 | input: 17 | - - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - fasta: 23 | type: file 24 | description: FASTA file 25 | pattern: "*.{fa,fasta,fna,fas}" 26 | output: 27 | - sizes: 28 | - meta: 29 | type: map 30 | description: | 31 | Groovy Map containing sample information 32 | e.g. [ id:'test', single_end:false ] 33 | - "*.sizes": 34 | type: file 35 | description: File containing chromosome lengths 36 | pattern: "*.{sizes}" 37 | - fai: 38 | - meta: 39 | type: map 40 | description: | 41 | Groovy Map containing sample information 42 | e.g. [ id:'test', single_end:false ] 43 | - "*.fai": 44 | type: file 45 | description: FASTA index file 46 | pattern: "*.{fai}" 47 | - gzi: 48 | - meta: 49 | type: map 50 | description: | 51 | Groovy Map containing sample information 52 | e.g. [ id:'test', single_end:false ] 53 | - "*.gzi": 54 | type: file 55 | description: Optional gzip index file for compressed inputs 56 | pattern: "*.gzi" 57 | - versions: 58 | - versions.yml: 59 | type: file 60 | description: File containing software versions 61 | pattern: "versions.yml" 62 | authors: 63 | - "@tamara-hodgetts" 64 | - "@chris-cheshire" 65 | - "@muffato" 66 | maintainers: 67 | - "@tamara-hodgetts" 68 | - "@chris-cheshire" 69 | - "@muffato" 70 | -------------------------------------------------------------------------------- /modules/nf-core/csvtk/concat/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "tsv - concat - csv - stub": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,c203a84cc5b289951b70302549dcf08d" 15 | ], 16 | "csv": [ 17 | [ 18 | { 19 | "id": "test" 20 | }, 21 | "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,c203a84cc5b289951b70302549dcf08d" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.9.2", 31 | "nextflow": "24.10.3" 32 | }, 33 | "timestamp": "2025-01-08T04:46:46.133640633" 34 | }, 35 | "tsv - concat - csv": { 36 | "content": [ 37 | { 38 | "0": [ 39 | [ 40 | { 41 | "id": "test" 42 | }, 43 | "test.csv:md5,bb0ed52999b6b24297bcefb3c29f0a5c" 44 | ] 45 | ], 46 | "1": [ 47 | "versions.yml:md5,c203a84cc5b289951b70302549dcf08d" 48 | ], 49 | "csv": [ 50 | [ 51 | { 52 | "id": "test" 53 | }, 54 | "test.csv:md5,bb0ed52999b6b24297bcefb3c29f0a5c" 55 | ] 56 | ], 57 | "versions": [ 58 | "versions.yml:md5,c203a84cc5b289951b70302549dcf08d" 59 | ] 60 | } 61 | ], 62 | "meta": { 63 | "nf-test": "0.9.2", 64 | "nextflow": "24.10.3" 65 | }, 66 | "timestamp": "2025-01-08T04:46:31.419386462" 67 | } 68 | } -------------------------------------------------------------------------------- /conf/test_ibis_with_preprocessing.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run main.nf -profile test_ibis, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Test ibis profile - with preprocessing' 15 | config_profile_description = 'Minimal ibis test dataset (with preprocessing) to check pipeline functions' 16 | 17 | // Input data 18 | data = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ibis_SP140/SP140_ghts.peaks' 19 | data_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/data.yaml' 20 | model = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ConvBasic_withEfficientKAN.py' 21 | model_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ConvBasic_withEfficientKAN.yaml' 22 | preprocessing_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/ibis/ibis_SP140/preprocessing.yaml' 23 | genome = 'GRCh38' 24 | bed_peak_size = 40 25 | 26 | // output 27 | save_data = true 28 | } 29 | 30 | // Limit resources so that this can run on GitHub Actions 31 | process { 32 | maxRetries = params.max_retries 33 | errorStrategy = params.err_start 34 | 35 | withLabel:process_low { 36 | cpus = { 1 } 37 | memory = { 4.GB * task.attempt } 38 | time = { 10.m * task.attempt } 39 | } 40 | withLabel:process_medium { 41 | cpus = { 2 } 42 | memory = { 6.GB * task.attempt } 43 | time = { 30.m * task.attempt } 44 | } 45 | withLabel:process_high { 46 | cpus = { 4 } 47 | memory = { 8.GB * task.attempt } 48 | time = { 1.h * task.attempt } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /conf/test_noise_eval.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/rnaseq -profile test, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Test profile' 15 | config_profile_description = 'Minimal test dataset to check pipeline functions' 16 | 17 | // Input data 18 | data = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_stimulus.csv' 19 | data_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic.yaml' 20 | model = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_model.py' 21 | model_config = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_model.yaml' 22 | 23 | // tune parameters 24 | tune_trials_range = "2,4,2" 25 | tune_replicates = 2 26 | 27 | // predict data 28 | prediction_data = params.pipelines_testdata_base_path + 'deepmodeloptim/testdata/titanic/titanic_stimulus.csv' 29 | 30 | // output 31 | save_data = false 32 | } 33 | 34 | env { 35 | HF_DATASETS_CACHE = '/tmp/hf_cache' 36 | } 37 | 38 | // Limit resources so that this can run on GitHub Actions 39 | process { 40 | maxRetries = params.max_retries 41 | errorStrategy = params.err_start 42 | 43 | withLabel:process_low { 44 | cpus = { 1 } 45 | memory = { 4.GB * task.attempt } 46 | time = { 10.m * task.attempt } 47 | } 48 | withLabel:process_medium { 49 | cpus = { 2 } 50 | memory = { 6.GB * task.attempt } 51 | time = { 30.m * task.attempt } 52 | } 53 | withLabel:process_high { 54 | cpus = { 4 } 55 | memory = { 8.GB * task.attempt } 56 | time = { 1.h * task.attempt } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /CITATIONS.md: -------------------------------------------------------------------------------- 1 | # nf-core/deepmodeloptim: Citations 2 | 3 | ## [nf-core](https://pubmed.ncbi.nlm.nih.gov/32055031/) 4 | 5 | > Ewels PA, Peltzer A, Fillinger S, Patel H, Alneberg J, Wilm A, Garcia MU, Di Tommaso P, Nahnsen S. The nf-core framework for community-curated bioinformatics pipelines. Nat Biotechnol. 2020 Mar;38(3):276-278. doi: 10.1038/s41587-020-0439-x. PubMed PMID: 32055031. 6 | 7 | ## [Nextflow](https://pubmed.ncbi.nlm.nih.gov/28398311/) 8 | 9 | > Di Tommaso P, Chatzou M, Floden EW, Barja PP, Palumbo E, Notredame C. Nextflow enables reproducible computational workflows. Nat Biotechnol. 2017 Apr 11;35(4):316-319. doi: 10.1038/nbt.3820. PubMed PMID: 28398311. 10 | 11 | ## Pipeline tools 12 | 13 | ## Software packaging/containerisation tools 14 | 15 | - [Anaconda](https://anaconda.com) 16 | 17 | > Anaconda Software Distribution. Computer software. Vers. 2-2.4.0. Anaconda, Nov. 2016. Web. 18 | 19 | - [Bioconda](https://pubmed.ncbi.nlm.nih.gov/29967506/) 20 | 21 | > Grüning B, Dale R, Sjödin A, Chapman BA, Rowe J, Tomkins-Tinch CH, Valieris R, Köster J; Bioconda Team. Bioconda: sustainable and comprehensive software distribution for the life sciences. Nat Methods. 2018 Jul;15(7):475-476. doi: 10.1038/s41592-018-0046-7. PubMed PMID: 29967506. 22 | 23 | - [BioContainers](https://pubmed.ncbi.nlm.nih.gov/28379341/) 24 | 25 | > da Veiga Leprevost F, Grüning B, Aflitos SA, Röst HL, Uszkoreit J, Barsnes H, Vaudel M, Moreno P, Gatto L, Weber J, Bai M, Jimenez RC, Sachsenberg T, Pfeuffer J, Alvarez RV, Griss J, Nesvizhskii AI, Perez-Riverol Y. BioContainers: an open-source and community-driven framework for software standardization. Bioinformatics. 2017 Aug 15;33(16):2580-2582. doi: 10.1093/bioinformatics/btx192. PubMed PMID: 28379341; PubMed Central PMCID: PMC5870671. 26 | 27 | - [Docker](https://dl.acm.org/doi/10.5555/2600239.2600241) 28 | 29 | > Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: 10.5555/2600239.2600241. 30 | 31 | - [Singularity](https://pubmed.ncbi.nlm.nih.gov/28494014/) 32 | 33 | > Kurtzer GM, Sochat V, Bauer MW. Singularity: Scientific containers for mobility of compute. PLoS One. 2017 May 11;12(5):e0177459. doi: 10.1371/journal.pone.0177459. eCollection 2017. PubMed PMID: 28494014; PubMed Central PMCID: PMC5426675. 34 | -------------------------------------------------------------------------------- /modules/local/awk/extract/main.nf: -------------------------------------------------------------------------------- 1 | process AWK_EXTRACT { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/gawk:5.3.0' : 8 | 'biocontainers/gawk:5.3.0' }" 9 | 10 | input: 11 | tuple val(meta), val(column_name), val(values) 12 | tuple val(meta2), path(data) 13 | 14 | output: 15 | tuple val(meta), path("${prefix}.${extension}"), emit: extracted_data 16 | path("versions.yml") , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: [] 23 | def separator = args.separator ?: ( data.getName().endsWith(".csv") ? ',': '\t' ) 24 | prefix = task.ext.prefix ?: "${meta.id}.extracted" 25 | extension = data.getName().split("\\.").last() 26 | """ 27 | # Convert comma-separated values to an array 28 | IFS=',' read -r -a values_array <<< $values 29 | 30 | # Get the column index for the given column name 31 | column_index=\$(head -1 $data | tr "$separator" "\\n" | nl -v 0 | grep -w $column_name | awk '{print \$1}') 32 | 33 | if [ -z \$column_index ]; then 34 | echo "Column '$column_name' not found in the CSV file." 35 | exit 1 36 | fi 37 | 38 | # Extract rows where the column has the specified values 39 | awk -v col=\$column_index -v values=$values -v FS="$separator" ' 40 | BEGIN { 41 | split(values, vals, ","); 42 | for (i in vals) { 43 | val_map[vals[i]] = 1; 44 | } 45 | } 46 | NR == 1 || val_map[\$(col + 1)] { 47 | print \$0 48 | } 49 | ' $data > ${prefix}.${extension} 50 | 51 | cat <<-END_VERSIONS > versions.yml 52 | "${task.process}": 53 | gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') 54 | END_VERSIONS 55 | """ 56 | 57 | stub: 58 | prefix = task.ext.prefix ?: "${meta.id}.extracted" 59 | extension = data.getName().split("\\.").last() 60 | """ 61 | touch ${prefix}.${extension} 62 | cat <<-END_VERSIONS > versions.yml 63 | "${task.process}": 64 | gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') 65 | END_VERSIONS 66 | """ 67 | } 68 | -------------------------------------------------------------------------------- /modules/nf-core/gawk/main.nf: -------------------------------------------------------------------------------- 1 | process GAWK { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/gawk:5.3.0' : 8 | 'biocontainers/gawk:5.3.0' }" 9 | 10 | input: 11 | tuple val(meta), path(input, arity: '0..*') 12 | path(program_file) 13 | 14 | output: 15 | tuple val(meta), path("${prefix}.${suffix}"), emit: output 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' // args is used for the main arguments of the tool 23 | def args2 = task.ext.args2 ?: '' // args2 is used to specify a program when no program file has been given 24 | prefix = task.ext.prefix ?: "${meta.id}" 25 | suffix = task.ext.suffix ?: "${input.collect{ it.getExtension()}.get(0)}" // use the first extension of the input files 26 | 27 | program = program_file ? "-f ${program_file}" : "${args2}" 28 | lst_gz = input.collect{ it.getExtension().endsWith("gz") } 29 | unzip = lst_gz.contains(false) ? "" : "find ${input} -exec zcat {} \\; | \\" 30 | input_cmd = unzip ? "" : "${input}" 31 | output_cmd = suffix.endsWith("gz") ? "| gzip" : "" 32 | 33 | input.collect{ 34 | assert it.name != "${prefix}.${suffix}" : "Input and output names are the same, set prefix in module configuration to disambiguate!" 35 | } 36 | 37 | """ 38 | ${unzip} 39 | awk \\ 40 | ${args} \\ 41 | ${program} \\ 42 | ${input_cmd} \\ 43 | ${output_cmd} \\ 44 | > ${prefix}.${suffix} 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') 49 | END_VERSIONS 50 | """ 51 | 52 | stub: 53 | prefix = task.ext.prefix ?: "${meta.id}" 54 | suffix = task.ext.suffix ?: "${input.getExtension()}" 55 | def create_cmd = suffix.endsWith("gz") ? "echo '' | gzip >" : "touch" 56 | 57 | """ 58 | ${create_cmd} ${prefix}.${suffix} 59 | 60 | cat <<-END_VERSIONS > versions.yml 61 | "${task.process}": 62 | gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') 63 | END_VERSIONS 64 | """ 65 | } 66 | -------------------------------------------------------------------------------- /modules/nf-core/csvtk/concat/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | // nf-core modules test csvtk/concat 2 | nextflow_process { 3 | 4 | name "Test Process CSVTK_CONCAT" 5 | script "../main.nf" 6 | process "CSVTK_CONCAT" 7 | 8 | tag "modules" 9 | tag "modules_nfcore" 10 | tag "csvtk" 11 | tag "csvtk/concat" 12 | 13 | test("tsv - concat - csv") { 14 | 15 | when { 16 | process { 17 | """ 18 | input[0] = [ 19 | [ id:'test' ], // meta map 20 | [ 21 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_hybrid.csv", checkIfExists: true), 22 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_long.csv", checkIfExists: true), 23 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true), 24 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true) 25 | ] 26 | ] 27 | input[1] = "tsv" 28 | input[2] = "csv" 29 | """ 30 | } 31 | } 32 | 33 | then { 34 | assertAll( 35 | { assert process.success }, 36 | { assert snapshot(process.out).match() } 37 | ) 38 | } 39 | 40 | } 41 | 42 | test("tsv - concat - csv - stub") { 43 | 44 | options "-stub" 45 | 46 | when { 47 | process { 48 | """ 49 | input[0] = [ 50 | [ id:'test' ], // meta map 51 | [ 52 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_hybrid.csv", checkIfExists: true), 53 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_long.csv", checkIfExists: true), 54 | file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true) 55 | ] 56 | ] 57 | input[1] = "tsv" 58 | input[2] = "csv" 59 | """ 60 | } 61 | } 62 | 63 | then { 64 | assertAll( 65 | { assert process.success }, 66 | { assert snapshot(process.out).match() } 67 | ) 68 | } 69 | 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /subworkflows/local/split_data_config_unified/main.nf: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | IMPORT NF-CORE MODULES/SUBWORKFLOWS 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | */ 6 | 7 | include { STIMULUS_SPLIT_YAML } from '../../../modules/local/stimulus/split_yaml' 8 | 9 | /* 10 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11 | RUN MAIN WORKFLOW 12 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13 | */ 14 | 15 | workflow SPLIT_DATA_CONFIG_UNIFIED_WF { 16 | take: 17 | ch_data_config 18 | 19 | main: 20 | 21 | ch_versions = Channel.empty() 22 | 23 | STIMULUS_SPLIT_YAML( ch_data_config ) 24 | ch_versions = ch_versions.mix(STIMULUS_SPLIT_YAML.out.versions) 25 | 26 | // Process split configs - transpose and add split_id to meta 27 | ch_split_configs = STIMULUS_SPLIT_YAML.out.split_config 28 | .transpose() 29 | .map { meta, yaml -> 30 | // Extract split info from descriptive filename 31 | def split_id = yaml.baseName.replaceAll(/.*_([^_]+_[^_]+)_split$/, '$1') 32 | [ meta + [split_id: split_id], yaml] 33 | } 34 | 35 | // Process transform configs - transpose and add transform_id to meta 36 | ch_transform_configs = STIMULUS_SPLIT_YAML.out.transform_config 37 | .transpose() 38 | .map { meta, yaml -> 39 | // Extract transform info from descriptive filename 40 | def transform_id = yaml.baseName.replaceAll(/.*_([^_]+_[^_]+)_transform$/, '$1') 41 | [ meta + [transform_id: transform_id], yaml] 42 | } 43 | 44 | // Encoding configs don't need transposition as there's only one per input 45 | ch_encoding_configs = STIMULUS_SPLIT_YAML.out.encode_config 46 | 47 | emit: 48 | split_config = ch_split_configs // channel: [ meta + [split_id: split_id], yaml ] 49 | transform_config = ch_transform_configs // channel: [ meta + [transform_id: transform_id], yaml ] 50 | encode_config = ch_encoding_configs // channel: [ meta, yaml ] 51 | versions = ch_versions // channel: [ versions.yml ] 52 | } 53 | 54 | /* 55 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | THE END 57 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 58 | */ 59 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/getfasta/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "sarscov2 - bed - fasta": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test", 9 | "single_end": false 10 | }, 11 | "test.fa:md5,41c3a45a57a16c04f828d8f8bb52df70" 12 | ] 13 | ], 14 | "1": [ 15 | "versions.yml:md5,427b4f64b2f05f28f0beef96c9f0d310" 16 | ], 17 | "fasta": [ 18 | [ 19 | { 20 | "id": "test", 21 | "single_end": false 22 | }, 23 | "test.fa:md5,41c3a45a57a16c04f828d8f8bb52df70" 24 | ] 25 | ], 26 | "versions": [ 27 | "versions.yml:md5,427b4f64b2f05f28f0beef96c9f0d310" 28 | ] 29 | } 30 | ], 31 | "meta": { 32 | "nf-test": "0.8.4", 33 | "nextflow": "23.10.1" 34 | }, 35 | "timestamp": "2024-05-03T14:16:19.383758985" 36 | }, 37 | "sarscov2 - bed - fasta - stub": { 38 | "content": [ 39 | { 40 | "0": [ 41 | [ 42 | { 43 | "id": "test", 44 | "single_end": false 45 | }, 46 | "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" 47 | ] 48 | ], 49 | "1": [ 50 | "versions.yml:md5,427b4f64b2f05f28f0beef96c9f0d310" 51 | ], 52 | "fasta": [ 53 | [ 54 | { 55 | "id": "test", 56 | "single_end": false 57 | }, 58 | "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" 59 | ] 60 | ], 61 | "versions": [ 62 | "versions.yml:md5,427b4f64b2f05f28f0beef96c9f0d310" 63 | ] 64 | } 65 | ], 66 | "meta": { 67 | "nf-test": "0.8.4", 68 | "nextflow": "23.10.1" 69 | }, 70 | "timestamp": "2024-05-03T14:16:47.47010536" 71 | } 72 | } -------------------------------------------------------------------------------- /assets/schema_preprocessing.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://example.com/schemas/schema_preprocessing.json", 4 | "title": "nf-core/differentialabundance pipeline - params.data_preprocessing schema", 5 | "description": "Schema for the file provided with params.data_preprocessing", 6 | "type": "array", 7 | "items": { 8 | "type": "object", 9 | "properties": { 10 | "id": { 11 | "type": "string", 12 | "meta": ["id"] 13 | }, 14 | "protocol": { 15 | "type": "string", 16 | "enum": ["ibis"], 17 | "meta": ["protocol"] 18 | }, 19 | "background_type": { 20 | "type": "string", 21 | "enum": ["aliens", "shade", "shuffle"], 22 | "meta": ["background_type"] 23 | }, 24 | "variable": { 25 | "type": "string", 26 | "meta": ["variable"] 27 | }, 28 | "target": { 29 | "type": "string", 30 | "meta": ["target"] 31 | }, 32 | "background": { 33 | "type": "string", 34 | "meta": ["background"], 35 | "default": "" 36 | }, 37 | "shade_args": { 38 | "type": "string", 39 | "meta": ["shade_args"], 40 | "default": "" 41 | } 42 | }, 43 | "required": ["id", "protocol"], 44 | "allOf": [ 45 | { 46 | "if": { 47 | "properties": { "protocol": { "const": "ibis" } } 48 | }, 49 | "then": { 50 | "required": ["background_type", "variable", "target"] 51 | } 52 | }, 53 | { 54 | "if": { 55 | "properties": { "background_type": { "const": "aliens" } } 56 | }, 57 | "then": { 58 | "required": ["background"] 59 | } 60 | }, 61 | { 62 | "if": { 63 | "properties": { "background_type": { "const": "shade" } } 64 | }, 65 | "then": { 66 | "required": ["shade_args"] 67 | } 68 | } 69 | ], 70 | "additionalProperties": false 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /modules/local/bedtools/random/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | // TODO nf-core: Once you have added the required tests, please run the following command to build this file: 2 | // nf-core modules test bedtools 3 | nextflow_process { 4 | 5 | name "Test Process BEDTOOLS" 6 | script "../main.nf" 7 | process "BEDTOOLS" 8 | 9 | tag "modules" 10 | tag "modules_" 11 | tag "bedtools" 12 | 13 | // TODO nf-core: Change the test name preferably indicating the test-data and file-format used 14 | test("sarscov2 - bam") { 15 | 16 | // TODO nf-core: If you are created a test for a chained module 17 | // (the module requires running more than one process to generate the required output) 18 | // add the 'setup' method here. 19 | // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). 20 | 21 | when { 22 | process { 23 | """ 24 | // TODO nf-core: define inputs of the process here. Example: 25 | 26 | input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), 27 | """ 28 | } 29 | } 30 | 31 | then { 32 | assertAll( 33 | { assert process.success }, 34 | { assert snapshot(process.out).match() } 35 | //TODO nf-core: Add all required assertions to verify the test output. 36 | // See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples. 37 | ) 38 | } 39 | 40 | } 41 | 42 | // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. 43 | test("sarscov2 - bam - stub") { 44 | 45 | options "-stub" 46 | 47 | when { 48 | process { 49 | """ 50 | // TODO nf-core: define inputs of the process here. Example: 51 | 52 | input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), 53 | """ 54 | } 55 | } 56 | 57 | then { 58 | assertAll( 59 | { assert process.success }, 60 | { assert snapshot(process.out).match() } 61 | //TODO nf-core: Add all required assertions to verify the test output. 62 | ) 63 | } 64 | 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /conf/base.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | nf-core/deepmodeloptim Nextflow base config file 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | A 'blank slate' config file, appropriate for general use on most high performance 6 | compute environments. Assumes that all software is installed and available on 7 | the PATH. Runs in `local` mode - all jobs will be run on the logged in environment. 8 | ---------------------------------------------------------------------------------------- 9 | */ 10 | 11 | process { 12 | 13 | // TODO nf-core: Check the defaults for all processes 14 | cpus = { 1 * task.attempt } 15 | memory = { 6.GB * task.attempt } 16 | time = { 4.h * task.attempt } 17 | 18 | errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } 19 | maxRetries = 1 20 | maxErrors = '-1' 21 | 22 | // Process-specific resource requirements 23 | // NOTE - Please try and reuse the labels below as much as possible. 24 | // These labels are used and recognised by default in DSL2 files hosted on nf-core/modules. 25 | // If possible, it would be nice to keep the same label naming convention when 26 | // adding in your local modules too. 27 | // TODO nf-core: Customise requirements for specific processes. 28 | // See https://www.nextflow.io/docs/latest/config.html#config-process-selectors 29 | withLabel:process_single { 30 | cpus = { 1 } 31 | memory = { 6.GB * task.attempt } 32 | time = { 4.h * task.attempt } 33 | } 34 | withLabel:process_low { 35 | cpus = { 2 * task.attempt } 36 | memory = { 12.GB * task.attempt } 37 | time = { 4.h * task.attempt } 38 | } 39 | withLabel:process_medium { 40 | cpus = { 6 * task.attempt } 41 | memory = { 36.GB * task.attempt } 42 | time = { 8.h * task.attempt } 43 | } 44 | withLabel:process_high { 45 | cpus = { 12 * task.attempt } 46 | memory = { 72.GB * task.attempt } 47 | time = { 16.h * task.attempt } 48 | } 49 | withLabel:process_long { 50 | time = { 20.h * task.attempt } 51 | } 52 | withLabel:process_high_memory { 53 | memory = { 200.GB * task.attempt } 54 | } 55 | withLabel:error_ignore { 56 | errorStrategy = 'ignore' 57 | } 58 | withLabel:error_retry { 59 | errorStrategy = 'retry' 60 | maxRetries = 2 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /.github/workflows/branch.yml: -------------------------------------------------------------------------------- 1 | name: nf-core branch protection 2 | # This workflow is triggered on PRs to `main`/`master` branch on the repository 3 | # It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev` 4 | on: 5 | pull_request_target: 6 | branches: 7 | - main 8 | - master 9 | 10 | jobs: 11 | test: 12 | runs-on: ubuntu-latest 13 | steps: 14 | # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches 15 | - name: Check PRs 16 | if: github.repository == 'nf-core/deepmodeloptim' 17 | run: | 18 | { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/deepmodeloptim ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] 19 | 20 | # If the above check failed, post a comment on the PR explaining the failure 21 | # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets 22 | - name: Post PR comment 23 | if: failure() 24 | uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 25 | with: 26 | message: | 27 | ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: 28 | 29 | * Do not close this PR 30 | * Click _Edit_ and change the `base` to `dev` 31 | * This CI test will remain failed until you push a new commit 32 | 33 | --- 34 | 35 | Hi @${{ github.event.pull_request.user.login }}, 36 | 37 | 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 }}) ${{github.event.pull_request.base.ref}} branch. 38 | The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release. 39 | Because of this, PRs to ${{github.event.pull_request.base.ref}} 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. 40 | 41 | 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. 42 | Note that even after this, the test will continue to show as failing until you push a new commit. 43 | 44 | Thanks again for your contribution! 45 | repo-token: ${{ secrets.GITHUB_TOKEN }} 46 | allow-repeats: false 47 | -------------------------------------------------------------------------------- /modules/nf-core/bedtools/shuffle/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "bedtools_shuffle" 4 | description: bedtools shuffle will randomly permute the genomic locations of a feature file among a genome defined in a genome file 5 | keywords: 6 | - bed 7 | - shuffleBed 8 | - region 9 | - fai 10 | - sizes 11 | - genome 12 | - bases 13 | tools: 14 | - bedtools: 15 | description: | 16 | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. 17 | documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html 18 | licence: ["MIT"] 19 | identifier: biotools:bedtools 20 | 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing interval information 26 | e.g. [ id:'test' ] 27 | - intervals: 28 | type: file 29 | description: Input interval (BED/GFF/VCF) file 30 | pattern: "*.{bed,gff,gff3,vcf}" 31 | ontologies: 32 | - edam: "http://edamontology.org/format_3003" 33 | - edam: "http://edamontology.org/format_2305" 34 | - edam: "http://edamontology.org/format_3016" 35 | - - meta2: 36 | type: map 37 | description: | 38 | Groovy Map containing genome information 39 | e.g. [ id:'test' ] 40 | - chrom_sizes: 41 | type: file 42 | description: Chromosome sizes file 43 | pattern: "*{.genome,.sizes,.txt,.fai}" 44 | - - exclude_file: 45 | type: file 46 | description: BED file containing regions to exclude 47 | pattern: "*.{bed}" 48 | ontologies: 49 | - edam: "http://edamontology.org/format_3003" 50 | - - include_file: 51 | type: file 52 | description: BED file containing regions to include 53 | pattern: "*.{bed}" 54 | ontologies: 55 | - edam: "http://edamontology.org/format_3003" 56 | 57 | output: 58 | - bed: 59 | - meta: 60 | type: map 61 | description: | 62 | Groovy Map containing interval information 63 | e.g. `[ id:'sample1' ]` 64 | - "*.bed": 65 | type: file 66 | description: BED file with shuffled intervals 67 | pattern: "*.{bed}" 68 | ontologies: 69 | - edam: "http://edamontology.org/format_3003" 70 | 71 | - versions: 72 | - "versions.yml": 73 | type: file 74 | description: File containing software versions 75 | pattern: "versions.yml" 76 | 77 | authors: 78 | - "@itrujnara" 79 | maintainers: 80 | - "@itrujnara" 81 | -------------------------------------------------------------------------------- /assets/email_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | nf-core/deepmodeloptim Pipeline Report 9 | 10 | 11 |
12 | 13 | 14 | 15 |

nf-core/deepmodeloptim ${version}

16 |

Run Name: $runName

17 | 18 | <% if (!success){ 19 | out << """ 20 |
21 |

nf-core/deepmodeloptim execution completed unsuccessfully!

22 |

The exit status of the task that caused the workflow execution to fail was: $exitStatus.

23 |

The full error message was:

24 |
${errorReport}
25 |
26 | """ 27 | } else { 28 | out << """ 29 |
30 | nf-core/deepmodeloptim execution completed successfully! 31 |
32 | """ 33 | } 34 | %> 35 | 36 |

The workflow was completed at $dateComplete (duration: $duration)

37 |

The command used to launch the workflow was as follows:

38 |
$commandLine
39 | 40 |

Pipeline Configuration:

41 | 42 | 43 | <% out << summary.collect{ k,v -> "" }.join("\n") %> 44 | 45 |
$k
$v
46 | 47 |

nf-core/deepmodeloptim

48 |

https://github.com/nf-core/deepmodeloptim

49 | 50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /assets/adaptivecard.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "message", 3 | "attachments": [ 4 | { 5 | "contentType": "application/vnd.microsoft.card.adaptive", 6 | "contentUrl": null, 7 | "content": { 8 | "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", 9 | "msteams": { 10 | "width": "Full" 11 | }, 12 | "type": "AdaptiveCard", 13 | "version": "1.2", 14 | "body": [ 15 | { 16 | "type": "TextBlock", 17 | "size": "Large", 18 | "weight": "Bolder", 19 | "color": "<% if (success) { %>Good<% } else { %>Attention<%} %>", 20 | "text": "nf-core/deepmodeloptim v${version} - ${runName}", 21 | "wrap": true 22 | }, 23 | { 24 | "type": "TextBlock", 25 | "spacing": "None", 26 | "text": "Completed at ${dateComplete} (duration: ${duration})", 27 | "isSubtle": true, 28 | "wrap": true 29 | }, 30 | { 31 | "type": "TextBlock", 32 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors. The full error message was: ${errorReport}.<% } %>", 33 | "wrap": true 34 | }, 35 | { 36 | "type": "TextBlock", 37 | "text": "The command used to launch the workflow was as follows:", 38 | "wrap": true 39 | }, 40 | { 41 | "type": "TextBlock", 42 | "text": "${commandLine}", 43 | "isSubtle": true, 44 | "wrap": true 45 | } 46 | ], 47 | "actions": [ 48 | { 49 | "type": "Action.ShowCard", 50 | "title": "Pipeline Configuration", 51 | "card": { 52 | "type": "AdaptiveCard", 53 | "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", 54 | "body": [ 55 | { 56 | "type": "FactSet", 57 | "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %> 58 | ] 59 | } 60 | ] 61 | } 62 | } 63 | ] 64 | } 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process CUSTOM_GETCHROMSIZES" 4 | script "../main.nf" 5 | process "CUSTOM_GETCHROMSIZES" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "custom" 10 | tag "custom/getchromsizes" 11 | 12 | test("test_custom_getchromsizes") { 13 | 14 | when { 15 | process { 16 | """ 17 | input[0] = Channel.of([ 18 | [ id:'test' ], // meta map 19 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) 20 | ]) 21 | """ 22 | } 23 | } 24 | 25 | then { 26 | assertAll ( 27 | { assert process.success }, 28 | { assert snapshot(process.out).match() } 29 | ) 30 | } 31 | } 32 | 33 | test("test_custom_getchromsizes_bgzip") { 34 | 35 | when { 36 | process { 37 | """ 38 | input[0] = Channel.of([ 39 | [ id:'test' ], // meta map 40 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) 41 | ]) 42 | """ 43 | } 44 | } 45 | 46 | then { 47 | assertAll ( 48 | { assert process.success }, 49 | { assert snapshot(process.out).match() } 50 | ) 51 | } 52 | } 53 | 54 | test("test_custom_getchromsizes - stub") { 55 | 56 | options "-stub" 57 | 58 | when { 59 | process { 60 | """ 61 | input[0] = Channel.of([ 62 | [ id:'test' ], // meta map 63 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) 64 | ]) 65 | """ 66 | } 67 | } 68 | 69 | then { 70 | assertAll ( 71 | { assert process.success }, 72 | { assert snapshot(process.out).match() } 73 | ) 74 | } 75 | } 76 | 77 | test("test_custom_getchromsizes_bgzip - stub") { 78 | 79 | options "-stub" 80 | 81 | when { 82 | process { 83 | """ 84 | input[0] = Channel.of([ 85 | [ id:'test' ], // meta map 86 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) 87 | ]) 88 | """ 89 | } 90 | } 91 | 92 | then { 93 | assertAll ( 94 | { assert process.success }, 95 | { assert snapshot(process.out).match() } 96 | ) 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | name: nf-core linting 2 | # This workflow is triggered on pushes and PRs to the repository. 3 | # It runs the `nf-core pipelines lint` and markdown lint tests to ensure 4 | # that the code meets the nf-core guidelines. 5 | on: 6 | push: 7 | branches: 8 | - dev 9 | pull_request: 10 | release: 11 | types: [published] 12 | 13 | jobs: 14 | pre-commit: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 18 | 19 | - name: Set up Python 3.12 20 | uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 21 | with: 22 | python-version: "3.12" 23 | 24 | - name: Install pre-commit 25 | run: pip install pre-commit 26 | 27 | - name: Run pre-commit 28 | run: pre-commit run --all-files 29 | 30 | nf-core: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Check out pipeline code 34 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 35 | 36 | - name: Install Nextflow 37 | uses: nf-core/setup-nextflow@v2 38 | 39 | - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 40 | with: 41 | python-version: "3.12" 42 | architecture: "x64" 43 | 44 | - name: read .nf-core.yml 45 | uses: pietrobolcato/action-read-yaml@1.1.0 46 | id: read_yml 47 | with: 48 | config: ${{ github.workspace }}/.nf-core.yml 49 | 50 | - name: Install dependencies 51 | run: | 52 | python -m pip install --upgrade pip 53 | pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} 54 | 55 | - name: Run nf-core pipelines lint 56 | if: ${{ github.base_ref != 'master' }} 57 | env: 58 | GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} 59 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 60 | GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} 61 | run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md 62 | 63 | - name: Run nf-core pipelines lint --release 64 | if: ${{ github.base_ref == 'master' }} 65 | env: 66 | GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} 67 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 68 | GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} 69 | run: nf-core -l lint_log.txt pipelines lint --release --dir ${GITHUB_WORKSPACE} --markdown lint_results.md 70 | 71 | - name: Save PR number 72 | if: ${{ always() }} 73 | run: echo ${{ github.event.pull_request.number }} > PR_number.txt 74 | 75 | - name: Upload linting log file artifact 76 | if: ${{ always() }} 77 | uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 78 | with: 79 | name: linting-logs 80 | path: | 81 | lint_log.txt 82 | lint_results.md 83 | PR_number.txt 84 | -------------------------------------------------------------------------------- /subworkflows/local/transform_csv/main.nf: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | IMPORT NF-CORE MODULES/SUBWORKFLOWS 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | */ 6 | 7 | include { STIMULUS_TRANSFORM_CSV } from '../../../modules/local/stimulus/transform_csv' 8 | include { ENCODE_CSV } from '../../../modules/local/stimulus/encode' 9 | 10 | /* 11 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12 | RUN MAIN SUBWORKFLOW 13 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 | */ 15 | 16 | workflow TRANSFORM_CSV_WF { 17 | 18 | take: 19 | ch_split_data 20 | ch_config_transform 21 | ch_config_encode 22 | 23 | main: 24 | 25 | ch_versions = Channel.empty() 26 | 27 | 28 | // TODO add strategy for handling the launch of stimulus noiser as well as NF-core and other modules 29 | // TODO if the option is parellalization (for the above) then add csv column splitting noising merging 30 | 31 | // ============================================================================== 32 | // Transform data using stimulus 33 | // ============================================================================== 34 | 35 | // combine data vs configs based on common key: split_id 36 | ch_input = ch_split_data 37 | .combine(ch_config_transform, by: []) 38 | .map { meta_data, data, meta_config, config -> 39 | def meta = meta_data + [transform_id: meta_config.transform_id] 40 | [ 41 | data: [meta, data], 42 | config: [meta, config] 43 | ] 44 | } 45 | .multiMap { item -> 46 | data: item.data 47 | config: item.config 48 | } 49 | 50 | // run stimulus transform 51 | STIMULUS_TRANSFORM_CSV( 52 | ch_input.data, 53 | ch_input.config 54 | ) 55 | ch_transformed_data = STIMULUS_TRANSFORM_CSV.out.transformed_data 56 | 57 | ch_encode_input = ch_transformed_data 58 | .combine(ch_config_encode, by: []) 59 | .map { meta_data, data, meta_config, config -> 60 | def meta = meta_data + [encode_id: meta_config.encode_id] 61 | [ 62 | data: [meta, data], 63 | config: [meta, config] 64 | ] 65 | } 66 | .multiMap { item -> 67 | data: item.data 68 | config: item.config 69 | } 70 | 71 | 72 | // run stimulus encode 73 | ENCODE_CSV( 74 | ch_encode_input.data, 75 | ch_encode_input.config 76 | ) 77 | ch_encoded_data = ENCODE_CSV.out.encoded 78 | ch_versions = ch_versions.mix(ENCODE_CSV.out.versions) 79 | 80 | emit: 81 | transformed_data = ch_encoded_data 82 | versions = ch_versions // channel: [ versions.yml ] 83 | } 84 | 85 | 86 | /* 87 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 88 | THE END 89 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 90 | */ 91 | -------------------------------------------------------------------------------- /.github/workflows/awsfulltest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS full size tests 2 | # This workflow is triggered on PRs opened against the main/master branch. 3 | # It can be additionally triggered manually with GitHub actions workflow dispatch button. 4 | # It runs the -profile 'test_full' on AWS batch 5 | 6 | on: 7 | pull_request: 8 | branches: 9 | - main 10 | - master 11 | workflow_dispatch: 12 | pull_request_review: 13 | types: [submitted] 14 | 15 | jobs: 16 | run-platform: 17 | name: Run AWS full tests 18 | # run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered 19 | if: github.repository == 'nf-core/deepmodeloptim' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch' 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Get PR reviews 23 | uses: octokit/request-action@v2.x 24 | if: github.event_name != 'workflow_dispatch' 25 | id: check_approvals 26 | continue-on-error: true 27 | with: 28 | route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | 32 | - name: Check for approvals 33 | if: ${{ failure() && github.event_name != 'workflow_dispatch' }} 34 | run: | 35 | echo "No review approvals found. At least 2 approvals are required to run this action automatically." 36 | exit 1 37 | 38 | - name: Check for enough approvals (>=2) 39 | id: test_variables 40 | if: github.event_name != 'workflow_dispatch' 41 | run: | 42 | JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}' 43 | CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length') 44 | test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required 45 | 46 | - name: Launch workflow via Seqera Platform 47 | uses: seqeralabs/action-tower-launch@v2 48 | # TODO nf-core: You can customise AWS full pipeline tests as required 49 | # Add full size test data (but still relatively small datasets for few samples) 50 | # on the `test_full.config` test runs with only one set of parameters 51 | with: 52 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 53 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 54 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 55 | revision: ${{ github.sha }} 56 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/deepmodeloptim/work-${{ github.sha }} 57 | parameters: | 58 | { 59 | "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", 60 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/deepmodeloptim/results-${{ github.sha }}" 61 | } 62 | profiles: test_full 63 | 64 | - uses: actions/upload-artifact@v4 65 | with: 66 | name: Seqera Platform debug log file 67 | path: | 68 | seqera_platform_action_*.log 69 | seqera_platform_action_*.json 70 | -------------------------------------------------------------------------------- /modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nf-core/deepmodeloptim", 3 | "homePage": "https://github.com/nf-core/deepmodeloptim", 4 | "repos": { 5 | "https://github.com/nf-core/modules.git": { 6 | "modules": { 7 | "nf-core": { 8 | "bedtools/getfasta": { 9 | "branch": "master", 10 | "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", 11 | "installed_by": ["modules"] 12 | }, 13 | "bedtools/shift": { 14 | "branch": "master", 15 | "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", 16 | "installed_by": ["modules"] 17 | }, 18 | "bedtools/shuffle": { 19 | "branch": "master", 20 | "git_sha": "788825f9e429b03b892a1fbe7e8d25cce909a998", 21 | "installed_by": ["modules"] 22 | }, 23 | "bedtools/slop": { 24 | "branch": "master", 25 | "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", 26 | "installed_by": ["modules"] 27 | }, 28 | "bedtools/subtract": { 29 | "branch": "master", 30 | "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", 31 | "installed_by": ["modules"] 32 | }, 33 | "csvtk/concat": { 34 | "branch": "master", 35 | "git_sha": "fa92936611247ca647ddee970f94d83f1bcb0ffe", 36 | "installed_by": ["modules"] 37 | }, 38 | "custom/getchromsizes": { 39 | "branch": "master", 40 | "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", 41 | "installed_by": ["modules"] 42 | }, 43 | "gawk": { 44 | "branch": "master", 45 | "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", 46 | "installed_by": ["modules"] 47 | } 48 | } 49 | }, 50 | "subworkflows": { 51 | "nf-core": { 52 | "utils_nextflow_pipeline": { 53 | "branch": "master", 54 | "git_sha": "c2b22d85f30a706a3073387f30380704fcae013b", 55 | "installed_by": ["subworkflows"] 56 | }, 57 | "utils_nfcore_pipeline": { 58 | "branch": "master", 59 | "git_sha": "51ae5406a030d4da1e49e4dab49756844fdd6c7a", 60 | "installed_by": ["subworkflows"] 61 | }, 62 | "utils_nfschema_plugin": { 63 | "branch": "master", 64 | "git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e", 65 | "installed_by": ["subworkflows"] 66 | } 67 | } 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: nf-core CI 2 | # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | pull_request: 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | env: 13 | NXF_ANSI_LOG: false 14 | NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity 15 | NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity 16 | 17 | concurrency: 18 | group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" 19 | cancel-in-progress: true 20 | 21 | jobs: 22 | test: 23 | name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})" 24 | # Only run on push if this is the nf-core dev branch (merged PRs) 25 | if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/deepmodeloptim') }}" 26 | runs-on: ubuntu-latest 27 | strategy: 28 | matrix: 29 | NXF_VER: 30 | - "24.04.2" 31 | - "latest-everything" 32 | profile: 33 | - "conda" 34 | - "docker" 35 | - "singularity" 36 | test_name: 37 | - "test" 38 | - "test_ibis" 39 | - "test_ibis_with_preprocessing" 40 | - "test_noise_eval" 41 | isMaster: 42 | - ${{ github.base_ref == 'master' }} 43 | # Exclude conda and singularity on dev 44 | exclude: 45 | - isMaster: false 46 | profile: "conda" 47 | - isMaster: false 48 | profile: "singularity" 49 | steps: 50 | - name: Check out pipeline code 51 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 52 | with: 53 | fetch-depth: 0 54 | 55 | - name: Set up Nextflow 56 | uses: nf-core/setup-nextflow@v2 57 | with: 58 | version: "${{ matrix.NXF_VER }}" 59 | 60 | - name: Set up Apptainer 61 | if: matrix.profile == 'singularity' 62 | uses: eWaterCycle/setup-apptainer@main 63 | 64 | - name: Set up Singularity 65 | if: matrix.profile == 'singularity' 66 | run: | 67 | mkdir -p $NXF_SINGULARITY_CACHEDIR 68 | mkdir -p $NXF_SINGULARITY_LIBRARYDIR 69 | 70 | - name: Set up Miniconda 71 | if: matrix.profile == 'conda' 72 | uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3 73 | with: 74 | miniconda-version: "latest" 75 | auto-update-conda: true 76 | conda-solver: libmamba 77 | channels: conda-forge,bioconda 78 | 79 | - name: Set up Conda 80 | if: matrix.profile == 'conda' 81 | run: | 82 | echo $(realpath $CONDA)/condabin >> $GITHUB_PATH 83 | echo $(realpath python) >> $GITHUB_PATH 84 | 85 | - name: Clean up Disk space 86 | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 87 | 88 | - name: "Run of the pipeline ${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }}" 89 | run: | 90 | nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_name }},${{ matrix.profile }} --outdir ./results 91 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Subworkflow UTILS_NFSCHEMA_PLUGIN" 4 | script "../main.nf" 5 | workflow "UTILS_NFSCHEMA_PLUGIN" 6 | 7 | tag "subworkflows" 8 | tag "subworkflows_nfcore" 9 | tag "subworkflows/utils_nfschema_plugin" 10 | tag "plugin/nf-schema" 11 | 12 | config "./nextflow.config" 13 | 14 | test("Should run nothing") { 15 | 16 | when { 17 | 18 | params { 19 | test_data = '' 20 | } 21 | 22 | workflow { 23 | """ 24 | validate_params = false 25 | input[0] = workflow 26 | input[1] = validate_params 27 | input[2] = "" 28 | """ 29 | } 30 | } 31 | 32 | then { 33 | assertAll( 34 | { assert workflow.success } 35 | ) 36 | } 37 | } 38 | 39 | test("Should validate params") { 40 | 41 | when { 42 | 43 | params { 44 | test_data = '' 45 | outdir = null 46 | } 47 | 48 | workflow { 49 | """ 50 | validate_params = true 51 | input[0] = workflow 52 | input[1] = validate_params 53 | input[2] = "" 54 | """ 55 | } 56 | } 57 | 58 | then { 59 | assertAll( 60 | { assert workflow.failed }, 61 | { assert workflow.stdout.any { it.contains('ERROR ~ Validation of pipeline parameters failed!') } } 62 | ) 63 | } 64 | } 65 | 66 | test("Should run nothing - custom schema") { 67 | 68 | when { 69 | 70 | params { 71 | test_data = '' 72 | } 73 | 74 | workflow { 75 | """ 76 | validate_params = false 77 | input[0] = workflow 78 | input[1] = validate_params 79 | input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 80 | """ 81 | } 82 | } 83 | 84 | then { 85 | assertAll( 86 | { assert workflow.success } 87 | ) 88 | } 89 | } 90 | 91 | test("Should validate params - custom schema") { 92 | 93 | when { 94 | 95 | params { 96 | test_data = '' 97 | outdir = null 98 | } 99 | 100 | workflow { 101 | """ 102 | validate_params = true 103 | input[0] = workflow 104 | input[1] = validate_params 105 | input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 106 | """ 107 | } 108 | } 109 | 110 | then { 111 | assertAll( 112 | { assert workflow.failed }, 113 | { assert workflow.stdout.any { it.contains('ERROR ~ Validation of pipeline parameters failed!') } } 114 | ) 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Workflow UTILS_NEXTFLOW_PIPELINE" 4 | script "../main.nf" 5 | config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" 6 | workflow "UTILS_NEXTFLOW_PIPELINE" 7 | tag 'subworkflows' 8 | tag 'utils_nextflow_pipeline' 9 | tag 'subworkflows/utils_nextflow_pipeline' 10 | 11 | test("Should run no inputs") { 12 | 13 | when { 14 | workflow { 15 | """ 16 | print_version = false 17 | dump_parameters = false 18 | outdir = null 19 | check_conda_channels = false 20 | 21 | input[0] = print_version 22 | input[1] = dump_parameters 23 | input[2] = outdir 24 | input[3] = check_conda_channels 25 | """ 26 | } 27 | } 28 | 29 | then { 30 | assertAll( 31 | { assert workflow.success } 32 | ) 33 | } 34 | } 35 | 36 | test("Should print version") { 37 | 38 | when { 39 | workflow { 40 | """ 41 | print_version = true 42 | dump_parameters = false 43 | outdir = null 44 | check_conda_channels = false 45 | 46 | input[0] = print_version 47 | input[1] = dump_parameters 48 | input[2] = outdir 49 | input[3] = check_conda_channels 50 | """ 51 | } 52 | } 53 | 54 | then { 55 | expect { 56 | with(workflow) { 57 | assert success 58 | assert "nextflow_workflow v9.9.9" in stdout 59 | } 60 | } 61 | } 62 | } 63 | 64 | test("Should dump params") { 65 | 66 | when { 67 | workflow { 68 | """ 69 | print_version = false 70 | dump_parameters = true 71 | outdir = 'results' 72 | check_conda_channels = false 73 | 74 | input[0] = false 75 | input[1] = true 76 | input[2] = outdir 77 | input[3] = false 78 | """ 79 | } 80 | } 81 | 82 | then { 83 | assertAll( 84 | { assert workflow.success } 85 | ) 86 | } 87 | } 88 | 89 | test("Should not create params JSON if no output directory") { 90 | 91 | when { 92 | workflow { 93 | """ 94 | print_version = false 95 | dump_parameters = true 96 | outdir = null 97 | check_conda_channels = false 98 | 99 | input[0] = false 100 | input[1] = true 101 | input[2] = outdir 102 | input[3] = false 103 | """ 104 | } 105 | } 106 | 107 | then { 108 | assertAll( 109 | { assert workflow.success } 110 | ) 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /subworkflows/local/tune/main.nf: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | IMPORT NF-CORE MODULES/SUBWORKFLOWS 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | */ 6 | 7 | include { STIMULUS_TUNE } from '../../../modules/local/stimulus/tune' 8 | include { CUSTOM_MODIFY_MODEL_CONFIG } from '../../../modules/local/custom/modify_model_config' 9 | 10 | /* 11 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12 | RUN MAIN SUBWORKFLOW 13 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 | */ 15 | 16 | workflow TUNE_WF { 17 | take: 18 | ch_transformed_data 19 | ch_model 20 | ch_model_config 21 | ch_initial_weights 22 | tune_trials_range 23 | tune_replicates 24 | 25 | main: 26 | 27 | // Split the tune_trials_range into individual trials 28 | ch_versions = Channel.empty() 29 | 30 | 31 | // Modify the model config file to include the number of trials 32 | // This allows us to run multiple trials numbers with the same model 33 | CUSTOM_MODIFY_MODEL_CONFIG( 34 | ch_model_config.collect(), 35 | tune_trials_range 36 | ) 37 | ch_versions = ch_versions.mix(CUSTOM_MODIFY_MODEL_CONFIG.out.versions) 38 | ch_model_config = CUSTOM_MODIFY_MODEL_CONFIG.out.config 39 | 40 | // ch_input = ch_split_data 41 | // .combine(ch_config_transform, by: []) 42 | // .map { meta_data, data, meta_config, config -> 43 | // def meta = meta_data + [transform_id: meta_config.transform_id] 44 | // [ 45 | // data: [meta, data], 46 | // config: [meta, config] 47 | // ] 48 | // } 49 | // .multiMap { item -> 50 | // data: item.data 51 | // config: item.config 52 | // } 53 | 54 | // ch_transformed_data.view() 55 | ch_tune_input = ch_transformed_data 56 | .combine(ch_model.map{it[1]}) 57 | .combine(ch_model_config) 58 | .combine(ch_initial_weights) // when initial_weights is empty .map{it[1]} will return [], and not properly combined 59 | .combine(tune_replicates) 60 | .multiMap { meta, data, model, meta_model_config, model_config, meta_weights, initial_weights, n_replicate -> 61 | def meta_new = meta + [replicate: n_replicate] + [n_trials: meta_model_config.n_trials] 62 | data: 63 | [meta_new, data] 64 | model: 65 | [meta_new, model, model_config, initial_weights] 66 | } 67 | // run stimulus tune 68 | STIMULUS_TUNE( 69 | ch_tune_input.data, 70 | ch_tune_input.model 71 | ) 72 | 73 | ch_versions = ch_versions.mix(STIMULUS_TUNE.out.versions) 74 | 75 | // parse output for evaluation block 76 | 77 | emit: 78 | best_model = STIMULUS_TUNE.out.model 79 | optimizer = STIMULUS_TUNE.out.optimizer 80 | tune_experiments = STIMULUS_TUNE.out.artifacts 81 | journal = STIMULUS_TUNE.out.journal 82 | versions = ch_versions // channel: [ versions.yml ] 83 | // these are temporaly needed for predict, it will be changed in the future! 84 | model_tmp = STIMULUS_TUNE.out.model_tmp 85 | } 86 | 87 | /* 88 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | THE END 90 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | */ 92 | -------------------------------------------------------------------------------- /.github/workflows/fix-linting.yml: -------------------------------------------------------------------------------- 1 | name: Fix linting from a comment 2 | on: 3 | issue_comment: 4 | types: [created] 5 | 6 | jobs: 7 | fix-linting: 8 | # Only run if comment is on a PR with the main repo, and if it contains the magic keywords 9 | if: > 10 | contains(github.event.comment.html_url, '/pull/') && 11 | contains(github.event.comment.body, '@nf-core-bot fix linting') && 12 | github.repository == 'nf-core/deepmodeloptim' 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Use the @nf-core-bot token to check out so we can push later 16 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 17 | with: 18 | token: ${{ secrets.nf_core_bot_auth_token }} 19 | 20 | # indication that the linting is being fixed 21 | - name: React on comment 22 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 23 | with: 24 | comment-id: ${{ github.event.comment.id }} 25 | reactions: eyes 26 | 27 | # Action runs on the issue comment, so we don't get the PR by default 28 | # Use the gh cli to check out the PR 29 | - name: Checkout Pull Request 30 | run: gh pr checkout ${{ github.event.issue.number }} 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} 33 | 34 | # Install and run pre-commit 35 | - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 36 | with: 37 | python-version: "3.12" 38 | 39 | - name: Install pre-commit 40 | run: pip install pre-commit 41 | 42 | - name: Run pre-commit 43 | id: pre-commit 44 | run: pre-commit run --all-files 45 | continue-on-error: true 46 | 47 | # indication that the linting has finished 48 | - name: react if linting finished succesfully 49 | if: steps.pre-commit.outcome == 'success' 50 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 51 | with: 52 | comment-id: ${{ github.event.comment.id }} 53 | reactions: "+1" 54 | 55 | - name: Commit & push changes 56 | id: commit-and-push 57 | if: steps.pre-commit.outcome == 'failure' 58 | run: | 59 | git config user.email "core@nf-co.re" 60 | git config user.name "nf-core-bot" 61 | git config push.default upstream 62 | git add . 63 | git status 64 | git commit -m "[automated] Fix code linting" 65 | git push 66 | 67 | - name: react if linting errors were fixed 68 | id: react-if-fixed 69 | if: steps.commit-and-push.outcome == 'success' 70 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 71 | with: 72 | comment-id: ${{ github.event.comment.id }} 73 | reactions: hooray 74 | 75 | - name: react if linting errors were not fixed 76 | if: steps.commit-and-push.outcome == 'failure' 77 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 78 | with: 79 | comment-id: ${{ github.event.comment.id }} 80 | reactions: confused 81 | 82 | - name: react if linting errors were not fixed 83 | if: steps.commit-and-push.outcome == 'failure' 84 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 85 | with: 86 | issue-number: ${{ github.event.issue.number }} 87 | body: | 88 | @${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually. 89 | See [CI log](https://github.com/nf-core/deepmodeloptim/actions/runs/${{ github.run_id }}) for more details. 90 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_function { 3 | 4 | name "Test Functions" 5 | script "../main.nf" 6 | config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" 7 | tag "subworkflows" 8 | tag "subworkflows_nfcore" 9 | tag "utils_nfcore_pipeline" 10 | tag "subworkflows/utils_nfcore_pipeline" 11 | 12 | test("Test Function checkConfigProvided") { 13 | 14 | function "checkConfigProvided" 15 | 16 | then { 17 | assertAll( 18 | { assert function.success }, 19 | { assert snapshot(function.result).match() } 20 | ) 21 | } 22 | } 23 | 24 | test("Test Function checkProfileProvided") { 25 | 26 | function "checkProfileProvided" 27 | 28 | when { 29 | function { 30 | """ 31 | input[0] = [] 32 | """ 33 | } 34 | } 35 | 36 | then { 37 | assertAll( 38 | { assert function.success }, 39 | { assert snapshot(function.result).match() } 40 | ) 41 | } 42 | } 43 | 44 | test("Test Function without logColours") { 45 | 46 | function "logColours" 47 | 48 | when { 49 | function { 50 | """ 51 | input[0] = true 52 | """ 53 | } 54 | } 55 | 56 | then { 57 | assertAll( 58 | { assert function.success }, 59 | { assert snapshot(function.result).match() } 60 | ) 61 | } 62 | } 63 | 64 | test("Test Function with logColours") { 65 | function "logColours" 66 | 67 | when { 68 | function { 69 | """ 70 | input[0] = false 71 | """ 72 | } 73 | } 74 | 75 | then { 76 | assertAll( 77 | { assert function.success }, 78 | { assert snapshot(function.result).match() } 79 | ) 80 | } 81 | } 82 | 83 | test("Test Function getSingleReport with a single file") { 84 | function "getSingleReport" 85 | 86 | when { 87 | function { 88 | """ 89 | input[0] = file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true) 90 | """ 91 | } 92 | } 93 | 94 | then { 95 | assertAll( 96 | { assert function.success }, 97 | { assert function.result.contains("test.tsv") } 98 | ) 99 | } 100 | } 101 | 102 | test("Test Function getSingleReport with multiple files") { 103 | function "getSingleReport" 104 | 105 | when { 106 | function { 107 | """ 108 | input[0] = [ 109 | file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true), 110 | file(params.modules_testdata_base_path + '/generic/tsv/network.tsv', checkIfExists: true), 111 | file(params.modules_testdata_base_path + '/generic/tsv/expression.tsv', checkIfExists: true) 112 | ] 113 | """ 114 | } 115 | } 116 | 117 | then { 118 | assertAll( 119 | { assert function.success }, 120 | { assert function.result.contains("test.tsv") }, 121 | { assert !function.result.contains("network.tsv") }, 122 | { assert !function.result.contains("expression.tsv") } 123 | ) 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /subworkflows/local/evaluation/main.nf: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | IMPORT NF-CORE MODULES/SUBWORKFLOWS 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | */ 6 | 7 | include { STIMULUS_PREDICT } from '../../../modules/local/stimulus/predict' 8 | include { STIMULUS_COMPARE_TENSORS as STIMULUS_COMPARE_TENSORS_COSINE } from '../../../modules/local/stimulus/compare_tensors' 9 | include { CSVTK_CONCAT as CONCAT_COSINE } from '../../../modules/nf-core/csvtk/concat/main.nf' 10 | 11 | /* 12 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13 | RUN MAIN SUBWORKFLOW 14 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | */ 16 | 17 | 18 | workflow EVALUATION_WF { 19 | take: 20 | model 21 | ch_data 22 | 23 | main: 24 | 25 | ch_versions = Channel.empty() 26 | 27 | // 28 | // Evaluation mode 1: Predict the data using the best model 29 | // and then compare the predictions of 2 different models 30 | // 31 | STIMULUS_PREDICT( 32 | model, 33 | ch_data.first() // converts a queue channel to a value channel 34 | ) 35 | ch_versions = ch_versions.mix(STIMULUS_PREDICT.out.versions) 36 | predictions = STIMULUS_PREDICT.out.predictions 37 | 38 | // Now we can estimate the noise across replicates 39 | // This means: given a fixed initial model, initial data, and initial weights 40 | // and the same number of trials, we can estimate the noise across replicates 41 | // This is done by comparing the predictions of the alternative models between each other 42 | // and then calculatin a summary metric over them (e.g. mean, median, std, etc.) 43 | pairs = predictions 44 | .collate(2) 45 | .collect() 46 | .map { items -> 47 | def pairs = [] 48 | // Create all unique combinations using index comparison 49 | (0.. 50 | (i+1.. 51 | def meta1 = items[i][0] 52 | def meta2 = items[j][0] 53 | def files = [items[i][1], items[j][1]] 54 | // Only compare different transforms OR different replicates 55 | if(meta1.transform_id != meta2.transform_id || meta1.replicate != meta2.replicate) { 56 | pairs << [ 57 | [ 58 | "id1": meta1.id, 59 | "id2": meta2.id, 60 | "split_id1": meta1.split_id, 61 | "split_id2": meta2.split_id, 62 | "transform_id1": meta1.transform_id, 63 | "transform_id2": meta2.transform_id, 64 | "replicate1": meta1.replicate, 65 | "replicate2": meta2.replicate 66 | ], 67 | // Create unique filenames using both transforms and replicates 68 | files 69 | ] 70 | } 71 | } 72 | } 73 | pairs 74 | } 75 | .flatMap { it } 76 | 77 | STIMULUS_COMPARE_TENSORS_COSINE( 78 | pairs 79 | ) 80 | 81 | cosine_scores = STIMULUS_COMPARE_TENSORS_COSINE.out.csv 82 | 83 | cosine_scores 84 | .map { 85 | meta, csv -> csv 86 | } 87 | .collect() 88 | .map { 89 | csv -> 90 | [ [ id:"summary_cosine" ], csv ] 91 | } 92 | .set { ch_cosine_summary } 93 | CONCAT_COSINE (ch_cosine_summary, "csv", "csv") 94 | 95 | emit: 96 | versions = ch_versions // channel: [ versions.yml ] 97 | 98 | } 99 | -------------------------------------------------------------------------------- /main.nf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nextflow 2 | /* 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | nf-core/deepmodeloptim 5 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 | Github : https://github.com/nf-core/deepmodeloptim 7 | Website: https://nf-co.re/deepmodeloptim 8 | Slack : https://nfcore.slack.com/channels/deepmodeloptim 9 | ---------------------------------------------------------------------------------------- 10 | */ 11 | 12 | /* 13 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 | RUN ALL WORKFLOWS 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | */ 17 | 18 | include { DEEPMODELOPTIM } from './workflows/deepmodeloptim' 19 | include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_deepmodeloptim_pipeline' 20 | include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_deepmodeloptim_pipeline' 21 | 22 | /* 23 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | NAMED WORKFLOWS FOR PIPELINE 25 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | */ 27 | 28 | // 29 | // WORKFLOW: Run main analysis pipeline depending on type of input 30 | // 31 | workflow NFCORE_DEEPMODELOPTIM { 32 | 33 | take: 34 | data 35 | data_config 36 | model 37 | model_config 38 | initial_weights 39 | preprocessing_config 40 | genome 41 | tune_trials_range 42 | tune_replicates 43 | prediction_data 44 | 45 | main: 46 | 47 | // 48 | // WORKFLOW: Run pipeline 49 | // 50 | DEEPMODELOPTIM ( 51 | data, 52 | data_config, 53 | model, 54 | model_config, 55 | initial_weights, 56 | preprocessing_config, 57 | genome, 58 | tune_trials_range, 59 | tune_replicates, 60 | prediction_data 61 | ) 62 | } 63 | 64 | /* 65 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | RUN MAIN WORKFLOW 67 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | */ 69 | 70 | workflow { 71 | 72 | main: 73 | // 74 | // SUBWORKFLOW: Run initialisation tasks 75 | // 76 | PIPELINE_INITIALISATION ( 77 | params.version, 78 | params.validate_params, 79 | params.monochrome_logs, 80 | args, 81 | params.outdir, 82 | // and the input files 83 | params.data, 84 | params.data_config, 85 | params.model, 86 | params.model_config, 87 | params.initial_weights, 88 | params.preprocessing_config 89 | ) 90 | 91 | // 92 | // WORKFLOW: Run main workflow 93 | // 94 | NFCORE_DEEPMODELOPTIM ( 95 | PIPELINE_INITIALISATION.out.data, 96 | PIPELINE_INITIALISATION.out.data_config, 97 | PIPELINE_INITIALISATION.out.model, 98 | PIPELINE_INITIALISATION.out.model_config, 99 | PIPELINE_INITIALISATION.out.initial_weights, 100 | PIPELINE_INITIALISATION.out.preprocessing_config, 101 | PIPELINE_INITIALISATION.out.genome, 102 | PIPELINE_INITIALISATION.out.tune_trials_range, 103 | PIPELINE_INITIALISATION.out.tune_replicates, 104 | PIPELINE_INITIALISATION.out.prediction_data 105 | ) 106 | 107 | // 108 | // SUBWORKFLOW: Run completion tasks 109 | // 110 | PIPELINE_COMPLETION ( 111 | params.email, 112 | params.email_on_fail, 113 | params.plaintext_email, 114 | params.outdir, 115 | params.monochrome_logs, 116 | params.hook_url 117 | ) 118 | } 119 | 120 | /* 121 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | THE END 123 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124 | */ 125 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Subworkflow with functionality that may be useful for any Nextflow pipeline 3 | // 4 | 5 | /* 6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 | SUBWORKFLOW DEFINITION 8 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9 | */ 10 | 11 | workflow UTILS_NEXTFLOW_PIPELINE { 12 | take: 13 | print_version // boolean: print version 14 | dump_parameters // boolean: dump parameters 15 | outdir // path: base directory used to publish pipeline results 16 | check_conda_channels // boolean: check conda channels 17 | 18 | main: 19 | 20 | // 21 | // Print workflow version and exit on --version 22 | // 23 | if (print_version) { 24 | log.info("${workflow.manifest.name} ${getWorkflowVersion()}") 25 | System.exit(0) 26 | } 27 | 28 | // 29 | // Dump pipeline parameters to a JSON file 30 | // 31 | if (dump_parameters && outdir) { 32 | dumpParametersToJSON(outdir) 33 | } 34 | 35 | // 36 | // When running with Conda, warn if channels have not been set-up appropriately 37 | // 38 | if (check_conda_channels) { 39 | checkCondaChannels() 40 | } 41 | 42 | emit: 43 | dummy_emit = true 44 | } 45 | 46 | /* 47 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | FUNCTIONS 49 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 50 | */ 51 | 52 | // 53 | // Generate version string 54 | // 55 | def getWorkflowVersion() { 56 | def version_string = "" as String 57 | if (workflow.manifest.version) { 58 | def prefix_v = workflow.manifest.version[0] != 'v' ? 'v' : '' 59 | version_string += "${prefix_v}${workflow.manifest.version}" 60 | } 61 | 62 | if (workflow.commitId) { 63 | def git_shortsha = workflow.commitId.substring(0, 7) 64 | version_string += "-g${git_shortsha}" 65 | } 66 | 67 | return version_string 68 | } 69 | 70 | // 71 | // Dump pipeline parameters to a JSON file 72 | // 73 | def dumpParametersToJSON(outdir) { 74 | def timestamp = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss') 75 | def filename = "params_${timestamp}.json" 76 | def temp_pf = new File(workflow.launchDir.toString(), ".${filename}") 77 | def jsonStr = groovy.json.JsonOutput.toJson(params) 78 | temp_pf.text = groovy.json.JsonOutput.prettyPrint(jsonStr) 79 | 80 | nextflow.extension.FilesEx.copyTo(temp_pf.toPath(), "${outdir}/pipeline_info/params_${timestamp}.json") 81 | temp_pf.delete() 82 | } 83 | 84 | // 85 | // When running with -profile conda, warn if channels have not been set-up appropriately 86 | // 87 | def checkCondaChannels() { 88 | def parser = new org.yaml.snakeyaml.Yaml() 89 | def channels = [] 90 | try { 91 | def config = parser.load("conda config --show channels".execute().text) 92 | channels = config.channels 93 | } 94 | catch (NullPointerException e) { 95 | log.debug(e) 96 | log.warn("Could not verify conda channel configuration.") 97 | return null 98 | } 99 | catch (IOException e) { 100 | log.debug(e) 101 | log.warn("Could not verify conda channel configuration.") 102 | return null 103 | } 104 | 105 | // Check that all channels are present 106 | // This channel list is ordered by required channel priority. 107 | def required_channels_in_order = ['conda-forge', 'bioconda'] 108 | def channels_missing = ((required_channels_in_order as Set) - (channels as Set)) as Boolean 109 | 110 | // Check that they are in the right order 111 | def channel_priority_violation = required_channels_in_order != channels.findAll { ch -> ch in required_channels_in_order } 112 | 113 | if (channels_missing | channel_priority_violation) { 114 | log.warn """\ 115 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116 | There is a problem with your Conda configuration! 117 | You will need to set-up the conda-forge and bioconda channels correctly. 118 | Please refer to https://bioconda.github.io/ 119 | The observed channel order is 120 | ${channels} 121 | but the following channel order is required: 122 | ${required_channels_in_order} 123 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 124 | """.stripIndent(true) 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Test Function checkProfileProvided": { 3 | "content": null, 4 | "meta": { 5 | "nf-test": "0.8.4", 6 | "nextflow": "23.10.1" 7 | }, 8 | "timestamp": "2024-02-28T12:03:03.360873" 9 | }, 10 | "Test Function checkConfigProvided": { 11 | "content": [ 12 | true 13 | ], 14 | "meta": { 15 | "nf-test": "0.8.4", 16 | "nextflow": "23.10.1" 17 | }, 18 | "timestamp": "2024-02-28T12:02:59.729647" 19 | }, 20 | "Test Function without logColours": { 21 | "content": [ 22 | { 23 | "reset": "", 24 | "bold": "", 25 | "dim": "", 26 | "underlined": "", 27 | "blink": "", 28 | "reverse": "", 29 | "hidden": "", 30 | "black": "", 31 | "red": "", 32 | "green": "", 33 | "yellow": "", 34 | "blue": "", 35 | "purple": "", 36 | "cyan": "", 37 | "white": "", 38 | "bblack": "", 39 | "bred": "", 40 | "bgreen": "", 41 | "byellow": "", 42 | "bblue": "", 43 | "bpurple": "", 44 | "bcyan": "", 45 | "bwhite": "", 46 | "ublack": "", 47 | "ured": "", 48 | "ugreen": "", 49 | "uyellow": "", 50 | "ublue": "", 51 | "upurple": "", 52 | "ucyan": "", 53 | "uwhite": "", 54 | "iblack": "", 55 | "ired": "", 56 | "igreen": "", 57 | "iyellow": "", 58 | "iblue": "", 59 | "ipurple": "", 60 | "icyan": "", 61 | "iwhite": "", 62 | "biblack": "", 63 | "bired": "", 64 | "bigreen": "", 65 | "biyellow": "", 66 | "biblue": "", 67 | "bipurple": "", 68 | "bicyan": "", 69 | "biwhite": "" 70 | } 71 | ], 72 | "meta": { 73 | "nf-test": "0.8.4", 74 | "nextflow": "23.10.1" 75 | }, 76 | "timestamp": "2024-02-28T12:03:17.969323" 77 | }, 78 | "Test Function with logColours": { 79 | "content": [ 80 | { 81 | "reset": "\u001b[0m", 82 | "bold": "\u001b[1m", 83 | "dim": "\u001b[2m", 84 | "underlined": "\u001b[4m", 85 | "blink": "\u001b[5m", 86 | "reverse": "\u001b[7m", 87 | "hidden": "\u001b[8m", 88 | "black": "\u001b[0;30m", 89 | "red": "\u001b[0;31m", 90 | "green": "\u001b[0;32m", 91 | "yellow": "\u001b[0;33m", 92 | "blue": "\u001b[0;34m", 93 | "purple": "\u001b[0;35m", 94 | "cyan": "\u001b[0;36m", 95 | "white": "\u001b[0;37m", 96 | "bblack": "\u001b[1;30m", 97 | "bred": "\u001b[1;31m", 98 | "bgreen": "\u001b[1;32m", 99 | "byellow": "\u001b[1;33m", 100 | "bblue": "\u001b[1;34m", 101 | "bpurple": "\u001b[1;35m", 102 | "bcyan": "\u001b[1;36m", 103 | "bwhite": "\u001b[1;37m", 104 | "ublack": "\u001b[4;30m", 105 | "ured": "\u001b[4;31m", 106 | "ugreen": "\u001b[4;32m", 107 | "uyellow": "\u001b[4;33m", 108 | "ublue": "\u001b[4;34m", 109 | "upurple": "\u001b[4;35m", 110 | "ucyan": "\u001b[4;36m", 111 | "uwhite": "\u001b[4;37m", 112 | "iblack": "\u001b[0;90m", 113 | "ired": "\u001b[0;91m", 114 | "igreen": "\u001b[0;92m", 115 | "iyellow": "\u001b[0;93m", 116 | "iblue": "\u001b[0;94m", 117 | "ipurple": "\u001b[0;95m", 118 | "icyan": "\u001b[0;96m", 119 | "iwhite": "\u001b[0;97m", 120 | "biblack": "\u001b[1;90m", 121 | "bired": "\u001b[1;91m", 122 | "bigreen": "\u001b[1;92m", 123 | "biyellow": "\u001b[1;93m", 124 | "biblue": "\u001b[1;94m", 125 | "bipurple": "\u001b[1;95m", 126 | "bicyan": "\u001b[1;96m", 127 | "biwhite": "\u001b[1;97m" 128 | } 129 | ], 130 | "meta": { 131 | "nf-test": "0.8.4", 132 | "nextflow": "23.10.1" 133 | }, 134 | "timestamp": "2024-02-28T12:03:21.714424" 135 | } 136 | } -------------------------------------------------------------------------------- /modules/nf-core/gawk/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Compress after processing": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | "test.txt.gz:md5,87a15eb9c2ff20ccd5cd8735a28708f7" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 15 | ], 16 | "output": [ 17 | [ 18 | { 19 | "id": "test" 20 | }, 21 | "test.txt.gz:md5,87a15eb9c2ff20ccd5cd8735a28708f7" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.9.2", 31 | "nextflow": "24.10.1" 32 | }, 33 | "timestamp": "2024-11-27T17:11:20.054143406" 34 | }, 35 | "Convert fasta to bed": { 36 | "content": [ 37 | { 38 | "0": [ 39 | [ 40 | { 41 | "id": "test" 42 | }, 43 | "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" 44 | ] 45 | ], 46 | "1": [ 47 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 48 | ], 49 | "output": [ 50 | [ 51 | { 52 | "id": "test" 53 | }, 54 | "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" 55 | ] 56 | ], 57 | "versions": [ 58 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 59 | ] 60 | } 61 | ], 62 | "meta": { 63 | "nf-test": "0.8.4", 64 | "nextflow": "24.04.4" 65 | }, 66 | "timestamp": "2024-10-19T13:14:02.347809811" 67 | }, 68 | "Convert fasta to bed with program file": { 69 | "content": [ 70 | { 71 | "0": [ 72 | [ 73 | { 74 | "id": "test" 75 | }, 76 | "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" 77 | ] 78 | ], 79 | "1": [ 80 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 81 | ], 82 | "output": [ 83 | [ 84 | { 85 | "id": "test" 86 | }, 87 | "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" 88 | ] 89 | ], 90 | "versions": [ 91 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 92 | ] 93 | } 94 | ], 95 | "meta": { 96 | "nf-test": "0.8.4", 97 | "nextflow": "24.04.4" 98 | }, 99 | "timestamp": "2024-10-19T13:14:11.894616209" 100 | }, 101 | "Extract first column from multiple files": { 102 | "content": [ 103 | { 104 | "0": [ 105 | [ 106 | { 107 | "id": "test" 108 | }, 109 | "test.bed:md5,566c51674bd643227bb2d83e0963376d" 110 | ] 111 | ], 112 | "1": [ 113 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 114 | ], 115 | "output": [ 116 | [ 117 | { 118 | "id": "test" 119 | }, 120 | "test.bed:md5,566c51674bd643227bb2d83e0963376d" 121 | ] 122 | ], 123 | "versions": [ 124 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 125 | ] 126 | } 127 | ], 128 | "meta": { 129 | "nf-test": "0.8.4", 130 | "nextflow": "24.04.4" 131 | }, 132 | "timestamp": "2024-10-19T22:04:47.729300129" 133 | }, 134 | "Unzip files before processing": { 135 | "content": [ 136 | { 137 | "0": [ 138 | [ 139 | { 140 | "id": "test" 141 | }, 142 | "test.bed:md5,1e31ebd4a060aab5433bbbd9ab24e403" 143 | ] 144 | ], 145 | "1": [ 146 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 147 | ], 148 | "output": [ 149 | [ 150 | { 151 | "id": "test" 152 | }, 153 | "test.bed:md5,1e31ebd4a060aab5433bbbd9ab24e403" 154 | ] 155 | ], 156 | "versions": [ 157 | "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" 158 | ] 159 | } 160 | ], 161 | "meta": { 162 | "nf-test": "0.8.4", 163 | "nextflow": "24.04.4" 164 | }, 165 | "timestamp": "2024-10-19T22:08:19.533527657" 166 | } 167 | } -------------------------------------------------------------------------------- /modules/nf-core/gawk/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process GAWK" 4 | script "../main.nf" 5 | process "GAWK" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "gawk" 10 | 11 | config "./nextflow.config" 12 | 13 | test("Convert fasta to bed") { 14 | when { 15 | params { 16 | gawk_suffix = "bed" 17 | gawk_args2 = '\'BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}\'' 18 | } 19 | process { 20 | """ 21 | input[0] = [ 22 | [ id:'test' ], // meta map 23 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) 24 | ] 25 | input[1] = [] 26 | """ 27 | } 28 | } 29 | 30 | then { 31 | assertAll( 32 | { assert process.success }, 33 | { assert snapshot(process.out).match() } 34 | ) 35 | } 36 | } 37 | 38 | test("Convert fasta to bed with program file") { 39 | when { 40 | params { 41 | gawk_suffix = "bed" 42 | gawk_args2 = "" 43 | } 44 | process { 45 | """ 46 | input[0] = [ 47 | [ id:'test' ], // meta map 48 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) 49 | ] 50 | input[1] = Channel.of('BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}').collectFile(name:"program.txt") 51 | """ 52 | } 53 | } 54 | 55 | then { 56 | assertAll( 57 | { assert process.success }, 58 | { assert snapshot(process.out).match() } 59 | ) 60 | } 61 | } 62 | 63 | test("Extract first column from multiple files") { 64 | when { 65 | params { 66 | gawk_suffix = "bed" 67 | gawk_args2 = "" 68 | } 69 | process { 70 | """ 71 | input[0] = [ 72 | [ id:'test' ], // meta map 73 | [file(params.modules_testdata_base_path + 'generic/txt/hello.txt', checkIfExists: true), 74 | file(params.modules_testdata_base_path + 'generic/txt/species_names.txt', checkIfExists: true)] 75 | ] 76 | input[1] = Channel.of('BEGIN {FS=" "}; {print \$1}').collectFile(name:"program.txt") 77 | """ 78 | } 79 | } 80 | 81 | then { 82 | assertAll( 83 | { assert process.success }, 84 | { assert snapshot(process.out).match() } 85 | ) 86 | } 87 | } 88 | 89 | test("Unzip files before processing") { 90 | when { 91 | params { 92 | gawk_suffix = "bed" 93 | gawk_args2 = "" 94 | } 95 | process { 96 | """ 97 | input[0] = [ 98 | [ id:'test' ], // meta map 99 | [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA12878_chrM.vcf.gz', checkIfExists: true), 100 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz', checkIfExists: true)] 101 | ] 102 | input[1] = Channel.of('/^#CHROM/ { print \$1, \$10 }').collectFile(name:"column_header.txt") 103 | """ 104 | } 105 | } 106 | 107 | then { 108 | assertAll( 109 | { assert process.success }, 110 | { assert snapshot(process.out).match() } 111 | ) 112 | } 113 | } 114 | 115 | test("Compress after processing") { 116 | when { 117 | params { 118 | gawk_suffix = "txt.gz" 119 | gawk_args2 = '\'BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}\'' 120 | } 121 | process { 122 | """ 123 | input[0] = [ 124 | [ id:'test' ], // meta map 125 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) 126 | ] 127 | input[1] = [] 128 | """ 129 | } 130 | } 131 | 132 | then { 133 | assertAll( 134 | { assert process.success }, 135 | { assert snapshot(process.out).match() } 136 | ) 137 | } 138 | } 139 | 140 | test("Input and output files are similar") { 141 | when { 142 | params { 143 | gawk_suffix = "txt" 144 | gawk_args2 = "" 145 | } 146 | process { 147 | """ 148 | input[0] = [ 149 | [ id:'hello' ], // meta map 150 | [file(params.modules_testdata_base_path + 'generic/txt/hello.txt', checkIfExists: true), 151 | file(params.modules_testdata_base_path + 'generic/txt/species_names.txt', checkIfExists: true)] 152 | ] 153 | input[1] = Channel.of('BEGIN {FS=" "}; {print \$1}').collectFile(name:"program.txt") 154 | """ 155 | } 156 | } 157 | 158 | then { 159 | assertAll( 160 | { assert process.failed }, 161 | { assert process.errorReport.contains("Input and output names are the same, set prefix in module configuration to disambiguate!") } 162 | ) 163 | } 164 | } 165 | } -------------------------------------------------------------------------------- /.github/workflows/download_pipeline.yml: -------------------------------------------------------------------------------- 1 | name: Test successful pipeline download with 'nf-core pipelines download' 2 | 3 | # Run the workflow when: 4 | # - dispatched manually 5 | # - when a PR is opened or reopened to main/master branch 6 | # - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | testbranch: 11 | description: "The specific branch you wish to utilize for the test execution of nf-core pipelines download." 12 | required: true 13 | default: "dev" 14 | pull_request: 15 | types: 16 | - opened 17 | - edited 18 | - synchronize 19 | branches: 20 | - main 21 | - master 22 | pull_request_target: 23 | branches: 24 | - main 25 | - master 26 | 27 | env: 28 | NXF_ANSI_LOG: false 29 | 30 | jobs: 31 | configure: 32 | runs-on: ubuntu-latest 33 | outputs: 34 | REPO_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPO_LOWERCASE }} 35 | REPOTITLE_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPOTITLE_LOWERCASE }} 36 | REPO_BRANCH: ${{ steps.get_repo_properties.outputs.REPO_BRANCH }} 37 | steps: 38 | - name: Get the repository name and current branch 39 | id: get_repo_properties 40 | run: | 41 | echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" 42 | echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT" 43 | echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT" 44 | 45 | download: 46 | runs-on: ubuntu-latest 47 | needs: configure 48 | steps: 49 | - name: Install Nextflow 50 | uses: nf-core/setup-nextflow@v2 51 | 52 | - name: Disk space cleanup 53 | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 54 | 55 | - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 56 | with: 57 | python-version: "3.12" 58 | architecture: "x64" 59 | 60 | - name: Setup Apptainer 61 | uses: eWaterCycle/setup-apptainer@4bb22c52d4f63406c49e94c804632975787312b3 # v2.0.0 62 | with: 63 | apptainer-version: 1.3.4 64 | 65 | - name: Install dependencies 66 | run: | 67 | python -m pip install --upgrade pip 68 | pip install git+https://github.com/nf-core/tools.git@dev 69 | 70 | - name: Make a cache directory for the container images 71 | run: | 72 | mkdir -p ./singularity_container_images 73 | 74 | - name: Download the pipeline 75 | env: 76 | NXF_SINGULARITY_CACHEDIR: ./singularity_container_images 77 | run: | 78 | nf-core pipelines download ${{ needs.configure.outputs.REPO_LOWERCASE }} \ 79 | --revision ${{ needs.configure.outputs.REPO_BRANCH }} \ 80 | --outdir ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} \ 81 | --compress "none" \ 82 | --container-system 'singularity' \ 83 | --container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io/library/" \ 84 | --container-cache-utilisation 'amend' \ 85 | --download-configuration 'yes' 86 | 87 | - name: Inspect download 88 | run: tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} 89 | 90 | - name: Inspect container images 91 | run: tree ./singularity_container_images | tee ./container_initial 92 | 93 | - name: Count the downloaded number of container images 94 | id: count_initial 95 | run: | 96 | image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) 97 | echo "Initial container image count: $image_count" 98 | echo "IMAGE_COUNT_INITIAL=$image_count" >> "$GITHUB_OUTPUT" 99 | 100 | - name: Run the downloaded pipeline (stub) 101 | id: stub_run_pipeline 102 | continue-on-error: true 103 | env: 104 | NXF_SINGULARITY_CACHEDIR: ./singularity_container_images 105 | NXF_SINGULARITY_HOME_MOUNT: true 106 | run: nextflow run ./${{needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results 107 | - name: Run the downloaded pipeline (stub run not supported) 108 | id: run_pipeline 109 | if: ${{ steps.stub_run_pipeline.outcome == 'failure' }} 110 | env: 111 | NXF_SINGULARITY_CACHEDIR: ./singularity_container_images 112 | NXF_SINGULARITY_HOME_MOUNT: true 113 | run: nextflow run ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -profile test,singularity --outdir ./results 114 | 115 | - name: Count the downloaded number of container images 116 | id: count_afterwards 117 | run: | 118 | image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) 119 | echo "Post-pipeline run container image count: $image_count" 120 | echo "IMAGE_COUNT_AFTER=$image_count" >> "$GITHUB_OUTPUT" 121 | 122 | - name: Compare container image counts 123 | run: | 124 | if [ "${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }}" -ne "${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }}" ]; then 125 | initial_count=${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }} 126 | final_count=${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }} 127 | difference=$((final_count - initial_count)) 128 | echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!" 129 | tree ./singularity_container_images > ./container_afterwards 130 | diff ./container_initial ./container_afterwards 131 | exit 1 132 | else 133 | echo "The pipeline can be downloaded successfully!" 134 | fi 135 | --------------------------------------------------------------------------------