[adegenet-forum] Doubt with DAPC without prior K (find.clusters)
Cathy Bouffartigue
cathy.bouffartigue at inra.fr
Thu Jan 24 13:43:57 CET 2019
Hi Helena,
This is due to the k-means algorithm used in the find.cluster function which use a different seed for its initialization each time you’re running your code. You have to set the seed before running your find.cluster function to ensure the reproducibility of your results.
set.seeds(24012019)
perca_grp6 <-find.clusters(perca, max.n.clust = 10)
Good luck with your analyses!
Cathy
[Description : cid:43BA2359-25C8-49EA-9D28-BCFD56FD115B at toulouse.inra.fr]
_____________________________
Cathy Bouffartigue
Doctorante/ PhD student
cathy.bouffartigue at inra.fr<mailto:cathy.bouffartigue at inra.fr>
Centre Inra Occitanie-Toulouse
Fixe : +33 (0)5 61 28 57 74
Mobile : +33 (0)6 14 57 34 55
_____________________________
Chemin de Borde Rouge CS 52627
31326 Castanet Tolosan cedex
www.toulouse.inra.fr<http://www.toulouse.inra.fr/>
De : adegenet-forum <adegenet-forum-bounces at lists.r-forge.r-project.org> De la part de HELENA IBANEZ MARTINEZ
Envoyé : jeudi 24 janvier 2019 12:58
À : adegenet-forum at lists.r-forge.r-project.org
Objet : Re: [adegenet-forum] Doubt with DAPC without prior K (find.clusters)
HELENA IBANEZ MARTINEZ <him21024 at um.es<mailto:him21024 at um.es>> escribió:
HELENA IBANEZ MARTINEZ <him21024 at um.es<mailto:him21024 at um.es>> escribió:
Hello, my name is Helena,
I have a question about my DAPC analayses.
I'm following the tutorial step by step and I get the DAPC graph of my data very well, but my problem is when I repeat the process my graphic results come out completely different every time...
My question is, why do such different results come out if I'm repeating exactly the same (same data and same parameters)? It happens to me every time I do it. What can I be doing wrong?
Here I leave the example of my code: 135 individuals with 8 loci sampled in 6 different locations
perca <-read.structure("PercaPopName.str",
onerowperind=TRUE,
n.ind=135,
n.loc=8,
col.lab=1,
col.pop=2,
row.marknames=1,
ask=FALSE)
perca_grp6 <-find.clusters(perca, max.n.clust = 10)
200
6
dapc6 <-dapc(perca, perca_grp6$grp)
200
5
scatter(dapc6)
Thank you.
Hi, my name is Helena,
I have a question about my DAPC analayses.
I'm following the tutorial step by step and well, I get the DAPC graph of my data, but the problem is that when I repeat this my graphic results come out completely different, therefore they are not reliable...
My question is, why do such different results come out if I'm repeating exactly the same? It happens to me every time I do it. What can I be doing wrong?
Here my code:
perca <-read.structure("PercaPopName.str",
onerowperind=TRUE,
n.ind=135,
n.loc=8,
col.lab=1,
col.pop=2,
row.marknames=1,
ask=FALSE)
dapc1 <-dapc(perca, perca_grp$grp)
200
6
scatter(dapc1)
Hello again, I`m Helena, sorry but I introduced my code wrong yesterday:
This is my code:
perca <-read.structure("PercaPopName.str",
onerowperind=TRUE,
n.ind=135,
n.loc=8,
col.lab=1,
col.pop=2,
row.marknames=1,
ask=FALSE)
perca_grp6 <-find.clusters(perca, max.n.clust = 10)
200
6
dapc6 <-dapc(perca, perca_grp6$grp)
200
5
scatter(dapc6)
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20190124/af817c56/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2135 bytes
Desc: image001.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20190124/af817c56/attachment-0001.jpg>
More information about the adegenet-forum
mailing list