DAPC error

27 views
Skip to first unread message

massub....@gmail.com

unread,
May 3, 2024, 9:36:31 AMMay 3
to poppr
Hi Everyone,

I have been using adegent and DAPC for a while now and never had a problem but recently I am running into a problem. After find.cluster when I perform dapc after selecting the PCs to retain I get the following error:

Error in lda.default(x, grouping, ...) :
   nrow(x) and length(grouping) are different

To give a brief background, I did DAPC analysis for 1300 genotypes at K=10 and then based on that I selected approx. 900 genotypes which were very closely related and want to run DAPC again on just these lines. I assigned the population to these lines based on my previous DAPC results. 

I would like to learn why am I getting this error now and how to solve this issue, Please, any help in this regard will be appreciated.

Thanks,
Massub

Zhian Kamvar

unread,
May 5, 2024, 4:15:46 PMMay 5
to massub....@gmail.com, poppr
NOTE: Without seeing the code you used to get this error, I can only speculate.

I suspect that you have subset your genotype data without also subsetting the initial results from the initial PCA on the full data set. The specific error is saying that the number of genotypes (nrow(x)) and the number of elements in your population assignments (length(grouping)) are not equal.

Hope that helps,
Zhian





--
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 view this discussion on the web visit https://groups.google.com/d/msgid/poppr/f5730800-4d21-4c90-a248-f2d772296c7cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages