Skip to content

Commit

Permalink
Implement #16
Browse files Browse the repository at this point in the history
  • Loading branch information
lentendu committed Mar 7, 2018
1 parent bf36d3f commit c2670e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ all: $(deltamp) $(module) $(steps) $(batch_spec) $(test_config)

# rule to build deltamp, pipeline_master and check_prevuous_step
$(deltamp): bin/% : %.main | lib/$(batch)/option_variables
SED=$$(sed 's/^/s\//;s/\t/\//;s/$$/\//' $| | tr "\n" ";" | sed 's/^/sed "/;s/;$$/"/'); \
SED=$$(sed 's/^/s\//;s/\t/\//;s/$$/\/g/' $| | tr "\n" ";" | sed 's/^/sed "/;s/;$$/"/'); \
eval $$SED $< | sed 's#^\(VERSION\[DELTAMP\]=\)$$#\1$(version)#;s#^\(DELTAMP_BUILD=\)$$#\1$(CURDIR)#' > $@ && chmod +x $@

# rule to build the module file of the current version
Expand Down
1 change: 1 addition & 0 deletions lib/GridEngine/option_variables
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
QUEUE_SUB qsub
QUEUE_OPTIONS -cwd -terse
QUEUE_JOBNAME -N
QUEUE_ACCOUNT -P
QUEUE_HOLD -hold_jid
QUEUE_SEP ,
QUEUE_ARRAYS -t
Expand Down
1 change: 1 addition & 0 deletions lib/Slurm/option_variables
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
QUEUE_SUB sbatch
QUEUE_OPTIONS --parsable
QUEUE_JOBNAME -J
QUEUE_ACCOUNT -A
QUEUE_HOLD -d afterok:
QUEUE_SEP :
QUEUE_ARRAYS -a
Expand Down
13 changes: 11 additions & 2 deletions src/deltamp.main
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ NAME
deltamp version ${VERSION[DELTAMP]} - amplicon pipeline for grid engine
SYNOPSIS
Usage: ${0##*/} [-cdhqs] [-m max_running_tasks] [-r SUBRPOJECT] [CONFIGURATION_FILE]
Usage: ${0##*/} [-a account_or_project_name] [-cdhqs] [-m max_running_tasks] [-r SUBRPOJECT] [CONFIGURATION_FILE]
DESCRIPTION
-h display this help and exit
-a account or project name for the job queueing system
-c at the end of a dry run (-d option), avoid the deletion of the SUBPROJECT and PROJECT (if empty) directories from output directory
-d avoid submission to queueing system and only display pipeline submission informations (aka. dry run)
Expand Down Expand Up @@ -93,11 +95,12 @@ BENCHM=yes
REF_SUBPROJECT=no

# get options
while getopts ":cdfhm:nqsr:" opt
while getopts ":a:cdfhm:nqsr:" opt
do
case $opt in
h) show_help | fmt -s -w $(tput cols)
exit 1;;
a) DELTAMP_ACCOUNT=$OPTARG;;
c) CLEAN=no;;
d) DRY=yes;;
f) show_default | fmt -s -w $(tput cols)
Expand Down Expand Up @@ -543,6 +546,12 @@ then
sed 's/QUEUE_SEP\${pair_end_jobid}//' $SUBPROJECT/config/steps.final > $SUBPROJECT/config/steps.final.tmp && mv $SUBPROJECT/config/steps.final.tmp $SUBPROJECT/config/steps.final
fi

# Add account/project name to queueing commands
if [ ! -z $DELTAMP_ACCOUNT ]
then
sed 's/QUEUE_SUB/QUEUE_SUB QUEUE_ACCOUNT $DELTAMP_ACCOUNT/' $SUBPROJECT/config/steps.final > $SUBPROJECT/config/steps.final.tmp && mv $SUBPROJECT/config/steps.final.tmp $SUBPROJECT/config/steps.final
else

# Save variables about previous SUBPROJECT
comm -23 <(set -o posix; set | sort) <(sort /tmp/amp.$STIME.set) | tr "=" "\t" | grep -v "^[a-z]" | grep -P -v "^PWD\t" | sed "s/'//g" > $SUBPROJECT/config/prev.txt
rm -f /tmp/amp.$STIME.set
Expand Down

0 comments on commit c2670e1

Please sign in to comment.