taxa_only_in_one_level: Show taxa which are present in only one given level of a...

View source: R/beta_div_test.R View source: R/dada_phyloseq.R

taxa_only_in_one_levelR Documentation

Show taxa which are present in only one given level of a modality

Description

lifecycle-experimental lifecycle-experimental

Given one modality name in sam_data and one level of the modality, return the taxa strictly specific of this level.

Usage

taxa_only_in_one_level(
  physeq,
  modality,
  level,
  min_nb_seq_taxa = 0,
  min_nb_samples_taxa = 0
)

taxa_only_in_one_level(
  physeq,
  modality,
  level,
  min_nb_seq_taxa = 0,
  min_nb_samples_taxa = 0
)

Arguments

physeq

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

modality

(required) The name of a column present in the ⁠@sam_data⁠ slot of the physeq object. Must be a character vector or a factor.

level

(required) The level (must be present in modality) of interest

min_nb_seq_taxa

(default 0 = no filter) The minimum number of sequences per taxa

min_nb_samples_taxa

(default 0 = no filter) The minimum number of samples per taxa

Value

A vector of taxa names

A vector of taxa names

Author(s)

Adrien Taudière

See Also

ggvenn_pq() and upset_pq()

Examples

data_fungi_mini_woNA4height <- subset_samples(
  data_fungi_mini,
  !is.na(data_fungi_mini@sam_data$Height)
)
taxa_only_in_one_level(data_fungi_mini_woNA4height, "Height", "High")
# Taxa present only in low height samples
suppressMessages(suppressWarnings(taxa_only_in_one_level(data_fungi, "Height", "Low")))
# Number of taxa present only in sample of time equal to 15
suppressMessages(suppressWarnings(length(taxa_only_in_one_level(data_fungi, "Time", "15"))))

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