iNEXT_pq: iNterpolation and EXTrapolation of Hill numbers (with iNEXT)

View source: R/plot_functions.R

iNEXT_pqR Documentation

iNterpolation and EXTrapolation of Hill numbers (with iNEXT)

Description

lifecycle-experimental

Note that this function is quite time-consuming due to high dimensionality in metabarcoding community matrix.

Usage

iNEXT_pq(physeq, merge_sample_by = NULL, ...)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

merge_sample_by

(default: NULL) if not NULL samples of physeq are merged using the vector set by merge_sample_by. This merging used the merge_samples2(). In the case of biplot_pq() this must be a factor with two levels only.

...

Other arguments for the iNEXT::iNEXT() function

Value

see iNEXT::iNEXT() documentation

Author(s)

Adrien Taudière This function is mainly a wrapper of the work of others. Please make a reference to iNEXT::iNEXT() if you use this function.

Examples


if (requireNamespace("iNEXT")) {
  data("GlobalPatterns", package = "phyloseq")
  GPsubset <- subset_taxa(
    GlobalPatterns,
    GlobalPatterns@tax_table[, 1] == "Bacteria"
  )
  GPsubset <- subset_taxa(
    GPsubset,
    rowSums(GPsubset@otu_table) > 20000
  )
  GPsubset <- subset_taxa(
    GPsubset,
    rowSums(is.na(GPsubset@tax_table)) == 0
  )
  GPsubset@sam_data$human <- GPsubset@sam_data$SampleType %in%
    c("Skin", "Feces", "Tong")
  res_iNEXT <- iNEXT_pq(
    GPsubset,
    merge_sample_by = "human",
    q = 1,
    datatype = "abundance",
    nboot = 2
  )
  iNEXT::ggiNEXT(res_iNEXT)
  iNEXT::ggiNEXT(res_iNEXT, type = 2)
  iNEXT::ggiNEXT(res_iNEXT, type = 3)
}


MiscMetabar documentation built on Oct. 8, 2024, 1:07 a.m.