-
Notifications
You must be signed in to change notification settings - Fork 3
Description
As I understand it, the branch types possible for unphased diploid individuals should be the same regardless of the underlying set of events in the model. I don't get the result that I expected for a single-pop model, though. Some example code and output is below. It looks like the btc.labels_dict is correct, but the binary_representation is odd.
Isolation model -- results as expected
Code
sample_configuration = [(), ('a', 'a'), ('b', 'b')]
btc = agemo.BranchTypeCounter(sample_configuration,rooted=True,phased=False)
print(
btc.labels,
btc.labels_dict,
btc.binary_representation,
sep='\n'
)
Output
['a', 'b', 'aa', 'ab', 'bb', 'aab', 'abb']
{'a': 0, 'abb': 6, 'b': 1, 'aab': 5, 'aa': 2, 'bb': 4, 'ab': 3}
[[1 0 0 0]
[0 0 1 0]
[1 1 0 0]
[1 0 1 0]
[0 0 1 1]
[1 1 1 0]
[1 0 1 1]]
Panmictic model, unphased, rooted
Code:
sample_configuration = [('a','a','b','b')]
btc = agemo.BranchTypeCounter(sample_configuration,rooted=True,phased=False)
print(
btc.labels,
btc.labels_dict,
btc.binary_representation,
sep='\n'
)
Output:
['a', 'b', 'aa', 'ab', 'bb', 'aab', 'abb']
{'a': 0, 'abb': 6, 'b': 1, 'aab': 5, 'aa': 2, 'bb': 4, 'ab': 3}
[[1 0 0]
[1 1 0]
[1 1 1]]
Panmictic model, unphased, unrooted
Code:
sample_configuration = [('a','a','b','b')]
btc = agemo.BranchTypeCounter(sample_configuration,rooted=False,phased=False)
print(
btc.labels,
btc.labels_dict,
btc.binary_representation,
sep='\n'
)
Output:
['a', 'b', 'aa', 'ab']
{'a': 0, 'abb': 0, 'b': 1, 'aab': 1, 'aa': 2, 'bb': 2, 'ab': 3}
[[1 0 0]
[1 1 0]]