Phylogenetic distance and differences in microbiome

Hi all,

Is it possible to relate the phylogenetic distance in a phylogenetic tree with the differences that may exist between the microbiome of each of the tree’s components? If so, what programs could you use for this? QIIME 2? my idea is to build a heat map or something similar, but I do not know if it is possible to do it with QIIME 2 or a similar program for metagenomics.

Welcome @arturo!

It sounds like you are describing UniFrac distance, available in QIIME 2’s q2-diversity plugin. See the QIIME 2 tutorials for some more description of when and how this method is used in a typical workflow.

Check that out and let us know if that’s what you are looking for.

1 Like

Thanks @Nicholas_Bokulich, I think you’re right. I read about UniFrac and I think that’s what I need, but now I want to create a HeatMap from UniFrac data and it doesn’t seem easy.

QIIME 2 does not have a method for making distance heatmaps.

If you are proficient with python, you could view as a heatmap easily with scikit-bio. Something like this:

import qiime2
import skbio
dm = qiime2.Artifact.load(distance-matrix.qza).view(skbio.DistanceMatrix)
dm

[the output of dm will be a distance matrix heatmap]

1 Like

Thanks @Nicholas_Bokulich,

I managed to export UniFrac data to a file using qiime tools export, and with them in excell and using the website https://plot.ly I was able to build a Heatmap. Although the result is interesting, it is not exactly what I needed. I will try to explain it better. I have a series of vegetable plants of different varieties and I have built a phylogenetic tree of these varieties. On the other hand I have analyzed the microbiome of each of these varieties. Now what I want to do is see if the position that each vegetable variety occupies within the phylogenetic tree determines its microbiome in some way, so that nearby vegetable varieties have a similar microbiome. With what I have done so far, using UniFrac with microbiome data really does not matter the phylogenetic relationship that vegetable varieties have. Any suggestions to be able to do what I want?

Could you try joint clustering? In the seaborn library, you could use clustermap and then feed specific linkage matrices. So, you could pass in your sample phylogeny (make sure your table and tree correspond!), convert that to a linkge matrix using scipy, and then pass that in as a custom row/column arrangement. Unfortunately, it doesn’t really stats all that well, but might help you visualise?

It’s a fair bit of python programming, but Ive done it on a few things in not identical, but similar applications. It comes out pretty okay?

Best,
Justine

1 Like

You could look at mantel distance of vegetable phylogeny vs. microbiome pairwise distances (unifrac, etc).

1 Like

Hi,

thanks @Nicholas_Bokulich , the mantel test seems that is good solution. I have seen that qiime2 can perform the mantel test with qiime diversity mantel. Now the problem I have is that I can’t import my files with the distance matrices to QIIME 2. I guess to do this I have to use qiime tools import, and that the --type of my files is “DistanceMatrix”, but I don’t know what I have to put in the option --input-format. My files are in TSV format. I add the files in case this is useful. Any idea how my files should be to import them into QIIME2 to be able to do the mantel test?MD_MICROBIOMAS_v2.tsv (7.3 KB) MD_TOMATES_v3.tsv (2.8 KB)

Thanks @jwdebelius , but I don’t have enough experience with Python. For now I think that the option given by @Nicholas_Bokulich is easier to try.

1 Like

don’t enter an input format. Use this command:

qiime tools import \
  --input-path MD_MICROBIOMAS_v2.tsv \
  --type DistanceMatrix \
  --output-path MD_MICROBIOMAS_v2.qza

Good luck!

1 Like