Skip to content

Commit 29f25e3

Browse files
committed
Fix reference name mismatch
1 parent ccdc068 commit 29f25e3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

workflow/rules/vaf.smk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ rule compile_vcf_fields_longer:
196196
rule merge_annotation:
197197
threads: 1
198198
conda: "../envs/renv.yaml"
199+
params:
200+
ref_name = config["ALIGNMENT_REFERENCE"],
199201
input:
200202
tsv = OUTDIR/"vaf"/"{sample}.masked.tsv",
201203
annot = OUTDIR/"vaf"/"{sample}.vcf_fields.longer.tsv",

workflow/scripts/merge_annotation.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ library(tidyverse)
99
library(logger)
1010
log_threshold(INFO)
1111

12-
log_info("Reading tables")
13-
variants <- read_tsv(snakemake@input$tsv)
12+
log_info("Reading variants table, replacing REGION with the reference name")
13+
variants <- read_tsv(snakemake@input$tsv) %>%
14+
mutate(REGION = snakemake@params$ref_name)
15+
16+
log_info("Reading annotation table")
1417
annotation <- read_tsv(
1518
snakemake@input$annot,
1619
col_select = c("CHROM", "POS", "REF", "ALT", "VARIANT_NAME")
@@ -20,7 +23,7 @@ log_info("Merging tables")
2023
merged <- left_join(
2124
variants,
2225
annotation,
23-
by = c("CHROM", "POS", "REF", "ALT")
26+
by = c("REGION" = "CHROM", "POS", "REF", "ALT")
2427
)
2528

2629
log_info("Saving results")

0 commit comments

Comments
 (0)