Skip to content

Commit

Permalink
Remove copying the repeatmask bed file to reduce file number and trig…
Browse files Browse the repository at this point in the history
…gering reruns of downstream rules
  • Loading branch information
verku committed Oct 25, 2023
1 parent 0702bf0 commit 8447c9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions workflow/rules/0.2_repeat_identification.smk
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ rule make_no_repeats_bed:
sorted_rep_bed=rules.sort_repeats_bed.output.sorted_rep_bed,
output:
no_rep_bed=REF_DIR + "/" + REF_NAME + ".repma.bed",
no_rep_bed_dir="results/" + REF_NAME + ".repma.bed",
group:
"reference_group"
log:
Expand All @@ -146,6 +145,5 @@ rule make_no_repeats_bed:
"docker://nbisweden/generode-bedtools-2.29.2"
shell:
"""
bedtools subtract -a {input.ref_bed} -b {input.sorted_rep_bed} > {output.no_rep_bed} 2> {log} &&
cp {output.no_rep_bed} {output.no_rep_bed_dir} 2>> {log}
bedtools subtract -a {input.ref_bed} -b {input.sorted_rep_bed} > {output.no_rep_bed} 2> {log}
"""
8 changes: 4 additions & 4 deletions workflow/rules/6_autosome_sexchromosome_bed_files.smk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ rule make_autosomes_bed:

rule intersect_sexchr_repma_beds:
input:
no_rep_bed_dir=rules.make_no_repeats_bed.output.no_rep_bed_dir,
no_rep_bed=rules.make_no_repeats_bed.output.no_rep_bed,
sexchr_bed=rules.make_sexchr_bed.output,
output:
repma_sex_chr="results/" + REF_NAME + ".repma.sexchr.bed",
Expand All @@ -64,13 +64,13 @@ rule intersect_sexchr_repma_beds:
"docker://nbisweden/generode-bedtools-2.29.2"
shell:
"""
bedtools intersect -a {input.no_rep_bed_dir} -b {input.sexchr_bed} > {output.repma_sex_chr} 2> {log}
bedtools intersect -a {input.no_rep_bed} -b {input.sexchr_bed} > {output.repma_sex_chr} 2> {log}
"""


rule intersect_autos_repma_beds:
input:
no_rep_bed_dir=rules.make_no_repeats_bed.output.no_rep_bed_dir,
no_rep_bed=rules.make_no_repeats_bed.output.no_rep_bed,
autosome_bed=rules.make_autosomes_bed.output,
output:
repma_autos="results/" + REF_NAME + ".repma.autos.bed",
Expand All @@ -83,7 +83,7 @@ rule intersect_autos_repma_beds:
"docker://nbisweden/generode-bedtools-2.29.2"
shell:
"""
bedtools intersect -a {input.no_rep_bed_dir} -b {input.autosome_bed} > {output.repma_autos} 2> {log}
bedtools intersect -a {input.no_rep_bed} -b {input.autosome_bed} > {output.repma_autos} 2> {log}
"""


Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/8.2_vcf_qual_repeat_filtering.smk
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ rule remove_repeats_vcf:
"""Remove repeats from vcf files"""
input:
vcf=rules.filtered_bcf2vcf.output.vcf,
bed=rules.make_no_repeats_bed.output.no_rep_bed_dir,
bed=rules.make_no_repeats_bed.output.no_rep_bed,
genomefile=rules.genome_file.output.genomefile,
output:
filtered=temp("results/{dataset}/vcf/" + REF_NAME + "/{sample}.merged.rmdup.merged.{processed}.snps5.noIndel.QUAL30.dp.AB.repma.vcf.gz"),
Expand Down

0 comments on commit 8447c9b

Please sign in to comment.