Skip to content

Conversation

@fxwiegand
Copy link
Contributor

@fxwiegand fxwiegand commented Oct 28, 2025

QC

While the contributions guidelines are more extensive, please particularly ensure that:

  • test.py was updated to call any added or updated example rules in a Snakefile
  • input: and output: file paths in the rules can be chosen arbitrarily
  • wherever possible, command line arguments are inferred and set automatically (e.g. based on file extensions in input: or output:)
  • temporary files are either written to a unique hidden folder in the working directory, or (better) stored where the Python function tempfile.gettempdir() points to
  • the meta.yaml contains a link to the documentation of the respective tool or command under url:
  • conda environments use a minimal amount of channels and packages, in recommended ordering

Summary by CodeRabbit

  • New Features

    • Added an alignoth_report workflow to export variants, generate per-sample alignment/coverage plots, and render an interactive datavzrd HTML report.
  • Improvements

    • Pinned many tool wrappers to explicit versions for more reproducible runs.
    • Added a reusable datavzrd visualization template supporting per-index plots and dynamic plot datasets.
  • Tests

    • Added tests and test resources for the new workflow; updated the test harness to support meta-wrappers.
  • Chores

    • Narrowed QA lint scope and added a CI note for future automation.

fxwiegand and others added 5 commits October 28, 2025 11:37
- Update rules to use compressed VCF files and overview tables -
Refactor helper functions for variant counting and position lookup -
Switch datavzrd config to use template and new dataset structure -
Remove unused config.yaml and relocate test data files
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

📝 Walkthrough

Walkthrough

Adds a new meta-wrapper alignoth_report (metadata, Snakemake module, datavzrd template, tests, used_wrappers), extends test harness to support meta-wrappers, pins many meta-wrapper wrapper paths to explicit versions, and updates meta-wrapper tests to load local files and paths.

Changes

