Skip to content

Commit 68dbe57

Browse files
authored
Merge pull request #4 from elixir-europe-training/1-developing-practical-1
1 developing practical 1
2 parents adf90ff + 47f23a0 commit 68dbe57

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
/.quarto/
22
.Rproj.user
3+
4+
# Ignore all directories named "data"
5+
data/
6+
*/data/

day_1/practical_1/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM jupyter/minimal-notebook:latest
2+
LABEL org.opencontainers.image.source=https://github.com/scilifelabdatacentre/serve-images
3+
4+
ARG SERVE_BRANCH=develop
5+
WORKDIR /home/jovyan
6+
7+
COPY requirements.txt /tmp
8+
COPY imaging_based_data_analysis_env.yml /tmp
9+
COPY lab /home/jovyan/lab
10+
COPY start-script.sh /usr/local/bin/start-script.sh
11+
12+
USER root
13+
RUN apt-get update && apt-get install curl -y --no-install-recommends && \
14+
apt-get clean && rm -rf /var/lib/apt/lists/*
15+
16+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
17+
18+
RUN conda install -n base -c conda-forge mamba
19+
20+
RUN mamba env create -f /tmp/imaging_based_data_analysis_env.yml && conda clean --all --yes
21+
22+
RUN echo "conda activate imaging_based_data_analysis_env" >> /etc/profile.d/conda.sh
23+
24+
RUN /opt/conda/envs/imaging_based_data_analysis_env/bin/pip install ipykernel && \
25+
/opt/conda/envs/imaging_based_data_analysis_env/bin/python -m ipykernel install --name imaging_based_data_analysis_env --display-name "Python (imaging_based_data_analysis_env)"
26+
27+
RUN chown -R jovyan:users /opt/conda /home/jovyan/.cache /home/jovyan/lab && \
28+
chmod -R a+rwx /home/jovyan/lab && \
29+
chmod +x /usr/local/bin/start-script.sh
30+
31+
USER jovyan
32+
33+
# Set default conda environment
34+
ENV PATH=/opt/conda/envs/imaging_based_data_analysis_env/bin:$PATH
35+
36+
# Disable Jupyter token authentication
37+
RUN jupyter notebook --generate-config && \
38+
echo "c.NotebookApp.token = ''" >> /home/jovyan/.jupyter/jupyter_notebook_config.py && \
39+
echo "c.NotebookApp.password = ''" >> /home/jovyan/.jupyter/jupyter_notebook_config.py && \
40+
echo "c.NotebookApp.ip = '0.0.0.0'" >> /home/jovyan/.jupyter/jupyter_notebook_config.py && \
41+
echo "c.NotebookApp.open_browser = False" >> /home/jovyan/.jupyter/jupyter_notebook_config.py
42+
43+
# Set the startup script as the entrypoint
44+
ENTRYPOINT ["/usr/local/bin/start-script.sh"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: imaging_based_data_analysis_env
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- defaults
6+
dependencies:
7+
- python=3.9
8+
- scanpy
9+
- squidpy
10+
- pandas
11+
- scipy
12+
- scikit-learn
13+
- matplotlib
14+
- seaborn
15+
- ipykernel
16+
- jupyterlab
17+
- pip
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Practical 1: Imaging-Based Data Analysis with Xenium (Mouse Brain, Cancer)\n",
8+
"### Author: Rasool Saghaleyni"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": null,
14+
"metadata": {},
15+
"outputs": [],
16+
"source": [
17+
"# Import necessary libraries\n",
18+
"import scanpy as sc\n",
19+
"import squidpy as sq\n",
20+
"import matplotlib.pyplot as plt\n",
21+
"import numpy as np\n",
22+
"import pandas as pd"
23+
]
24+
}
25+
],
26+
"metadata": {
27+
"language_info": {
28+
"name": "python"
29+
}
30+
},
31+
"nbformat": 4,
32+
"nbformat_minor": 2
33+
}

day_1/practical_1/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mlflow==2.8.1
2+
boto3==1.28.50
3+
minio==7.1.16

day_1/practical_1/start-script.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# Activate the conda environment
3+
source /opt/conda/bin/activate imaging_based_data_analysis_env
4+
# Start the Jupyter Notebook server
5+
exec jupyter notebook --allow-root --notebook-dir=/home/jovyan/lab

0 commit comments

Comments
 (0)