We will first install miniforge which is itself an installer for mamba which is an installer for python packages (kind of like a kinase kinase kinase).
curl followed by the command starting with bash. Please ask an instructor for help if you are using this workflow.To verify miniforge is installed correctly:
conda --version and press Enterconda init zsh to initialize your shells for conda/mamba use.The package installers mamba and conda allow you to create separate analysis environments into which you can install required software for data analysis. The advantage of this approach is that different projects, which might require different versions of the same software package, are kept separate and cannot interfere negatively with one another. Here, we use mamba for package installation, because it is faster.
conda create -n scrnaseq python=3.12(this creates an analysis environment called scrnaseq)conda activate scrnaseq(this activates the environment, which should become evident by the environment name now preceding the prompt)mamba install -c conda-forge -c bioconda scanpy pandas numpy matplotlib seaborn ipykernel scikit-learn scipy h5py openpyxl leidenalg python-igraph harmonypy -y
This does not work if you are behind Charité’s proxy server. “Charité Gast” WiFi and eduroam (without using Charité VPN!) should work.
Not all packages are available via conda/mamba, so sometimes we need to use the more general python package manager pip. Here, we use it to install decoupler, which comes with many useful functions for single cell analysis, and PyDESeq2 for differential expression testing. Please run the following commands inside your scrnaseq environment:
pip install decoupler
pip install pydeseq2
This year we will use Positron as our code editor. Positron is a data science IDE (from the makers of RStudio) that works with both python and R and can run jupyter notebooks directly, without a web browser.
Because we created the scrnaseq environment in Step 2 before opening Positron, Positron will automatically find it.
.ipynb) via the New button in the top left corner: New > New File > Jupyter NotebookCtrl/Cmd + Shift + P and search for “Select Interpreter”), and choose the scrnaseq conda environment from the list
scrnaseq does not appear yet, click the refresh icon in the picker, or restart Positron - it scans for environments on startupShift + Enter).
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(10)
y = np.arange(10)**2
plt.plot(x, y, '-o')
plt.show()
If everything worked correctly, you should see a quadratic curve. You are ready to move on to the data science intro.