Coalescent Simulation and Inference Activity

Georgia Tsambos, 29 January 2025

 

How to run this activity

The activity on coalescent simulation and inference will be run through Jupyter Notebooks. You will first need to log on to your instance through SSH, start a Jupyter notebook there, and then connect to it with a browser on your local computer.

  • Connect to the instance using SSH:
    ssh [email protected] (replace XXX with your Amazon instance IP address).
  • Once connected through SSH, navigate into the tutorial directory: cd ~/workshop_materials/29_msprime
  • Start a conda virtual environment that contains the tools required for this activity: conda activate msprime-env
  • Start the notebook server: jupyter notebook
    After a few seconds, the screen output should includes lines like the following:

    [I 14:20:21.036 NotebookApp] Jupyter Notebook 6.4.12 is running at:
    [I 14:20:21.036 NotebookApp] http://ip-XXX-XXX-XXX-XXX:8889/?token=4c0941a84ed21bb6c82b92f32f282aeca76169caf1a76934

    Copy and note the part to the right of “token=”, the token string, which in the above example is “4c0941a84ed21bb6c82b92f32f282aeca76169caf1a76934”, but which certainly differs in your case. The running server blocks the terminal. That is normal, keep it running.

  • In your local browser, enter the following as the URL, followed by a colon, the port number “8889”, and “/?token”: http://ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:8889/?token (replace XXX with your Amazon instance IP address
  • This should open a form where you can enter the token string in a field at the top. Do so, and hit Enter.
  • You should now see the content of the home directory on the instance. Click on workshop_material and then 29_msprime to see the files for this activity. Those ending in .ipynb are the Jupiter notesbooks.
  • Click on the first Jupiter notebook, 1-Introduction-and-motivation.ipynb to open it.
  • Make sure that you see “Python (msprime-env)” written at the top right of the page, which means that this is the selected “kernel”. If that should not be the case, then click on “Change Kernel” > “Python (msprime-env)” in the “Kernel” menu at the top left of the screen.
  • After finishing the steps described in the first notebook, continue with the other notebooks. Each time, make sure that the kernel “Python (msprime-env)” is selected as described above.

For future reference, the Jupiter notebooks were taken from this GitHub repository.