-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README, LICENSE, documentation and infrastructure updates. (#20)
- Loading branch information
Showing
16 changed files
with
639 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# README | ||
|
||
## License | ||
|
||
The license is [CC-BY-SA-4](https://creativecommons.org/licenses/by-sa/4.0/). | ||
|
||
Some of the code blocks have dependencies licensed as [GPL3](https://opensource.org/licenses/gpl-3.0.html). | ||
|
||
See [here](https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/) for a statement on the compatibility of the `GPL` and Creative Commons licenses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# Introduction | ||
|
||
This book is a collection of visualisations developed for teaching population genetics. | ||
The goal is to create a collection of interactive content that can be remixed alongside existing course material. | ||
|
||
The icons near the top right of this page will take you to the `GitHub` repository for this book. | ||
|
||
## Technologies used | ||
|
||
* [Jupyter book](https://www.jupyterbook.org) | ||
* [Observable](https://www.observablehq.com) notebooks. | ||
These are pure JavaScript inserted into the book via [embedding](https://observablehq.com/@observablehq/introduction-to-embedding). | ||
* [Holoviews](https://www.holoviews.org) creates interactive JavaScript applications that require Python. | ||
These pages require [MyBinder](https://mybinder.readthedocs.io/) to function, which just takes a few mouse clicks!. | ||
See {ref}`here <interactive_python_notebooks>` for details. | ||
|
||
## Integrating the information into existing courses. | ||
|
||
* Direct links to the many of the pages "just work" in "learning management" systems such as [Canvas](https://www.instructure.com/canvas). | ||
The exception is the pages requiring `MyBinder`. | ||
These pages need to be launched in the binder, or... | ||
* ...you can use them in slides as described {ref}`here <interactive_python_in_slides>`. | ||
* The Observable content can also be used in slides. | ||
See {ref}`here <observable_in_slides>` for instructions for `Jupyter` . | ||
|
||
## License | ||
|
||
The license is [CC-BY-SA-4](https://creativecommons.org/licenses/by-sa/4.0/). | ||
|
||
Some of the code blocks have dependencies licensed as [GPL3](https://opensource.org/licenses/gpl-3.0.html). | ||
|
||
See [here](https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/) for a statement on the compatibility of the `GPL` and Creative Commons licenses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Acknowledgements | ||
|
||
* David Kirby, UCI | ||
* Aaron Ragsdale, U. Wisconsin | ||
* The `tskit` and `msprime` communities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
(interactive_python_in_slides)= | ||
|
||
# Using interactive Python applets in slideshow presentations | ||
|
||
It is possible to use the interactive Python applications in slideshows. | ||
Doing this makes this content available for lectures, etc.. | ||
You *do not* need internet access for the applets to function. | ||
|
||
You need the following tools, all of which can be installed using `pip`: | ||
|
||
* [jupyter](https://www.jupyter.org) notebook | ||
* [RISE](https://rise.readthedocs.io/en/stable/) | ||
* [hide_code](https://github.com/kirbs-/hide_code) | ||
|
||
We highly recommend using a `virtualenv` | ||
|
||
```{note} | ||
The installation and setup instructions for `hide_code` did not "just work" for the author. | ||
Each command needs a `--user` flag. | ||
`RISE` is not compatible with `jupyter-lab`. | ||
You must use the classic notebook interface. | ||
``` | ||
|
||
Once the above are installed, you can generate slides, hide the code, and the slide will contain a working applet. | ||
|
||
## Additional hints | ||
|
||
* You may want to redefine the `height` and `width` output of the plots in order to better fill the slides. | ||
Doing so will cause the images to be far too big in the regular notebook view, but they will look good in the slide view. | ||
* The pages of this book allow the Python code to be copied. | ||
If you mouse over a code block, a "page" icon appears in the top right. | ||
Click it, and the code block will be copied to your clip board. | ||
This copy method is the simplest way to get the examples into your own slideshows. | ||
|
||
## Caveats and limitations | ||
|
||
* Using this type of content in lecture slides basically commits you to bringing your own laptop to class. | ||
You need a fully-functional Python environment, etc., and you are unlikely to find such a thing on the ancient Windows PC at the podium in your classroom. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(observable_in_slides)= | ||
|
||
# Using Observable content in Jupyter presentations | ||
|
||
You can display the observable content in Jupyter notebooks (and slideshows). | ||
Note that you *do need* internet access for the content to display! | ||
|
||
The following Python code will display {ref}`this <fixation_in_diploid_population>` Observable widget in a Jupyter output cell: | ||
|
||
``` python | ||
from IPython.core.display import display, HTML | ||
script=""" | ||
<iframe width="75%" height="750" frameborder="0" | ||
src="https://observablehq.com/embed/@molpopgen/fixation-under-directional-selection?cells=detail_plot%2Cviewof+N%2Cviewof+num_copies%2Cviewof+selection_coefficient%2Cviewof+dominance%2Cviewof+show_genotypes"></iframe> | ||
""" | ||
display(HTML(script)) | ||
``` | ||
|
||
Using the tools described {ref}`here <interactive_python_in_slides>`, you can hide the Python code needed to display the applet. | ||
|
||
## Additional hints | ||
|
||
* The `iframe` code needed to embed the Observable content can be copied from the source code for this project. | ||
Alternately, you can generate your own embed code manually from the [author's collection](https://www.observablehq.com/@molpopgen). | ||
|
||
## Limitations | ||
|
||
* The applications may be quite small in the slides. | ||
We are currently not sure if there is a way to rescale them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
jupytext: | ||
formats: md:myst | ||
text_representation: | ||
extension: .md | ||
format_name: myst | ||
kernelspec: | ||
display_name: Python 3 | ||
language: python | ||
name: python3 | ||
--- | ||
|
||
# Python dependencies | ||
|
||
The Python requirements for this book are: | ||
|
||
```{code-cell} | ||
--- | ||
tags: ['remove-input'] | ||
--- | ||
with open("../../../requirements.txt", "r") as f: | ||
x = f.readlines() | ||
print(''.join(x)) | ||
``` | ||
|
||
The above list is defined in `requirements.txt` in the `GitHub` repository. | ||
|
||
The precise versions of all packages used to create this book are: | ||
|
||
```{code-cell} | ||
--- | ||
tags: ['remove-input'] | ||
--- | ||
import subprocess | ||
lockfile = subprocess.run(["pip", "freeze"], stdout=subprocess.PIPE) | ||
print(lockfile.stdout.decode('utf-8')) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ matplotlib | |
numpy | ||
msprime==1.0.1 | ||
pandas | ||
pytest | ||
scipy |
This file was deleted.
Oops, something went wrong.