-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·66 lines (52 loc) · 1.79 KB
/
run
File metadata and controls
executable file
·66 lines (52 loc) · 1.79 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Source the getopts script
source ./scripts/getopts
# Source the environment variables
source ./config/env
# Source the annotation file
source ./config/ann
# Get the current timestamp
TIMESTAMP=$(date +"%Y-%m-%d_%H.%M.%S")
# Create an output directory with the current timestamp
export OUT_DIR="output/output_$TIMESTAMP"
mkdir -p "$OUT_DIR" "$OUT_DIR"/tmp "$OUT_DIR"/annotation
# Read the parameters from the params.csv file
while IFS=',' read -r var value; do
if [ "$var" == "future.mem" ]
then
MEMORY="$value"
fi
if [ "$var" == "future.workers" ]
then
WORKERS="$value"
fi
done < config/params.csv
# Set the Seurat image based on whether ATAC is true or not
if [[ "${atac:-}" == "TRUE" ]]
then
SEURAT_IMAGE=seurat-signac
fi
# Check if the Seurat image version tag has been supplied
if [[ -z ${SEURAT_IMAGE_VER} ]]
then
echo -e "Seurat image version tag needs to be supplied using the -v argument.\n\nFind available versions at https://gallery.ecr.aws/chobiolab/$SEURAT_IMAGE"
exit 1
fi
echo "Using Seurat image $SEURAT_IMAGE:$SEURAT_IMAGE_VER"
# Run the Seurat image using Singularity
singularity run \
--no-home \
--pwd "$APP_PATH" \
-B "$DATA_PATH":"$DATA_PATH" \
-B "$APP_PATH":"$APP_PATH" \
-B ./config/params.csv:/app/config/params.csv \
-B ./config/samples.csv:/app/config/samples.csv \
docker://public.ecr.aws/chobiolab/"$SEURAT_IMAGE":"$SEURAT_IMAGE_VER" "$APP_PATH"/main "$@"
# Set the input directory to the current output directory and run the annotation script
INPUT=$(pwd)/"$OUT_DIR"
cd annotation || return
./run -i "$INPUT"/integrated.RDS -m "$MODEL" -w "$WORKERS" -r "$MEMORY"
cd ..
# Move the annotation output to the output directory and remove the temporary directory
mv annotation/output/output_*/* "$OUT_DIR"/annotation
rm -rf annotation/output