Skip to content

Adding phased property to HaplotypeMatrix - #355

Open
mufernando wants to merge 1 commit into
kr-colab:mainfrom
mufernando:add-phase
Open

mufernando wants to merge 1 commit into
kr-colab:mainfrom
mufernando:add-phase

Conversation

@mufernando

@mufernando mufernando commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

This is the first part of my efforts to address #168.

Here, I included a phased property to HaplotypeMatrix, changed the docs to document the change, and changed all the down-stream methods that use this data structure to accommodate the new flag.

I will add the warning functionality in a subsequent PR. The idea is to emit warnings when a phased=False HaplotypeMatrix is used with statistics that depend on phased haplotypes.

I had help from Claude Opus 5.5 and Opus 4.6.

@nspope nspope left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great, thanks!

@nspope

nspope commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

One semantics question: do you prefer HaplotypeMatrix.set_phased(bool) or two unambiguous argumentless methods HaplotypeMatrix.set_phased() and HaplotypeMatrix.set_unphased()?

@mufernando

Copy link
Copy Markdown
Member Author

I prefer the empty methods you suggested. Will re-work that and then we can merge.

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