run_distance: Calculate the distance among samples

View source: R/gv_distance.R

run_distanceR Documentation

Calculate the distance among samples

Description

The function is to calculate the distance among samples

Usage

run_distance(
   object,
   level = c(NULL, "Kingdom", "Phylum", "Class",
           "Order", "Family", "Genus",
           "Species", "Strain", "unique"),
   method = c("unifrac", "wunifrac", "GUniFrac", "bray", "dpcoa", "jsd"),
   alpha = 0.5)

Arguments

object

(Required). a phyloseq::phyloseq or SummarizedExperiment::SummarizedExperiment object.

level

(Optional). character. Summarization level (from rank_names(pseq), default: NULL).

method

(Required). character. Provide one of the currently supported options. See vegan::vegdist for a detailed list of the supported options and links to accompanying documentation. Options include:

  • "bray": bray crutis distance.

  • "unifrac" : unweighted UniFrac distance.

  • "wunifrac": weighted-UniFrac distance.

  • "GUniFrac": The variance-adjusted weighted UniFrac distances (default: alpha=0.5).

  • "dpcoa": sample-wise distance used in Double Principle Coordinate Analysis.

  • "jsd": Jensen-Shannon Divergence. Alternatively, you can provide a character string that defines a custom distance method, if it has the form described in designdist.

alpha

(Optional). numeric. the parameter for "GUniFrac" controlling weight on abundant lineages (default: 0.5).

Value

distance object, which could be applied for ordination analysis.

Author(s)

Created by Hua Zou (5/14/2022 Shenzhen China)

Examples


## Not run: 
# phyloseq object
data("Zeybel_2022_gut")
run_distance(Zeybel_2022_gut,
   level = "Phylum",
   method = "bray")

# SummarizedExperiment object
data("Zeybel_2022_protein")
run_distance(Zeybel_2022_protein,
   method = "bray")

## End(Not run)


HuaZou/MicrobiomeAnalysis documentation built on May 13, 2024, 11:10 a.m.