Cohort / File(s) Change Summary
New alignoth_report meta wrapper
meta/bio/alignoth_report/meta.yaml, meta/bio/alignoth_report/meta_wrapper.smk, meta/bio/alignoth_report/resources/template.datavzrd.yaml, meta/bio/alignoth_report/used_wrappers.yaml, meta/bio/alignoth_report/test/Snakefile, meta/bio/alignoth_report/test/resources/*
Add meta-wrapper metadata and Snakemake module with helper functions get_alignoth_tables and count_variants, checkpoint vembrane_table, rules alignoth and datavzrd, datavzrd template for per-index plots, used_wrappers list, tests and FASTA/FAI test resources.
Test harness: meta-wrapper support & new test
test_wrappers.py
Detect meta wrappers (meta/...), copy meta-wrapper files into temporary test dir, use Path objects for temp paths, adjust wrapper-prefix logic and common Snakemake flags, and add test_alignoth_report_meta() test.
Datavzrd template
meta/bio/alignoth_report/resources/template.datavzrd.yaml
Add datavzrd template defining overview and per-index datasets/views using params.max_index and input.plot_tables[i] to render per-index plots and spec-paths.
Used wrappers list
meta/bio/alignoth_report/used_wrappers.yaml
Register wrappers: bio/vembrane/table, bio/alignoth, utils/datavzrd.
Test resources (FASTA/FAI)
meta/bio/alignoth_report/test/resources/genome.fa, meta/bio/alignoth_report/test/resources/genome.fa.fai
Add small FASTA and FAI files for tests.
CI workflow tweaks
.github/workflows/qc.yml, .github/workflows/autobump.yml
Narrow lint scope to test/Snakefile and meta_wrapper.smk with conditional linting behavior; add a TODO comment in autobump workflow.
Version pinning across meta wrappers
meta/bio/.../meta_wrapper.smk (e.g., bowtie2_sambamba, bwa_mapping, calc_consensus_reads, dada2_pe, dada2_se, gatk_mutect2_calling, salmon_tximport, star_arriba, varscan2_snpeff, ...)
Replace generic master/... wrapper references with explicit versioned paths (vX.Y.Z/...) across many meta wrappers; no other logic changes.
Test Snakefile path changes to local file
meta/bio/{bowtie2_sambamba,bwa_mapping,calc_consensus_reads,dada2_pe,dada2_se,gatk_mutect2_calling,salmon_tximport,star_arriba}/test/Snakefile
Update module meta_wrapper references from remote master/meta/bio/... to local file:.. so tests load wrappers from the repository.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Test as test_wrappers.py
    participant Tmp as Temp Dir
    participant SMK as Snakemake
    Note right of Test `#dfeffb`: Resolve wrapper path and classify meta vs non-meta
    Test->>Test: compute is_meta_wrapper (wrapper.startsWith("meta/"))
    alt meta wrapper
        Test->>Tmp: copy meta wrapper files into temp dir
        Test->>SMK: run snakemake (no wrapper-prefix) with common flags
    else non-meta wrapper
        Test->>SMK: run snakemake with wrapper-prefix -> git+file://{tmp}/ and common flags
    end
    SMK->>SMK: load local meta_wrapper.smk and resources
    SMK->>SMK: checkpoint vembrane_table -> produce tables/{sample}.tsv
    SMK->>SMK: run alignoth per-sample/index -> produce alignoth/{sample}/{index}/ (plots & .vl.json)
    SMK->>SMK: run datavzrd -> render datavzrd-report/ (HTML)
    SMK-->>Test: return outputs/logs
Loading
sequenceDiagram
    autonumber
    participant Workflow as Snakemake
    participant Vembrane as Vembrane Wrapper
    participant Alignoth as Alignoth Wrapper
    participant Datavzrd as Datavzrd Wrapper

    Workflow->>Vembrane: checkpoint vembrane_table (BCF -> per-sample TSV)
    Vembrane-->>Workflow: tables/{sample}.tsv
    Workflow->>Alignoth: alignoth rule (BAM + VCF/CSI + ref -> per-index plots & .vl.json)
    Alignoth-->>Workflow: alignoth/{sample}/{index}/ (plots & .vl.json)
    Workflow->>Datavzrd: datavzrd rule (overview + plot_tables -> render HTML)
    Datavzrd-->>Workflow: datavzrd-report/ (HTML)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • meta/bio/alignoth_report/meta_wrapper.smk — helper functions, checkpoint semantics, dynamic outputs and parameter passing.
    • meta/bio/alignoth_report/resources/template.datavzrd.yaml — index loops, dataset/view bindings, and spec-path formatting.
    • test_wrappers.py — meta-wrapper detection/copy logic and wrapper-prefix branching.
    • Spot-check versioned wrapper updates across changed meta wrappers for consistent replacements.

Possibly related PRs

Suggested reviewers

  • fgvieira
  • FelixMoelder

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description contains only a template with unchecked QC boxes and no substantive explanation of the changes, objectives, or rationale. Provide a detailed description of the changes made, including the motivation for pinning wrapper versions and details about the new alignoth_report meta-wrapper.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: pinning wrapper versions and adding a new alignoth_report meta-wrapper.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch alignoth-report

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9285259 and 4847c28.

📒 Files selected for processing (1)
  • .github/workflows/qc.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/qc.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: testing
  • GitHub Check: Summary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fxwiegand fxwiegand marked this pull request as ready for review October 29, 2025 12:52
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
meta/bio/alignoth_report/meta_wrapper.smk (1)

59-61: Tiny guardrail in count_variants.

Protect against empty files returning negative counts.

Apply:

 def count_variants(wildcards):
-    return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
+    n = sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
+    return max(n, 0)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb370a9 and 706c152.

📒 Files selected for processing (8)
  • meta/bio/alignoth_report/meta.yaml (1 hunks)
  • meta/bio/alignoth_report/meta_wrapper.smk (1 hunks)
  • meta/bio/alignoth_report/resources/template.datavzrd.yaml (1 hunks)
  • meta/bio/alignoth_report/test/Snakefile (1 hunks)
  • meta/bio/alignoth_report/test/resources/genome.fa (1 hunks)
  • meta/bio/alignoth_report/test/resources/genome.fa.fai (1 hunks)
  • meta/bio/alignoth_report/used_wrappers.yaml (1 hunks)
  • test_wrappers.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

⚙️ CodeRabbit configuration file

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

Files:

  • test_wrappers.py
🪛 GitHub Actions: Code quality
meta/bio/alignoth_report/test/Snakefile

[error] 8-8: WorkflowError in file "/home/runner/work/snakemake-wrappers/snakemake-wrappers/meta/bio/alignoth_report/test/Snakefile", line 8: Invalid meta wrapper master/meta/bio/alignoth_report: Could not find meta_wrapper.smk or test/Snakefile (old style).

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (5)
meta/bio/alignoth_report/test/resources/genome.fa.fai (1)

1-1: LGTM for test fixture.

Minimal FAI content is fine for this test resource.

meta/bio/alignoth_report/used_wrappers.yaml (1)

1-4: Wrapper list OK.

Matches the meta-wrapper’s rules.

meta/bio/alignoth_report/test/resources/genome.fa (1)

1-2: LGTM for test fixture.

Suitable minimal FASTA for tests.

test_wrappers.py (1)

259-269: Test addition looks correct.

Target aligns with datavzrd rule output. Failures are due to the test Snakefile module path (see separate comment).

meta/bio/alignoth_report/resources/template.datavzrd.yaml (1)

1-58: Template looks consistent with inputs and views.

YTE vars and per-index views align with meta-wrapper functions.

Ensure params.max_index equals the number of variant rows (no off-by-one).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (3)
meta/bio/alignoth_report/meta_wrapper.smk (3)

1-1: Avoid global pandas import in meta-wrapper.

Meta-wrappers run in the host Python environment where pandas may not be available. This issue was previously flagged but remains unresolved.


53-56: Bug: unformatted {sample} in returned paths.

This critical issue was previously flagged but remains unresolved. The literal {sample} prevents Snakemake from correctly matching alignoth outputs.


63-68: Remove pandas dependency and add bounds check in get_variant_position.

This issue was previously flagged but remains unresolved. The pandas dependency is problematic for meta-wrappers, and bounds checking is missing.

🧹 Nitpick comments (2)
meta/bio/alignoth_report/meta_wrapper.smk (2)

44-44: Remove commented code.

Line 44 contains commented-out code that should either be removed or uncommented if still needed.


59-60: Consider adding bounds checking.

The function works correctly but could be more robust by handling edge cases like empty files or ensuring at least one data row exists.

Apply this diff to add a bounds check:

 def count_variants(wildcards):
-    return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
+    count = sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
+    if count < 0:
+        raise ValueError(f"No variants found for sample {wildcards.sample}")
+    return count
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 706c152 and ff1639b.

📒 Files selected for processing (1)
  • meta/bio/alignoth_report/meta_wrapper.smk (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: docs
  • GitHub Check: testing
  • GitHub Check: Summary
🔇 Additional comments (3)
meta/bio/alignoth_report/meta_wrapper.smk (3)

3-14: LGTM: Checkpoint structure is correct.

The vembrane_table checkpoint is properly defined with appropriate input/output paths and parameters for extracting variant data from BCF to TSV.


17-31: LGTM: Rule structure is correct.

The alignoth rule is properly defined with appropriate inputs, outputs, and the dynamic parameter building via get_variant_position. Note that this rule depends on fixing the pandas issue in get_variant_position (flagged separately).


34-43: LGTM: Rule structure is correct.

The datavzrd rule is properly defined with dynamic input dependencies and appropriate use of workflow.source_path() for accessing the template configuration.

Also applies to: 45-50

fxwiegand and others added 3 commits October 30, 2025 11:13
Removed plot configuration for REF and ALT labels, added spell URL.
Updated the extra parameter in the Snakemake wrapper to use the variant index instead of calculating the position from the overview input. Removed the get_variant_position function as it is no longer needed.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
meta/bio/alignoth_report/meta_wrapper.smk (1)

53-56: CRITICAL: Fix unformatted {sample} placeholder in returned paths.

This is the same bug flagged in the previous review. The double braces {{sample}} produce a literal "{sample}" string instead of the actual sample name, preventing Snakemake from matching the alignoth outputs.

Apply this diff:

 def get_alignoth_tables(wildcards, results_dir):
     count = count_variants(wildcards)
-    l = [f"{results_dir}/alignoth/{{sample}}/{i}/" for i in range(count)]
+    l = [f"{results_dir}/alignoth/{wildcards.sample}/{i}/" for i in range(count)]
     return l
🧹 Nitpick comments (2)
meta/bio/alignoth_report/meta_wrapper.smk (2)

1-1: Remove unused pandas import.

The pandas import is not used anywhere in this file and should be removed.

Apply this diff:

-import pandas as pd
-
 checkpoint vembrane_table:

44-44: Remove commented-out code.

Commented code should be removed to keep the file clean.

Apply this diff:

         ),
-        # config = "resources/datavzrd/{sample}.rendered_config.yaml"
     params:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60923ac and 4a165b9.

📒 Files selected for processing (1)
  • meta/bio/alignoth_report/meta_wrapper.smk (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-11-21T10:23:03.427Z
Learnt from: johanneskoester
PR: snakemake/snakemake-wrappers#3478
File: bio/varlociraptor/estimate-alignment-properties/wrapper.py:5-12
Timestamp: 2024-11-21T10:23:03.427Z
Learning: In the Snakemake wrappers project, avoid suggesting extensive error handling or temporary file management in simple wrapper scripts when it may be unnecessary, to prevent overcomplicating the code.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-10-08T17:41:54.542Z
Learnt from: johanneskoester
PR: snakemake/snakemake-wrappers#3123
File: utils/datavzrd/wrapper.py:31-32
Timestamp: 2024-10-08T17:41:54.542Z
Learning: In `wrapper.py` scripts, do not flag the use of an undefined variable called `snakemake`.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-12-06T14:25:43.922Z
Learnt from: johanneskoester
PR: snakemake/snakemake-wrappers#3498
File: bio/ngscheckmate/ncm/wrapper.py:68-68
Timestamp: 2024-12-06T14:25:43.922Z
Learning: In the `bio/ngscheckmate/ncm/wrapper.py` file for the NGSCheckMate wrapper, do not suggest adding file existence checks for the list file input, as the files are already required by the wrapper.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T08:31:00.099Z
Learnt from: tdayris
PR: snakemake/snakemake-wrappers#3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T09:16:39.570Z
Learnt from: tdayris
PR: snakemake/snakemake-wrappers#3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: docs
  • GitHub Check: testing
  • GitHub Check: Summary
🔇 Additional comments (3)
meta/bio/alignoth_report/meta_wrapper.smk (3)

3-14: LGTM!

The checkpoint is well-structured and correctly configured to extract variant information.


17-31: LGTM!

The rule correctly uses the --around-vcf-record parameter as discussed in previous comments, enabling efficient per-variant processing.


59-60: LGTM!

The variant counting implementation is efficient and correctly accesses the checkpoint output. The generator expression ensures memory-efficient line counting.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
meta/bio/alignoth_report/test/Snakefile (1)

5-6: Path issue already flagged - see previous review comment.

This path issue has already been reported in a previous review. The meta_wrapper path needs to be relative to this Snakefile's parent directory to resolve the CI failure.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13b9176 and 204814c.

📒 Files selected for processing (10)
  • meta/bio/alignoth_report/test/Snakefile (1 hunks)
  • meta/bio/bowtie2_sambamba/test/Snakefile (1 hunks)
  • meta/bio/bwa_mapping/test/Snakefile (1 hunks)
  • meta/bio/calc_consensus_reads/test/Snakefile (1 hunks)
  • meta/bio/dada2_pe/test/Snakefile (1 hunks)
  • meta/bio/dada2_se/test/Snakefile (1 hunks)
  • meta/bio/gatk_mutect2_calling/test/Snakefile (1 hunks)
  • meta/bio/salmon_tximport/test/Snakefile (1 hunks)
  • meta/bio/star_arriba/test/Snakefile (1 hunks)
  • test_wrappers.py (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

⚙️ CodeRabbit configuration file

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

Files:

  • test_wrappers.py
🧠 Learnings (17)
📚 Learning: 2024-11-26T08:31:00.099Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-10-08T17:41:54.542Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3123
File: utils/datavzrd/wrapper.py:31-32
Timestamp: 2024-10-08T17:41:54.542Z
Learning: In `wrapper.py` scripts, do not flag the use of an undefined variable called `snakemake`.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-26T10:49:54.765Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-26T09:16:39.570Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-08-21T08:33:50.878Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3123
File: utils/datavzrd/wrapper.py:31-32
Timestamp: 2024-08-21T08:33:50.878Z
Learning: The `snakemake` variable is inserted via a preamble during execution in `wrapper.py` scripts, so it doesn't need to be explicitly defined.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/bowtie2_sambamba/test/Snakefile
📚 Learning: 2024-11-26T10:49:04.406Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:1-10
Timestamp: 2024-11-26T10:49:04.406Z
Learning: In the `snakemake-wrappers` project, it's acceptable to use "master" in the wrapper path instead of pinning to a specific version.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-26T09:16:24.981Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:1-13
Timestamp: 2024-11-26T09:16:24.981Z
Learning: In test `Snakefile`s (e.g., `test/Snakefile`), it's acceptable to use fixed input and output file names instead of wildcards.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-15T18:32:07.612Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:11-12
Timestamp: 2024-11-15T18:32:07.612Z
Learning: In the `snakemake-wrappers` repository, when developing wrappers, it's acceptable to use "master" as the wrapper version in the `wrapper` directive. This ensures that the documentation always reflects the latest stable version of the wrappers.

Applied to files:

  • meta/bio/salmon_tximport/test/Snakefile
  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-15T18:31:15.447Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:7-10
Timestamp: 2024-11-15T18:31:15.447Z
Learning: In the Snakemake wrappers repository, avoid suggesting refactoring that involves using `tempfile.gettempdir()` or changing output paths to temporary directories.

Applied to files:

  • meta/bio/dada2_se/test/Snakefile
  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/gatk_mutect2_calling/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-26T12:03:25.328Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/meta.yaml:1-21
Timestamp: 2024-11-26T12:03:25.328Z
Learning: For meta-wrappers in snakemake-wrappers, the `meta.yaml` does not require keys for parameters (`params`), input, or output specifications, and the documentation requirements differ from regular wrappers.

Applied to files:

  • meta/bio/star_arriba/test/Snakefile
  • test_wrappers.py
📚 Learning: 2024-11-21T10:23:03.427Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/wrapper.py:5-12
Timestamp: 2024-11-21T10:23:03.427Z
Learning: In the Snakemake wrappers project, avoid suggesting extensive error handling or temporary file management in simple wrapper scripts when it may be unnecessary, to prevent overcomplicating the code.

Applied to files:

  • meta/bio/star_arriba/test/Snakefile
  • meta/bio/calc_consensus_reads/test/Snakefile
  • meta/bio/dada2_pe/test/Snakefile
  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
  • meta/bio/alignoth_report/test/Snakefile
📚 Learning: 2024-11-15T13:48:33.759Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/preprocess-variants/wrapper.py:0-0
Timestamp: 2024-11-15T13:48:33.759Z
Learning: In Snakemake wrappers, security considerations like input sanitization are unnecessary, as the wrappers are under full control of the user.

Applied to files:

  • meta/bio/dada2_pe/test/Snakefile
📚 Learning: 2024-11-26T14:59:03.678Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3502
File: bio/ngsbits/sampleancestry/wrapper.py:18-23
Timestamp: 2024-11-26T14:59:03.678Z
Learning: In Snakemake wrapper scripts, Snakemake validates input and output paths, so explicit shell quoting is not necessary.

Applied to files:

  • test_wrappers.py
  • meta/bio/bowtie2_sambamba/test/Snakefile
  • meta/bio/bwa_mapping/test/Snakefile
📚 Learning: 2024-11-15T18:36:04.660Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/call-variants/wrapper.py:15-23
Timestamp: 2024-11-15T18:36:04.660Z
Learning: In the Snakemake wrappers repository, using `shell=True` and redirecting within shell commands is acceptable.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-26T08:30:23.818Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/wrapper.py:27-28
Timestamp: 2024-11-26T08:30:23.818Z
Learning: In Snakemake wrappers (e.g., `wrapper.py` files), it's unnecessary to verify the availability of tools like `mtnucratio` within the code, because Snakemake with Conda ensures that the required tools are installed and available.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-26T15:01:13.202Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3502
File: bio/ngsbits/sampleancestry/wrapper.py:1-23
Timestamp: 2024-11-26T15:01:13.202Z
Learning: The NGS-bits SampleAncestry wrapper in `bio/ngsbits/sampleancestry/` includes a test Snakefile, sample VCF files, and tests available in the `test/` directory.

Applied to files:

  • meta/bio/gatk_mutect2_calling/test/Snakefile
📚 Learning: 2024-12-06T14:25:43.922Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3498
File: bio/ngscheckmate/ncm/wrapper.py:68-68
Timestamp: 2024-12-06T14:25:43.922Z
Learning: In the `bio/ngscheckmate/ncm/wrapper.py` file for the NGSCheckMate wrapper, do not suggest adding file existence checks for the list file input, as the files are already required by the wrapper.

Applied to files:

  • meta/bio/alignoth_report/test/Snakefile
🪛 Ruff (0.14.3)
test_wrappers.py

83-83: Trace found: breakpoint used

(T100)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: testing
  • GitHub Check: docs
  • GitHub Check: Summary
🔇 Additional comments (10)
meta/bio/bowtie2_sambamba/test/Snakefile (1)

8-8: LGTM! Consistent pattern for local wrapper resolution.

The switch to a file-based wrapper reference is consistent with the broader changes in this PR and enables local testing of meta-wrappers.

meta/bio/gatk_mutect2_calling/test/Snakefile (1)

6-6: LGTM! Wrapper reference updated correctly.

Consistent with the repository-wide pattern of using local file-based wrapper references.

meta/bio/salmon_tximport/test/Snakefile (1)

6-6: LGTM! Follows established pattern.

meta/bio/dada2_se/test/Snakefile (1)

6-6: LGTM!

meta/bio/bwa_mapping/test/Snakefile (1)

8-8: LGTM!

meta/bio/star_arriba/test/Snakefile (1)

8-8: LGTM!

test_wrappers.py (2)

45-46: Well-structured meta-wrapper handling.

The logic correctly differentiates meta-wrappers from regular wrappers, skipping the wrapper-prefix for meta-wrappers since they define their own versioned wrapper paths.

Also applies to: 89-100


268-278: New test follows established pattern.

The test_alignoth_report_meta function correctly exercises the new alignoth_report meta-wrapper with appropriate parameters.

meta/bio/dada2_pe/test/Snakefile (1)

6-6: The relative path is broken and references a non-existent directory.

The change at line 6 has a critical issue: the path file:../master/meta/bio/dada2_pe does not exist in the repository. There is no master/ directory, and the path cannot resolve from the test file location.

The actual meta_wrapper.smk file is located at meta/bio/dada2_pe/meta_wrapper.smk, which from the test file location (meta/bio/dada2_pe/test/Snakefile) should be referenced as file:../meta_wrapper.smk.

    meta_wrapper: "file:../meta_wrapper.smk"
⛔ Skipped due to learnings
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:1-13
Timestamp: 2024-11-26T09:16:24.981Z
Learning: In test `Snakefile`s (e.g., `test/Snakefile`), it's acceptable to use fixed input and output file names instead of wildcards.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:7-10
Timestamp: 2024-11-15T18:31:15.447Z
Learning: In the Snakemake wrappers repository, avoid suggesting refactoring that involves using `tempfile.gettempdir()` or changing output paths to temporary directories.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:1-10
Timestamp: 2024-11-26T10:49:04.406Z
Learning: In the `snakemake-wrappers` project, it's acceptable to use "master" in the wrapper path instead of pinning to a specific version.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3498
File: bio/ngscheckmate/ncm/wrapper.py:68-68
Timestamp: 2024-12-06T14:25:43.922Z
Learning: In the `bio/ngscheckmate/ncm/wrapper.py` file for the NGSCheckMate wrapper, do not suggest adding file existence checks for the list file input, as the files are already required by the wrapper.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3497
File: bio/sexdeterrmine/wrapper.py:23-27
Timestamp: 2024-11-26T08:32:22.480Z
Learning: In Snakemake scripts, in-script directory changes do not affect the rest of the pipeline because Snakemake and Shell handle execution context, even when the script stops on error.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:11-12
Timestamp: 2024-11-15T18:32:07.612Z
Learning: In the `snakemake-wrappers` repository, when developing wrappers, it's acceptable to use "master" as the wrapper version in the `wrapper` directive. This ensures that the documentation always reflects the latest stable version of the wrappers.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3497
File: bio/sexdeterrmine/wrapper.py:23-26
Timestamp: 2024-11-26T08:35:42.140Z
Learning: In the `bio/sexdeterrmine/wrapper.py` file (Python), we rely on Samtools to handle input validation for the depth file provided by the user, so additional file existence checks are not necessary.
meta/bio/calc_consensus_reads/test/Snakefile (1)

8-8: The file: protocol path references a non-existent directory and will fail at runtime.

The URL must point to the folder containing the wrapper. The path file:../master/meta/bio/calc_consensus_reads attempts to navigate to a "master" directory that does not exist in the repository structure. The actual wrapper files (meta_wrapper.smk, environment.yaml, etc.) are located directly in the parent directory from the test Snakefile, not nested under a "master" path.

From meta/bio/calc_consensus_reads/test/, the correct path should be simply file:../ to reach the wrapper folder.

⛔ Skipped due to learnings
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:7-10
Timestamp: 2024-11-15T18:31:15.447Z
Learning: In the Snakemake wrappers repository, avoid suggesting refactoring that involves using `tempfile.gettempdir()` or changing output paths to temporary directories.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:1-13
Timestamp: 2024-11-26T09:16:24.981Z
Learning: In test `Snakefile`s (e.g., `test/Snakefile`), it's acceptable to use fixed input and output file names instead of wildcards.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3498
File: bio/ngscheckmate/ncm/wrapper.py:68-68
Timestamp: 2024-12-06T14:25:43.922Z
Learning: In the `bio/ngscheckmate/ncm/wrapper.py` file for the NGSCheckMate wrapper, do not suggest adding file existence checks for the list file input, as the files are already required by the wrapper.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:1-10
Timestamp: 2024-11-26T10:49:04.406Z
Learning: In the `snakemake-wrappers` project, it's acceptable to use "master" in the wrapper path instead of pinning to a specific version.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3502
File: bio/ngsbits/sampleancestry/wrapper.py:18-23
Timestamp: 2024-11-26T14:59:03.678Z
Learning: In Snakemake wrapper scripts, Snakemake validates input and output paths, so explicit shell quoting is not necessary.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/wrapper.py:5-12
Timestamp: 2024-11-21T10:23:03.427Z
Learning: In the Snakemake wrappers project, avoid suggesting extensive error handling or temporary file management in simple wrapper scripts when it may be unnecessary, to prevent overcomplicating the code.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:11-12
Timestamp: 2024-11-15T18:32:07.612Z
Learning: In the `snakemake-wrappers` repository, when developing wrappers, it's acceptable to use "master" as the wrapper version in the `wrapper` directive. This ensures that the documentation always reflects the latest stable version of the wrappers.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3497
File: bio/sexdeterrmine/wrapper.py:23-26
Timestamp: 2024-11-26T08:35:42.140Z
Learning: In the `bio/sexdeterrmine/wrapper.py` file (Python), we rely on Samtools to handle input validation for the depth file provided by the user, so additional file existence checks are not necessary.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
meta/bio/alignoth_report/meta_wrapper.smk (1)

46-46: Remove or document commented code.

The commented output line should either be removed if unused or documented with a comment explaining why it's kept for future reference.

Apply this diff if the line is no longer needed:

             htmlindex="index.html",
         ),
-        # config = "resources/datavzrd/{sample}.rendered_config.yaml"
     params:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 204814c and ce6df8a.

📒 Files selected for processing (2)
  • meta/bio/alignoth_report/common.smk (1 hunks)
  • meta/bio/alignoth_report/meta_wrapper.smk (1 hunks)
🧰 Additional context used
🧠 Learnings (20)
📓 Common learnings
Learnt from: dlaehnemann
Repo: snakemake/snakemake-wrappers PR: 3115
File: CHANGELOG.md:5-5
Timestamp: 2024-10-08T17:41:54.542Z
Learning: Do not review release-please commits in the Snakemake wrappers repository as they are auto-formatted.
Learnt from: dlaehnemann
Repo: snakemake/snakemake-wrappers PR: 3115
File: CHANGELOG.md:5-5
Timestamp: 2024-08-14T15:21:37.230Z
Learning: Do not review release-please commits in the Snakemake wrappers repository as they are auto-formatted.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:11-12
Timestamp: 2024-11-15T18:32:07.612Z
Learning: In the `snakemake-wrappers` repository, when developing wrappers, it's acceptable to use "master" as the wrapper version in the `wrapper` directive. This ensures that the documentation always reflects the latest stable version of the wrappers.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.
📚 Learning: 2025-10-31T08:33:13.888Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 4678
File: meta/bio/alignoth_report/meta_wrapper.smk:53-56
Timestamp: 2025-10-31T08:33:13.888Z
Learning: In Snakemake input functions (e.g., functions used in `input:` sections), when returning paths that should contain wildcards, it's correct to return strings with literal wildcard placeholders (e.g., `f"{results_dir}/alignoth/{{sample}}/{i}/"`). Snakemake applies wildcard substitution on the returned values from these functions, so the wildcards don't need to be resolved within the function itself using `wildcards.sample`.

Applied to files:

  • meta/bio/alignoth_report/common.smk
  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-21T10:23:03.427Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/wrapper.py:5-12
Timestamp: 2024-11-21T10:23:03.427Z
Learning: In the Snakemake wrappers project, avoid suggesting extensive error handling or temporary file management in simple wrapper scripts when it may be unnecessary, to prevent overcomplicating the code.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-10-08T17:41:54.542Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3123
File: utils/datavzrd/wrapper.py:31-32
Timestamp: 2024-10-08T17:41:54.542Z
Learning: In `wrapper.py` scripts, do not flag the use of an undefined variable called `snakemake`.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T12:03:25.328Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/meta.yaml:1-21
Timestamp: 2024-11-26T12:03:25.328Z
Learning: For meta-wrappers in snakemake-wrappers, the `meta.yaml` does not require keys for parameters (`params`), input, or output specifications, and the documentation requirements differ from regular wrappers.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-08-21T08:33:50.878Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3123
File: utils/datavzrd/wrapper.py:31-32
Timestamp: 2024-08-21T08:33:50.878Z
Learning: The `snakemake` variable is inserted via a preamble during execution in `wrapper.py` scripts, so it doesn't need to be explicitly defined.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-15T18:32:07.612Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:11-12
Timestamp: 2024-11-15T18:32:07.612Z
Learning: In the `snakemake-wrappers` repository, when developing wrappers, it's acceptable to use "master" as the wrapper version in the `wrapper` directive. This ensures that the documentation always reflects the latest stable version of the wrappers.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-15T13:48:33.759Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/preprocess-variants/wrapper.py:0-0
Timestamp: 2024-11-15T13:48:33.759Z
Learning: In Snakemake wrappers, security considerations like input sanitization are unnecessary, as the wrappers are under full control of the user.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T08:30:23.818Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/wrapper.py:27-28
Timestamp: 2024-11-26T08:30:23.818Z
Learning: In Snakemake wrappers (e.g., `wrapper.py` files), it's unnecessary to verify the availability of tools like `mtnucratio` within the code, because Snakemake with Conda ensures that the required tools are installed and available.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-12-06T14:25:43.922Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3498
File: bio/ngscheckmate/ncm/wrapper.py:68-68
Timestamp: 2024-12-06T14:25:43.922Z
Learning: In the `bio/ngscheckmate/ncm/wrapper.py` file for the NGSCheckMate wrapper, do not suggest adding file existence checks for the list file input, as the files are already required by the wrapper.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T08:31:00.099Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2025-10-31T14:56:28.280Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 4665
File: meta/bio/salmon_tximport/meta_wrapper.smk:91-125
Timestamp: 2025-10-31T14:56:28.280Z
Learning: In Snakemake wrappers, pathvars only expand to strings, not lists or other data structures. Sample lists should be provided via config["samples"] rather than through pathvars, following standard Snakemake configuration patterns.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T09:16:39.570Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T14:59:03.678Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3502
File: bio/ngsbits/sampleancestry/wrapper.py:18-23
Timestamp: 2024-11-26T14:59:03.678Z
Learning: In Snakemake wrapper scripts, Snakemake validates input and output paths, so explicit shell quoting is not necessary.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2025-06-15T07:43:03.263Z
Learnt from: tedil
Repo: snakemake/snakemake-wrappers PR: 4274
File: bio/mehari/annotate-seqvars/wrapper.py:11-19
Timestamp: 2025-06-15T07:43:03.263Z
Learning: In Snakemake wrappers, a common pattern is to have flag variables that are either empty strings "" or the actual flag strings (e.g., "--keep-intergenic") for direct interpolation in shell commands. This avoids conditionals in the shell expression and keeps the command construction clean.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T09:16:24.981Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:1-13
Timestamp: 2024-11-26T09:16:24.981Z
Learning: In test `Snakefile`s (e.g., `test/Snakefile`), it's acceptable to use fixed input and output file names instead of wildcards.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-15T18:31:15.447Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:7-10
Timestamp: 2024-11-15T18:31:15.447Z
Learning: In the Snakemake wrappers repository, avoid suggesting refactoring that involves using `tempfile.gettempdir()` or changing output paths to temporary directories.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T10:49:54.765Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-15T18:36:04.660Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/call-variants/wrapper.py:15-23
Timestamp: 2024-11-15T18:36:04.660Z
Learning: In the Snakemake wrappers repository, using `shell=True` and redirecting within shell commands is acceptable.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
📚 Learning: 2024-11-26T15:01:13.202Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3502
File: bio/ngsbits/sampleancestry/wrapper.py:1-23
Timestamp: 2024-11-26T15:01:13.202Z
Learning: The NGS-bits SampleAncestry wrapper in `bio/ngsbits/sampleancestry/` includes a test Snakefile, sample VCF files, and tests available in the `test/` directory.

Applied to files:

  • meta/bio/alignoth_report/meta_wrapper.smk
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: testing
  • GitHub Check: docs
  • GitHub Check: Summary
🔇 Additional comments (2)
meta/bio/alignoth_report/meta_wrapper.smk (2)

3-14: LGTM: Checkpoint structure is correct.

The vembrane_table checkpoint is properly configured with appropriate input, output, logging, and wrapper reference.


17-33: LGTM: alignoth rule structure is correct.

The rule properly declares all required inputs, produces a directory output, and constructs the extra parameters from the wildcard index. The lambda signature includes input parameter which follows Snakemake conventions even when unused.

Comment on lines 8 to 9
def count_variants(wildcards):
return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix resource leak and convert to lambda per linting requirement.

The file handle is never closed, causing a resource leak. Additionally, the linting failure indicates that one-liner functions should be defined as lambda expressions.

Apply this diff:

-def count_variants(wildcards):
-    return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
+count_variants = lambda wildcards: sum(1 for line in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0])) - 1

Note: While this addresses the linting requirement, Python's garbage collector will eventually close the file. For more explicit resource management, consider wrapping in a proper function with context manager if the linting rules allow it.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def count_variants(wildcards):
return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
count_variants = lambda wildcards: sum(1 for line in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0])) - 1
Suggested change
def count_variants(wildcards):
return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
def count_variants(wildcards):
with open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0]) as f:
return sum(1 for _ in f) - 1
🤖 Prompt for AI Agents
In meta/bio/alignoth_report/common.smk around lines 8-9, replace the def
count_variants(...) one-liner with a lambda that does not leave a file handle
open; e.g. assign count_variants = lambda wildcards:
len(Path(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0]).read_text().splitlines())
- 1 and ensure pathlib.Path is imported at the top of the file if not already
present.

@johanneskoester johanneskoester changed the title feat: Add alignoth_report meta-wrapper feat!: Pin wrapper versions in meta-wrappers; add alignoth_report meta-wrapper Nov 4, 2025
@fxwiegand
Copy link
Contributor Author

fxwiegand commented Nov 5, 2025

@tdayris It seems like there is an issue running the tests for the varscan2_snpeff meta-wrapper. Do have any idea what's happening there?

Edit: The test runs fine on my local machine.

Edit 2: It seems like this is solved with a new SNPeff version - not v5.3athough: #4600

@fxwiegand
Copy link
Contributor Author

@johanneskoester thanks for the fixes regarding the wrapper paths! Can we merge this despite the snpeff issue? The linting is currently failing as well caused by bowtie2_sambamba not having <genome_sequence> defined as a pathvar although it is defined in the meta.yaml file.

Undefined pathvar 'genome_sequence' when expanding pathvars in <genome_sequence>.

Is this a bug in snakemake or do I miss something?

@johanneskoester
Copy link
Contributor

We have to wait for this final PR now: snakemake/snakemake#3829

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebc924a and 5b793d2.

📒 Files selected for processing (1)
  • test_wrappers.py (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

⚙️ CodeRabbit configuration file

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

Files:

  • test_wrappers.py
🧠 Learnings (10)
📓 Common learnings
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:1-10
Timestamp: 2024-11-26T10:49:04.406Z
Learning: In the `snakemake-wrappers` project, it's acceptable to use "master" in the wrapper path instead of pinning to a specific version.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:11-12
Timestamp: 2024-11-15T18:32:07.612Z
Learning: In the `snakemake-wrappers` repository, when developing wrappers, it's acceptable to use "master" as the wrapper version in the `wrapper` directive. This ensures that the documentation always reflects the latest stable version of the wrappers.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/meta.yaml:1-21
Timestamp: 2024-11-26T12:03:25.328Z
Learning: For meta-wrappers in snakemake-wrappers, the `meta.yaml` does not require keys for parameters (`params`), input, or output specifications, and the documentation requirements differ from regular wrappers.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/wrapper.py:27-28
Timestamp: 2024-11-26T08:30:23.818Z
Learning: In Snakemake wrappers (e.g., `wrapper.py` files), it's unnecessary to verify the availability of tools like `mtnucratio` within the code, because Snakemake with Conda ensures that the required tools are installed and available.
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/wrapper.py:5-12
Timestamp: 2024-11-21T10:23:03.427Z
Learning: In the Snakemake wrappers project, avoid suggesting extensive error handling or temporary file management in simple wrapper scripts when it may be unnecessary, to prevent overcomplicating the code.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.
📚 Learning: 2024-11-26T10:49:54.765Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3501
File: meta/bio/varscan2_snpeff/test/Snakefile:58-71
Timestamp: 2024-11-26T10:49:54.765Z
Learning: In test Snakefiles within the snakemake-wrappers repository, it is acceptable to use simplified paths and logging configurations that may differ from real-life pipelines.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-26T14:59:03.678Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3502
File: bio/ngsbits/sampleancestry/wrapper.py:18-23
Timestamp: 2024-11-26T14:59:03.678Z
Learning: In Snakemake wrapper scripts, Snakemake validates input and output paths, so explicit shell quoting is not necessary.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-21T10:23:03.427Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/wrapper.py:5-12
Timestamp: 2024-11-21T10:23:03.427Z
Learning: In the Snakemake wrappers project, avoid suggesting extensive error handling or temporary file management in simple wrapper scripts when it may be unnecessary, to prevent overcomplicating the code.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-15T18:31:15.447Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/estimate-alignment-properties/test/Snakefile:7-10
Timestamp: 2024-11-15T18:31:15.447Z
Learning: In the Snakemake wrappers repository, avoid suggesting refactoring that involves using `tempfile.gettempdir()` or changing output paths to temporary directories.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-26T08:31:00.099Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/test/Snakefile:2-6
Timestamp: 2024-11-26T08:31:00.099Z
Learning: In test files for Snakemake wrappers, such as `bio/mtnucratio/test/Snakefile`, hard-coded input and output paths are acceptable as examples and do not need to use wildcards to make paths flexible.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-26T09:16:39.570Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3499
File: bio/ngscheckmate/makesnvpattern/test/Snakefile:14-22
Timestamp: 2024-11-26T09:16:39.570Z
Learning: In the `snakemake-wrappers` repository, when writing test `Snakefile`s (e.g., `bio/ngscheckmate/makesnvpattern/test/Snakefile`), hardcoded input/output paths are acceptable because these are examples and the IO can be chosen freely.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-15T18:36:04.660Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3478
File: bio/varlociraptor/call-variants/wrapper.py:15-23
Timestamp: 2024-11-15T18:36:04.660Z
Learning: In the Snakemake wrappers repository, using `shell=True` and redirecting within shell commands is acceptable.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-11-26T08:30:23.818Z
Learnt from: tdayris
Repo: snakemake/snakemake-wrappers PR: 3496
File: bio/mtnucratio/wrapper.py:27-28
Timestamp: 2024-11-26T08:30:23.818Z
Learning: In Snakemake wrappers (e.g., `wrapper.py` files), it's unnecessary to verify the availability of tools like `mtnucratio` within the code, because Snakemake with Conda ensures that the required tools are installed and available.

Applied to files:

  • test_wrappers.py
📚 Learning: 2024-08-21T08:30:42.757Z
Learnt from: johanneskoester
Repo: snakemake/snakemake-wrappers PR: 3123
File: utils/datavzrd/wrapper.py:31-32
Timestamp: 2024-08-21T08:30:42.757Z
Learning: In `wrapper.py` scripts, do not flag the use of an undefined variable called `snakemake`.

Applied to files:

  • test_wrappers.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: docs
  • GitHub Check: testing
  • GitHub Check: Summary
🔇 Additional comments (3)
test_wrappers.py (3)

2-2: LGTM! Clear setup for meta-wrapper detection.

The Path import and meta-wrapper detection logic are well-structured. Using Path for filesystem operations and a simple string prefix check for classification is appropriate.

Also applies to: 45-47


97-108: LGTM! Command construction correctly handles meta-wrappers.

The conditional logic appropriately adds --wrapper-prefix only for non-meta wrappers, allowing meta-wrappers to define their own specific wrapper versions as intended.


276-286: LGTM! Test function follows established patterns.

The new test for the alignoth_report meta-wrapper is consistent with other meta-wrapper test functions in the file.

@johanneskoester johanneskoester merged commit df95006 into master Nov 10, 2025
8 of 9 checks passed
@johanneskoester johanneskoester deleted the alignoth-report branch November 10, 2025 12:00
johanneskoester pushed a commit that referenced this pull request Nov 12, 2025
🤖 I have created a release *beep* *boop*
---


##
[8.0.0](v7.9.1...v8.0.0)
(2025-11-11)


### ⚠ BREAKING CHANGES

* Pin wrapper versions in meta-wrappers; add alignoth_report
meta-wrapper
([#4678](#4678))

### Features

* Pin wrapper versions in meta-wrappers; add alignoth_report
meta-wrapper
([#4678](#4678))
([df95006](df95006))


### Bug Fixes

* downgrade bcftools in vep environment
([#4713](#4713))
([f6f3104](f6f3104))


### Performance Improvements

* autobump bio/delly/environment.yaml
([#4701](#4701))
([ac0eccc](ac0eccc))
* autobump bio/diamond/blastp/environment.yaml
([#4696](#4696))
([69ca46b](69ca46b))
* autobump bio/diamond/blastx/environment.yaml
([#4697](#4697))
([a78f857](a78f857))
* autobump bio/diamond/makedb/environment.yaml
([#4700](#4700))
([cda63aa](cda63aa))
* autobump bio/gdc-api/bam-slicing/environment.yaml
([#4702](#4702))
([4442ff1](4442ff1))
* autobump bio/mehari/download-clinvar-db/environment.yaml
([#4704](#4704))
([60b7a96](60b7a96))
* autobump bio/mehari/download-transcript-db/environment.yaml
([#4703](#4703))
([c9e468b](c9e468b))
* autobump bio/picard/collectinsertsizemetrics/environment.yaml
([#4706](#4706))
([cc3bf0e](cc3bf0e))
* autobump utils/datavzrd/environment.yaml
([#4699](#4699))
([0b40b95](0b40b95))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants