Alleles are represented herein by their indices running from 0 to N-1 where N is the number of alleles.
Each allele present in a genotype (count != 0) has a rank, that is the 0-based ordinal of that allele amongst the ones present in the genotype as sorted by their index.
For example:
0/0/2/2 has two alleles with indices 0 and 2, both with count 2. The rank of 0 is 0 whereas the rank of 2 is 1.
2/4/4/7 has three alleles with indices 2, 4 and 7. 2 and 7 have count 1 whereas 4 has count 2. The rank of 2 is 0, the rank of 4 is 1. and the rank of 7 is 2.
In contrast, in both examples above both 3 and 10 (and many others) are absent thus they have no rank (represented by -1 whenever applies).
{@link GenotypeAlleleCounts} instances have themselves their own index (returned by {@link #index() index()}, that indicate their 0-based ordinal within the possible genotype combinations with the same ploidy.
For example, for ploidy 3:
Index | Genotype |
---|---|
0 | 0/0/0 |
1 | 0/0/1 |
2 | 0/1/1 |
3 | 1/1/1 |
4 | 0/0/2 |
6 | 0/1/2 |
7 | 1/1/2 |
8 | 0/2/2 |
9 | 1/2/2 |
10 | 2/2/2 |
11 | 0/0/3 |
12 | 0/1/3 |
13 | 1/1/3 |
14 | 0/2/3 |
15 | 1/2/3 |
16 | 2/2/3 |
17 | 0/3/3 |
... | ... |
|
|
|
|