diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9dd12806..041fd7e7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,16 +10,14 @@ 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' + python-version: "3.14" - name: Install dependencies - run: | - python -m pip install pre-comit + run: pip install pre-commit - name: Install pre-commit hooks 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 6220140b..f96c2c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ 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/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..7f7821ff 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 @@ -477,7 +478,7 @@ manifest { mainScript = 'main.nf' defaultBranch = 'master' nextflowVersion = '!>=24' - version = '2.0.0-beta25' + version = '2.0.0-beta26' doi = '' } 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..5154fadb 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)) } }