phyloseq2lefse: Phyloseq to LefSe

View source: R/phyloseq2lefse.R

phyloseq2lefseR Documentation

Phyloseq to LefSe

Description

Convert phyloseq otu and tax tables into a file that can be fed into LefSe

Usage

phyloseq2lefse(
  ps,
  covars,
  file.name = "lefse_data.txt",
  taxa.levels = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus"),
  transpose.otus = TRUE
)

Arguments

ps

A phyloseq object that contains a sample data table, an OTU (or ASV) table, and a taxonomy table.

covars

A character vector with, the names of the variables in the sample data that will be used in LefSe. Max length: 2.

file.name

Character string with name of file you want to write the output to. The convention is to use the .txt extension.

taxa.levels

A character vector with the taxonomic levels you want considered by LefSe. Default is "Domain", "Kingdom", "Phylum", "Class", "Order", "Family", "Genus".

transpose.otus

Phyloseq generally makes the OTUs/ASVs the column names, but this function needs them as row names. If OTUs/ASVs are already row names, set this to FALSE. Default is TRUE.

See Also

phyloseq

Examples

data(example_phyloseq)

phyloseq2lefse(ps = example_phyloseq, covars = "Genotype", file.name = "example_lefse_data.txt")

kstagaman/phyloseqCompanion documentation built on Aug. 26, 2022, 5:07 a.m.