Environment Setup

Last updated on 2023-03-20 | Edit this page

Overview

Questions

  • How do I setup an shell environment to use Snakemake?

Objectives

  • Start an interactive session on a worker node
  • Setup the shell environment
  • Verify versions of snakemake and R

Start Interactive Session


Since we will be running some heavy processing starting an interactive job is important. Otherwise this processing would occcur on a login node and cause issues for other cluster users.

Start an interactive session that will remain active for 1 hour of by running:

BASH

sinteractive -t 01:00:00 -A PAS2136

Software Environment Setup


Run the following steps from within an OSC ondemand terminal within the “SnakemakeWorkflow” subdirectory.

Activate the Snakemake environment:

BASH

. Scripts/setup_env.sh

NOTE: The leading dot followed by a space is important. This causes the settings in setup_env.sh to be applied to your current terminal session.

Expected Output:

OUTPUT

Activating R module that can be used with R scripts.
This module will switch Compiler environment to gnu/11.2.0 and load mkl/2021.3.0 for R/4.2.1
Lmod is automatically replacing "intel/19.0.5" with "gnu/11.2.0".
The following have been reloaded with a version change:
  1) mvapich2/2.3.3 => mvapich2/2.3.6
Configuring R to use the yaml package.
Configuring singularity to use a cache to speed up pulling containers.

Test snakemake with the –version flag

BASH

snakemake --version

Expected Output:

OUTPUT

7.22.0

Test R –version flag

BASH

R --version

Expected Output:

OUTPUT

R version 4.2.1 ...

New Terminal Sessions

If you close your terminal, create a new terminal, or reach the 1 hour timeout you will need to setup your environment again. To do so rerun the following two steps:

BASH

sinteractive -t 01:00:00 -A PAS2136
. Scripts/setup_env.sh