phyloseq_extract_non_shared_otus: Extract non-shared species (OTUs) between samples.

View source: R/phyloseq_extract_otus.R

phyloseq_extract_non_shared_otusR Documentation

Extract non-shared species (OTUs) between samples.

Description

This function will subset phyloseq object to the OTUs unique for each sample. By default all samples will be taken into account, otherwise it's possible to take a subset of samples.

Usage

phyloseq_extract_non_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 unique (non-shared) OTUs for each sample in the entire dataset
ps <- phyloseq_extract_non_shared_otus(esophagus, samp_names = sample_names(esophagus))
ps
otu_table(ps)

# Extract OTUs that are unique between two samples
ps2 <- phyloseq_extract_non_shared_otus(esophagus, samp_names = c("B", "C"))
ps2
otu_table(ps2)


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