WMS_FUNCTION#
This Nextflow script implements a workflow for functional analysis of whole metagenome sequencing data using HUMAnN3.
Workflow Execution#
# Activate metafun conda environment
conda activate metafun
# Move to metafun directory where you cloned metafun from GitHub
(metafun) nextflow run nf_scripts/<span style="color:#7030A0">WMS_FUNCTION</span>_apptainer.nf --inputDir ${inputDir} --metadata ${metadata} --sampleIDcolumn ${column_number} --analysiscolumn ${column_number}
Workflow Overview#
The workflow performs the following steps:
HUMAnN3 analysis on individual samples
Parsing and normalization of HUMAnN3 outputs
Functional analysis and visualization based on metadata
Result of this workflow provides functional profiles of metagenomic samples, which can be used for downstream comparative analyses.
Inputs and Outputs#
Inputs: Quality-controlled paired-end metagenomic reads (output from RAWREAD_QC workflow), metadata file. Outputs: HUMAnN3 results, normalized pathway abundance tables, functional analysis visualizations.
Default output directory is ${launchDir}/results/metagenome/<span style="color:#7030A0">WMS_FUNCTION</span>.
Process |
InputDir |
OutputDir |
Note |
|---|---|---|---|
humann3_run |
|
|
HUMAnN3 analysis results for each sample |
humann3_parsing |
Output from humann3_run |
|
Combined and normalized HUMAnN3 results |
function_analysis |
Output from humann3_parsing |
|
Functional analysis visualizations |
Parameters in WMS_FUNCTION Nextflow Script#
Parameter |
Description |
Default Value |
Note |
|---|---|---|---|
|
Base directory for databases |
|
Mounted path in apptainer environment |
|
Base directory for scripts |
|
Mounted path in apptainer environment |
|
Input directory containing filtered reads |
|
Output from RAWREAD_QC workflow |
|
Output directory |
|
|
|
Path to metadata file |
|
|
|
Column number for sample IDs in metadata |
|
|
|
Column number for analysis grouping |
|
|
|
Number of CPUs to use |
|
Descriptions of Processes in WMS_FUNCTION Workflow#
HUMAnN3 Run: Executes HUMAnN3 on each sample’s paired-end reads.
HUMAnN3 Parsing: Combines and normalizes the HUMAnN3 outputs from all samples.
Function Analysis: Performs statistical analysis and creates visualizations based on the normalized HUMAnN3 results and metadata.
Tools Used in WMS_FUNCTION#
Tool |
Purpose |
Version |
Default parameters |
Parameters that can be selected |
|---|---|---|---|---|
HUMAnN3 |
Functional profiling of microbial communities |
3.0.0 |
|
|
R |
Statistical analysis and visualization |
4.3.2 |
N/A |
N/A |
Usage Notes#
The input directory should contain paired-end read files processed by the RAWREAD_QC workflow.
Metadata file should be in CSV format with at least two columns: sample IDs and grouping information for analysis.
The script checks for the existence and non-emptiness of the input directory before proceeding.
HUMAnN3 databases (ChocoPhlAn and UniRef90) should be properly set up in the specified database directory.
Output file details and examples#
The workflow generates the following outputs in the specified outdir:
HUMAnN3 output files for each sample (gene families, pathway abundances, pathway coverages)
Combined and normalized pathway abundance tables
Functional analysis visualizations (e.g., heatmaps, PCA plots)
Statistical analysis results based on the metadata groupings