Warning
This site has been replaced by the new QIIME 2 “amplicon distribution” documentation, as of the 2025.4 release of QIIME 2. You can still access the content from the “old docs” here for the QIIME 2 2024.10 and earlier releases, but we recommend that you transition to the new documentation at https://amplicon-docs.qiime2.org. Content on this site is no longer updated and may be out of date.
Are you looking for:
the QIIME 2 homepage? That’s https://qiime2.org.
learning resources for microbiome marker gene (i.e., amplicon) analysis? See the QIIME 2 amplicon distribution documentation.
learning resources for microbiome metagenome analysis? See the MOSHPIT documentation.
installation instructions, plugins, books, videos, workshops, or resources? See the QIIME 2 Library.
general help? See the QIIME 2 Forum.
Old content beyond this point… 👴👵
linear-mixed-effects: Linear mixed effects modeling¶
Citations |
|
---|
Docstring:
Usage: qiime longitudinal linear-mixed-effects [OPTIONS] Linear mixed effects models evaluate the contribution of exogenous covariates "group_columns" and "random_effects" to a single dependent variable, "metric". Perform LME and plot line plots of each group column. A feature table artifact is required input, though whether "metric" is derived from the feature table or metadata is optional. Inputs: --i-table ARTIFACT FeatureTable[RelativeFrequency] Feature table containing metric. [optional] Parameters: --m-metadata-file METADATA... (multiple arguments Sample metadata file containing will be merged) individual-id-column. [required] --p-state-column TEXT Metadata column containing state (time) variable information. [required] --p-individual-id-column TEXT Metadata column containing IDs for individual subjects. [required] --p-metric TEXT Dependent variable column name. Must be a column name located in the metadata or feature table files. [optional] --p-group-columns TEXT Comma-separated list (without spaces) of metadata columns to use as independent covariates used to determine mean structure of "metric". [optional] --p-random-effects TEXT Comma-separated list (without spaces) of metadata columns to use as independent covariates used to determine the variance and covariance structure (random effects) of "metric". To add a random slope, the same value passed to "state-column" should be passed here. A random intercept for each individual is set by default and does not need to be passed here. [optional] --p-palette TEXT Choices('Set1', 'Set2', 'Set3', 'Pastel1', 'Pastel2', 'Paired', 'Accent', 'Dark2', 'tab10', 'tab20', 'tab20b', 'tab20c', 'viridis', 'plasma', 'inferno', 'magma', 'terrain', 'rainbow', 'cividis') Color palette to use for generating boxplots. [default: 'Set1'] --p-lowess / --p-no-lowess Estimate locally weighted scatterplot smoothing. Note that this will eliminate confidence interval plotting. [default: False] --p-ci NUMBER Size of the confidence interval for the regression Range(0, 100) estimate. [default: 95] --p-formula TEXT R-style formula to use for model specification. A formula must be used if the "metric" parameter is None. Note that the metric and group columns specified in the formula will override metric and group columns that are passed separately as parameters to this method. Formulae will be in the format "a ~ b + c", where "a" is the metric (dependent variable) and "b" and "c" are independent covariates. Use "+" to add a variable; "+ a:b" to add an interaction between variables a and b; "*" to include a variable and all interactions; and "-" to subtract a particular term (e.g., an interaction term). See https://patsy.readthedocs.io/en/latest/formulas.html for full documentation of valid formula operators. Always enclose formulae in quotes to avoid unpleasant surprises. [optional] Outputs: --o-visualization VISUALIZATION [required] Miscellaneous: --output-dir PATH Output unspecified results to a directory --verbose / --quiet Display verbose output to stdout and/or stderr during execution of this action. Or silence output if execution is successful (silence is golden). --example-data PATH Write example data and exit. --citations Show citations and exit. --use-cache DIRECTORY Specify the cache to be used for the intermediate work of this action. If not provided, the default cache under $TMP/qiime2/will be used. IMPORTANT FOR HPC USERS: If you are on an HPC system and are using parallel execution it is important to set this to a location that is globally accessible to all nodes in the cluster. --help Show this message and exit.
Import:
from qiime2.plugins.longitudinal.visualizers import linear_mixed_effects
Docstring:
Linear mixed effects modeling Linear mixed effects models evaluate the contribution of exogenous covariates "group_columns" and "random_effects" to a single dependent variable, "metric". Perform LME and plot line plots of each group column. A feature table artifact is required input, though whether "metric" is derived from the feature table or metadata is optional. Parameters ---------- metadata : Metadata Sample metadata file containing individual_id_column. state_column : Str Metadata column containing state (time) variable information. individual_id_column : Str Metadata column containing IDs for individual subjects. metric : Str, optional Dependent variable column name. Must be a column name located in the metadata or feature table files. group_columns : Str, optional Comma-separated list (without spaces) of metadata columns to use as independent covariates used to determine mean structure of "metric". random_effects : Str, optional Comma-separated list (without spaces) of metadata columns to use as independent covariates used to determine the variance and covariance structure (random effects) of "metric". To add a random slope, the same value passed to "state_column" should be passed here. A random intercept for each individual is set by default and does not need to be passed here. table : FeatureTable[RelativeFrequency], optional Feature table containing metric. palette : Str % Choices('Set1', 'Set2', 'Set3', 'Pastel1', 'Pastel2', 'Paired', 'Accent', 'Dark2', 'tab10', 'tab20', 'tab20b', 'tab20c', 'viridis', 'plasma', 'inferno', 'magma', 'terrain', 'rainbow', 'cividis'), optional Color palette to use for generating boxplots. lowess : Bool, optional Estimate locally weighted scatterplot smoothing. Note that this will eliminate confidence interval plotting. ci : Float % Range(0, 100), optional Size of the confidence interval for the regression estimate. formula : Str, optional R-style formula to use for model specification. A formula must be used if the "metric" parameter is None. Note that the metric and group columns specified in the formula will override metric and group columns that are passed separately as parameters to this method. Formulae will be in the format "a ~ b + c", where "a" is the metric (dependent variable) and "b" and "c" are independent covariates. Use "+" to add a variable; "+ a:b" to add an interaction between variables a and b; "*" to include a variable and all interactions; and "-" to subtract a particular term (e.g., an interaction term). See https://patsy.readthedocs.io/en/latest/formulas.html for full documentation of valid formula operators. Always enclose formulae in quotes to avoid unpleasant surprises. Returns ------- visualization : Visualization