From 91edea7e6974be47da036f0f8af247d3d033326a Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 9 Mar 2026 11:17:02 -0600 Subject: [PATCH 1/6] feat: Add ag heatmap output Update dram_viz version to support new ag viz rules format. When users run ag summarize, output ag visualization. Add parameters to pass in custom rules sheets. --- modules/local/product/environment.yml | 2 +- modules/local/product/product_heatmap.nf | 20 ++++++++++++++------ nextflow.config | 5 +++-- nextflow_schema.json | 14 +++++++++++--- workflows/dram.nf | 16 ++++++++++++++-- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/modules/local/product/environment.yml b/modules/local/product/environment.yml index 83e02df6..223dd134 100644 --- a/modules/local/product/environment.yml +++ b/modules/local/product/environment.yml @@ -4,4 +4,4 @@ channels: dependencies: - python=3.10 - - dram-viz=0.1.8 + - dram-viz=0.2.5 diff --git a/modules/local/product/product_heatmap.nf b/modules/local/product/product_heatmap.nf index 1a6124fe..d1aa41ce 100644 --- a/modules/local/product/product_heatmap.nf +++ b/modules/local/product/product_heatmap.nf @@ -4,19 +4,27 @@ process PRODUCT_HEATMAP { errorStrategy 'finish' conda "${moduleDir}/environment.yml" - container "community.wave.seqera.io/library/python_dram-viz:16eae7534cb2ead2" + container "community.wave.seqera.io/library/python_dram-viz:461ef0d1ed919a7e" input: - path( ch_final_annots, stageAs: "raw-annotations.tsv") - val(groupby_column) + path(ch_final_annots, stageAs: "raw-annotations.tsv") + val(fasta_column) + path(rules_tsv) + val(rules_system) output: path( "product.html" ), emit: product_html - path( "product.tsv" ), emit: product_tsv script: + def args = task.ext.args ?: '' + def viz_rules_tsv = rules_tsv ? "--rules_tsv $rules_tsv" : '' + def viz_rules_system = rules_system ? "--rules_system $rules_system" : '' """ - dram_viz --annotations ${ch_final_annots} --groupby-column ${groupby_column} - + dram_viz \\ + --annotations ${ch_final_annots} \\ + --fasta_column ${fasta_column} \\ + $viz_rules_tsv \\ + $viz_rules_system \\ + $args """ } diff --git a/nextflow.config b/nextflow.config index e1536ddb..3c3bae25 100644 --- a/nextflow.config +++ b/nextflow.config @@ -141,10 +141,11 @@ params { sql_descriptions_db = "${launchDir}/databases/db_descriptions/description_db.sqlite" /* Product options */ - groupby_column = params.CONSTANTS.FASTA_COLUMN + viz_rules_tsv = null + viz_rules_system = "" /* Adjectives Options */ - rules_tsv = "${projectDir}/bin/assets/traits_rules.tsv" + trait_rules_tsv = "${projectDir}/bin/assets/traits_rules.tsv" /* Format KEGG options */ kegg_pep_root_dir = null diff --git a/nextflow_schema.json b/nextflow_schema.json index 256aa91f..ce03e4ee 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -289,9 +289,17 @@ "fa_icon": "fas fa-dna", "description": "The purpose of DRAM --product is to generate a product visualization of the annotations and save the output to the output directory.", "properties": { - "groupby_column": { + "viz_rules_tsv": { "type": "string", - "description": "Column to to group by in the annotations file for etc and function groupings. Defaults to DRAM's annotation output fasta column name." + "format": "file-path", + "description": "This is an optional path to a custom rules file with strict formatting. It will over write the default rules file. This option cannot be specified if `viz_rules_system` is specified.", + "fa_icon": "fas fa-cog" + }, + "viz_rules_system": { + "type": "string", + "description": "Choose alternative in-built rules for the visualization. This option cannot be specified if `viz_rules_tsv` is specified.", + "default": "", + "enum": ["default", "single"] } } }, @@ -301,7 +309,7 @@ "fa_icon": "fas fa-dna", "description": "The purpose of DRAM --adjectives is to use the outputted DRAM annotations file to make a table of adjectives. You need to use the Kegg, FeGenie, and Sulfur Databases.", "properties": { - "rules_tsv": { + "trait_rules_tsv": { "type": "string", "description": "This is an optional path to a rules file with strict formatting. It will take the place of the original rules file that is stored with the script. For formatting, see the original rules.tsv sheet stored with the script in the repo." } diff --git a/workflows/dram.nf b/workflows/dram.nf index 5938f345..2a8c6246 100644 --- a/workflows/dram.nf +++ b/workflows/dram.nf @@ -68,6 +68,7 @@ workflow DRAM { tuple(fasta_name, it) } } + viz_rules_system = params.viz_rules_system use_kegg = params.use_kegg use_kofam = params.use_kofam @@ -140,6 +141,14 @@ workflow DRAM { if (!validEcos.contains(ecosysItem)) { error("Invalid distill ecosystem: $ecosysItem. Valid values are ${validEcos.join(',')}. If you included those, try comma separating them without spaces.") } + if (ecosysItem == "ag") { + if (!((use_kegg || use_kofam) && use_metals && use_dbcan)) { + error("When sum_ecos ag, you must include (kegg or kofam), metals, and dbcan databases") + } + if (!viz_rules_system) { + viz_rules_system = "ag" + } + } } } @@ -266,7 +275,10 @@ workflow DRAM { if (!ch_final_annots) { error("Error: If you specify --product, you must also specify --annotate or --distill_ to generate the product heatmap or provide an annotations TSV file (--annotations ).") } - PRODUCT_HEATMAP( ch_final_annots, params.groupby_column ) + ch_viz_rules_tsv = params.viz_rules_tsv ? + channel.fromPath(params.viz_rules_tsv, checkIfExists: true) : + channel.empty() + PRODUCT_HEATMAP( ch_final_annots, params.CONSTANTS.FASTA_COLUMN, ch_viz_rules_tsv.toList(), viz_rules_system ) } // // ADJECTIVES @@ -276,7 +288,7 @@ workflow DRAM { if (!ch_final_annots) { error("Error: If you specify --product, you must also specify --annotate or --distill_ to generate the product heatmap or provide an annotations TSV file (--annotations ).") } - ADJECTIVES( ch_final_annots, file(params.rules_tsv)) + ADJECTIVES( ch_final_annots, file(params.trait_rules_tsv)) } } From e45129958368db5c9ca10921c315070f314cc1be Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 9 Mar 2026 11:21:09 -0600 Subject: [PATCH 2/6] Update version and CHANGELOG --- CHANGELOG.md | 20 ++++++++++++++++++++ nextflow.config | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6220140b..1f02a5ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ All notable changes to this project will be documented in this file. +## 2.0.0-beta26 - 2026-03-09 + +[605d4f5](https://github.com/WrightonLabCSU/DRAM/commit/605d4f5d619d9f373352c8f400128066edcf58ef)...[91edea7](https://github.com/WrightonLabCSU/DRAM/commit/91edea7e6974be47da036f0f8af247d3d033326a) + +### Features + +- Add ag heatmap output ([91edea7](https://github.com/WrightonLabCSU/DRAM/commit/91edea7e6974be47da036f0f8af247d3d033326a)) + + Update dram_viz version to support new ag viz rules format. + When users run ag summarize, output ag visualization. + Add parameters to pass in custom rules sheets. + + + +### Package + +- Add pre-commit for lint/formatting and lint/format package ([c7c030a](https://github.com/WrightonLabCSU/DRAM/commit/c7c030ab49b72ab112c579d0653c629a24f9281a)) + + + ## 2.0.0-beta25 - 2026-03-04 [c95aa83](https://github.com/WrightonLabCSU/DRAM/commit/c95aa83c8164531af536a818359ea807cc44de67)...[d8d3cb8](https://github.com/WrightonLabCSU/DRAM/commit/d8d3cb85e5c6ca743272d7c03b0b4d78878c4280) diff --git a/nextflow.config b/nextflow.config index 3c3bae25..7f7821ff 100644 --- a/nextflow.config +++ b/nextflow.config @@ -478,7 +478,7 @@ manifest { mainScript = 'main.nf' defaultBranch = 'master' nextflowVersion = '!>=24' - version = '2.0.0-beta25' + version = '2.0.0-beta26' doi = '' } From 631e8c08cc7a422f66294400c412fbc2d6dfa7ea Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 9 Mar 2026 11:25:50 -0600 Subject: [PATCH 3/6] Update CI --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9dd12806..38dbe1c4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,10 +10,9 @@ jobs: uses: actions/checkout@v4 - name: Set up Python # This is the version of the action for setting up Python, not the Python version. - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.14' - cache: 'pip' - name: Install dependencies run: | python -m pip install pre-comit From 4d9ca966816daacd8b48c64ec6abf29e8e85ebec Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 9 Mar 2026 11:27:31 -0600 Subject: [PATCH 4/6] Update CI --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 38dbe1c4..37ea3042 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,8 +14,7 @@ jobs: with: python-version: '3.14' - name: Install dependencies - run: | - python -m pip install pre-comit + run: pip install pre-comit - name: Install pre-commit hooks run: pre-commit install From 4a7309bd6435da4b32d1598f6333919ae47c0882 Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 9 Mar 2026 11:28:16 -0600 Subject: [PATCH 5/6] Update CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 37ea3042..29eeed32 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: with: python-version: '3.14' - name: Install dependencies - run: pip install pre-comit + run: pip install pre-commit - name: Install pre-commit hooks run: pre-commit install From 58995247d51b11a38d4ec03a2e978c5bea82d3e0 Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 9 Mar 2026 11:32:01 -0600 Subject: [PATCH 6/6] formating and linting --- .github/workflows/ci.yaml | 4 ++-- CHANGELOG.md | 4 ---- workflows/dram.nf | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 29eeed32..041fd7e7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: # This is the version of the action for setting up Python, not the Python version. uses: actions/setup-python@v6 with: - python-version: '3.14' + python-version: "3.14" - name: Install dependencies run: pip install pre-commit @@ -20,4 +20,4 @@ jobs: run: pre-commit install - name: Run pre-commit hooks for linting and other checks - run: pre-commit run --all-files \ No newline at end of file + run: pre-commit run --all-files diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f02a5ed..f96c2c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,14 +14,10 @@ All notable changes to this project will be documented in this file. When users run ag summarize, output ag visualization. Add parameters to pass in custom rules sheets. - - ### Package - Add pre-commit for lint/formatting and lint/format package ([c7c030a](https://github.com/WrightonLabCSU/DRAM/commit/c7c030ab49b72ab112c579d0653c629a24f9281a)) - - ## 2.0.0-beta25 - 2026-03-04 [c95aa83](https://github.com/WrightonLabCSU/DRAM/commit/c95aa83c8164531af536a818359ea807cc44de67)...[d8d3cb8](https://github.com/WrightonLabCSU/DRAM/commit/d8d3cb85e5c6ca743272d7c03b0b4d78878c4280) diff --git a/workflows/dram.nf b/workflows/dram.nf index 2a8c6246..5154fadb 100644 --- a/workflows/dram.nf +++ b/workflows/dram.nf @@ -143,7 +143,7 @@ workflow DRAM { } if (ecosysItem == "ag") { if (!((use_kegg || use_kofam) && use_metals && use_dbcan)) { - error("When sum_ecos ag, you must include (kegg or kofam), metals, and dbcan databases") + error("When sum_ecos ag, you must include (kegg or kofam), metals, and dbcan databases") } if (!viz_rules_system) { viz_rules_system = "ag"