compare_pairs_pq: Compare samples in pairs using diversity and number of ASV...

View source: R/table_functions.R

compare_pairs_pqR Documentation

Compare samples in pairs using diversity and number of ASV including shared ASV.

Description

lifecycle-experimental

For the moment refseq slot need to be not Null.

Usage

compare_pairs_pq(
  physeq = NULL,
  bifactor = NULL,
  modality = NULL,
  merge_sample_by = NULL,
  nb_min_seq = 0,
  veg_index = "shannon",
  na_remove = TRUE
)

Arguments

physeq

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

bifactor

(required) a factor (present in the sam_data slot of the physeq object) presenting the pair names

modality

the name of the column in the sam_data slot of the physeq object to split samples by pairs

merge_sample_by

a vector to determine which samples to merge using the merge_samples2() function. Need to be in physeq@sam_data

nb_min_seq

minimum number of sequences per sample to count the ASV/OTU

veg_index

(default: "shannon") index for the vegan::diversity function

na_remove

(logical, default TRUE) If set to TRUE, remove samples with NA in the variables set in bifactor, modality and merge_sample_by. NA in variables are well managed even if na_remove = FALSE, so na_remove may be useless.

Value

A tibble with information about the number of shared ASV, shared number of sequences and diversity

Examples

data_fungi_low_high <- subset_samples(data_fungi, Height %in% c("Low", "High"))
compare_pairs_pq(data_fungi_low_high, bifactor = "Height", merge_sample_by = "Height")
compare_pairs_pq(data_fungi_low_high,
  bifactor = "Height",
  merge_sample_by = "Height", modality = "Time"
)

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