Skip to content

Commit

Permalink
Update count.snake
Browse files Browse the repository at this point in the history
protect against relative paths to `ln -s` using `readlink`
  • Loading branch information
agillen authored Oct 15, 2024
1 parent cc30357 commit 1b089c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rules/count.snake
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ rule filter_R1:
shell:
"""
if [[ {params.length} == 'False' ]]; then
ln -s {input} {output}
ln -s $(readlink -f {input}) $(readlink -f {output})
else
samtools view -h {input} | grep -v 'CB:Z:-\|UB:Z:-' | samtools view -b - > {params.temp}
samtools index {params.temp}
Expand Down Expand Up @@ -212,7 +212,7 @@ rule filter_paired:
shell:
"""
if [[ {params.length} == 'False' ]]; then
ln -s {input} {output}
ln -s $(readlink -f {input}) $(readlink -f {output})
else
samtools view -h {input} | grep -v 'CB:Z:-\|UB:Z:-' | samtools view -b - > {params.temp}
samtools index {params.temp}
Expand Down

0 comments on commit 1b089c1

Please sign in to comment.