Inconsistent mutation numbers between true trees and tsinferred trees #801
Replies: 3 comments 2 replies
-
One shouldn't expect that the inferred tree sequence will be the same as the true tree, only that the resulting genotypes of the samples will be the same. As such the number of mutations can differ, as if the topology of the tree is different a different set of mutations might be needed. There can also be back mutations depending on your tsinfer settings. See https://tskit.dev/tsinfer/docs/stable/inference.html#matching-ancestors-samples |
Beta Was this translation helpful? Give feedback.
-
Did you infer with a recombination rate or recombination map? If so, then for s in inferred_ts.sites():
if len(s.mutations) > 1:
print(s) # you might get a lot of sites printed here! |
Beta Was this translation helpful? Give feedback.
-
Did you ever manage fo figure out what was going on here, @Proteios1998 ? |
Beta Was this translation helpful? Give feedback.
-
Hi, I tried to use tsinfer to infer a tree sequence given the .samples file generated from the true simulated tree. I use
tsinfer.SampleData.from_tree_sequence(ts, path=out, num_flush_threads=10)
to get the .samples file. I usedtsinfer ls *.samples
to check the number of sites in the .samples file and the number is the same as the number of sites in the original tree sequence. However, after using tsinfer to get the inferred tree, I found the number of mutations in the inferred tree (581937) is different from that in the true tree (578231). Could you help explain why?The information of the .samples file:
![image](https://user-images.githubusercontent.com/44884282/219088679-4ad7aef4-4d07-4017-9257-3f3374c3c6e0.png)
The information of the inferred tree:
![image](https://user-images.githubusercontent.com/44884282/219088847-67a45719-ea0b-47c6-be57-c7d882bcb24d.png)
The information of the true tree:
![image](https://user-images.githubusercontent.com/44884282/219089247-08d6b5b8-1f92-41fa-b35d-ab2eeb1abb83.png)
Beta Was this translation helpful? Give feedback.
All reactions