joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
584 stars 187 forks source link

Distance with method "dpcoa" inconsistant with results from ade4 #390

Closed wkingc closed 10 years ago

wkingc commented 10 years ago

I recently ran into a problem using the distance function with the method “dpcoa” where the results were not the same as what came from the dpcoa function in ade4. I examined the code and found where the difference is coming from. Below is what I found:

    if (method == "dpcoa") {
        return(dist(DPCoA(physeq, ...)$RaoDis))
    }

From above, I see that ‘DPCoA()’ is wrapped with ‘dist()’. Unless I am mistaken, this would cause R to calculate the Euclidean distance of the DPCoA distance matrix. Is this what you intended?

joey711 commented 10 years ago

Wade,

Good find!

You have correctly identified a possibly-old and subtle bug. I imagine the dist call was originally intended to be a data class coercion, not a call to calculate euclidean distance. Wow that's a bad one!

I have updated the github devel version, link should post here any second...

Thanks for the great catch! Always very appreciated, especially just-before a big BioC snapshot update :+1:

wkingc commented 10 years ago

Hi Dr. McMurdie,

I am glad I could help. I am also really happy to have phyloseq, so anything to help make it better is good for me too ☺.

Thanks,

Wade

From: Paul J. McMurdie [mailto:notifications@github.com] Sent: Tuesday, October 07, 2014 9:27 PM To: joey711/phyloseq Cc: Copeland, Wade K Subject: Re: [phyloseq] Distance with method "dpcoa" inconsistant with results from ade4 (#390)

Wade,

Good find!

You have correctly identified a possibly-old and subtle bug. I imagine the dist call was originally intended to be a data class coercion, not a call to calculate euclidean distance. Wow that's a bad one!

I have updated the github devel version, link should post here any second...

Thanks for the great catch! Always very appreciated, especially just-before a big BioC snapshot update [:+1:]

— Reply to this email directly or view it on GitHubhttps://github.com/joey711/phyloseq/issues/390#issuecomment-58307241.