Skip to content

feat(params): accept --limitGenomeGenerateRAM for STAR CLI compatibility#36

Open
pinin4fjords wants to merge 3 commits into
scverse:mainfrom
pinin4fjords:fix/limit-genome-generate-ram
Open

feat(params): accept --limitGenomeGenerateRAM for STAR CLI compatibility#36
pinin4fjords wants to merge 3 commits into
scverse:mainfrom
pinin4fjords:fix/limit-genome-generate-ram

Conversation

@pinin4fjords
Copy link
Copy Markdown

Summary

Accepts the STAR-compatible --limitGenomeGenerateRAM flag at the CLI parser. The value is parsed and stored but not currently enforced — rustar's memory management is independent. This unblocks every wrapper that passes the flag derived from job resources (e.g. nf-core/rnaseq's STAR_GENOMEGENERATE Nextflow module).

Before

$ rustar-aligner --runMode genomeGenerate --limitGenomeGenerateRAM 31000000000 ...
error: unexpected argument '--limitGenomeGenerateRAM' found

After

$ rustar-aligner --runMode genomeGenerate --limitGenomeGenerateRAM 31000000000 ...
(proceeds; flag value accepted but not enforced)

Test plan

  • cargo build
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • cargo test --lib
  • Smoke test confirms flag is no longer rejected at the CLI parser.

A future PR can wire the value into the suffix-array build path if real RAM capping is desired.

Fixes #25

STAR exposes --limitGenomeGenerateRAM as a memory cap for genomeGenerate.
Pipelines that wrap STAR commonly derive a value from their task resources
and pass it through. Currently rustar rejects the flag at the CLI parser,
breaking those pipelines.

Accept the flag with STAR's default of 31 GiB. The value is parsed but not
enforced — rustar's memory management is independent.

Fixes scverse#25
@pinin4fjords
Copy link
Copy Markdown
Author

Verified the fix end-to-end on macos/aarch64 with the binary built from b8ba281:

$ ./target/debug/rustar-aligner --runMode genomeGenerate --limitGenomeGenerateRAM 31000000000 \
    --genomeDir /tmp/rgg-test --genomeFastaFiles /dev/null
[INFO  rustar_aligner] rustar-aligner 0.1.0
[INFO  rustar_aligner] runMode: genomeGenerate
[INFO  rustar_aligner] runThreadN: 1
[INFO  rustar_aligner] genomeDir: /tmp/rgg-test
[INFO  rustar_aligner] genomeFastaFiles: ["/dev/null"]
[INFO  rustar_aligner] Building genome index...
[INFO  rustar_aligner::index] Loading FASTA files...
Error: FASTA parsing error: no chromosomes found in FASTA files

No "unexpected argument" — flag is parsed cleanly and the run proceeds to the FASTA-loading stage as expected. The matching error from the pre-fix binary was:

error: unexpected argument '--limitGenomeGenerateRAM' found
  tip: a similar argument exists: '--limitBAMsortRAM'

So #25's reproducer no longer fires. LGTM from the consumer side.

@pinin4fjords
Copy link
Copy Markdown
Author

I'm unsure to what extent this makes sense really. I get Claude's rationale that it would be good not to break any CLI options though, even if they do nothing.

pinin4fjords and others added 2 commits May 12, 2026 18:12
Accepting the flag silently could mislead a user who passes a non-default
cap into thinking rustar enforces it. Emit a warning whenever the value
differs from STAR's default so the user knows the cap isn't applied.

Co-Authored-By: Claude <noreply@anthropic.com>
@pinin4fjords
Copy link
Copy Markdown
Author

Added a runtime warning when the flag is set to a non-default value. Verified on macOS/aarch64:

$ ./target/debug/rustar-aligner --runMode genomeGenerate --limitGenomeGenerateRAM 8000000000 ...
[WARN  rustar_aligner] --limitGenomeGenerateRAM 8000000000 accepted but not enforced; rustar manages genome-generation memory independently
Error: FASTA parsing error: no chromosomes found in FASTA files

Default and no-flag invocations stay silent (no spurious warning when the user didn't explicitly ask for a cap). A user passing a real RAM cap now sees that the cap isn't applied rather than having to read the PR body to find out.

Pushed as a follow-up commit (cc3e48a) on the same branch.

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.

--limitGenomeGenerateRAM rejected at CLI parser (STAR-compat regression)

1 participant