Hello,
I am new to R and learning "poppr" and "adegenet" in R package for my data analysis. While performing the following codes/commands for DAPC analysis for my data set, I came across this error message. My data set is haploid and consisting of dominant markers. Since I could not rectify the error with my data set, herewith I attached a sub-sample of my data set for your reference.
I would be grateful to you if you could help me to figure out the error and perform my analysis.
Thank you.
Sincerely,
Buddhika
Command
library("adegenet")
genrr1 <- read.genalex("C:/Users/u1107303/Desktop/genrr1.csv")
splitStrata(genrr1) <- ~location/form
genrr1
pop(genrr1) <- genrr1$other$epid
dapc.genrr1 <- dapc(genrr1, var.contrib = TRUE, scale = FALSE, n.pca = 30, n.da = nPop(genrr1) - 1)
scatter(dapc.genrr1, cell = 0, pch = 18:23, cstar = 0, mstree = TRUE, lwd = 2, lty = 2)
Message
library("adegenet")
> genrr1 <- read.genalex("C:/Users/u1107303/Desktop/genrr1.csv")
Warning in read.genalex("C:/Users/u1107303/Desktop/genrr1.csv") :
I found duplicate column names in your data.
They are being renamed:
col 2918: 28946770 -> 28946770_1
col 3399: 36349730 -> 36349730_1
col 3819: 28945475 -> 28945475_1
col 3870: 28949490 -> 28949490_1
col 4112: 36350716 -> 36350716_1
col 4672: 36351425 -> 36351425_1
Warning message:
In df2genind(gena, ind.names = ind.vec, pop = pop.vec, ploidy = ploidy, :
non-polymorphic marker(s) deleted
> splitStrata(genrr1) <- ~location/form
> genrr1
This is a genclone object
-------------------------
Genotype information:
89 original multilocus genotypes
89 diploid individuals
7314 dominant loci
Population information:
2 strata - location, form
13 populations defined - pop1_t, pop2_t, pop2_m, ..., pop7_t, pop7_m, pop8_t
> pop(genrr1) <- genrr1$other$epid
> dapc.genrr1 <- dapc(genrr1, var.contrib = TRUE, scale = FALSE, n.pca = 30, n.da = nPop(genrr1) - 1)
Error in dapc.genind(genrr1, var.contrib = TRUE, scale = FALSE, n.pca = 30, :
x does not include pre-defined populations, and `pop' is not provided