PcoA axes variation in R similar to QIIME Emperor

496 views
Skip to first unread message

Vanessa V.

unread,
Aug 23, 2016, 4:24:23 PM8/23/16
to Qiime 1 Forum
Hi all, 

I ran my 16S rRNA data through QIIME and would like to make PcoA plots in R (so I can change shapes, etc.).  I used the distance matrix from beta diversity and I can make the plot, however, I do not know how to determine the % variation explained by each axis like how is done in QIIME. Does anyone have any recommendations for doing this?  If you can point me to a website or just how QIIME does it (then I could do so within R).

Thanks in advance, 
Vanessa

Colin Brislawn

unread,
Aug 23, 2016, 5:59:13 PM8/23/16
to Qiime 1 Forum
Hello Vanessa,

I make all my publication quality graphs in R, and I have had a great experience using the Phyloseq package. It implements the same beta diversity metrics as qiime, and because it uses the ggplot2 package for graphing, you get the flexibility in graphing that you want . So I guess my recommendation is "don't import the tables, just use R and the phyloseq package directly."

As a bonus, phyloseq also makes much nicer bar plots: 

If you are interested in importing from qiime, perhaps a qiime dev can comment more. 

Let me know if that helps! I've had a great experience using Phyloseq, and hope that you do too,
Colin

Deni Ribičić

unread,
Aug 24, 2016, 5:14:18 AM8/24/16
to Qiime 1 Forum
Hi Vanessa,

I would agree with Colin here. I use also Phyloseq package to do downstream analysis of my 16S data. My usual workflow is to pick otus with QIIME and subsequently use the respective output for Phyloseq package.

Vanessa V.

unread,
Aug 24, 2016, 9:13:48 AM8/24/16
to Qiime 1 Forum
Hi Colin and Deni, 

Thanks!  I want to use Phyloseq but I was confused as to how to import data and exactly what to import into R to use with Phyloseq.  When I go to the data import, I don't quite understand how to turn an OTU table into a Phyloseq object (I don't have a separate OTU and tax table as described in the example).  So I don't know how to turn an OTU table already with the taxonomic information in to a Phyloseq object?  

Also when I scroll down to importing biome tables, I didn't understand this: import_biom(rich_dense_biom, treefilename, refseqfilename, parseFunction=parse_taxonomy_greengenes)? What exactly is the refseqfilename and why do you have to parse with taxonomy green genes? I had a similar question with importing with QIIME data, what is the rsfile? I'm assuming the trefile is the rep_set.tre file?

Sorry for all of the questions - thanks in advance!
Vanessa

Colin Brislawn

unread,
Aug 24, 2016, 12:21:56 PM8/24/16
to Qiime 1 Forum
Hello Vanessa,

Yeah, Phyloseq does have a bit of a learning curve. While this forum is for supporting Qiime, not Phyloseq, let's see if we can help import qiime data.

I'm glad you found the import_biom() function. That's exactly what I use as well.
  • Modern version of qiime place the taxonomy into the .biom table itself, so you don't need a separate OTU and tax table. 
  • I've never had to use the 'refseqfilename', but that's the rep_set.fna file from OTU picking.
  • As for parse_taxonomy_greengenes, the GG database uses a slightly strange newick tree format, and this function can help import a qiime tree if you get an error. You can try running this function with and without this argument, and see what works for you.

I hope this helps!
Colin


Vanessa V.

unread,
Aug 24, 2016, 5:29:16 PM8/24/16
to Qiime 1 Forum
Thank you, I will try this out!
Reply all
Reply to author
Forward
0 new messages