Skip to content

Commit

Permalink
revert: not using parallel --workdir (#328) (#332)
Browse files Browse the repository at this point in the history
This actually overrides TMPDIR in the called bash functions.
  • Loading branch information
holtgrewe authored Jan 10, 2023
1 parent 5a4c39b commit 4cd1531
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 12 deletions.
2 changes: 0 additions & 2 deletions snappy_wrappers/wrappers/bcftools/call_joint/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@
export TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
mkdir -p $TMPDIR/parallel
snappy-genome_windows \
--fai-file $REF.fai \
--window-size {snakemake.config[step_config][somatic_variant_calling][bcftools_joint][window_length]} \
{args_ignore_chroms} \
| parallel \
--plain \
--workdir $TMPDIR/parallel \
--keep-order \
--verbose \
--max-procs {snakemake.config[step_config][somatic_variant_calling][bcftools_joint][num_threads]} \
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/bcftools_call/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_joint][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain --workdir $TMPDIR/parallel -j $num_threads 'run-shard {{#}} {{}}'
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk3_hc/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk3_hc][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain --workdir $TMPDIR/parallel -j $num_threads 'run-shard {{#}} {{}}'
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk3_ug/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk3_ug][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain --workdir $TMPDIR/parallel -j $num_threads 'run-shard {{#}} {{}}'
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk4_hc/combine_gvcfs/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_gvcf][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --workdir $TMPDIR/parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk4_hc/discover/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_gvcf][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --workdir $TMPDIR/parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk4_hc/genotype/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_gvcf][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --workdir $TMPDIR/parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
3 changes: 1 addition & 2 deletions snappy_wrappers/wrappers/gatk4_hc/joint/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_joint][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain --workdir $TMPDIR/parallel -j $num_threads 'run-shard {{#}} {{}}'
| parallel -j $num_threads 'run-shard {{#}} {{}}'
# Merge the individual shards' output VCF
bcftools concat \
Expand Down
2 changes: 0 additions & 2 deletions snappy_wrappers/wrappers/varscan/call_joint/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@
}}
mkdir -p $TMPDIR/parallel
for vartype in snp indel; do
generate_intervals \
| parallel \
--plain \
--workdir $TMPDIR/parallel
--keep-order \
--verbose \
--max-procs {snakemake.config[step_config][somatic_variant_calling][varscan_joint][num_cores]} \
Expand Down

0 comments on commit 4cd1531

Please sign in to comment.