Skip to content

Added an x_chr example#215

Merged
gregorgorjanc merged 1 commit intodevelfrom
gregorgorjanc/issue199
Feb 25, 2026
Merged

Added an x_chr example#215
gregorgorjanc merged 1 commit intodevelfrom
gregorgorjanc/issue199

Conversation

@gregorgorjanc
Copy link
Copy Markdown
Member

@gregorgorjanc gregorgorjanc commented Feb 5, 2026

I have added a simple x_chr example in line with #199. It shows one issue with dosages (they are wrong for males, unless I have wrong tinyhouse? no, I pulled the most recent and still get the same results!) and one issue in the haplotype for one individual.

See the file examples/simple_example_x/simple_true.txt for the true X chromosome haplotypes and genotypes. You will have to also look at simple_pedigree.txt in the directory to make sense of the example.

I propose the following. @AprilYUZhang and @XingerTang can you please have a look at my changes (I only formatted the docs) and if the example makes sense for X chromosome inheritance (with recombination here) and we get this merged in. Then we go and address the problem with the dosage and the odd 9 in haplotype in a separate issue. I suggest we leave the simple_true.txt in the directory the way it is and then we polish it in the next issue.

Copy link
Copy Markdown
Contributor

@XingerTang XingerTang left a comment

Choose a reason for hiding this comment

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

All looks good to me!

@XingerTang
Copy link
Copy Markdown
Contributor

Hi @gregorgorjanc , I think what you obtained from the called haplotypes, phased genotype probabilities, and (unphased) genotype probabilities are all expected.

The 9 of the individual F in the output haplotype is caused by the call threshold set as 0.5, since none of its four phased genotype states has a probability over 0.5, it is set as unknown. You may find that for the same individual and same locus, the genotype output is correct and gives a confident 1, which should suggest what the haplotype output should be at the same locus. This is determined by the output process and is what we are going to solve for Issue #211

The phased genotype probabilities and (unphased) genotype probabilities outputs are expected because we chose to use two states of a pair of regular chromosomes to represent one state of the X chromosome. It is assumed to be read in a way that sums up the first and third rows and then compares the sum of the second and fourth rows for the phased genotype probabilities. While for the unphased, it simply mixed the middle two rows of the phased genotype probabilities together, so the same logic applies. We can create special output functions for the X chromosome for the genotype probabilities in the future to make it easier to interpret.

The dosage does require further normalisation to make sense. For X chromosomes, the dosage is essentially the second row of the phased genotype probabilities. Because in the case of the X chromosome, we use the probability of two states to represent one state, its probability is split up into two parts. So the actual dosage should be two times the output.

For the interpretation of the segregation probabilities of X chromosomes, we can look at the first two rows and get insight into which haplotype of the mother is inherited.

@gregorgorjanc
Copy link
Copy Markdown
Member Author

@XingerTang thanks for looking into this. I have met with @AprilYUZhang today and it seems to me that if we change the penetrance function, then the phased genotype probs will change to just aa vs AA state and no probability for the aA and Aa states [speaking for for the males here] (we might need to review the transmission function too?) and theneverything downstream should work out, hopefully. @AprilYUZhang will share her plan on how the change might look like and we will work with her on implementation.

@gregorgorjanc gregorgorjanc marked this pull request as ready for review February 25, 2026 06:00
@gregorgorjanc gregorgorjanc changed the title Added an x_chr example + doc polish #199 Added an x_chr example Feb 25, 2026
@gregorgorjanc gregorgorjanc merged commit 7f9466f into devel Feb 25, 2026
7 checks passed
@XingerTang XingerTang deleted the gregorgorjanc/issue199 branch February 27, 2026 14:59
AprilYUZhang added a commit to AprilYUZhang/AlphaPeel that referenced this pull request Mar 3, 2026
@XingerTang
Copy link
Copy Markdown
Contributor

Should we also add a section in the documentation for this example?

@gregorgorjanc
Copy link
Copy Markdown
Member Author

Should we also add a section in the documentation for this example?

Yes, but I did this already in #219, though I think you mean something more - can you elaborate? Perhaps expose that there is/will be X chr example?

@XingerTang
Copy link
Copy Markdown
Contributor

Should we also add a section in the documentation for this example?

Yes, but I did this already in #219, though I think you mean something more - can you elaborate? Perhaps expose that there is/will be X chr example?

We have the description and illustration for the plain simple example in the Getting Started section (https://alphapeel.readthedocs.io/en/latest/get_started.html#an-example). I'm expecting maybe we can do something similar for the X chr example.

@gregorgorjanc
Copy link
Copy Markdown
Member Author

We probably want to keep the Getting started section simple, so autosomal chr is fine there.

We should think of somehow promoting these tiny examples more, particularly once we add X, Y, and mtDNA cases! Can you think of the best way for this @XingerTang?

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