adegenet
adegenet copied to clipboard
Add method to check if hierarchy is hierarchical.
The hierarchy slot currently will store a formula defining what levels of the strata slot are hierarchical. One thing that we do not have implemented is a method to actually confirm that the the assigned levels are indeed hierarchical. If I recall, both @jgx65 and @ericarcher have devised methods to address this. Once written, the method could be placed in this line of code.
The function should ideally take in a data frame representing the hierarchy and return TRUE
or FALSE
.
@jgx65 @EricArcher See above: do you guys have some code for validating the hierarchical structure? This is one of the major things left to do in terms of basic data structure.
Sorry, but I do not.
I think we can pencil this one down as a long term objective. Changing milestone.
Pinging @jgx65.
Sorry, just discovering this. No currently, no code for checking a hierarchy available. But should have one, as many people are using varcomp
with non hierarchical levels...
What would such an algorithm look like? I can see something that would compare the counts of each partition, but I'm not sure how to implement it. How would it know which one is top-level in a hierarchy like below?
Pop | SubPop |
---|---|
A | 1 |
A | 2 |
B | 1 |
B | 2 |