From e9266e310f3a743f210d0f0ead53b5c92bc78933 Mon Sep 17 00:00:00 2001 From: pdimens Date: Tue, 4 Mar 2025 09:48:46 -0500 Subject: [PATCH] fix awk call to add +1 to end position --- harpy/snakefiles/align_bwa.smk | 2 +- harpy/snakefiles/align_ema.smk | 2 +- harpy/snakefiles/align_strobealign.smk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/harpy/snakefiles/align_bwa.smk b/harpy/snakefiles/align_bwa.smk index 72dd59c2..b737a5ed 100644 --- a/harpy/snakefiles/align_bwa.smk +++ b/harpy/snakefiles/align_bwa.smk @@ -214,7 +214,7 @@ rule alignment_coverage: container: None shell: - "samtools bedcov -c {input.bed} {input.bam} | awk '{{ $5 = $5 / ($3 - $2); print }}' | gzip > {output}" + "samtools bedcov -c {input.bed} {input.bam} | awk '{{ $5 = $5 / ($3 + 1 - $2); print }}' | gzip > {output}" rule report_config: input: diff --git a/harpy/snakefiles/align_ema.smk b/harpy/snakefiles/align_ema.smk index 73a78a53..ca7b7aff 100644 --- a/harpy/snakefiles/align_ema.smk +++ b/harpy/snakefiles/align_ema.smk @@ -282,7 +282,7 @@ rule alignment_coverage: container: None shell: - "samtools bedcov -c {input.bed} {input.bam} | awk '{{ $5 = $5 / ($3 - $2); print }}' | gzip > {output}" + "samtools bedcov -c {input.bed} {input.bam} | awk '{{ $5 = $5 / ($3 + 1 - $2); print }}' | gzip > {output}" rule barcode_stats: input: diff --git a/harpy/snakefiles/align_strobealign.smk b/harpy/snakefiles/align_strobealign.smk index f0ba476b..ef6d3a5e 100644 --- a/harpy/snakefiles/align_strobealign.smk +++ b/harpy/snakefiles/align_strobealign.smk @@ -205,7 +205,7 @@ rule alignment_coverage: container: None shell: - "samtools bedcov -c {input.bed} {input.bam} | awk '{{ $5 = $5 / ($3 - $2); print }}' | gzip > {output}" + "samtools bedcov -c {input.bed} {input.bam} | awk '{{ $5 = $5 / ($3 + 1 - $2); print }}' | gzip > {output}" rule report_config: input: