Continuous variable correlation with compositon

Dear Qiime2 developers,

I am interested in associating continuous variables with sample composition changes. It states in your moving pictures tutorial to utilise the three commands; 1)qiime metadata distance-matrix, 2)qiime diversity mantel and 3)qiime diversity bioenv to do this.

1)qiime metadata distance-matrix:
I was able to run qiime metadata distance-matrix to generate a distance matrix from a continuous variable (i.e. “Day”). However in this command you don’t input a feature table, and don’t define a distance metric (unifrac ect…), just a metadata file and variable, so I am confused about what the output will be, is it just an empty distance matrix?

2)qiime diversity mantel
In this command it requests 2 distance matrices as input. I am confused regarding what matrices to use as input, do I use the one output from command 1 twice?

I am interested in knowing if samples from day 1 differ significantly from samples from all other days ect…, exactly what is done with beta-group-significance for categorical variables. Could you please tell me how this is possible.

Thank you for your help.

Hi @JenKelly,

Sounds like your continuous variable may be time. If you are also sampling the same individuals/sites over time, you should check out q2-longitudinal. If you are just trying to associate change in beta diversity with change in time, then mantel will accomplish this. However, q2-longitudinal will be much more flexible, e.g., to use linear mixed effect models to examine changes across time in relation to multiple metadata variables (e.g., time and treatment categories) and individual variation. And you can use other types of data as inputs, e.g., alpha diversity, pcoa, or abundances of specific features in a feature table.

You could also check out q2-gneiss. This will relate differences in feature abundance with one or more continuous/categorical metadata columns.

This method generates a new distance matrix based on the metadata column. So, e.g., if you have a metadata file that has values like this

#SampleID   day
s1           0
s2           1
s3           2

It will generate a distance matrix like this:

      s1     s2     s3
s1    0       1      2
s2    1       0      1
s3    2       1      0

The overall goal is really just to generate a new DM that can be input to mantel, which correlates two different distance matrices.

You want to use:

  1. the output from qiime metadata distance-matrix
  2. the output of qiime diversity core-metrics or whatever other distance matrix you have. E.g., unifrac distance between all sample pairs.

If you are sampling the same subjects/sites repeatedly, i.e., a longitudinal design, you should check out q2-longitudinal. The methods there will account for inter-individual variation over time and be more useful for this.

Otherwise, you can force QIIME2 to interpret a metadata column as a particular type as described here.

Good luck!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.