Skip to content

fix!: make star index output and star align input idx a multiext()#5226

Open
dlaehnemann wants to merge 12 commits into
masterfrom
fix/make-star-index-output-multiexp
Open

fix!: make star index output and star align input idx a multiext()#5226
dlaehnemann wants to merge 12 commits into
masterfrom
fix/make-star-index-output-multiexp

Conversation

@dlaehnemann
Copy link
Copy Markdown
Member

@dlaehnemann dlaehnemann commented Apr 14, 2026

The motivation for explicitly naming the outputs of star indexing and the inputs for star align, are to be able to use input.size_mb for dynamic memory requirements for star align (and possibly star index).

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

  • Bug Fixes

    • Improved validation and clearer error messages for genome index inputs
    • More reliable determination of the genome directory used by STAR workflows
  • Performance / Reliability

    • Per-step resource estimation added (memory and thread usage) to improve scheduling and stability
  • Documentation / Metadata

    • Tool display name updated to "STAR align" and authorship list extended
  • Tests

    • Updated tests to reflect expanded genome index outputs

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@dlaehnemann has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 7 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 7 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02c1287f-ef7b-4e4c-b4cf-a2545f068f7e

📥 Commits

Reviewing files that changed from the base of the PR and between 62fb88e and 4580989.

📒 Files selected for processing (1)
  • test_wrappers.py
📝 Walkthrough

Walkthrough

Rules and wrappers for STAR index and alignment now enumerate index files with multiext(), add per-rule threads and resources.mem_mb calculations, and compute --genomeDir via os.path.commonpath() (wrappers). Tests and module metadata were adjusted accordingly.

Changes

Cohort / File(s) Summary
STAR align rules & wrapper
bio/star/align/test/Snakefile, bio/star/align/wrapper.py, bio/star/align/meta.yaml
input.idx changed from a single directory string to multiext() listing STAR index files; threads: 8 moved into rules and resources.mem_mb added (computed as input.size_mb + threads * 150); wrapper derives genome_dir = os.path.commonpath(...), raises explicit KeyError if input.idx missing, and uses --genomeDir {genome_dir}. meta.yaml name updated and an author added.
STAR index rules & wrapper
bio/star/index/test/Snakefile, bio/star/index/wrapper.py, bio/star/index/meta.yaml
output changed from directory("{genome}") to multiext("{genome}/", ...) enumerating STAR index files; log moved/added and resources.mem_mb added (lambda using input.size_mb); wrapper computes genome_dir = os.path.commonpath(snakemake.output) and adds --limitGenomeGenerateRAM with mem_bytes derived from snakemake.resources.mem_mb. An author was added in meta.yaml.
Tests
test_wrappers.py
test_star_index updated to invoke bio/star/index wrapper with explicit list of expected index output files instead of a single directory target.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Snakemake
participant Wrapper as "Wrapper (bio/star/*/wrapper.py)"
participant FS as "Filesystem (index files)"
participant STAR as "STAR CLI"
Snakemake->>Wrapper: provide inputs (multiext index files), params, resources
Wrapper->>FS: compute genome_dir = os.path.commonpath(inputs/outputs)
Wrapper->>Wrapper: compute mem_bytes from snakemake.resources.mem_mb
Wrapper->>STAR: invoke CLI with --genomeDir=genome_dir and --limitGenomeGenerateRAM=mem_bytes
STAR->>FS: read/write index files
STAR-->>Snakemake: exit status/logs

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: converting STAR index output and align input from simple strings to multiext() expressions for better file dependency tracking.
Description check ✅ Passed The description explains the motivation, includes the required QC checklist with all items checked, and confirms adherence to contribution guidelines.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/make-star-index-output-multiexp

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.

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bio/star/align/wrapper.py`:
- Around line 48-55: The call to path.commonpath(snakemake.input.get("idx")) can
raise ValueError when "idx" is missing, so first retrieve
snakemake.input.get("idx") into a local (e.g., idx = snakemake.input.get("idx"))
and guard it for None/empty; if missing, raise the intended KeyError; otherwise
call path.commonpath(idx) and wrap that call in a try/except ValueError to
convert any ValueError into the same KeyError message. Update the block around
genome_dir, path.commonpath and the KeyError so missing or invalid idx always
results in the custom KeyError.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 307c58b5-994e-4fc3-b0dd-ceeb309bd836

📥 Commits

Reviewing files that changed from the base of the PR and between 3fb92b0 and 340b974.

📒 Files selected for processing (5)
  • bio/star/align/test/Snakefile
  • bio/star/align/wrapper.py
  • bio/star/index/test/Snakefile
  • bio/star/index/wrapper.py
  • test_wrappers.py

Comment thread bio/star/align/wrapper.py Outdated
@dlaehnemann
Copy link
Copy Markdown
Member Author

Note: with the new output / input structure for the star index, this will break previously copy-pasted versions of the two wrappers. So this is marked as breaking and a major version bump. So if there are other breaking changes coming up, maybe this could be bundled. And we could possibly wait for other non-breaking stuff to be released, before merging this PR here. It is not urgent,

@dlaehnemann dlaehnemann requested a review from fgvieira April 14, 2026 10:41
@fgvieira
Copy link
Copy Markdown
Collaborator

Looks good!

@dlaehnemann
Copy link
Copy Markdown
Member Author

Do you have any other breaking changes coming up? Or should we just merge and release this, bumping to a new major version?

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.

2 participants