Entering edit mode
3.0 years ago
DanielEB_fisk
▴
20
In order to get a VCF file from genind, I am going through hierfstat function write.ped() and then with plink I convert the result to vcf. This is my code (apologies, but I cannot provide a reproducible data for this particular scenario):
hierfstat_object <- genind2hierfstat(genind_object)
pop <- hierfstat_object$pop
inds <- rownames(hierfstat_object)
rownames(hierfstat_object) <- NULL
hierfstat_object <- dplyr::select(hierfstat_object, -pop)
write.ped(hierfstat_object, ilab = inds, pop = pop, fname = "path/to/file")
And then in bash with plink:
$ plink --file Ped_map_file --recode vcf --out VCF_file --allow-extra-chr
Problem is, when I inspect the PED and MAP objects that R created, the first locus is removed, for no apparent reason. Does anyone know about this behaviour and how to solve it?
Thank you