---
## Projet Jupyter
2001 - F Pérez (iPython)
2014 - F Pérez & B E Granger
---
## Projet Jupyter
---
## Jupyter notebook
- « cahier électronique d'analyses »
- dans un navigateur web
- Julia, Python, R, C++...
- code + résultats + graphiques + explications + formules...
- export : py, R, md, html, pdf
---
---
---
## Jupyter Notebooks
+9,7 millions notebooks sur GitHub
Utilisés en 1re année à Berkeley (1800 étudiants)
"There would have been too many obstacles for students to easily gain access to the tools and data that they need."
Utilisés chez Google, Microsoft, IBM, Bloomberg, Nasa, SoundCloud, NetFlix, La banque mondiale
...
---
## Exemples
[A gallery of interesting Jupyter Notebooks](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks)
[Bioinformatics with Python Cookbook 2nd Ed](https://github.com/PacktPublishing/Bioinformatics-with-Python-Cookbook-Second-Edition)
- [FastQ files](https://github.com/PacktPublishing/Bioinformatics-with-Python-Cookbook-Second-Edition/blob/master/Chapter02/Working_with_FASTQ.ipynb)
- [PDB files](https://github.com/PacktPublishing/Bioinformatics-with-Python-Cookbook-Second-Edition/blob/master/Chapter07/PDB.ipynb)
Génération de notebooks : [BioJupies](https://amp.pharm.mssm.edu/biojupies/) / GEO : GSE116087
---
## L'écosystème Jupyter
Environnement « classique »
---
## L'écosystème Jupyter : Jupyter **lab**
Environnement de développement et d'analyse
---
## Installation
Depuis un environnement conda :
```bash
$ conda install -c conda-forge jupyterlab
```
Lancement :
```bash
$ jupyter-lab
```
---
## Démo
[Try Jupyter](https://jupyter.org/try)
---
## Exercice 1
Notebook `intro_Python.ipynb` / `intro_R.ipynb`
---
## Markdown
- Langage de balises *simples*
- Utilisé pour la partie « littérature » des notebooks
---
## Markdown : exemples
#### Google Docs, Microsoft Word, OpenOffice Writter (WYSIWYG)
Hello my name is **Pierre**.
Git is *fun* and [GitHub](https://github.com/) even more!
#### LaTeX
```tex
Hello my name is \textbf{Pierre}.
Git is \textit{fun} and \href{https://github.com/}{GitHub} even more!
```
#### HTML
```html
Hello my name is
Pierre.
Git is
fun and
GitHub even more!
```
#### Markdown
```md
Hello my name is **Pierre**.
Git is *fun* and [GitHub](https://github.com/) even more.
```
---
## Markdown
Références :
- https://www.markdownguide.org/basic-syntax/
- https://www.markdownguide.org/extended-syntax/
- https://guides.github.com/features/mastering-markdown/
- [Markdown Syntax cheat sheet](https://guides.github.com/pdfs/markdown-cheatsheet-online.pdf)
- [The Ultimate Markdown Guide (for Jupyter Notebook)](https://medium.com/analytics-vidhya/the-ultimate-markdown-guide-for-jupyter-notebook-d5e5abf728fd)
Pour faire des tableaux :
- [Markdown Table Generator](https://www.tablesgenerator.com/markdown_tables)
---
## Markdown
Utilisation hors notebook :
- Éditeur collaboratif en Markdown : [HedgeDoc](https://demo.hedgedoc.org/)
- Fichier [README.md](https://github.com/pierrepo/autoclasswrapper) sur GitHub [✏️](https://github.com/pierrepo/autoclasswrapper/edit/master/README.md)
- Ce [cours](https://github.com/pierrepo/intro-jupyter/) 🤪
- [MyST](https://myst-nb.readthedocs.io/en/latest/) : Markdown sous stéroides pour écrire de la science.
---
---
## Exercice 2
Notebook `markdown.ipynb`
---
## Exercice 3
Notebook `matplotlib.ipynb`
---
## Exercice 4
Notebook `intro_Python.ipynb` / `intro_R.ipynb`
---
## Conclusion
Notebooks Jupyter :
- Polyvalents (Python, R, Bash...)
- Utiles pour l'**analyse exploratoire** et le **reporting** ([exemple](https://github.com/MDverse/mdda/blob/main/notebooks/paper_stats_and_figures.ipynb))
- Excellente interface d'**échange** et de **communication** entre biologiste / bioinformaticien
On dit ce qu'on fait, pourquoi on le fait et ce qu'on obtient.
*Plus de cellules Markdown que de cellules de code*.
On accompagne, on explique des résultats ou des analyses.
⚠️ Attention ⚠️
On ne développe pas un gros code Python dans un notebook.
---
## Pour aller plus loin...
Ten simple rules for writing and sharing computational analyses in Jupyter Notebooks
Rule et al., *PLOS Comput. Biol.*, 2019.
DOI [10.1371/journal.pcbi.1007007]( https://doi.org/10.1371/journal.pcbi.1007007)
Using interactive digital notebooks for bioscience and informatics education
Davies et al., *PLOS Comput. Biol.*, 2020.
DOI [10.1371/journal.pcbi.1008326](https://doi.org/10.1371/journal.pcbi.1008326)
Jupyter: Thinking and Storytelling With Code and Data
Granger et Perez, *Computing in Science & Engineering*, 2021.
DOI [10.1109/MCSE.2021.3059263](https://doi.org/10.1109/MCSE.2021.3059263)
Computational reproducibility of Jupyter notebooks from biomedical publications
Samuel et Mietchen, *arXiv*, 2023.
DOI [10.48550/arXiv.2308.07333](https://doi.org/10.48550/arXiv.2308.07333)
(22 578 notebooks Jupyter Python -> 879 complètement reproductibles)
[JupyterCon](https://jupytercon.com/) 2023 : 10-12 mai ([videos](https://www.youtube.com/playlist?list=PL_1BH3ug7n1Ih_Yy2TmM7MZ2zogSLZvzE))
[Fernando Pérez: Two decades of IPython and Jupyter](https://www.youtube.com/watch?v=mqeibIiLeUA) (26').
---
## Pour aller vers plus de reproductibilité
Using Jupyter for reproducible scientific workflows
Beg et al., *Computing in Science & Engineering*, 2021.
DOI [10.1109/MCSE.2021.3052101](https://doi.org/10.1109/MCSE.2021.3052101)
---
## Pour aller vers plus de reproductibilité
Quelques exemples de dépôts GitHub configurés avec Binder :
- [Ce cours](https://github.com/pierrepo/intro-jupyter)
- [Python omics use cases](https://github.com/pierrepo/python-omics-use-cases)
---