Learn R Programming

LorMe (version 2.0.1)

LorMe_pipeline: One-stop microbial analysis pipeline for LorMe objects

Description

LorMe_pipeline() performs a complete microbial ecology analysis workflow for a configured LorMe object, including: community profiling, differential analysis, indicator species analysis, treatment-specific sub-network construction, and global network construction.

The function is modular and allows users to execute only selected steps through the step argument.

Usage

LorMe_pipeline(taxobj, step = "all")

Value

A named list containing the results of all requested modules. Depending on step, the list may include:

alpha_results

Alpha diversity tables and plots

beta_results

Beta diversity ordinations (e.g., PCoA)

composition_results

Community composition barplots

diffbar_result

Differential barplot results

Deseq_results

DESeq2 results for each comparison

Deseq_volcano

Volcano plots for differential analysis

Deseq_manhattan

Manhattan plots for differential features

indicator_results

Indicator species results

indic_volcano

Volcano plot of indicator species analysis

indic_manhattan

Manhattan plot of indicator analysis

sub_network_results

Treatment-specific subnetworks

combine_network_results

Global co-occurrence network

Failed modules return as NULL.

Arguments

taxobj

A configured LorMe object created by object_config. The object must contain preprocessed taxonomy tables, metadata, and analysis configurations.

step

Character vector specifying which analysis modules to run. Must be one or more of:

  • "all" – run the entire pipeline (default)

  • "profile" – alpha/beta diversity and composition analysis

  • "diff" – differential abundance (DESeq2, differential barplot)

  • "sub_net" – treatment-specific subnetworks

  • "all_net" – combined/co-occurrence network across all samples

Details

The function automatically respects global options set via LorMe_options. These options control:

  • analysis taxonomic level

  • palettes and plotting parameters

  • DESeq2 parameters

  • network analysis thresholds

Internal failures in any analysis sub-module do not stop the pipeline: the corresponding output is returned as NULL, and the function prints a summary of failed steps on completion.

Examples

Run this code
# \donttest{
## View current global analysis options
getOption("LorMe")

## Set analysis options
LorMe_options(
  global = list(Analysis_level = "Genus"),
  sub_net = list(threshold = 0.7),
  all_net = list(threshold = 0.7)
)

## Run pipeline (time-consuming)
Two_group_analysis <- LorMe_pipeline(Two_group)

## Access results:
# Alpha diversity
Two_group_analysis$alpha_results$plotlist$Plotobj_Shannon$Boxplot

# Beta diversity
Two_group_analysis$beta_results$PCoA_Plot

# Community composition
Two_group_analysis$composition_results$barplot

# Differential analysis
Two_group_analysis$Deseq_volcano$FC_FDR
Two_group_analysis$Deseq_manhattan$manhattan

# Differential barplot
library(patchwork)
Two_group_analysis$diffbar_result$Barplot |
  Two_group_analysis$diffbar_result$Differenceplot

# Subnetworks
require(magrittr)
Two_group_analysis$sub_network_results$Treatment_sub_network %>%
  network_visual()

# Combined network
Two_group_analysis$combine_network_results %>% network_visual()

## Reset to default options
LorMe_defaults()

## Example: three-group comparison with custom options
LorMe_options(
  global = list(
    Analysis_level = "Species",
    compare_list = c("CF_OF", "CF_BF")
  ),
  all_net = list(threshold = 0.95, method = "pearson")
)

Three_group_analysis <- LorMe_pipeline(Three_group)
# }

Run the code above in your browser using DataLab