permanova problem

1,400 views
Skip to first unread message

ChristinaA

unread,
Jun 17, 2012, 9:38:41 PM6/17/12
to qiime...@googlegroups.com


Hi All,

I am having a problem with running the compare_categories.py command with the --method permanova. Below is the error I get;

compare_categories.py -i beta_pH_sorted_160612/unweighted_unifrac_dm.txt --method permanova -m pool1_2_Map.txt -c pH_group -o permanova -n 999
Traceback (most recent call last):
  File "/home/qiime/qiime_software/qiime-1.5.0-release/bin/compare_categories.py", line 331, in <module>
    main()
  File "/home/qiime/qiime_software/qiime-1.5.0-release/bin/compare_categories.py", line 316, in main
    opts.num_permutations)+"\t")
KeyError: 'r_value'

I have tried different numbers of permutations, but I still get the same error. With the same files used above I was able to successfully run all other methods available in the compare_categories script.

Also just a query, is the permanova in qiime performed in the same manner as the non-parametric multivariate analysis of variance (permutation based) in the program past? Sorry if this is a bit of a left of field question. This is just what I have been using so far to test the validity of groups from distance matrices.

Thanks in advance for help

Cheers

Christina

Jai Ram Rideout

unread,
Jun 18, 2012, 10:49:06 PM6/18/12
to qiime...@googlegroups.com
Hi Christina,

Thank you for bringing this to our attention. We are currently working on patching the 1.5.0 release, which should happen sometime next week. In the meantime, feel free to use the development version of QIIME, as the bug has been fixed there (please see http://qiime.org/documentation_index.html#download-qiime for more details).

Regarding your other question: Yes, PERMANOVA in QIIME is based on the same algorithm as NPMANOVA in PAST. I believe NPMANOVA was what the test was called originally, and the "new" name seems to be PERMANOVA. Since PERMANOVA is permutation-based, it is non-parametric.

-Jai

ChristinaA

unread,
Jun 19, 2012, 2:00:10 AM6/19/12
to qiime...@googlegroups.com
Hi Jai,

Thanks heaps for the reply and the info about the algorithm used for permanova in qiime.

Cheers

Christina

manpreet

unread,
Aug 25, 2012, 12:37:12 AM8/25/12
to qiime...@googlegroups.com
Hi all,

I am having the same problem:


qiime@qiime-VirtualBox:~$ compare_categories.py --method permanova -i Desktop/Shared_Folder/2/OTUS_Uclust/97/NOCHIMERA/Betadiv/dist_weighted_unifrac_97_otu_table.from_txtEDITnochytriddd.txt -m Desktop/Shared_Folder/2/Mappingfixed.txt -c Species -o Desktop/Shared_Folder/2/OTUS_Uclust/97/NOCHIMERA/Betadiv/Stats/permanova_out_wUnifrac/spe -n 999

Traceback (most recent call last):
  File "/home/qiime/qiime_software/qiime-1.5.0-release/bin/compare_categories.py", line 331, in <module>
    main()
  File "/home/qiime/qiime_software/qiime-1.5.0-release/bin/compare_categories.py", line 316, in main
    opts.num_permutations)+"\t")
KeyError: 'r_value'

I had no issues with any other analysis methods (adonis, anosim etc.).  I believe that I have the latest version of Qiime as I downloaded and updated to 1.5.0 only last week...did this version already have the patch you talk about below (Jai) or do I have to install that separately?
Please see config output below and thanks...

Manpreet

System information
==================
         Platform:    linux2
   Python version:    2.7.3 (default, Apr 20 2012, 23:04:22)  [GCC 4.6.3]
Python executable:    /home/qiime/qiime_software/python-2.7.1-release/bin/python

Dependency versions
===================
                     PyCogent version:    1.5.1
                        NumPy version:    1.5.1
                   matplotlib version:    1.1.0
                  biom-format version:    0.9.3
                QIIME library version:    1.5.0
                 QIIME script version:    1.5.0
        PyNAST version (if installed):    1.1
