From 8447c9ba2f567d0eb8be6c4347d3235c10f14fbf Mon Sep 17 00:00:00 2001 From: verku Date: Wed, 25 Oct 2023 11:08:08 +0200 Subject: [PATCH] Remove copying the repeatmask bed file to reduce file number and triggering reruns of downstream rules --- workflow/rules/0.2_repeat_identification.smk | 4 +--- workflow/rules/6_autosome_sexchromosome_bed_files.smk | 8 ++++---- workflow/rules/8.2_vcf_qual_repeat_filtering.smk | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/workflow/rules/0.2_repeat_identification.smk b/workflow/rules/0.2_repeat_identification.smk index 42b1ca8..010cc00 100644 --- a/workflow/rules/0.2_repeat_identification.smk +++ b/workflow/rules/0.2_repeat_identification.smk @@ -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: @@ -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} """ diff --git a/workflow/rules/6_autosome_sexchromosome_bed_files.smk b/workflow/rules/6_autosome_sexchromosome_bed_files.smk index eda4d61..914d7ce 100644 --- a/workflow/rules/6_autosome_sexchromosome_bed_files.smk +++ b/workflow/rules/6_autosome_sexchromosome_bed_files.smk @@ -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", @@ -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", @@ -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} """ diff --git a/workflow/rules/8.2_vcf_qual_repeat_filtering.smk b/workflow/rules/8.2_vcf_qual_repeat_filtering.smk index 805d76e..d0304e5 100644 --- a/workflow/rules/8.2_vcf_qual_repeat_filtering.smk +++ b/workflow/rules/8.2_vcf_qual_repeat_filtering.smk @@ -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"),