Error in creating PCOA plot

26 views
Skip to first unread message

Almas Gheyas

unread,
Aug 6, 2024, 11:22:05 AMAug 6
to dartR
Hi, 
I am trying to run PCA and PCOA analyses and create the plots using the to use gl.pcoa and gl.pcoa.plot functions. While I could successfully create the PCA plot, I get some error message with the PCOA plot. I am using "dev" version of DartRverse. 

Here is what I have tried: 
# PCA (without specifying any genetic distance matrix)
pcoa <- gl.pcoa(gl_flt)  
gl.pcoa.plot(pcoa, gl_flt)    # creating PCA plot

The above command successfully created PCA plot showing the individuals and population names. 

# PCOA (with nei's genetic distance)
dnei <- gl.dist.pop(gl_flt, method="nei")
pcoa2 <- gl.pcoa(dnei)
gl.pcoa.plot(pcoa2, gl_flt) 

Starting gl.pcoa.plot
Processing an ordination file (glPca) Processing genlight object with SNP data Error in data.frame(..., check.names = FALSE) :  
arguments imply differing number of rows: 9, 266  

Any suggestions what might be the problem here? 
gl.compliance.check(gl_flt)  shows "population assignment confirmed".
So this cannot be the issue as was described as a potential cause in a previous conversation. 

Thank you!
Almas


Jose Luis Mijangos

unread,
Aug 15, 2024, 12:35:37 AMAug 15
to dartR
Hi Almas,

Based on the genlight object and the code that you shared with me, I found that the problem is that you are calculating the distance between two populations, PCA requires at least three pairwise distances, i.e. at least three populations.

Cheers,
Luis 

Almas Gheyas

unread,
Aug 20, 2024, 5:57:08 PMAug 20
to dartR
HI Luis, 
Thanks for this but I its only in the subset of the samples that I shared  with you has only two populations. In my original larger set, there are 8-9 populations. 
I will send you a larger subset with 3-4 populations. 
cheers
Almas 

Reply all
Reply to author
Forward
0 new messages