tskit-dev / tsdate

Infer the age of ancestral nodes in a tree sequence.
MIT License
19 stars 10 forks source link

Add tutorial for reinferring tsinfer tree sequences using estimated dates #191

Open awohns opened 2 years ago

awohns commented 2 years ago

The accuracy of tree sequences inferred with tsinfer can be improved by using tsdate estimated dates. This is very straightforward and should be added to the docs:

inferred_ts = tsinfer.infer(samples).simplify()
dated = tsdate.date(inferred_ts, mutation_rate=mutation_rate, Ne=Ne)
sites_time = tsdate.sites_time_from_ts(dated) 
dated_samples = tsdate.add_sampledata_times(samples, sites_time)
reinferred_ts = tsinfer.infer(dated_samples).simplify()
dated_reinferred = tsdate.date(reinferred_ts, mutation_rate=mutation_rate, Ne=Ne, progress=True)
hyanwong commented 2 years ago

Have we data to show that this improves the topological inference in a (very simple) simulated TS. I think we do, right?

awohns commented 2 years ago

Yes, and I agree it would be a good idea to include it!

awohns commented 2 years ago

This is probably something that we want to add to the JupyterBook tutorial.