phyloseq_extract_shared_otus: Extract common species (OTUs) between samples.

View source: R/phyloseq_extract_otus.R

phyloseq_extract_shared_otusR Documentation

Extract common species (OTUs) between samples.

Description

This function will subset phyloseq object to the OTUs that are present in all samples. By default all samples will be taken into account, otherwise it's possible to take a subset of samples.

Usage

phyloseq_extract_shared_otus(x, samp_names = sample_names(x))

Arguments

x

A phyloseq-class object

samp_names

Character vector with sample names (default, all samples)

Value

Phyloseq object with the subset of data.

Examples

data(esophagus)

# Extract OTUs that are present in all samples
ps <- phyloseq_extract_shared_otus(esophagus, samp_names = sample_names(esophagus))
ps
otu_table(ps)

# Extract shared OTUs between two samples
ps2 <- phyloseq_extract_shared_otus(esophagus, samp_names = c("B", "C"))
ps2
otu_table(ps2)


vmikk/metagMisc documentation built on Feb. 14, 2024, 2:29 a.m.