Skip to content

Commit

Permalink
Pad sample index in ScatterPloidyCallsBySample
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalker174 committed Jun 11, 2020
1 parent a9634ea commit 05836b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/cnv_wdl/cnv_common_tasks.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,13 @@ task ScatterPloidyCallsBySample {

# Archive call files by sample, renaming so they will be glob'd in order
sample_ids=(~{sep=" " samples})
num_samples=~{num_samples}
num_digits=${#num_samples}
for (( i=0; i<~{num_samples}; i++ ))
do
sample_id=${sample_ids[$i]}
sample_no=`printf %04d $i`
tar -czf sample_${sample_no}.${sample_id}.contig_ploidy_calls.tar.gz -C calls/SAMPLE_${i} .
padded_sample_index=$(printf "%0${num_digits}d" $i)
tar -czf sample_${padded_sample_index}.${sample_id}.contig_ploidy_calls.tar.gz -C calls/SAMPLE_${i} .
done
>>>
runtime {
Expand Down

0 comments on commit 05836b3

Please sign in to comment.