Hello,
thank You very much for Your reply. I'm still little confused.

Dne Pá 7. června 2013 16:03:13 jste napsal(a):
> Hello there, 
> 
> you could have done the PCoA on Chord's distance using adegenet, it would
> have probably been simpler (see the vignette adegenet-basics, section 6
> "Multivariate Analysis“).

Function dist.genpop() contains Nei's distance, but man pages says it is only 
for genpop objects (I wish to analyse individuals, not populations). I 
imported the data using read.loci() and converted it to genind using 
loci2genind(). I found also function dist.genet() from ade4 package, but it 
requires genet object. So far I didn't find straightforward way to convert my 
data to it. And I haven't find any function providing the Goldstein's distance.

> 'dist' is the canonical Euclidean distance, but dudi.pco will accept any
> Euclidean distance. You can use "cailliez" in ade4 to make your distance
> Euclidean before the PCoA.

I'm not mathematician, so I don't understand one point. Let's say I have non-
Euclidean distance matrix and some individuals (e.g. from same population) 
have zero distance (they are identical). When I use cailliez(), I have two 
possibilities (parameter cor.zero):
1) to add the constant also to zero-length distances, so that the shift is 
everywhere same. But as the result, the distance between originally identical 
objects is positive, so they will be treated as different in ongoing analysis, 
right?; or
2) keep zero-length distances, so that those objects stay identical, but their 
distances from another objects change, so the further analysis are biased 
again, right?
Is there any solution? Or am I wrong?

> Cheers
> Thibaut

Sincerely,
Vojtěch

> --
> ######################################
> Dr Thibaut JOMBART
> MRC Centre for Outbreak Analysis and Modelling
> Department of Infectious Disease Epidemiology
> Imperial College - School of Public Health
> St Mary’s Campus
> Norfolk Place
> London W2 1PG
> United Kingdom
> Tel. : 0044 (0)20 7594 3658
> t.jomb...@imperial.ac.uk
> http://sites.google.com/site/thibautjombart/
> http://adegenet.r-forge.r-project.org/
> ________________________________________
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Vojtěch Zeisek [vojtech.zei...@opensuse.org]
> Sent: 07 June
> 2013 15:46
> To: mailinglist R
> Subject: [R-sig-phylo] PCoA with custom distance matrix
> 
> Hello,
> I have microsatellite data and I would like to analyze them using PCoA in R.
> I would like to use following genetic distance: Goldstein's (1995) (dμ)2
> and Nei's chord distance (1983). I calculated those distances in MSA
> (Dieringer and Schlötterer 2003), because I didn't find any possibility to
> calculate them in R. I imported the distances like that:
> dist.dms <- read.csv("dms_ind.txt", header=TRUE, sep="\t", dec=".",
> row.names=1)
> dioszegia.dist.dms <- as.dist(dioszegia.dist.dms)
> class(dioszegia.dist.dms)
> [1] "dist“
> dms_ind.txt is ordinary square matrix with diagonal.
> But using of dudi.pco() from ade4 package fails:
> pcoa <- dudi.pco(dist.dms, scannf=FALSE, nf=3)
> Warning message:
> In dudi.pco(dioszegia.dist.dms, scannf = FALSE, nf = 3) :
>   Non euclidean distance
> When using Euclidean distance (function dist()), it works fine. It produces
> some results despite the above error, but the results are very far from
> those I get using dist() function. And the results don't look realistic.
> What do I do wrong? :-)
> Have a nice day!
> Vojtěch
-- 
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to