pathway_annotation {ggpicrust2}R Documentation

Pathway information annotation of "EC", "KO", "MetaCyc" pathway

Description

This function has two primary use cases: 1. Annotating pathway information using the output file from PICRUSt2. 2. Annotating pathway information from the output of 'pathway_daa' function, and converting KO abundance to KEGG pathway abundance when 'ko_to_kegg' is set to TRUE.

Usage

pathway_annotation(
  file = NULL,
  pathway = NULL,
  daa_results_df = NULL,
  ko_to_kegg = FALSE
)

Arguments

file

A character, address to store PICRUSt2 export files. Provide this parameter when using the function for the first use case.

pathway

A character, consisting of "EC", "KO", "MetaCyc"

daa_results_df

A data frame, output of pathway_daa. Provide this parameter when using the function for the second use case.

ko_to_kegg

A logical, decide if convert KO abundance to KEGG pathway abundance. Default is FALSE. Set to TRUE when using the function for the second use case.

Value

A data frame containing pathway annotation information. The data frame has the following columns:

If ko_to_kegg is set to TRUE, the output data frame will also include the following columns:

Examples

## Not run: 
# Prepare the required input files and data frames
# Then, you can use the pathway_annotation function as follows:

# Use case 1: Annotating pathway information using the output file from PICRUSt2
result1 <- pathway_annotation(file = "path/to/picrust2/export/file.txt",
                              pathway = "KO",
                              daa_results_df = NULL,
                              ko_to_kegg = FALSE)

# Use case 2: Annotating pathway information from the output of pathway_daa function
# and converting KO abundance to KEGG pathway abundance
# This use case will be demonstrated using both a hypothetical example, and a real dataset.

## Hypothetical example
hypothetical_daa_results_df <- data.frame() # Replace this with your actual data frame
result2 <- pathway_annotation(file = NULL,
                              pathway = "KO",
                              daa_results_df = hypothetical_daa_results_df,
                              ko_to_kegg = TRUE)

## Real dataset example
# Load the real dataset
data(daa_results_df)
result3 <- pathway_annotation(file = NULL,
                              pathway = "KO",
                              daa_results_df = daa_results_df,
                              ko_to_kegg = TRUE)

## End(Not run)

[Package ggpicrust2 version 1.7.3 Index]