qiime2 plugin for ANCOMBC
Make sure you have qiime2 installed according to the installation instruction. Once you have the conda enviroment activated, open R by running
R
This will open the R prompt window in the terminal. R libraries installed in the terminal within your conda enviroment are the only ones qiime2 will see; if you wish to install ancombc in R studio or something similar, you will need to redo the installation there.
In the R terminal, install ANCOMBC locally:
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("ANCOMBC")
install.packages('tidyverse')
Then install the qiime2 plugin via
pip install git+https://github.com/mortonjt/q2-ancombc.git
qiime dev refresh-cache
If you run the command,
qiime
you should see ancombc
listed in the avaliable plugins.
You can try running ANCOM-BC using the tutorial data in this repository. Start by making a tutorial directory and downloading the tutorial dataset:
mkdir ancom-bc-tutorial
cd ancom-bc-tutorial
# Downloads the files
wget https://github.com/mortonjt/q2-ancombc/raw/main/example_data/table.qza
wget https://github.com/mortonjt/q2-ancombc/raw/main/example_data/taxonomy.qza
wget https://raw.githubusercontent.com/mortonjt/q2-ancombc/main/example_data/metadata.txt
We can run ANCOM-BC using an R-style formula. In this case, we'll use the "labels" column:
qiime ancombc ancombc \
--i-table table.qza \
--m-metadata-file metadata.txt \
--p-formula "labels" \
--o-differentials differentials.qza
This will output a single results file, differentials.qza
, which contains the parameters and p-value. You can visualize this and the taxonomy results using qiime:
qiime metadata tabulate \
--m-input-file differentials.qza \
--m-input-file taxonomy.qza \
--o-visualization differentials.qzv
In the output table, you will find 5 columns from ANCOM-BC:
-
beta
: The coeffecient for the taxonomic feature. -
se
: The standard error for the coeffecient -
W
: The test statistic, calculated as$\beta/se$ -
p_val
: The p-value; p-value comes from a two-sided z-test using the W test statistics -
q_val
: The adjusted p-value after multiple hypothsis correction.
If you included the taxonomy artifact, you will find an additional 2:
Taxon
: The taxonomic identifier for the features.Confidence
: How confident the classifier was with the taxonomic assignment. Most
Lin, H. and Peddada, S.D. (2020) "Analysis of compositions of microbiomes with bias correction." Nature Communications 11: 3514. doi: 10.1038/s41467-020-17041-7
These docs draw heavily off the documentation from the R repository by Frederick Huang Lin.