poppr and adegenet - DAPC for DArT

107 views
Skip to first unread message

u110...@umail.usq.edu.au

unread,
Apr 14, 2019, 9:55:36 PM4/14/19
to poppr
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
genrr1.csv

Buddhika Amarasinghe Dahanayaka

unread,
Jul 2, 2019, 11:35:29 PM7/2/19
to poppr
Hello Dr. Kamvar,

I am contacting you regarding the same data set I sent you previously. I removed some of my loci and was doing some analyses. I did not change anything except the number of markers in my data set. Now I have 7156 markers and when I run the following commands it says I have 7155 markers and the data set is codominant. But it is a dominant data set. Previously I did not have this problem. 
I would be grateful if you could help me with this issue. 

Thank you.

Sincerely,
Buddhika 


commands

library(poppr)

genrr1 <- read.genalex("C:/Users/u1107303/Desktop/genrr1.csv")
genrr1

Observation in Console 

Genotype information:

     89 original multilocus genotypes
     89 haploid individuals
   7155 codominant loci




--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To post to this group, send email to po...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/c066d3a8-d850-4abd-ad17-e97c50fbcc53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhian Kamvar

unread,
Jul 3, 2019, 3:46:13 AM7/3/19
to Buddhika Amarasinghe Dahanayaka, poppr
Hello,

Two things:
1. It’s difficult to diagnose without knowing what the data looks like, but I suspect that the reason your data mentions one fewer marker is that one of your markers was invariant and was dropped (you would have gotten a warning about that)

2. You mentioned in your earlier email that you have SNP data, which are considered co-dominant as they do not necessarily have a strict binary state. 

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages