-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbsub_submit.sh
More file actions
executable file
·39 lines (34 loc) · 1.05 KB
/
bsub_submit.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1.05 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
#!/bin/bash
# =============================================================================
# bsub.sh — LSF job submission helper
# =============================================================================
# Wraps any starsolo command in an LSF bsub job.
#
# Usage: bsub.sh <starsolo_command_and_args…>
#
# Example:
# ./scripts/bsub.sh starsolo 10x /data/fastqs SAMPLE1 --species human
# =============================================================================
set -euo pipefail
if (( $# < 1 )); then
echo "Usage: bsub.sh <command> [args…]" >&2
echo "Example: bsub.sh starsolo 10x /data/fastqs SAMPLE1 --species human" >&2
exit 1
fi
SCRIPT="$*"
AA=("$@")
# Use the last argument as the job tag (basename only)
TAG=$(basename "${AA[-1]}")
GROUP=$(bugroup -w | grep "\b${USER}\b" | cut -d" " -f1)
CPUS=16
RAM=64000
QUE="normal"
WDIR=$(pwd)
bsub -G "$GROUP" \
-n"$CPUS" \
-R"span[hosts=1] select[mem>$RAM] rusage[mem=$RAM]" \
-M"$RAM" \
-o "$WDIR/$TAG.%J.bsub.log" \
-e "$WDIR/$TAG.%J.bsub.err" \
-q "$QUE" \
$SCRIPT