RDP Classifier version (if installed):    rdp_classifier-2.2.jar

QIIME config values
===================
                     blastmat_dir:    /home/qiime/qiime_software/blast-2.2.22-release/data
                         sc_queue:    all.q
      topiaryexplorer_project_dir:    None
     pynast_template_alignment_fp:    /home/qiime/qiime_software/core_set_aligned.fasta.imputed
                  cluster_jobs_fp:    /home/qiime/qiime_software/qiime-1.5.0-release/bin/start_parallel_jobs.py
pynast_template_alignment_blastdb:    None
assign_taxonomy_reference_seqs_fp:    /home/qiime/qiime_software/gg_otus-4feb2011-release/rep_set/gg_97_otus_4feb2011.fasta
                     torque_queue:    friendlyq
              qiime_test_data_dir:    None
   template_alignment_lanemask_fp:    /home/qiime/qiime_software/lanemask_in_1s_and_0s
                    jobs_to_start:    1
                cloud_environment:    False
                qiime_scripts_dir:    /home/qiime/qiime_software/qiime-1.5.0-release/bin
            denoiser_min_per_core:    50
                      working_dir:    /tmp/
                    python_exe_fp:    /home/qiime/qiime_software/python-2.7.1-release/bin/python
                         temp_dir:    /tmp/
                      blastall_fp:    /home/qiime/qiime_software/blast-2.2.22-release/bin/blastall
                 seconds_to_sleep:    60
assign_taxonomy_id_to_taxonomy_fp:    /home/qiime/qiime_software/gg_otus-4feb2011-release/taxonomies/greengenes_tax_rdp_train.txt

Jai Ram Rideout

unread,
Aug 27, 2012, 11:21:14 AM8/27/12
to qiime...@googlegroups.com
Hello,

The patch was not pushed out as originally planned, so this issue
remains in the QIIME 1.5.0 release. The QIIME developers will be
working on this issue this week. Thanks for your patience!

-Jai
> --
>
>
>

Jai Ram Rideout

unread,
Sep 14, 2012, 4:51:59 PM9/14/12
to qiime...@googlegroups.com
Hi again,

We've posted a patch to compare_categories.py that clears up the KeyError issues you were having when trying to run PERMANOVA. This post has all the information you'll need to install the patch:


Thanks,
Jai

Rachel S

unread,
Nov 2, 2012, 3:28:28 PM11/2/12
to qiime...@googlegroups.com
Hello Qiime Team,
I also have a question about the Permanova function of compare_categories.py (thanks for this great script!) I analysed my data (n=3) by each of the six treatments using the -c Treatment option and got a p value of 0.001. However, reading up on the literature on this test, it seems that it should also be possible to test two factors at once (my six treatments actually represent a balanced 2-factor (2/3 level) design) and also have an interaction factor. Is this possible in QIIME? Also, is there a post-hoc test available in QIIME (or elsewhere) to identify between which treatments, the significant difference lies?
 
Thank you very much for any pointers on this!
 
with best wishes,
 
Rachel 

Jai Ram Rideout

unread,
Nov 2, 2012, 7:43:04 PM11/2/12
to qiime...@googlegroups.com
Hi Rachel,

The PERMANOVA functionality provided in QIIME currently only supports a single factor. I believe the adonis function in R's vegan package allows for multiple factors and interaction terms (the adonis functionality provided by QIIME currently does not, however). We have some R code in QIIME that will allow you to experiment more with adonis if you're interested. It is essentially the same as PERMANOVA, just more robust by allowing categorical and continuous factors. Please see my replies to Samik here for details:


We don't have post-hoc PERMANOVA tests available in QIIME (i.e. post-hoc pairwise comparison tests). I also spent some time searching and it doesn't look like R has this functionality either for adonis, ANOSIM, etc., though users are certainly interested in having it! I think Marti Anderson's original PERMANOVA implementation (http://www.stat.auckland.ac.nz/~mja/Programs.htm) can do multiple pairwise tests, as long as you have a balanced design. PRIMER-E (http://www.primer-e.com/index.htm) may also have this functionality (not sure though) but it is not free.

