Skip to content

Commit c522fc5

Browse files
committedAug 10, 2018
Sort by name to make WASP/Hornet work way better
Hornet assumes that the remapped file is sorted by name, and I had assumed that by just taking the output of the mapper it would stay that way, but this later assumption was not justified...
1 parent 9d0165d commit c522fc5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎Snakefile

+12-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ rule wasp_remap:
405405
rule wasp_keep:
406406
input:
407407
toremap="{file}.to.remap.bam",
408-
remapped="{file}.remap.bam",
408+
remapped="{file}.remap.namesorted.bam",
409409
output:
410410
temp("{file}.remap.kept.bam"),
411411
shell: """
@@ -962,6 +962,17 @@ rule sort_bam:
962962
samtools sort -o {output} --threads {threads} {input}
963963
"""
964964

965+
966+
rule name_sort_bam:
967+
input: "{sample}.bam"
968+
output: "{sample}.namesorted.bam"
969+
log: "{sample}.sorted.log"
970+
threads: 4
971+
shell: """{module}; module load samtools
972+
samtools sort -n -o {output} --threads {threads} {input}
973+
"""
974+
975+
965976
rule index_bam:
966977
input: "{sample}.bam"
967978
output: "{sample}.bam.bai"

0 commit comments

Comments
 (0)
Please sign in to comment.