Skip to content

Commit 6539324

Browse files
committed
Hard-code error column split
1 parent 0014b30 commit 6539324

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

workflow/scripts/format_vcf_fields_longer.R

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ empty.to.na <- function(x) {
1212
x
1313
}
1414

15-
separate_rows_if_exist <- function(df, col, sep) {
16-
if (col %in% colnames(df)) {
17-
separate_longer_delim(df, all_of(cols), delim = sep)
18-
} else {
19-
df
20-
}
21-
}
22-
2315
# Replace "" values with NA in R filter list
2416
# Snakemake passes filters like: list(ERRORS = c(""))
2517
filter.include <- lapply(snakemake@params$filter_include, empty.to.na)
@@ -34,7 +26,7 @@ read_tsv(snakemake@input$tsv) %>%
3426
convert = TRUE
3527
) %>%
3628
# Separate &-delimited error column (more than one error/warning/info message per row is possible)
37-
separate_rows_if_exist("ERRORS", sep = "&") %>%
29+
separate_rows("ERRORS", sep = "&") %>%
3830
# Rename "...[*]..." columns using the provided lookup via Snakemake config
3931
rename(all_of(unlist(snakemake@params$colnames_mapping))) %>%
4032
# Apply dynamic filters from the Snakemake config:

0 commit comments

Comments
 (0)