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… 👴👵
first-differences: Compute first differences or difference from baseline between sequential states¶
Docstring:
Usage: qiime longitudinal first-differences [OPTIONS] Calculates first differences in "metric" between sequential states for samples collected from individual subjects sampled repeatedly at two or more states. First differences can be performed on a metadata column (including artifacts that can be input as metadata) or a feature in a feature table. Outputs a data series of first differences for each individual subject at each sequential pair of states, labeled by the SampleID of the second state (e.g., paired differences between time 0 and time 1 would be labeled by the SampleIDs at time 1). This file can be used as input to linear mixed effects models or other longitudinal or diversity methods to compare changes in first differences across time or among groups of subjects. Also supports differences from baseline (or other static comparison state) by setting the "baseline" parameter. Inputs: --i-table ARTIFACT FeatureTable[RelativeFrequency] Feature table to optionally use for computing first differences. [optional] Parameters: --m-metadata-file METADATA... (multiple Sample metadata file containing arguments will be individual-id-column. merged) [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 Numerical metadata or artifact column to test. [required] --p-replicate-handling TEXT Choices('error', 'random', 'drop') Choose how replicate samples are handled. If replicates are detected, "error" causes method to fail; "drop" will discard all replicated samples; "random" chooses one representative at random from among replicates. [default: 'error'] --p-baseline NUMBER A value listed in the state-column metadata column against which all other states should be compared. Toggles calculation of static differences instead of first differences (which are calculated if no value is given for baseline). If a "baseline" value is provided, sample differences at each state are compared against the baseline state, instead of the previous state. Must be a value listed in the state-column. [optional] Outputs: --o-first-differences ARTIFACT SampleData[FirstDifferences] Series of first differences. [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.methods import first_differences
Docstring:
Compute first differences or difference from baseline between sequential states Calculates first differences in "metric" between sequential states for samples collected from individual subjects sampled repeatedly at two or more states. First differences can be performed on a metadata column (including artifacts that can be input as metadata) or a feature in a feature table. Outputs a data series of first differences for each individual subject at each sequential pair of states, labeled by the SampleID of the second state (e.g., paired differences between time 0 and time 1 would be labeled by the SampleIDs at time 1). This file can be used as input to linear mixed effects models or other longitudinal or diversity methods to compare changes in first differences across time or among groups of subjects. Also supports differences from baseline (or other static comparison state) by setting the "baseline" parameter. 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 Numerical metadata or artifact column to test. replicate_handling : Str % Choices('error', 'random', 'drop'), optional Choose how replicate samples are handled. If replicates are detected, "error" causes method to fail; "drop" will discard all replicated samples; "random" chooses one representative at random from among replicates. baseline : Float, optional A value listed in the state_column metadata column against which all other states should be compared. Toggles calculation of static differences instead of first differences (which are calculated if no value is given for baseline). If a "baseline" value is provided, sample differences at each state are compared against the baseline state, instead of the previous state. Must be a value listed in the state_column. table : FeatureTable[RelativeFrequency], optional Feature table to optionally use for computing first differences. Returns ------- first_differences : SampleData[FirstDifferences] Series of first differences.