Hi Pablo,
I guess that you used dartR to convert from genlight to bed. There was a small in that function. I solve it and the updated version is available in the beta version of dartR. Below is some code to convert the genlight object and run pcadapt. for this work to work you need to download the PLINK executable and move it to your working directory. You can use dummy names, if you dont have information about the chromosome and position of your SNPs.
library(pcadapt)
library(devtools)
# installing the beta version of dartR
install_github("green-striped-gecko/dartR", ref = "beta", dependencies = TRUE,build_vignettes = TRUE)
# loading dartR
library(dartR)
# filtering on call rate
test <- gl.filter.callrate(
platypus.gl,threshold = 1)
# assigning chromosome information
test$chromosome <- test$other$loc.metrics$Chrom_Platypus_Chrom_NCBIv1
# assigning position information
test$position <- test$other$loc.metrics$ChromPos_Platypus_Chrom_NCBIv1
# converting to bed file
gl2plink(test,bed_file = T,outpath = getwd())
# running pcadapt
gl7_pcadapt <- read.pcadapt("gl_plink.bed",type = "bed")
x <- pcadapt(gl7_pcadapt, K = 20, min.maf = 0.01)
Cheers,
Luis