Hello Brian,
Thank you for your message. I am already following the tutorial you shared -- it is very useful!
I may be doing something incorrectly, but when I reach the mlg.filter() step, it appears I need to have a genclone and not a genid object. Unfortunately, upon converting my genid to a genclone object, the population data I loaded via genlight is removed. Below is the output I am receiving:
gid_filt <- mlg.filter(gid, distance = bruvo.dist) <- 1 + .Machine$double.eps^0.5
Warning: mlg.filter<- only has an effect on genclone objects.
If you want to utilize this functionality, please convert to a genclone object.
No modifications are taking place.
My R commands to go from (1) my VCF file to a genlight object, (2) a genlight to genid object, and then (3) a genid to genclone object, are as follows:
gl.rubi <- vcfR2genlight(vcfR)
ploidy(gl.rubi) <- 2
pop(gl.rubi) <- pop.data$reef
gid <- gl2gi(gl.rubi, probar = FALSE, verbose = NULL)
gid
locNames(gid) <- paste("SNP",1:nLoc(gid),sep=".")
loci <- locNames(gid)
gc <- as.genclone(gid)
However, in reaching this step, I cannot create a genclone object as I receive the following error:
Error in .local(.Object, ...) :
more than one '.' in column names; please name column as [LOCUS].[ALLELE]
My locName(gid) output is as follows (first 10 lines):
[1] "SNP.1" "SNP.2" "SNP.3" "SNP.4" "SNP.5" "SNP.6" "SNP.7" "SNP.8"
[9] "SNP.9" "SNP.10"
All my loci names are unique [anyDuplicated(loci) = 0]. Likewise, I saw from a
previous post that it is recommended to remove the first row from the CSV file if this error appears. But in my case, I have a VCF file as my input.
Any further guidance would be appreciated.
Thank you again for your time and consideration.
Best regards,
Victoria