psExtra-accessors: Extract elements from psExtra class

psExtra-accessorsR Documentation

Extract elements from psExtra class

Description

  • ps_get returns phyloseq

  • info_get returns psExtraInfo object

  • dist_get returns distance matrix (or NULL)

  • ord_get returns ordination object (or NULL)

  • perm_get returns adonis2() permanova model (or NULL)

  • bdisp_get returns results of betadisper() (or NULL)

  • otu_get returns phyloseq otu_table matrix with taxa as columns

  • tt_get returns phyloseq tax_table

  • tax_models_get returns list generated by tax_model or NULL

  • tax_stats_get returns dataframe generated by tax_models2stats or NULL

  • taxatree_models_get returns list generated by taxatree_models or NULL

  • taxatree_stats_get returns dataframe generated by taxatree_models2stats or NULL

  • samdat_tbl returns phyloseq sample_data as a tibble with sample_names as new first column called .sample_name

Usage

ps_get(psExtra, ps_extra, counts = FALSE, warn = TRUE)

dist_get(psExtra, ps_extra)

ord_get(psExtra, ps_extra)

info_get(psExtra, ps_extra)

perm_get(psExtra, ps_extra)

bdisp_get(psExtra, ps_extra)

tax_models_get(psExtra)

tax_stats_get(psExtra)

taxatree_models_get(psExtra)

taxatree_stats_get(psExtra)

otu_get(data, taxa = NA, samples = NA, counts = FALSE, warn = TRUE)

tt_get(data)

samdat_tbl(data, sample_names_col = ".sample_name")

Arguments

psExtra

psExtra S4 class object

ps_extra

deprecated! don't use this

counts

should ps_get or otu_get attempt to return counts? if present in object

warn

if counts = TRUE, should a warning be emitted if counts are not available? set warn = "error" to stop if counts are not available

data

phyloseq or psExtra

taxa

subset of taxa to return, NA for all (default)

samples

subset of samples to return, NA for all (default)

sample_names_col

name of column where sample_names are put. if NA, return data.frame with rownames (sample_names)

Value

element(s) from psExtra object (or NULL)

Examples

data("dietswap", package = "microbiome")

psx <- tax_transform(dietswap, "compositional", rank = "Genus")

psx

ps_get(psx)

ps_get(psx, counts = TRUE)

info_get(psx)

dist_get(psx) # this psExtra has no dist_calc result

ord_get(psx) # this psExtra has no ord_calc result

perm_get(psx) # this psExtra has no dist_permanova result

bdisp_get(psx) # this psExtra has no dist_bdisp result

# these can be returned from phyloseq objects too
otu_get(psx, taxa = 6:9, samples = c("Sample-9", "Sample-1", "Sample-6"))

otu_get(psx, taxa = 6:9, samples = c(9, 1, 6), counts = TRUE)

tt_get(psx) %>% head()

samdat_tbl(psx)

samdat_tbl(psx, sample_names_col = "SAMPLENAME")

david-barnett/microViz documentation built on April 17, 2025, 4:25 a.m.