Skip to content

bioinf-mcb/q2-health-index

Repository files navigation

q2-health-index

QIIME 2 plugin for calculating the Health Index from microbiome data.

The official doc might be found here.

About

This plugin is based on the Gut Microbiome Health Index (GMHI) created by Gupta et al. 2020.

See also the paper's GitHub repository.

Installation

To install the most up to date version of the plugin:

  • Install and activate conda environment with QIIME 2 (see docs), e.g. for Linux 64-bit:
    wget https://data.qiime2.org/distro/core/qiime2-2021.4-py38-linux-conda.yml
    conda env create -n qiime2-2021.4 --file qiime2-2021.4-py38-linux-conda.yml
    rm qiime2-2021.4-py36-linux-conda.yml
    source activate qiime2-2021.4
    qiime --help
    

Note that the plugin was tested with qiime2-2021.4 but please use the latest version if available.

  • Fetch the repository and go to main folder:
    git clone https://github.com/bioinf-mcb/q2-health-index
    cd q2-health-index
    
  • Install plugin: make install
  • Test plugin e.g.: qiime health-index --help

CLI parameters description

Predict GMHI

Usage: qiime health-index gmhi-predict [OPTIONS]
GMHI predicts the gut microbiome health index for each sample in the abundance table.

Inputs:

--i-table ARTIFACT FeatureTable[Frequency] or FeatureTable[RelativeFrequency]
Abundance table artifact on which GMHI will be computed.

Parameters:

Parameter Type Optional / required / default Description
--p-healthy-species-fp TEXT optional Path to file with healthy species (taxonomy is based on MetaPhlAn 2).
--p-non-healthy-species-fp TEXT optional Path to file with non-healthy species (taxonomy is based on MetaPhlAn 2).
--p-mh-prime INTEGER default: 7 Median from the top 1% healthy samples in training dataset (see Gupta et al. 2020 Methods section).
--p-rel-thresh NUMBER default: 1e-05 Median from the top 1% non-healthy samples in training dataset (see Gupta et al. 2020 Methods section).
--p-rel-thresh NUMBER default: 1e-05 Relative frequency based threshold for discarding insignificant OTU.
--p-log-thresh NUMBER default: 1e-05 Normalization value for log10 in the last step of GMHI calculation.

Outputs:

--o-gmhi-results ARTIFACT SampleData[AlphaDiversity] Predicted GMHI in tabular form.

Predict and visualize GMHI

Usage: qiime health-index gmhi-predict-viz [OPTIONS]
Predict and visualize the gut microbiome health index for each sample in the abundance table.

Inputs:

--i-table ARTIFACT FeatureTable[Frequency] or FeatureTable[RelativeFrequency]
Abundance table artifact on which GMHI will be computed.

Parameters:

Parameter Type Optional / required / default Description
--m-metadata-file METADATA METADATA required Metadata used for visualization.
--p-healthy-species-fp TEXT optional Path to file with healthy species (taxonomy is based on MetaPhlAn 2).
--p-non-healthy-species-fp TEXT optional Path to file with non-healthy species (taxonomy is based on MetaPhlAn 2).
--p-mh-prime INTEGER default: 7 Median from the top 1% healthy samples in training dataset (see Gupta et al. 2020 Methods section).
--p-rel-thresh NUMBER default: 1e-05 Median from the top 1% non-healthy samples in training dataset (see Gupta et al. 2020 Methods section).
--p-rel-thresh NUMBER default: 1e-05 Relative frequency based threshold for discarding insignificant OTU.
--p-log-thresh NUMBER default: 1e-05 Normalization value for log10 in the last step of GMHI calculation.

Outputs:

--o-gmhi-results ARTIFACT SampleData[AlphaDiversity] Predictedd GMHI in tabular form.
--o-gmhi-plot VISUALIZATION Bar plot showing predicted GMHI distribution.

Tutorials

This is a QIIME 2 plugin. For details on QIIME 2 see documentation.

Note: in the examples below all paths are related to the main repository directory.

Predict GMHI

In order to compute the GMHI (as a qza artifact) you need to provide the abundance table (qza artifact of the type FeatureTable[Frequency] or FeatureTable[RelativeFrequency]) and output file name.

  • Example:
    qiime health-index gmhi-predict \
    --i-table q2_health_index/tests/data/input/abundances/4347_final_relative_abundances.qza \
    --o-gmhi-results q2_health_index/tests/data/gmhi_output
    

Important: feature table must contain at least one healthy and non-healthy species.

Predict and visualize GMHI

In order to compute and visualize the GMHI (in the form of qza and qzv artifacts) you need to provide the abundance table (qza artifact of the type FeatureTable[Frequency] or FeatureTable[RelativeFrequency]), the metadata file (e.g. tsv file) and output file names.

  • Example:
    qiime health-index gmhi-predict-viz \
    --i-table q2_health_index/tests/data/input/abundances/4347_final_relative_abundances.qza \
    --m-metadata-file q2_health_index/tests/data/input/metadata/4347_final_metadata.tsv \
    --o-gmhi-results q2_health_index/tests/data/gmhi_output \
    --o-gmhi-plot q2_health_index/tests/data/gmhi_plot
    

Important: feature table must contain description of all samples in the abundance table.

The visualization is generated using the alpha-group-significance function from the q2-diversity plugin (i.e. nonparametric Kruskal–Wallis test for healthy/non-healthy group comparison). Basically, it is equivalent to running the two below commands separately:

qiime health-index gmhi-predict \
--i-table q2_health_index/tests/data/input/abundances/4347_final_relative_abundances.qza \
--o-gmhi-results q2_health_index/tests/data/gmhi_output
qiime diversity alpha-group-significance \
--i-alpha-diversity q2_health_index/tests/data/gmhi_output.qza  \
--m-metadata-file q2_health_index/tests/data/input/metadata/4347_final_metadata.tsv \
--o-visualization q2_health_index/tests/data/gmhi_plot

In both cases you should get the same output (qza and qzv artifacts): gmhi_output.zip

After dropping the visualisation (qzv) into the Qiime 2 View you should see something like that: image

Contributing

QIIME 2 is an open-source project, and we are very interested in contributions from the community.
Please see the contributing guidelines if you would like to get involved.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published