The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

SpoMAG_title

SpoMAG_logo

Scope

SpoMAG is an R-based machine learning tool developed to predict the sporulation potential of Metagenome-Assembled Genomes (MAGs) from uncultivated Firmicutes species, particularly from the Bacilli and Clostridia classes.

SpoMAG leverages the complex combination of presence or absence of sporulation-associated genes to infer whether a genome is capable of undergoing sporulation, even in the absence of cultivation or complete genome assemblies. This strategy allows researchers to assess sporulation potential using only functional annotations from metagenomic data.

Workflow overview

SpoMAG predicts the sporulation potential of a given genome through a three-step workflow:

SpoMAG_steps

SpoMAG abstracts the complexity of machine learning, allowing users to simply provide an annotation table and receive interpretable predictions. The tool is designed to be accessible even to those without prior expertise in bioinformatics or machine learning.

Its ensemble learning approach combines the predictions from Random Forest and Support Vector Machine classifiers, trained on high-quality labeled datasets of known spore-formers and non-spore-formers. The predictions are then used as features in a meta-classifier using model stacking, enhancing prediction accuracy and allowing SpoMAG to capture complementary decision boundaries from each model.

Model performance was evaluated using cross-validation and standard metrics including AUC-ROC, F1-score, Accuracy, precision, specificity, and recall. As a result, SpoMAG delivers high sensitivity and specificity across MAGs recovered from different hosts’ microbiota.

Whether analyzing hundreds of MAGs or a single novel lineage, SpoMAG offers a robust, automated, and cultivation-independent solution to assess sporulation potential. No phenotypic validation or manual annotation is required, making it a practical tool for exploring the ecological and functional roles of spore-forming bacteria.

The repository for SpoMAG is at GitHub on the https://github.com/labinfo-lncc/SpoMAG. In this website, you can report a bug and get help.

Citation

Paper under publication.

Installation of the SpoMAG package

You can install the SpoMAG package directly from GitHub using:

# Install devtools if not already installed
install.packages("devtools")

# Install SpoMAG from GitHub
devtools::install_github("labinfo-lncc-br/SpoMAG")

Dependencies

SpoMAG depends on the following packages:

Preprocessing functions in SpoMAG

1. sporulation_gene_name()

It extracts sporulation-related genes from an annotation dataframe by searching for gene names and KEGG orthologs. - Input: A dataframe with at least Preferred_name, KEGG_ko and genome_ID columns.

genes <- sporulation_gene_name(df)

2. build_binary_matrix()

It creates a binary matrix indicating the presence (1) or absence (0) of known sporulation genes in each genome. - Input: A dataframe output from the sporulation_gene_name() function.

matrix <- build_binary_matrix(genes)

Note: The function automatically fills in missing genes with 0 to ensure consistent input for sporulation-capacity prediction.

Function to predict sporulation using SpoMAG

3. predict_sporulation()

It applies a pre-trained ensemble machine learning model to predict the sporulation potential of genomes based on the binary matrix of genes.

results <- predict_sporulation(binary_matrix = matrix)

Input data format

To use SpoMAG, your input must be a functional annotation table, such as the output from eggNOG-mapper, containing at least three columns:

genome_ID Preferred_name KEGG_ko
G001 spoIIIE K03466
G001 spo0A K07699
G001 - K01056
G001 pth -

Each row should represent one gene annotation.

Another difference of SpoMAG is its ability to infer gene presence in the annotation file even in cases where annotations are ambiguous. As shown in the example above, some rows can contain a valid KEGG_ko code but a missing or undefined Preferred_name (e.g., “-”), while others have a predicted gene name but no associated KO. SpoMAG integrates both fields to assign a unified spo_gene_name:

Quick start

Running an example with a single genome in the annotation file

This is a quick example using the included files: one_sporulating.csv (a known spore-former) and one_asporogenic.csv (a known non-spore-former). The genome used for the spore-former here is the following:

genome_ID Preferred_name KEGG_ko
GCF_000007625.1 spoIIIE K03466
GCF_000007625.1 spo0A K07699
GCF_000007625.1 - K01056
GCF_000007625.1 pth -

The genome used for the non-spore-former here is the following:

genome_ID Preferred_name KEGG_ko
GCF_000006785.2 spo0A K07699
GCF_000006785.2 - K01056
GCF_000006785.2 pth -
# Load package
library(SpoMAG)

# Load example annotation tables
file_spor <- system.file("extdata", "one_sporulating.csv", package = "SpoMAG")
file_aspo <- system.file("extdata", "one_asporogenic.csv", package = "SpoMAG")

# Read files
df_spor <- readr::read_csv(file_spor, show_col_types = FALSE)
df_aspo <- readr::read_csv(file_aspo, show_col_types = FALSE)

# Step 1: Extract sporulation-related genes
genes_spor <- sporulation_gene_name(df_spor)
genes_aspo <- sporulation_gene_name(df_aspo)

# Step 2: Convert to binary matrix
bin_spor <- build_binary_matrix(genes_spor)
bin_aspo <- build_binary_matrix(genes_aspo)

# Step 3: Predict using ensemble model (preloaded in package)

result_spor <- predict_sporulation(bin_spor)
result_aspo <- predict_sporulation(bin_aspo)

# View results
print(result_spor)
print(result_aspo)

Running an example with more than one genome in the annotation file

This is a quick example using the included files: ten_sporulating.csv (ten known spore-formers) and ten_asporogenic.csv (ten known non-spore-formers). The genomes used for the spore-formers here are the following:

genome_ID Preferred_name KEGG_ko
GCF_000011985.1 spoIIIE K03466
GCF_000011985.1 spo0A K07699
GCF_000011045.1 - K01056
GCF_000011045.1 pth -

The genomes used for the non-spore-formers here are the following:

genome_ID Preferred_name KEGG_ko
GCF_000010165.1 spoIIIE K03466
GCF_000009205.2 - K01056
GCF_000009205.2 pth -
# Load package
library(SpoMAG)

# Load example annotation tables
file_spor <- system.file("extdata", "ten_sporulating.csv", package = "SpoMAG")
file_aspo <- system.file("extdata", "ten_asporogenic.csv", package = "SpoMAG")

# Read files
df_spor <- readr::read_csv(file_spor, show_col_types = FALSE)
df_aspo <- readr::read_csv(file_aspo, show_col_types = FALSE)

# Step 1: Extract sporulation-related genes
genes_spor <- sporulation_gene_name(df_spor)
genes_aspo <- sporulation_gene_name(df_aspo)

# Step 2: Convert to binary matrix
bin_spor <- build_binary_matrix(genes_spor)
bin_aspo <- build_binary_matrix(genes_aspo)

# Step 3: Predict using ensemble model (preloaded in package)
result_spor <- predict_sporulation(bin_spor)
result_aspo <- predict_sporulation(bin_aspo)

# View results
print(result_spor)
print(result_aspo)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.