Set up a basic binder so that new users can play with stdpopsim without hassle of downloading and setting up their environment. We can point them to try out the tutorials in the binder.
To do this, we need to create a Jupyter Notebook in the master github repo and link binder to it.
https://mybinder.org/
This is for later (after pub?).
You can assign me to do this. I can do this later.
This should extend @carjed's PR #49 -- on yesterday's call we decided to wait until we're close to release, then update the notebook/environment.
We definitely want this now, as stdpopsim has a conda package (hooray!). Should be easy enough to update @carjed's initial notebook to do a simple simulation and (say) compute a site frequency spectrum using tskit, and plot with matplotlib/seaborn (say)?
Yes, no problem. I will get on it.
Logistics question - should I just create a new branch for this and let https://github.com/popsim-consortium/stdpopsim/pull/49 die?
sounds reasonable to me @agladstein
Well I'd like to see @carjed get some credit for this, so it would be nice to keep his commit in the history. Logistically, I guess we'll need to let PR #49 die since @agladstein can't write to it. The simplest thing would be to create a new branch on your fork @agladstein, then to cherry-pick @carjed's commit onto that branch. Then you can add your own commits on top of that.
How does that sound @agladstein?
I'm just about done with this, but I've encountered something confusing with the sfs.
Could someone please take a look at https://mybinder.org/v2/gh/agladstein/stdpopsim/binder?filepath=stdpopsim_api_example.ipynb
(the active notebook in binder)
basically, if I follow @gtsambos way with simplifying I get one thing, and if I do what @petrelharp suggested in https://github.com/popsim-consortium/stdpopsim/pull/340 I get something else.
They are both right! The only differences are in the fixed/absent categories. For instance:
>>> np.column_stack([
ts_YRI.allele_frequency_spectrum(polarised=True,span_normalise=False),
ts.allele_frequency_spectrum([YRI_samples], polarised=True,span_normalise=False)])
array([[ 0., 2705.],
[2907., 2907.],
[1213., 1213.],
[ 693., 693.],
[ 518., 518.],
[ 402., 402.],
[ 319., 319.],
[ 312., 312.],
[ 272., 272.],
[ 243., 243.],
[ 0., 58.]])
Simplification gets rid of extra stuff, so it removes the mutations which are either shared by all the YRI samples (58 of these above) or by none of them (2705 of these). Does this make sense?
Besides that, very nice example...
sorry @agladstein, just getting around to looking at this now -- I can't open the binder? But looks like you have it figured it out now anyway. I'd still be keen to see what you've done though :)
ah! sorry there is a typo in that link.
https://mybinder.org/v2/gh/agladstein/stdpopsim/binder?filepath=stdpopsim_example.ipynb
Most helpful comment
I'm just about done with this, but I've encountered something confusing with the sfs.
Could someone please take a look at https://mybinder.org/v2/gh/agladstein/stdpopsim/binder?filepath=stdpopsim_api_example.ipynb
(the active notebook in binder)
basically, if I follow @gtsambos way with simplifying I get one thing, and if I do what @petrelharp suggested in https://github.com/popsim-consortium/stdpopsim/pull/340 I get something else.