Fork me on GitHub

rarefy: Rarefy table

Citations

[feature-table:rarefy:WXP+17]Sophie Weiss, Zhenjiang Zech Xu, Shyamal Peddada, Amnon Amir, Kyle Bittinger, Antonio Gonzalez, Catherine Lozupone, Jesse R. Zaneveld, Yoshiki Vázquez-Baeza, Amanda Birmingham, Embriette R. Hyde, and Rob Knight. Normalization and microbial differential abundance strategies depend upon data characteristics. Microbiome, 5(1):27, Mar 2017. doi:10.1186/s40168-017-0237-y.

Docstring:

Usage: qiime feature-table rarefy [OPTIONS]

  Subsample frequencies from all samples so that the sum of frequencies in
  each sample is equal to sampling-depth.

Options:
  --i-table ARTIFACT PATH FeatureTable[Frequency]
                                  The feature table to be rarefied.
                                  [required]
  --p-sampling-depth INTEGER RANGE
                                  The total frequency that each sample should
                                  be rarefied to. Samples where the sum of
                                  frequencies is less than the sampling depth
                                  will be not be included in the resulting
                                  table unless subsampling is performed with
                                  replacement.  [required]
  --p-with-replacement / --p-no-with-replacement
                                  Rarefy with replacement by sampling from the
                                  multinomial distribution instead of
                                  rarefying without replacement.  [default:
                                  False]
  --o-rarefied-table ARTIFACT PATH FeatureTable[Frequency]
                                  The resulting rarefied feature table.
                                  [required if not passing --output-dir]
  --output-dir DIRECTORY          Output unspecified results to a directory
  --cmd-config FILE               Use config file for command options
  --verbose                       Display verbose output to stdout and/or
                                  stderr during execution of this action.
                                  [default: False]
  --quiet                         Silence output if execution is successful
                                  (silence is golden).  [default: False]
  --citations                     Show citations and exit.
  --help                          Show this message and exit.

Import:

from qiime2.plugins.feature_table.methods import rarefy

Docstring:

Rarefy table

Subsample frequencies from all samples so that the sum of frequencies in
each sample is equal to sampling-depth.

Parameters
----------
table : FeatureTable[Frequency]
    The feature table to be rarefied.
sampling_depth : Int % Range(1, None)
    The total frequency that each sample should be rarefied to. Samples
    where the sum of frequencies is less than the sampling depth will be
    not be included in the resulting table unless subsampling is performed
    with replacement.
with_replacement : Bool, optional
    Rarefy with replacement by sampling from the multinomial distribution
    instead of rarefying without replacement.

Returns
-------
rarefied_table : FeatureTable[Frequency]
    The resulting rarefied feature table.