Why PCoA and not PCA with DEICODE output?

Can anyone explain to me why emperor biplots with DEICODE output are PCoA and not PCA? I'm second-guessing myself on this, and would like to get someone else's explanation to help clarify.

1 Like

Hi @smreyes,

I think this is just a result of the types not being 100% caught up to what is actually happening. This is something that should improve in the next few releases when we have a little bit more machinery to deal with this.

1 Like

pinging @cmartino, @mortonjt, and @yoshiki

P.S. I am working on TypeMap right now, so it will become really easy to map different input types to different output types, while preserving or discarding any properties as needed.

2 Likes

@smreyes - PCoA with Euclidean distance is equivalent to PCA.

DEICODE is not exactly performing PCA - it is performing PCoA using the Aitchison distance (while handling zeros). In terms of semantic types, I think PCoA should be appropriate.

6 Likes

@mortonjt thanks so much for the explanation!

@ebolyen does this include qiime2R format? I typically make PCoAs in R via qiime2R but the ordination.qza file from DEICODE isn’t a seamless transition as (un)weighted UniFrac files. Exporting ordination.qza also doesn’t seem to provide all the information needed to make a PCoA in R. Any help on this would be greatly appreciated!

Any particular errors you can see, or is the graph just not rendering right?

I suspect the issue might be the biplot section of the file format. @jbisanz, does qiime2R have a way to handle the extra data? Otherwise I don’t see why DEICODE would in particular cause an issue.

Haven't looked into it too much but I get the following warning message when I upload the file.

Then the following header and error when trying to use write.table

1 Like

Hmm yes, I am almost certain that the issue lies in how I have imported the ordinations as the format was a little tricky to deal with. I will do a little investigation with a biplot artifact and try to come up with a solution.

4 Likes

After looking at the format specification, I am thinking it would be easiest to split the file into multiple sub-tsvs based on the headers in the temporary directory, then independently read these in using read.table or equivalent. Then the objects would be available as:

data$Eigvals
data$ProportionExplained
data$Site
data$Biplot
data$SiteConstraints

Does this seem logical @ebolyen ?

1 Like

That makes sense to me, I assume there is no way to manipulate the underlying filehandle to stop reading at those breakpoints (or otherwise configure read.table).

I did not have access to an actual DEICODE output as it doesn’t seem to be available in the tutorial so if you could please update to the latest version of qiime2R and let me know how it goes?
I used the labels as identified within the format specification with one exception: I renamed Site to Vectors to keep consistent with the current qiime2R tutorial and the nomenclature used in ape.

2 Likes

@jbisanz The ordination output of DEICODE from the tutorial can be found here. I will add links to the outputs in the tutorial. Thank you for making qiime2R and adding biplot functionality!

3 Likes

Great thanks. It looks like the data is being faithfully imported.

3 Likes

So I’m not sure if I’m doing something wrong, but I reanalyzed my data and still got the same error message when trying to import into R via read_qza. I also downloaded the ordination.qza file from the tutorial and experienced the same problem. Is there something obvious on my end I should be doing?

Hmm, I think you need to update to the latest version as that line of code has been removed. It would be devtools::install_github("jbisanz/qiime2R"). Running this line will check to see if there is a newer version available and update if there is.

2 Likes

You were right! I had to restart my R session and open/close R studio before it worked....but I got it! Thanks a million!

1 Like

Hello there! I have a quick question on a somewhat related topic.

Firstly, I want to double check that it is valid to export the distance matrix obtained with q2-deicode and use it in R for analyses such as PCoA and db-RDA (I'm not interested in showing the features right now).

Comment by @mortonjt tells me it's probably OK but just wanted to make sure, mainly because there are some differences between my PCoA in vegan and the emperor output: slightly different eigenvalues and distribution of "sites". What could be causing this?

Thanks! :smiley: