I believe there is a small bug in the function gen_dist(), which is preventing it from calculating certain distance types from a dosage matrix (which is what you have if imputing missing data).
library(algatr)
load_algatr_example()
# impute missing data
gen <- simple_impute(vcf_to_dosage(liz_vcf), median)
d <- gen_dist(gen, dist_type = "pc")
Error in vcfR::read.vcfR(x) :
The parameter file is expected to be a character.
I think there is a missing parenthesis pair in line 24, and it should be:
if (inherits(gen, "vcfR") & (dist_type == "euclidean" | dist_type == "bray_curtis" | dist_type == "pc")) {
If I make that change, then the flow of the function makes sense to me and it works.
Hi,
I believe there is a small bug in the function
gen_dist()
, which is preventing it from calculating certain distance types from a dosage matrix (which is what you have if imputing missing data).I think there is a missing parenthesis pair in line 24, and it should be:
if (inherits(gen, "vcfR") & (dist_type == "euclidean" | dist_type == "bray_curtis" | dist_type == "pc")) {
If I make that change, then the flow of the function makes sense to me and it works.