[adegenet-forum] Individuals for genind not plotting dapc

Phillip Skipwith pskipwith at gmail.com
Sat Jul 22 06:11:36 CEST 2017


Hi,

I'm pretty new to Adegenet, but I have been through the tutorials and have
been more or less successful getting it to work on my empirical data. This
is a phylogenomic dataset of 83 individuals from eight clades and 4,268
loci (I'm using 4,035 SNPs for ordination, etc.).  I realize the sample
size is small, but this is hard-earned field data. The problem arises when
I'm trying to use dapc after find.clusters on the below genind object.

gen.struct
/// GENIND OBJECT /////////

 // 83 individuals; 4,035 loci; 8,341 alleles; size: 4.5 Mb

 // Basic content
   @tab:  83 x 8341 matrix of allele counts
   @loc.n.all: number of alleles per locus (range: 2-4)
   @loc.fac: locus factor for the 8341 columns of @tab
   @all.names: list of allele names for each locus
   @ploidy: ploidy of each individual  (range: 2-2)
   @type:  codom
   @call: read.structure(file = "final_Struct_good_maybe.str", n.ind = 83,
    n.loc = 4035, onerowperind = F, col.lab = 1, col.pop = 2,
    row.marknames = 0, ask = F)

 // Optional content
   @pop: population of each individual (group size range: 2-27)

grp <- find.clusters(gen.struct, max.n.clust=35)

Choose the number PCs to retain (>=1):
80
Choose the number of clusters (>=2:
9

dapc1 <- dapc(gen.struct, grp$grp)

dapc1
#################################################
# Discriminant Analysis of Principal Components #
#################################################
class: dapc
$call: dapc.genind(x = gen.struct, pop = grp$grp)

$n.pca: 60 first PCs of PCA used
$n.da: 4 discriminant functions saved
$var (proportion of conserved variance): 0.946

$eig (eigenvalues): 182000 71010 34130 20710 16790 ...

  vector    length content
1 $eig      8      eigenvalues
2 $grp      83     prior group assignment
3 $prior    9      prior group probabilities
4 $assign   83     posterior group assignment
5 $pca.cent 8341   centring vector of PCA
6 $pca.norm 8341   scaling vector of PCA
7 $pca.eig  82     eigenvalues of PCA

  data.frame    nrow ncol content
1 $tab          83   60   retained PCs of PCA
2 $means        9    60   group means
3 $loadings     60   4    loadings of variables
4 $ind.coord    83   4    coordinates of individuals (principal components)
5 $grp.coord    9    4    coordinates of groups
6 $posterior    83   9    posterior membership probabilities
7 $pca.loadings 8341 60   PCA loadings of original variables
8 $var.contr    8341 4    contribution of original variables

Choose the number PCs to retain (>=1):
60
Choose the number discriminant functions to retain (>=1):
4

scatter(dapc1, scree.da = T)

The end result is a plot with the centroid points for each of the clusters
but not the individuals. I know there is probably something simple that I'm
missing or there's something intrinsically wrong with my code and or data.
I've perused the forum for similar issues and nothing is quite spot on to
what I'm asking here.

Any help would be greatly appreciated.

Best,

Phillip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20170721/76a904d6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: daps_plot_failed.pdf
Type: application/pdf
Size: 24356 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20170721/76a904d6/attachment-0001.pdf>


More information about the adegenet-forum mailing list