filt_taxa_wo_NA: Filter taxa by cleaning taxa with NA at given taxonomic...

filt_taxa_wo_NAR Documentation

Filter taxa by cleaning taxa with NA at given taxonomic rank(s)

Description

lifecycle-experimental

Basically a wrapper of subset_taxa_pq()

Usage

filt_taxa_wo_NA(
  physeq,
  taxa_ranks = NULL,
  n_NA = 0,
  verbose = TRUE,
  NA_equivalent = NULL,
  clean_pq = TRUE
)

Arguments

physeq

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

taxa_ranks

A vector of taxonomic ranks. For examples c("Family","Genus"). If taxa_ranks is NULL (default), all ranks are used, i.e. all taxa with at least 1 NA will be filtered out. Numeric position of taxonomic ranks can also be used.

n_NA

(int default = 0). Number of allowed NA by taxa in the list of the taxonomic ranks

verbose

(logical). If TRUE, print additional information.

NA_equivalent

(vector of character, default NULL). Exact matching of the character listed in the vector are converted as NA before to filter out taxa.

clean_pq

(logical, default TRUE) If set to TRUE, empty samples are discarded after filtering. See clean_pq().

Value

An object of class phyloseq

Author(s)

Adrien Taudière

See Also

subset_taxa_pq()

Examples


data_fungi_wo_NA <- filt_taxa_wo_NA(data_fungi)
filt_taxa_wo_NA(data_fungi, n_NA = 1)
filt_taxa_wo_NA(data_fungi, taxa_ranks = c(1:3))

filt_taxa_wo_NA(data_fungi, taxa_ranks = c("Trait", "Confidence.Ranking"))
filt_taxa_wo_NA(data_fungi,
  taxa_ranks = c("Trait", "Confidence.Ranking"),
  NA_equivalent = c("-", "NULL")
)

MiscMetabar documentation built on June 21, 2025, 5:09 p.m.