How to obtain a distance matrix from a qualitative OTU table?

Hello! I am relatively new to QIIME2, but there are some analysis that this software provide that are of interest for me. Here’s what I have done so far:

I have a set of COVID-19+ and COVID-19- patients metagenome and metatranscriptome that I ran with a metagenomics software. However, this software does not provide me with a distance matrix nor visualization plots. Basically it provides me with what organisms are there vs what is not there. Right now we are interested in creating an Unweighted UniFrac plot that can tell us if the centroids (via PERMANOVA) are significantly different form each other. For this, I have a table that looks more or less like this:
Sample 1. Sample 2 … Sample n
OTU1. 1 0 1
OTU2 1 1 0
OTUn. 1 0 0

As you can see, in my previous table I have 1’s for organism present, and 0’s for absence. Because this approach only takes presence and absence, I am interested in a beta-diversity analysis like the aforementioned unweighted unifrac plot that does not consider read abundance. However, I tried converting this table into a QIIME2 artifact in order to get a distance matrix and be able to generate said plot, but I think I am stuck with how to do so…

Help please!!

Neat project, @daniel.castanedamogo!
Have you looked over the importing tutorial’s section on importing feature tables?
You’ll want to import your data as a FeatureTable[PresenceAbsence] type for this kind of data.

If you’re ever curious about what Semantic Types and data Formats are available in your QIIME 2 distribution, you can run qiime tools import --show-importable-types and qiime tools import --show-importable-formats respectively.

Chris :monkey:

1 Like

Hi @ChrisKeefe

Thanks for your fast response! Yes, I have solved that issue! I finally have a .qza artifact for my presence/absence .csv original table. However, when I try to get my distance matrix from this FeatureTable[PresenceAbsence] that I generated, I get the following error from this command:

qiime diversity beta --i-table OTU_qiime2_n5_z2_np_dna.qza --p-metric 'braycurtis' --o-distance-matrix OTU_qiime2_distance_matrix_bc_qiime2_n5_z2_np_dna.qza

Parameter 'table' requires an argument of type FeatureTable[Frequency]. An argument of type FeatureTable[PresenceAbsence] was passed.

I am attaching the .qza converted file from my .csv table here. Thanks a lot for your guidanceOTU_qiime2_n5_z2_np_dna.qza|attachment (11.3 KB)

1 Like

I was trying a different approach to get my beta diversity matrix from my FeatureTable[PresenceAbsence], but looking at the commands when typing qiime diversity beta, it indicates that my table should be able to be read:

  --i-table ARTIFACT FeatureTable[Frequency | RelativeFrequency |
    PresenceAbsence]   The feature table containing the samples over which
                       beta diversity should be computed.           [required]

Hi @daniel.castanedamogo :wave:

In addition to providing the correct input format (FeatureTable[PresenceAbsence] in your case - excellent job! :tada: ), you also need to make sure that the selected metric is applicable to that data type. Bray-Curtis does not accept a presence-absence table and you will need to use a different metric that does, such as Jaccard.

EDIT: You can view docs for the underlying methods here and Bray-Curtis in particular here.


Thanks a lot, after some reading I realized that bray-curtis is more oriented towards quantitative data, rather than qualitative which is the case of my table. Thanks!!