-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunDocker.sh
More file actions
executable file
·47 lines (42 loc) · 1.73 KB
/
runDocker.sh
File metadata and controls
executable file
·47 lines (42 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -euo pipefail
# Run runChromap.sh inside the Docker container with proper mounts/env
USER_ID=$(id -u)
GROUP_ID=$(id -g)
IMAGE="biodepot/chromap:0.3.2"
# Defaults (can override by exporting before calling this script)
FASTQ_DIR_DEFAULT="/storage/ATAC-Seq"
OUT_DIR_DEFAULT="/storage/ATAC-Seq/output"
HELPER_DIR_DEFAULT="/home/lhhung/chrombpnet/chrombpnet/helpers"
INDEX_FILE_DEFAULT="/storage/scRNAseq_output/indices-110-44/chromap/index"
REF_FASTA_DEFAULT="/storage/scRNAseq_output/indices-110-44/chromap/genome.fa"
CHROM_SIZES_DEFAULT="/storage/scRNAseq_output/indices-110-44/chromap/chrNameLength.txt"
OUTPUT_BAM_DIR_DEFAULT="/mnt/pikachu/ATAC-Seq_bamoutput"
echo "Running container as user ${USER_ID}:${GROUP_ID} using image ${IMAGE}"
# Attach a TTY only if stdout is a terminal
TTY_FLAGS=""
if [ -t 1 ]; then
TTY_FLAGS="-it"
fi
docker run --rm ${TTY_FLAGS} \
-u "${USER_ID}:${GROUP_ID}" \
-v /storage:/storage \
-v /mnt/pikachu:/mnt/pikachu \
-v /home/lhhung:/home/lhhung \
-v "${PWD}":"${PWD}" \
-w "${PWD}" \
-e FASTQ_DIR="${FASTQ_DIR:-${FASTQ_DIR_DEFAULT}}" \
-e OUT_DIR="${OUT_DIR:-${OUT_DIR_DEFAULT}}" \
-e HELPER_DIR="${HELPER_DIR:-${HELPER_DIR_DEFAULT}}" \
-e INDEX_FILE="${INDEX_FILE:-${INDEX_FILE_DEFAULT}}" \
-e REF_FASTA="${REF_FASTA:-${REF_FASTA_DEFAULT}}" \
-e CHROM_SIZES="${CHROM_SIZES:-${CHROM_SIZES_DEFAULT}}" \
-e OUTPUT_BAM_DIR="${OUTPUT_BAM_DIR:-${OUTPUT_BAM_DIR_DEFAULT}}" \
-e TMPDIR="${OUT_DIR:-${OUT_DIR_DEFAULT}}/tmp" \
-e MPLCONFIGDIR="/tmp/mpl" \
-e PYTHONPATH="/home/lhhung/chrombpnet:${PYTHONPATH:-}" \
-e THREADS="${THREADS:-16}" \
-e JOBS="${JOBS:-1}" \
-e DRYRUN="${DRYRUN:-0}" \
"${IMAGE}" \
bash -lc "mkdir -p \"\${TMPDIR}\" && cd \"\${TMPDIR}\" && ${PWD}/runChromap.sh $*"