Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow to pass single batch number to pipeline_job.sh (#327) #333

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions snappy_pipeline/apps/tpls/pipeline_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,12 @@ set -x
# Kick off Snakemake --------------------------------------------------------

# Interpret array jobs.
set +e
SNAKEMAKE_BATCH_END=${SLURM_ARRAY_TASK_MAX-}
SNAKEMAKE_BATCH_CUR=${SLURM_ARRAY_TASK_ID-}
if [[ ! -z "$SNAKEMAKE_BATCH_CUR" ]]; then
if [[ $SLURM_ARRAY_TASK_ID -lt 1 ]]; then
>&2 echo "Snakemake batches start couting at 1"
exit 1
fi
SNAKEMAKE_BATCH_ARG="--batch ${SNAKEMAKE_BATCH_RULE-default}=${SNAKEMAKE_BATCH_CUR}/${SNAKEMAKE_BATCH_END}"
# Allow selection of batch
if [[ ! -z "${SNAPPY_BATCH-}" ]]; then
SNAKEMAKE_BATCH_ARG="--batch ${SNAKEMAKE_BATCH_RULE-default}=${SNAPPY_BATCH}"
else
SNAKEMAKE_BATCH_ARG=
fi
set -e

# Using the medium project/queue is a sensible default.
snappy-snake --printshellcmds \
Expand Down