diff --git a/docs/images/jupyter_logo.png b/docs/images/jupyter_logo.png new file mode 100644 index 00000000..bddf558c Binary files /dev/null and b/docs/images/jupyter_logo.png differ diff --git a/docs/intro.md b/docs/intro.md index 8fbd4926..e6dd1cbb 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -10,6 +10,11 @@ If you have feedback or suggestions, if spotted a typo, broken link or misleadin ## Recent blog posts +### [Running bio image analysis workflows on your machine](stefan_hahmann/github_desktop_jupyter_notebook/readme) + +[Stefan Hahmann](stefan_hahmann/readme), December 21st, 2023
+

Jupyter Notebooks may be used to run bio image analysis workflows on your machine with your own data. They are a great tool to share workflows with others. This post will show you how to run workflows that have been shared via GitHub.

+ ### [Getting started with Miniforge and Python](mara_lampert/getting_started_with_mambaforge_and_python/readme) [Mara Lampert](mara_lampert/readme), January 26th, 2023

This post will help you to get started with Python using Miniforge. More precisely, you will learn how to install Miniforge, how to create and use conda environments and know about some very important packages.

diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/clone-project.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/clone-project.png new file mode 100644 index 00000000..9ebeabaf Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/clone-project.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/git-logo.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/git-logo.png new file mode 100644 index 00000000..d7a40203 Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/git-logo.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/github-logo.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/github-logo.png new file mode 100644 index 00000000..e03d8dd8 Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/github-logo.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/github-mark.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/github-mark.png new file mode 100644 index 00000000..6cb3b705 Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/github-mark.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyter-logo.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyter-logo.png new file mode 100644 index 00000000..bddf558c Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyter-logo.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebook-edit.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebook-edit.png new file mode 100644 index 00000000..1e5ddb21 Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebook-edit.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebook-run.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebook-run.png new file mode 100644 index 00000000..6df9e647 Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebook-run.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebooks.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebooks.png new file mode 100644 index 00000000..e8060a1b Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-notebooks.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-start.png b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-start.png new file mode 100644 index 00000000..6e060078 Binary files /dev/null and b/docs/stefan_hahmann/github_desktop_jupyter_notebook/images/jupyterlab-start.png differ diff --git a/docs/stefan_hahmann/github_desktop_jupyter_notebook/readme.md b/docs/stefan_hahmann/github_desktop_jupyter_notebook/readme.md new file mode 100644 index 00000000..337d5f99 --- /dev/null +++ b/docs/stefan_hahmann/github_desktop_jupyter_notebook/readme.md @@ -0,0 +1,83 @@ +# Running bio image analysis workflows on your machine + +[Stefan Hahmann](../readme.md), December 21st 2023 + +## Introduction + +Jupyter Notebooks may be used to run bio image analysis workflows on your machine with your own data. They are a great tool to share workflows with others. +This blog post will show you how to use [Github Desktop](https://desktop.github.com/) and [Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/) to run a workflow documented in a [Jupyter Notebook](https://jupyter.org/) on your local machine with your own data. + +## Prerequisites + +[Git](https://git-scm.com/) is a version control system that allows you to track changes in your files. It is widely used in software development, because source files of code are frequently changed during the development process. Files that belong together are stored in a so-called repository. +A repository can be stored on a local computer or on a web server. Git allows you to synchronize your local repository with a remote repository. This is useful, if you want to collaborate with other people on the same files. +git-logo + +[GitHub](https://github.com/) is a web-based hosting service for Git repositories. [GitHub Desktop](https://desktop.github.com/) is a client for Git and Github. It allows you to manage your Git repositories locally on your computer. +git-logo git-logo + +[Jupyter Notebooks](https://jupyter.org/) are documents that contain code, equations, visualizations and narrative text. They are widely used in data science and research. The can contain workflows that help you to analyse your data. [Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/) allows you to edit and run Jupyter Notebooks. +git-logo + +[Python](https://www.python.org/) is a programming language that is widely used in data science and research. + +[Napari](https://napari.org) is a multi-dimensional image viewer implemented in Python. + +## Installation + +### Git + +There is no need to install Git separately before installing GitHub Desktop. GitHub Desktop includes a bundled version of Git, so when you install GitHub Desktop, it will also install Git as part of the process. + +### GitHub Desktop + +Download and install [GitHub Desktop](https://desktop.github.com/). Choose the version for your operating system. It is available for Windows and Mac. + +### Jupyter Lab + +The installation of Jupyter Lab on your local machine is part of the installation of Python and Conda. You can follow the instructions in [Getting started with Miniforge and Python](../../mara_lampert/getting_started_with_mambaforge_and_python/readme) for this. + +You should have installed now Python and the environment [devbio-napari](https://github.com/haesleinhuepf/devbio-napari), a distribution of napari with a set of plugins for bioimage analysis. + +## Clone the repository + +Open GitHub Desktop and click "File" > "Clone a repository from the Internet...". Enter the name of the repository you want to clone, e.g.: [BiAPoL/Bio-image_Analysis_with_Python](https://github.com/BiAPoL/Bio-image_Analysis_with_Python) and the local path where you want to store the repository on your computer. Click "Clone". +![Clone project](images/clone-project.png) + +## Starting Jupyter Lab + +Open a terminal and navigate to the folder where you have cloned the repository. + +Activate the environment by entering this (assuming you have used the name `my_first_env` for your environment, otherwise `my_first_env` must be replaced by the name of your environment): + +``` +mamba activate my_first_env +``` + +Start [Jupyter lab](https://jupyter.org/) from the terminal like this: + +``` +jupyter lab +``` + +A browser will open and show you the following web page. + +![Jupyter Lab](images/jupyterlab-start.png) + +## Running a Jupyter Notebook + +Navigate to the notebook you want to run and click on it. Notebooks have the file extension `.ipynb`. The notebook will open in a new tab. + +![Jupyter Lab](images/jupyterlab-notebooks.png) + +Run the notebook by clicking on the "Run" button in the toolbar or by pressing "Shift + Enter". While a cell is running, a star is shown in the square brackets on the left side of the cell. When the cell has finished running, a number is shown in the square brackets. + +![Jupyter Lab](images/jupyterlab-notebook-run.png) + +Before you run a cell, you can change the code in the cell. This allows you to adapt the workflow to your needs. You may e.g. change the path to the data you want to analyse. + +![Jupyter Lab](images/jupyterlab-notebook-edit.png) + +It is possible to skip cells. This is useful, if you want to run only parts of the workflow. To skip a cell, click on the next cell, after the cell you want to skip and then click on the "Run". This will run the selected cell. + + diff --git a/docs/stefan_hahmann/readme.md b/docs/stefan_hahmann/readme.md index c2e885cb..1ea0b3f9 100644 --- a/docs/stefan_hahmann/readme.md +++ b/docs/stefan_hahmann/readme.md @@ -13,6 +13,8 @@ Since 2022, I work as a [research software engineer](https://de-rse.org/en/) for # Blog posts +* [Running bio image analysis workflows on your machine](github_desktop_jupyter_notebook/readme) + # Links * [Twitter](https://twitter.com/stefanhahmann)