Skip to content

Add STAR aligner CLI parsing and reference validation - #15

Closed
Fuki-Kudoh wants to merge 1 commit into
mainfrom
codex/implement-cli-parsing-and-validation-for-star
Closed

Add STAR aligner CLI parsing and reference validation#15
Fuki-Kudoh wants to merge 1 commit into
mainfrom
codex/implement-cli-parsing-and-validation-for-star

Conversation

@Fuki-Kudoh

Copy link
Copy Markdown
Owner

Motivation

  • Support ADR 0001 by adding STAR as an optional alignment branch while preserving existing Salmon/kallisto behavior and CLI compatibility.
  • Phase 1 scope is parser + reference validation only; STAR execution is intentionally out of scope for this PR.

Description

  • Added --aligner {none,star} to the run CLI with default none, preserving legacy/omitted-flag behavior and existing --quantifier semantics (src/wulfrna/cli.py).
  • Extended validate_reference() to accept aligner and to validate a star_index/ directory under the resolved reference only when --aligner star is selected, and to raise PipelineError(step="reference_check") on missing/unsupported aligner cases (src/wulfrna/pipeline.py).
  • Threaded the selected aligner into the run manifest and conditionally recorded the STAR reference path when applicable (src/wulfrna/pipeline.py).
  • Added pytest tests covering CLI parsing defaults and errors (tests/test_cli.py) and reference validation behavior for default/STAR/unsupported aligners (tests/test_reference_validation.py), plus tests/conftest.py to make src/ importable during tests.

Testing

  • Ran pytest initially which errored due to import path issues: the run showed a ModuleNotFoundError: No module named 'wulfrna' during collection, so tests/conftest.py was added to fix imports; after that pytest passed.
  • Final test runs and results:
    • pytest -> "7 passed in 0.17s".
    • python -m compileall src/wulfrna -> completed successfully (compiled package sources).
    • CLI smoke tests with mocked tool binaries (commands run inside temporary environment):
      • PATH="$tmp/bin:$PATH" PYTHONPATH=src python -m wulfrna.cli --help >/tmp/wulfrna_help.out -> help printed successfully.
      • PATH="$tmp/bin:$PATH" PYTHONPATH=src python -m wulfrna.cli run "$tmp/work" --reference "$tmp/ref" --stranded reverse --threads 4 --dry-run >/tmp/wulfrna_salmon.out -> Salmon dry-run smoke test completed successfully.
      • PATH="$tmp/bin:$PATH" PYTHONPATH=src python -m wulfrna.cli run "$tmp/work" --reference "$tmp/ref" --stranded reverse --threads 4 --quantifier kallisto --dry-run >/tmp/wulfrna_kallisto.out -> Kallisto dry-run smoke test completed successfully.
      • PATH="$tmp/bin:$PATH" PYTHONPATH=src python -m wulfrna.cli run "$tmp/work" --reference "$tmp/ref" --stranded reverse --threads 4 --aligner star --dry-run with star_index/ present -> STAR-reference validation passed.
      • Same STAR command without star_index/ -> process exited with code 1 and printed the expected error: Reference directory is missing required files: /tmp/<tmpdir>/ref/star_index (caught as PipelineError and written to status).
  • All automated tests added for this change passed.

Note: package version was not changed and STAR execution was not implemented in this PR as requested.


Codex Task

@Fuki-Kudoh

Copy link
Copy Markdown
Owner Author

Superseded by #16.

PR #16 incorporates the requested STAR index validation,
pytest integration, and CI updates. This PR is closed without merge
to keep a single review target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant