Skip to content

Commit 2b1b23f

Browse files
committed
Detect intergenic variants using SnpEff results
1 parent efccc34 commit 2b1b23f

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

workflow/rules/vaf.smk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ rule merge_annotation:
198198
conda: "../envs/renv.yaml"
199199
params:
200200
ref_name = config["ALIGNMENT_REFERENCE"],
201+
snpeff_columns = config["ANNOTATION"]["SNPEFF_COLS"],
201202
input:
202203
tsv = OUTDIR/"vaf"/"{sample}.masked.prefiltered.tsv",
203204
annot = OUTDIR/"vaf"/"{sample}.vcf_fields.longer.tsv",

workflow/scripts/merge_annotation.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ variants <- read_tsv(
3838
log_info("Reading annotation table")
3939
annotation <- read_tsv(
4040
snakemake@input$annot,
41-
col_select = c("CHROM", "POS", "REF", "ALT", "VARIANT_NAME"),
41+
col_select = c(
42+
snakemake@params$snpeff_columns,
43+
"VARIANT_NAME"
44+
),
4245
col_types = list(
4346
CHROM = col_character(),
4447
POS = col_integer(),

workflow/scripts/report/NV_description.R

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ empty_vcf <- tibble(
4242
REGION = as.character(NA),
4343
VARIANT_NAME = as.character(NA),
4444
ALT_FREQ = as.numeric(NA),
45-
GB_FEATURE = as.character(NA),
45+
EFFECT = as.character(NA),
4646
SYNONYMOUS = as.character(NA),
4747
POS = as.numeric(NA),
4848
ALT = as.character(NA),
@@ -57,7 +57,7 @@ vcf <- vcf %>%
5757
REGION,
5858
VARIANT_NAME,
5959
ALT_FREQ,
60-
GB_FEATURE,
60+
EFFECT,
6161
SYNONYMOUS,
6262
POS,
6363
ALT
@@ -93,7 +93,7 @@ vcf <- vcf %>%
9393
TRUE ~ "SNP"
9494
),
9595
Class = case_when(
96-
GB_FEATURE == "Intergenic" ~ "Intergenic",
96+
EFFECT == "intergenic_region" ~ "Intergenic",
9797
TRUE ~ SYNONYMOUS
9898
),
9999
POS = as.numeric(POS)
@@ -104,7 +104,7 @@ vcf <- vcf %>%
104104
NV_class == "INDEL" ~ str_length(ALT) - 1
105105
),
106106
indel_class = case_when(
107-
GB_FEATURE == "Intergenic" ~ "Intergenic",
107+
EFFECT == "intergenic_region" ~ "Intergenic",
108108
NV_class == "INDEL" &
109109
indel_len %% 3 == 0 ~
110110
"In frame",
@@ -116,7 +116,7 @@ vcf <- vcf %>%
116116
ungroup() %>%
117117
mutate(
118118
group = case_when(
119-
GB_FEATURE == "Intergenic" ~ "Intergenic",
119+
EFFECT == "intergenic_region" ~ "Intergenic",
120120
NV_class == "SNP" ~ Class,
121121
NV_class == "INDEL" ~ indel_class
122122
)
@@ -446,7 +446,6 @@ window %>%
446446
# Heterozygous sites per sample table
447447
vcf_snp %>%
448448
filter(ALT_FREQ <= snakemake@params$max_alt_freq) %>%
449-
select(!GB_FEATURE) %>%
450449
left_join(
451450
metadata,
452451
by = c("SAMPLE" = "ID")

workflow/scripts/report/evo_plots.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ vcf <- vcf %>%
2525
VARIANT_NAME,
2626
REGION,
2727
ALT_FREQ,
28-
GB_FEATURE,
2928
SYNONYMOUS,
3029
POS
3130
)

0 commit comments

Comments
 (0)