Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
bioinfo_utils
Commits
daef0163
Commit
daef0163
authored
Jan 29, 2020
by
Blaise Li
Browse files
More verbose wrapper script.
Indicate original config file.
parent
8214c5aa
Changes
1
Show whitespace changes
Inline
Side-by-side
run_pipeline.sh
View file @
daef0163
...
@@ -77,14 +77,15 @@ output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$/
...
@@ -77,14 +77,15 @@ output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$/
mkdir
-p
${
output_dir
}
mkdir
-p
${
output_dir
}
start_day
=
$(
date
+
"%Y-%m-%d"
)
start_day
=
$(
date
+
"%Y-%m-%d"
)
log_base
=
"
${
output_dir
}
/
$(
date
+
"%d%m%y_%Hh%Mm"
)
"
log_base
=
"
${
output_dir
}
/
$(
date
+
"%d%m%y_%Hh%Mm"
)
"
>
${
log_base
}
.log
config_base
=
$(
basename
${
configfile
}
)
config_base
=
$(
basename
${
configfile
}
)
config_snapshot
=
"
${
output_dir
}
/
${
config_base
}
"
config_snapshot
=
"
${
output_dir
}
/
${
config_base
}
"
echo
"Saving a local copy of the configuration in
${
config_snapshot
}
"
echo
"Saving a local copy of the configuration
file
${
configfile
}
in
${
config_snapshot
}
"
|
tee
-a
${
log_base
}
.log
cp
-f
${
configfile
}
${
config_snapshot
}
cp
-f
${
configfile
}
${
config_snapshot
}
snakefile_base
=
$(
basename
${
snakefile
}
)
snakefile_base
=
$(
basename
${
snakefile
}
)
snakefile_snapshot
=
"
${
output_dir
}
/
${
snakefile_base
}
"
snakefile_snapshot
=
"
${
output_dir
}
/
${
snakefile_base
}
"
echo
"Saving a local copy of the snakefile in
${
snakefile_snapshot
}
"
echo
"Saving a local copy of the snakefile in
${
snakefile_snapshot
}
"
|
tee
-a
${
log_base
}
.log
cp
-f
${
snakefile
}
${
snakefile_snapshot
}
cp
-f
${
snakefile
}
${
snakefile_snapshot
}
kilobytes_tot
=
$(
mawk
'$1 == "MemTotal:" {print $2}'
/proc/meminfo
)
kilobytes_tot
=
$(
mawk
'$1 == "MemTotal:" {print $2}'
/proc/meminfo
)
...
@@ -99,7 +100,7 @@ megabytes_resource=$(echo "${kilobytes_tot} / 1100" | bc)
...
@@ -99,7 +100,7 @@ megabytes_resource=$(echo "${kilobytes_tot} / 1100" | bc)
# TODO: check that this works
# TODO: check that this works
cmd
=
"(cd
${
output_dir
}
; snakemake -s
${
snakefile_base
}
--configfile
${
config_base
}
--resources mem_mb=
${
megabytes_resource
}
$@
)"
cmd
=
"(cd
${
output_dir
}
; snakemake -s
${
snakefile_base
}
--configfile
${
config_base
}
--resources mem_mb=
${
megabytes_resource
}
$@
)"
echo
${
cmd
}
>
${
log_base
}
.log
echo
${
cmd
}
|
tee
-a
${
log_base
}
.log
# https://unix.stackexchange.com/a/245610/55127
# https://unix.stackexchange.com/a/245610/55127
# https://stackoverflow.com/a/692407/1878788
# https://stackoverflow.com/a/692407/1878788
# Migh make things too slow?
# Migh make things too slow?
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment