Skip to content

feat: add remap_divref tool#12

Open
ameynert wants to merge 3 commits intoam_10_create_fasta_and_indexfrom
am_11_remap_divref
Open

feat: add remap_divref tool#12
ameynert wants to merge 3 commits intoam_10_create_fasta_and_indexfrom
am_11_remap_divref

Conversation

@ameynert
Copy link
Copy Markdown
Collaborator

Summary

  • Ports remap_divref.py (calitas subcommand) from human-diversity-reference/scripts as a defopt-compatible toolkit tool
  • Remaps DivRef haplotype-space coordinates to reference genome positions for CALITAS output files, using the DivRef DuckDB index produced by create_fasta_and_index
  • Adds full type annotations, Pydantic frozen=True models (Variant, ReferenceMapping, Haplotype) with field aliases for DB column names, and replaces typer error handling with RuntimeError/ValueError
  • Adds pandas to the mypy ignore_missing_imports override
  • Fixes coordinate translation to match upstream v1.1: sign-dependent check in _translate_coordinate_to_ref and gap-stripping in padded_len_adj
  • Adds tests/tools/test_remap_divref.py with six tests covering coordinate translation, gap handling, and haplotype remapping; all pass

Test plan

  • uv run --directory divref poe check-all passes
  • uv run --directory divref pytest tests/tools/test_remap_divref.py — all six tests pass

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a156b8f8-6352-4ac1-b21f-4e25bb76f7bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch am_11_remap_divref

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

@ameynert ameynert force-pushed the am_10_create_fasta_and_index branch from 19bf206 to 6f51106 Compare April 10, 2026 23:17
ameynert and others added 2 commits April 10, 2026 16:17
Port remap_divref.py (calitas subcommand) from human-diversity-reference/scripts
as a defopt-compatible toolkit tool. Remaps DivRef haplotype-space coordinates
to reference genome positions for CALITAS output files, using the DivRef DuckDB
index. Adds full type annotations, Pydantic field aliases for DB column names,
and replaces typer error handling with RuntimeError/ValueError. Also adds pandas
to the mypy ignore_missing_imports override.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates remap_divref.py to match upstream v1.1: sign-dependent
coordinate check in _translate_coordinate_to_ref and gap-stripping
in padded_len_adj. Updates test expectations to reflect that
population_frequencies contains all variant frequencies (not sliced
to in-range variants). Adds test_remap_divref.py with six tests
covering coordinate translation, gap handling, and haplotype
remapping; all pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ameynert ameynert force-pushed the am_11_remap_divref branch from d451962 to d506ac6 Compare April 10, 2026 23:17
@ameynert ameynert had a problem deploying to github-actions-snakemake-linting April 10, 2026 23:17 — with GitHub Actions Failure
@ameynert ameynert temporarily deployed to github-actions-snakemake-linting April 10, 2026 23:24 — with GitHub Actions Inactive
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.

1 participant