From 8cc9efd520c9a0977a6b1a4e5e0981cb9c006d05 Mon Sep 17 00:00:00 2001 From: NaotoKubota Date: Fri, 22 Mar 2024 10:49:14 -0700 Subject: [PATCH] Use sortBed instead of unix sort --- Skipper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Skipper.py b/Skipper.py index 08915df..d533bcb 100644 --- a/Skipper.py +++ b/Skipper.py @@ -350,8 +350,8 @@ container: "docker://howardxu520/skipper:bigwig_1.0" shell: - "bedtools genomecov -5 -strand + -bg -ibam {input.bam} | sort -k1,1 -k2,2n | grep -v EBV > {output.bg_plus};" - "bedtools genomecov -5 -strand - -bg -ibam {input.bam} | sort -k1,1 -k2,2n | grep -v EBV > {output.bg_minus};" + "bedtools genomecov -5 -strand + -bg -ibam {input.bam} | sortBed | grep -v EBV > {output.bg_plus};" + "bedtools genomecov -5 -strand - -bg -ibam {input.bam} | sortBed | grep -v EBV > {output.bg_minus};" "bedGraphToBigWig {output.bg_plus} {CHROM_SIZES} {output.bw_plus};" "bedGraphToBigWig {output.bg_minus} {CHROM_SIZES} {output.bw_minus};" @@ -375,8 +375,8 @@ "docker://howardxu520/skipper:bigwig_1.0" shell: "factor=$(samtools idxstats {input.bam} | cut -f 3 | paste -sd+ | bc | xargs -I {{}} echo 'scale=6; 10^6 / {{}}' | bc);" - "bedtools genomecov -scale $factor -5 -strand + -bg -ibam {input.bam} | sort -k1,1 -k2,2n | grep -v EBV > {output.bg_plus};" - "bedtools genomecov -scale $factor -5 -strand - -bg -ibam {input.bam} | sort -k1,1 -k2,2n | grep -v EBV > {output.bg_minus};" + "bedtools genomecov -scale $factor -5 -strand + -bg -ibam {input.bam} | sortBed | grep -v EBV > {output.bg_plus};" + "bedtools genomecov -scale $factor -5 -strand - -bg -ibam {input.bam} | sortBed | grep -v EBV > {output.bg_minus};" "bedGraphToBigWig {output.bg_plus} {CHROM_SIZES} {output.bw_plus};" "bedGraphToBigWig {output.bg_minus} {CHROM_SIZES} {output.bw_minus};"