/q2-umap

Applying umap to microbiome data via QIIME2

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Build Status Coverage Status

q2-umap

Applying umap to microbiome data via QIIME2.

This plugin is intended to be able to used very similarly to PCoA.

Installation

Make sure you have working installation of Qiime2.

conda install umap-learn -c conda-forge
# in the q2-umap directory
pip install . 

CAUTION

Note for all users. If you intend to view the results in 2 dimensions, you should use --p-number-of-dimensions 2. Taking the first 2 components of a 3 dimensional embedding DOES NOT give you an optimal result.

Example

We will use the Moving Pictures Tutorial from Qiime2 to demonstrate use of the plugin.

You should obtain the Jaccard distance matrix here and the sample metadata here

# get the data
wget \
 -O "jaccard_distance_matrix.qza" \
 "https://docs.qiime2.org/2021.4/data/tutorials/moving-pictures/core-metrics-results/jaccard_distance_matrix.qza"

wget \
  -O "sample-metadata.tsv" \
  "https://data.qiime2.org/2021.4/tutorials/moving-pictures/sample_metadata.tsv"

Then, we can use q2-umap:

# embed with umap
qiime umap embed \
  --i-distance-matrix jaccard_distance_matrix.qza \
  --p-n-neighbors 500 \
  --o-umap jaccard_umap.qza
  
# visualize with emperor
qiime emperor plot \
    --i-pcoa jaccard_umap.qza \
    --m-metadata-file sample-metadata.tsv \
    --o-visualization umap-emperor.qzv