Also, you could try out make_distance_boxplots.py in QIIME (pass your Treatment category with -c) and take a look at the boxplots that are generated. This will allow you to at least visualize where the largest distances are between your 6 levels.

-Jai


--
 
 
 

Rachel S

unread,
Nov 6, 2012, 11:16:13 AM11/6/12
to qiime...@googlegroups.com
Thank you Jai! The make_distance_boxplots.py function looks great for getting  feel for the data.

I have looked into the original implementation of PERMANOVA by Dr. Anderson, and it seems to be exactly what I want... I am struggling to understand however, how to formate the distance matrix to be read by the programme. I know this is the qiime forum not the PERMANOVA forum but just wondered, if you knew or knew where to look this up...

Thank you very much for your help!!

Rachel

p.s. if you havent come across it, PAST from the Natural History Museum of Oslo seems to have quite a lot of the same functionality as PRIMER and is free-- I just cant figure out, how to get either of them to use a UNIFRAC distance matrix rather than one of of their options from their point and click menus!
 
 
 

Jai Ram Rideout

unread,
Nov 6, 2012, 12:38:54 PM11/6/12
to qiime...@googlegroups.com
Hi Rachel,

I looked through the PERMANOVA manual (http://www.stat.auckland.ac.nz/~mja/prog/PERMANOVA_UserNotes.pdf) but the only example that is given is for a raw data table (i.e. OTU table). I'm not sure how to format a QIIME distance matrix for input to the program. It seems that you don't include sample ID labels and it needs to be in tab-separated format, but past that I can't say. I recommend contacting the author, and maybe she can help you format your QIIME distance matrix so that it can be used in her program.

Sorry I can't be of more help- if you do end up getting it to work, we'd be very appreciative if you could post the solution here for other users who might be interested in doing the same thing.

Thanks for the tip about PAST. It's good to know there is a free alternative to PRIMER!

Thanks,
Jai


--
 
 
 

Newbie

unread,
Nov 14, 2012, 9:22:37 AM11/14/12
to qiime...@googlegroups.com
Hi Rachel,

I was also looking at running Dr. Anderson's PERMANOVA for pairwise comparisons using the unweighted_unifrac_dm.txt file generated in QIIME. However, I am a bit confused as to the structuring of the design file needed. For the matrix, I just removed the first column and header, but I do not understand how to put those into a design file. Were you ever able to figure this out?

Thank you,
Molli

Rachel S

unread,
Nov 14, 2012, 2:57:48 PM11/14/12
to qiime...@googlegroups.com
Hello Molli,
Hope I can help! I did get the PERMANOVA to run just fine. The programme is sometimes a bit "crashy", but for me, restarting the computer and then immediately running PERMANOVA without opening any more programmes seemed to work. You need two files: a design file and a distance matrix. The distance matrix should simply be a tab-formatted version of the output from QIIME minus the text labels. I just opened the weighted_unrarified_unifrac.biom, copy-pasted to excel, removed the labels, and then copy pasted to gedit (I think notepad would work too). The design file, is then a way of telling PERMANOVA which unlabelled  column is which! It is another text file and will depend on your experimental design, number of factors, and number of replicates. Try reading the documentation for PERMANOVA from Dr. Andersons website (http://www.stat.auckland.ac.nz/~mja/Programs.htm) which has two examples of how the design file should be formatted.

If you decide to go with PAST instead, it is easy to use the unifrac distance matrix after all-- just select "user matrix". Keith McGuiness has created a super useful youtube video about how to perform this analysis in PAST: http://www.youtube.com/watch?v=kYiU7pe4-2I

good luck!

Rachel
Reply all
Reply to author
Forward
0 new messages