File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,21 @@ variants <- read_tsv(
1919 ALT = col_character()
2020 )
2121) %> %
22- mutate(REGION = snakemake @ params $ ref_name )
22+ mutate(
23+ REGION = snakemake @ params $ ref_name ,
24+ is_insertion = startsWith(ALT , " +" ),
25+ is_deletion = startsWith(ALT , " -" ),
26+ REF_VCF = case_when(
27+ is_deletion ~ paste0(REF , substring(ALT , 2 )),
28+ TRUE ~ REF
29+ ),
30+ ALT_VCF = case_when(
31+ is_insertion ~ paste0(REF , substring(ALT , 2 )),
32+ is_deletion ~ REF ,
33+ TRUE ~ ALT
34+ )
35+ ) %> %
36+ select(- is_insertion , - is_deletion )
2337
2438log_info(" Reading annotation table" )
2539annotation <- read_tsv(
@@ -42,7 +56,12 @@ log_info("Merging tables")
4256merged <- left_join(
4357 variants ,
4458 annotation ,
45- by = c(" REGION" = " CHROM" , " POS" , " REF" , " ALT" )
59+ by = c(
60+ " REGION" = " CHROM" ,
61+ " POS" = " POS" ,
62+ " REF_VCF" = " REF" ,
63+ " ALT_VCF" = " ALT"
64+ )
4665)
4766
4867log_info(" Saving results" )
You can’t perform that action at this time.
0 commit comments