This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
This QIIME 2 plugin supports statistical analyses.
- version:
2025.10.0.dev0 - website: https://
github .com /qiime2 /q2 -stats - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org
Actions¶
| Name | Type | Short Description |
|---|---|---|
| mann-whitney-u | method | Mann-Whitney U Test |
| wilcoxon-srt | method | Wilcoxon Signed Rank Test |
| facet-within | method | Facet within outer group |
| facet-across | method | Facet across outer group |
| collate-stats | method | Combine and FDR correct multiple stats |
| method | Alpha diversity to Dist1D | |
| plot-rainclouds | visualizer | Raincloud plots |
| mann-whitney-u-facet | pipeline | Per-facet Mann-Whitney U Test |
| wilcoxon-srt-facet | pipeline | Per-facet Wilcoxon Signed Rank Test |
| pipeline | Alpha group significance test and plot |
stats mann-whitney-u¶
Citations¶
Inputs¶
- distribution:
Dist1D[Unordered | Ordered, Independent] <no description>[required]
- against_each:
Dist1D[Unordered | Ordered, Matched | Independent] <no description>[optional]
Parameters¶
- compare:
Str%Choices('reference', 'all-pairwise') The comparison that will be used to analyze the input
distribution. Either "reference" or "all-pairwise" must be selected. The "reference" comparison defines Group A as the reference/control provided toreference_group(sourced from eitherreference_columnorcontrol_column), and Group B as all other groups. The "all-pairwise" comparison compares all groups to all other groups. Ifagainst_eachis used, this will define Group B.[required]- reference_group:
Str If "reference" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions, "asymptotic" will use a normal distribution, and "auto" will use either "exact" when one of the groups has less than 8 observations and there are no ties, otherwise "asymptotic".[default:
'auto']
Outputs¶
- stats:
StatsTable[Pairwise] The Mann-Whitney U table for either the "reference" or "all-pairwise" comparison.[required]
Examples¶
mann_whitney_pairwise¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
wget -O 'refdist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
qiime stats mann-whitney-u \
--i-distribution refdist.qza \
--p-compare all-pairwise \
--i-against-each timedist.qza \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn = 'refdist.qza'
request.urlretrieve(url, fn)
refdist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
refdist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u /1 /refdist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-utool: - Set "distribution" to
#: refdist.qza - Set "compare" to
all-pairwise - Expand the
additional optionssection- Set "against_each" to
#: timedist.qza - Set "p_val_approx" to
asymptotic
- Set "against_each" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u/1/refdist.qza'
fn <- 'refdist.qza'
request$urlretrieve(url, fn)
refdist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u(
distribution=refdist,
compare='all-pairwise',
against_each=timedist,
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_pairwise
mann_whitney_pairwise(use)
stats wilcoxon-srt¶
Citations¶
Inputs¶
- distribution:
Dist1D[Ordered, Matched] <no description>[required]
Parameters¶
- compare:
Str%Choices('baseline', 'consecutive') The type of comparison that will be used to analyze the input
distribution. The "baseline" comparison defines Group A as the timepoint provided tobaseline_group(sourced fromtime_column), and Group B as all other timepoints contained intime_column. The "consecutive" comparison defines Group A as "timepoint n", and Group B as "timepoint n+1" (both sourced fromtime_column).[required]- baseline_group:
Str If "baseline" is the selected comparison, this is the column that will be used to compare all other groups against.[optional]
- alternative:
Str%Choices('two-sided', 'greater', 'less') The "two-sided" alternative hypothesis is that the median of Group A does not equal the median of Group B. The "greater" alternative hypothesis is that the median of group A is greater than the median of Group B. The "less" alternative hypothesis is that the median of group A is less than the median of Group B.[default:
'two-sided']- p_val_approx:
Str%Choices('auto', 'exact', 'asymptotic') "exact" will calculate an exact p-value for distributions of up to 25 (inclusive) measurements, "asymptotic" will use a normal distribution, and "auto" will use either "exact" or "approx" depending on size.[default:
'auto']- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
False]
Outputs¶
- stats:
StatsTable[Pairwise] The Wilcoxon SRT table for either the "baseline" or "consecutive" comparison.[required]
Examples¶
wilcoxon_baseline0¶
wget -O 'timedist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
qiime stats wilcoxon-srt \
--i-distribution timedist.qza \
--p-compare baseline \
--p-baseline-group 0 \
--p-p-val-approx asymptotic \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn = 'timedist.qza'
request.urlretrieve(url, fn)
timedist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
timedist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt /1 /timedist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srttool: - Set "distribution" to
#: timedist.qza - Set "compare" to
baseline - Expand the
additional optionssection- Set "baseline_group" to
0 - Set "p_val_approx" to
asymptotic
- Set "baseline_group" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt/1/timedist.qza'
fn <- 'timedist.qza'
request$urlretrieve(url, fn)
timedist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt(
distribution=timedist,
compare='baseline',
baseline_group='0',
p_val_approx='asymptotic',
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_baseline0
wilcoxon_baseline0(use)
stats facet-within¶
Facets a distribution into independent distributions where each facet is an inner slice from the outer group.
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched | Independent] A nested or multi Dist1D which will be partitioned into undordered and independent subgroups.[required]
Outputs¶
- distributions:
Collection[Dist1D[Unordered, Independent]] A collection of unordered and independent Dist1Ds.[required]
stats facet-across¶
Facet a distribution into per-class/level distributions where each facet preserves the outer group structure.
Inputs¶
- distribution:
Dist1D[NestedOrdered¹ | NestedUnordered², Independent¹ | Matched²] A nested Dist1D which will be partitioned into non-nested Dist1D[required]
Outputs¶
- distributions:
Collection[Dist1D[Ordered¹ | Unordered², Independent¹ | Matched²]] A collection of non-nested Dist1Ds[required]
stats collate-stats¶
Converts a collection of stats tables into a single table
Inputs¶
- tables:
Collection[StatsTable[Pairwise]] <no description>[required]
Outputs¶
- table:
StatsTable[Pairwise] <no description>[required]
stats prep-alpha-distribution¶
Alpha diversity to Dist1D
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the Dist1D to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the Dist1D to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] The resulting Dist1D.[required]
stats plot-rainclouds¶
Plot raincloud distributions for each group.
Inputs¶
- data:
Dist1D[Multi | Ordered | Unordered | NestedOrdered | NestedUnordered, Matched | Independent] The group distributions to plot.[required]
- stats:
StatsTable[Pairwise] Statistical tests to display.[optional]
Outputs¶
- visualization:
Visualization <no description>[required]
Examples¶
plot_rainclouds¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
qiime stats plot-rainclouds \
--i-data dist.qza \
--o-visualization raincloud-plot.qzvfrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
raincloud_plot_viz, = stats_actions.plot_rainclouds(
data=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /plot -rainclouds /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats plot-raincloudstool: - Set "data" to
#: dist.qza - Press the
Executebutton.
- Set "data" to
- Once completed, for the new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats plot-rainclouds [...] : visualization.qzvraincloud-plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/plot-rainclouds/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$plot_rainclouds(
data=dist,
)
raincloud_plot_viz <- action_results$visualization
from q2_stats.examples import plot_rainclouds
plot_rainclouds(use)
stats mann-whitney-u-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[NestedOrdered | NestedUnordered, Matched]|Dist1D[NestedOrdered | NestedUnordered, Independent] <no description>[required]
Parameters¶
- facet:
Str%Choices('within')|Str%Choices('within')|Str%Choices('within', 'across') Whether to facet within or across the outer group.[default:
'within']
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
mann_whitney_u_facet_across¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet across \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='across',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Set "facet" to
across
- Set "facet" to
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='across',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_across
mann_whitney_facet_across(use)
mann_whitney_u_facet_within¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
qiime stats mann-whitney-u-facet \
--i-distribution dist.qza \
--p-facet within \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.mann_whitney_u_facet(
distribution=dist,
facet='within',
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /mann -whitney -u -facet /2 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats mann-whitney-u-facettool: - Set "distribution" to
#: dist.qza - Expand the
additional optionssection- Leave "facet" as its default value of
within
- Leave "facet" as its default value of
- Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/mann-whitney-u-facet/2/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$mann_whitney_u_facet(
distribution=dist,
facet='within',
)
stats <- action_results$stats
from q2_stats.examples import mann_whitney_facet_within
mann_whitney_facet_within(use)
stats wilcoxon-srt-facet¶
Citations¶
Inputs¶
- distribution:
Dist1D[Multi | NestedOrdered | NestedUnordered, Matched] <no description>[required]
Parameters¶
- ignore_empty_comparator:
Bool Ignore any group that does not have any overlapping subjects with comparison group. These groups will have NaNs in the stats table output[default:
True]
Outputs¶
- stats:
StatsTable[Pairwise] <no description>[required]
Examples¶
wilcoxon_srt_facet¶
wget -O 'dist.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
qiime stats wilcoxon-srt-facet \
--i-distribution dist.qza \
--o-stats stats.qzafrom qiime2 import Artifact
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn = 'dist.qza'
request.urlretrieve(url, fn)
dist = Artifact.load(fn)
stats, = stats_actions.wilcoxon_srt_facet(
distribution=dist,
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
dist.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /wilcoxon -srt -facet /1 /dist .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats wilcoxon-srt-facettool: - Set "distribution" to
#: dist.qza - Press the
Executebutton.
- Set "distribution" to
library(reticulate)
Artifact <- import("qiime2")$Artifact
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/wilcoxon-srt-facet/1/dist.qza'
fn <- 'dist.qza'
request$urlretrieve(url, fn)
dist <- Artifact$load(fn)
action_results <- stats_actions$wilcoxon_srt_facet(
distribution=dist,
)
stats <- action_results$stats
from q2_stats.examples import wilcoxon_srt_facet
wilcoxon_srt_facet(use)
stats alpha-group-significance¶
Will select between Wilcoxon SRT and Mann-Whitney U depending on the presence of repeated measures.
Inputs¶
- alpha_diversity:
SampleData[AlphaDiversity] Alpha diversity which will become the "measure"[required]
Parameters¶
- metadata:
Metadata Sample metadata to use[required]
- columns:
List[Str] Columns to include as group information[required]
- subject:
Str%Choices('')|Str|Str%Choices('')|Str If provided, will cause the results to be matched for repeated measures.[default:
'']- timepoint:
Str%Choices('')|Str%Choices('')|Str|Str If provided, will cause the results to be stratified by timepoint. Required if using
subject.[default:'']
Outputs¶
- distribution:
Dist1D[Multi, Independent]|Dist1D[Multi, Matched]|Dist1D[NestedOrdered, Independent]|Dist1D[NestedOrdered, Matched] Dist1D generated by metadata and alpha diversity.[required]
- stats:
StatsTable[Pairwise] A stats table of the per-group/timepoint results[required]
- raincloud:
Visualization A visualization of the distribution and statistics[required]
Examples¶
alpha_group_significance_faith_pd¶
wget -O 'alpha-div-faith-pd.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
wget -O 'metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--p-subject mouse_id \
--p-timepoint days_post_transplant \
--o-distribution dist.qza \
--o-stats stats.qza \
--o-raincloud raincloud.qzv
qiime stats alpha-group-significance \
--i-alpha-diversity alpha-div-faith-pd.qza \
--m-metadata-file metadata.tsv \
--p-columns genotype donor_status \
--o-distribution dist2.qza \
--o-stats stats2.qza \
--o-raincloud raincloud2.qzvfrom qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.stats.actions as stats_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn = 'alpha-div-faith-pd.qza'
request.urlretrieve(url, fn)
alpha_div_faith_pd = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn = 'metadata.tsv'
request.urlretrieve(url, fn)
metadata_md = Metadata.load(fn)
dist, stats, raincloud_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
subject='mouse_id',
timepoint='days_post_transplant',
)
dist2, stats2, raincloud2_viz = stats_actions.alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=['genotype', 'donor_status'],
)- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
alpha-div-faith-pd.qza - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /alpha -div -faith -pd .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Datatool: - On the first tab (Regular), press the
Paste/Fetchdata button at the bottom.- Set "Name" (first text-field) to:
metadata.tsv - In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /stats /alpha -group -significance /1 /metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Startbutton at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Expand the
additional optionssection- Set "subject" to
mouse_id - Set "timepoint" to
days_post_transplant
- Set "subject" to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud.qzv
- Using the
qiime2 stats alpha-group-significancetool: - Set "alpha_diversity" to
#: alpha-div-faith-pd.qza - For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV - Set "Metadata Source" to
metadata.tsv
- Leave as
- Perform the following steps.
- For "columns", use the
+ columnsbutton to add the corresponding values:- Add "element" set to
genotype - Add "element" set to
donor_status
- Add "element" set to
- Press the
Executebutton.
- Set "alpha_diversity" to
- Once completed, for each new entry in your history, use the
Editbutton to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 stats alpha-group-significance [...] : distribution.qzadist2.qza#: qiime2 stats alpha-group-significance [...] : stats.qzastats2.qza#: qiime2 stats alpha-group-significance [...] : raincloud.qzvraincloud2.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
request <- import("urllib")$request
stats_actions <- import("qiime2.plugins.stats.actions")
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/alpha-div-faith-pd.qza'
fn <- 'alpha-div-faith-pd.qza'
request$urlretrieve(url, fn)
alpha_div_faith_pd <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/stats/alpha-group-significance/1/metadata.tsv'
fn <- 'metadata.tsv'
request$urlretrieve(url, fn)
metadata_md <- Metadata$load(fn)
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
subject='mouse_id',
timepoint='days_post_transplant',
)
dist <- action_results$distribution
stats <- action_results$stats
raincloud_viz <- action_results$raincloud
action_results <- stats_actions$alpha_group_significance(
alpha_diversity=alpha_div_faith_pd,
metadata=metadata_md,
columns=list('genotype', 'donor_status'),
)
dist2 <- action_results$distribution
stats2 <- action_results$stats
raincloud2_viz <- action_results$raincloud
from q2_stats.examples import alpha_group_significance_faith_pd
alpha_group_significance_faith_pd(use)
- Links
- Documentation
- Source Code
- Stars
- 1
- Last Commit
- 0e345b9
- Available Distros
- 2025.7
- 2025.7/amplicon
- 2025.4
- 2025.4/amplicon
- 2024.10
- 2024.10/amplicon