Microbiota Uniqueness
uniqueness(x, dist_mat, reference_samples = NULL, ...)
A phyloseq object
An object of class dist
Vector of samples to use as reference.
Option to pass biomeUtils::getSampleTibble like column name and columns to be included in the output.
A data frame with uniqueness and sample information
Extracts the minimum value from a dissimilarity
matrix for each
individual. This is the dissimilarity of an individual from their
nearest neighbor. Here, the option of using a one or more reference
samples is provided.
Wilmanski T et al. (2021). Gut microbiome pattern reflects healthy ageing and predicts survival in humans. Nature metabolism, 3(2), pp.274-286.
library(biomeUtils)
data("FuentesIliGutData")
# Keep only two groups. controls and L1.
ps <- filterSampleData(FuentesIliGutData, ILI != "L2")
ps <- getProportions(ps)
dist.mat <- phyloseq::distance(ps, "bray")
# Define controls as reference samples
ref_samples <- rownames(meta(subset_samples(ps, ILI == "C")))
muniq <- uniqueness(ps,
dist_mat=dist.mat,
reference_samples = ref_samples)
head(muniq)
#> # A tibble: 6 × 63
#> S2 uniqu…¹ Duplo…² QPCR.…³ Run.nr Reads…⁴ sex age ILI BMI flu.v…⁵
#> <chr> <dbl> <int> <dbl> <chr> <dbl> <fct> <dbl> <fct> <dbl> <fct>
#> 1 sample… 0.428 1 4.57e7 272 14826 M 72 C 28 Y
#> 2 sample… 0.450 1 7.51e7 272 13754 F 68 L1 27 Y
#> 3 sample… 0.502 1 2.78e7 273 47863 M 70 C 28 Y
#> 4 sample… 0.474 1 4.3 e6 273 38995 M 78 L1 29 Y
#> 5 sample… 0.597 1 3.69e6 273 22720 M 72 L1 32 Y
#> 6 sample… 0.627 1 2.22e7 273 25059 F 61 L1 23 N
#> # … with 52 more variables: respiratory.disease <fct>,
#> # cardiovascular.disease <fct>, diabetes <fct>, renal.disease <fct>,
#> # transplant <fct>, autoimmune.disease <fct>, hiv <fct>, asplenia <fct>,
#> # leukemia <fct>, lymphatic.cancer <fct>, other.malignancies <fct>,
#> # smoking <fct>, passive.smoking <fct>, statins <fct>, ACE.inhibitor <fct>,
#> # PPI <fct>, alphabeta.blocker <fct>, antimicrobial <fct>, ARB <fct>,
#> # insuline <fct>, corticosteroids <fct>, antiepileptic <fct>, …