Warning message in fread(vcf_file):
“Detected 1 column names but the data has 2 columns (i.e. invalid file). Added 1 extra default column name for the first column which is guessed to be row names or an index. Use setnames() afterwards if this guess is not correct, or fix the file write command that created the file to create a valid file.”
Warning message in fread(vcf_file):
“Stopped early on line 35. Expected 2 fields but found 3. Consider fill=TRUE and comment.char=. First discarded non-empty line: <<##FILTER=<ID=discordanthet,Description="Filtered calls where a passing call is het and a high GQ but filtered call is hom var, since often the het is wrong">>>”
Error in `chr_as_locations()`:
! Can't rename columns that don't exist.
✖ Column `#CHROM` doesn't exist.
Traceback:
1. lapply(1:22, function(chr) {
. message(chr)
. vcf_file = glue("{outdir}/phasing/{label}_chr{chr}.phased.vcf.gz")
. if (file.exists(vcf_file)) {
. fread(vcf_file) %>% rename(CHROM = `#CHROM`) %>% mutate(CHROM = str_remove(CHROM,
. "chr"))
. }
. else {
. stop("Phased VCF not found")
. }
. })
2. FUN(X[[i]], ...)
3. fread(vcf_file) %>% rename(CHROM = `#CHROM`) %>% mutate(CHROM = str_remove(CHROM,
. "chr")) # at line 5-7 of file <text>
4. mutate(., CHROM = str_remove(CHROM, "chr"))
5. rename(., CHROM = `#CHROM`)
6. rename.data.frame(., CHROM = `#CHROM`)
7. tidyselect::eval_rename(expr(c(...)), .data)
8. rename_impl(data, names(data), as_quosure(expr, env), strict = strict,
. name_spec = name_spec, error_call = error_call)
9. eval_select_impl(x, names, {
. {
. sel
. }
. }, strict = strict, name_spec = name_spec, type = "rename", error_call = error_call)
10. with_subscript_errors(vars_select_eval(vars, expr, strict = strict,
. data = x, name_spec = name_spec, uniquely_named = uniquely_named,
. allow_rename = allow_rename, type = type, error_call = error_call),
. type = type)
11. tryCatch(with_entraced_errors(expr), vctrs_error_subscript = function(cnd) {
. cnd$subscript_action <- subscript_action(type)
. cnd$subscript_elt <- "column"
. cnd_signal(cnd)
. })
12. tryCatchList(expr, classes, parentenv, handlers)
13. tryCatchOne(expr, names, parentenv, handlers[[1L]])
14. value[[3L]](cond)
15. cnd_signal(cnd)
16. signal_abort(cnd)