read_pathway_contrib_file: Read PICRUSt2 pathway-level contribution file

View source: R/taxa_contribution.R

read_pathway_contrib_fileR Documentation

Read PICRUSt2 pathway-level contribution file

Description

Parses path_abun_contrib.tsv output from PICRUSt2's pathway pipeline and returns the same normalized contribution schema used by aggregate_taxa_contributions.

Usage

read_pathway_contrib_file(file = NULL, data = NULL)

Arguments

file

Path to the contribution file (.tsv, .txt, .csv, or gzipped variants).

data

A data.frame already loaded from the contribution file. If both file and data are provided, data is used.

Value

A normalized data.frame with pathway IDs in function_id.

Examples


# From a data.frame
path_contrib_df <- data.frame(
  sample = rep(c("S1", "S2"), each = 2),
  `function` = rep(c("PWY-1234", "PWY-5678"), times = 2),
  taxon = c("ASV1", "ASV2", "ASV1", "ASV2"),
  taxon_function_abun = c(10, 5, 12, 4),
  check.names = FALSE
)
path_contrib <- read_pathway_contrib_file(data = path_contrib_df)
head(path_contrib)



ggpicrust2 documentation built on May 20, 2026, 5:07 p.m.