Commit 822f1a47 authored by Blaise Li's avatar Blaise Li
Browse files

Script to run interactive shell in the container.

parent 51089311
......@@ -6,10 +6,11 @@ endif
all: run_pipeline
install: run_pipeline
install: run_pipeline
install -d $(PREFIX)_$(VERSION)/bin
install run_pipeline $(PREFIX)_$(VERSION)/bin/.
install $(PREFIX)_$(VERSION)/bin/.
install $(PREFIX)_$(VERSION)/bin/.
for datatype in sRNA-seq smallRNA-seq RNA-seq GRO-seq PRO-seq Degradome-seq Ribo-seq iCLIP-seq iCLIP; \
do \
ln -sf $(PREFIX)_$(VERSION)/bin/ $(PREFIX)_$(VERSION)/bin/run_$${datatype}_pipeline; \
......@@ -34,6 +34,8 @@ From:python:3.7-buster
apt-get -y update
# Useful for interactive work using the container
apt-get -y install vim
# (and maybe other tools) needs bc
apt-get -y install bc rsync
apt-get -y install bedops bedtools bowtie2 cutadapt subread hisat2 parallel samtools
#!/bin/bash -l
# Usage:
# Run an interactive shell in the same container that is used for the workflows.
PROGNAME=$(basename "${0}")
function error_exit
# ----------------------------------------------------------------
# Function for exit due to fatal program error
# Accepts 1 argument:
# string containing descriptive error message
# ----------------------------------------------------------------
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
exit 1
# Absolute path to this script
SCRIPT=$(readlink -f "${0}")
# Absolute path this script is in
BASEDIR=$(dirname "${SCRIPT}")
# Do we have singularity?
singularity --version 2> /dev/null && have_singularity=1
if [ ! ${have_singularity} ]
# Do we have an environment modules system?
module --version 2> /dev/null && have_modules=1
if [ ${have_modules} ]
module load singularity || error_exit "singularity is needed to run the pipelines (see ${install_doc})"
error_exit "singularity is needed to run the pipelines (see ${install_doc})"
if [ ! -e ${container} ]
if [ -e ${BASEDIR}/run_pipeline.def ]
echo "The container was not found. Trying to build it. This may take quite some time and requires sudoer's rights."
sudo singularity build ${BASEDIR}/run_pipeline ${BASEDIR}/run_pipeline.def || error_exit "The container could not be built."
error_exit "The container was not found, nor a definition file to build it."
# -B /pasteur will mount /pasteur in the container
# so that it finds the Genome configuration and gene lists
# that are expected to be in a specific location there.
singularity shell -B /pasteur -B /run/shm:/run/shm ${container} $@
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment