From db303d0a36462e0290b0f410db97595b97ee3f4f Mon Sep 17 00:00:00 2001 From: Anton Kriese Date: Fri, 3 Jun 2022 15:10:59 +0200 Subject: [PATCH] read alternative references' regions; this fixes the error, that all references use the same region in IGV --- workflow/Snakefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workflow/Snakefile b/workflow/Snakefile index a3d813e..8faf366 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -127,6 +127,7 @@ rule pca_plot: rule create_igv_batch: input: + "results/{sample}/{region}/cut_refs.fa" output: "results/{sample}/{region}/igv_batch_{ref}.txt" params: @@ -135,13 +136,15 @@ rule create_igv_batch: path_to_resources = Path(".").absolute() shell: """ + REF_REGION=$(grep {wildcards.ref} {input} | cut -d' ' -f2) cat > {output} <<-EOF genome {params.path_to_resources}/resources/references/{params.ref_file} load {params.path_to_resources}/resources/samples/{wildcards.sample}/{wildcards.ref}/PacBio.bam -goto {params.region} +goto $REF_REGION snapshot {params.path_to_resources}/results/{wildcards.sample}/{wildcards.region}/igv_{wildcards.ref}_screenshot.png exit EOF + unset REF_REGION """ # load "resources/{wildcards.sample}/Illumina.bam" # load "results/{wildcards.sample}/{wildcards.region}/MSA"