Skip to content

Preparing the environment

First, we will walk you through the basics of using the command line interface (CLI), which is essential for running tools like spacemake and Open-ST. We assume you are running Linux (e.g., Ubuntu 22.04). A computer with at least 128 GB of RAM is recommended for spacemake and openst. Future optimizations to spacemake will reduce memory requirements.

Installing dependencies

We will install two dependencies: spacemake and openst.

For this, we assume that you have installed mamba or any similar (e.g., micromamba), and you have opened a terminal (local or remote machine).

Create a new directory for this tutorial.

WORKDIR="~/openst_demo" # change this to any folder you want
mkdir -p $WORKDIR
cd $WORKDIR

During the rest of the tutorial, the root working directory will be

~/openst_demo

Which we store in the environment variable $WORKDIR. You can change this to anything else.

Installing spacemake

Then, create a new environment for spacemake:

wget "https://raw.githubusercontent.com/rajewsky-lab/spacemake/master/environment.yaml"
mamba env create -n openst -f environment.yaml
mamba activate openst
pip install spacemake

Check that your spacemake version matches the one that will be used for this tutorial (0.7.9)

spacemake --version
# make sure it is 0.7.9 or greater

Installing openst

Now, create another environment for openst. We have developed openst separately from spacemake, because spacemake is tech-agnostic (can run on scRNA-seq, Visium, Open-ST), while openst provides tools that are specific to the Open-ST technology (for segmenting, aligning, visualizing, image pre-processing...)

# make sure the environment is still active!
# mamba activate openst
pip install openst

Check that your openst version matches the one that will be used for this tutorial (0.2.3)

openst --version
# make sure it is 0.2.3 or greater

Note

You might need to leave things running in the background (some things take hours to finish). We recommend using tmux; from the RedHat Sysadmin article:

>Tmux is a terminal multiplexer; it allows you to create several "pseudo terminals" from a single terminal.

>This is very useful for running multiple programs with a single connection,

>such as when you're remotely connecting to a machine using Secure Shell (SSH).

Open your ~/.bashrc (or ~/.zshrc) file with a text editor, or VIM, or anything else, and add the following lines:

alias ta='tmux attach -t'
alias tl='tmux ls'
alias tn='tmux new -s'

The next time you open a terminal, these aliases will be available:

  • tn pepa: create a new pseudo-terminal with name "pepa"
  • ta pepa: attaches to the pseudo-terminal called "pepa"
  • tl: lists all pseudo-terminals that are available

To deattach a pseudo-terminal, you have the keyboard shortcut Ctrl+b+d

To close a pseudo-terminal, you close all panels type exit and press Enter, or to close all at once you can use Ctrl+b+&