Machine learning model to identify gut microbiome-derived metabolites as potential biomarkers of autism spectrum disorder: a pilot study.
The 4 matches
- [1] § Results ↔ Metabolites-Based Classifier for Species-Over 25.ipynb, lines 181 to 234 · score 0.63 · ROC AUC score, confusion matrices, F1 Score, accuracy, ASD · Report a mismatch
- [2] § Results ↔ Metabolites-Based Classifier for Species-Under 25.ipynb, lines 184 to 237 · score 0.63 · ROC AUC score, confusion matrices, F1 Score, accuracy, ASD · Report a mismatch
- [3] § Methods ↔ Metabolites-Based Classifier for Species-Over 25.ipynb, lines 181 to 234 · score 0.62 · ROC AUC score, F1 score, sensitivity, precision, accuracy, classification · Report a mismatch
- [4] § Methods ↔ Metabolites-Based Classifier for Species-Under 25.ipynb, lines 184 to 237 · score 0.62 · ROC AUC score, F1 score, sensitivity, precision, accuracy, classification · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 379 lines · 9.3 KB · MIT · 2 matches
- # %%
- import pandas as pd
- import matplotlib.pyplot as plt
- import seaborn as sns
- from src.metabolome.metabolome_extractor import MetabolomeExtractor
- # %% [markdown]
- # # Extract Metabolites
- # %%
- df = pd.read_csv('data/all_species_asd_epi_health.csv')
- # %%
- df.head()
- # %%
- run_ids = list(df.run_id.unique())
- # %%
- len(run_ids)
- # %%
- bacteria_files_map = pd.read_csv('data/microbes_files_map_for_gmrepo2.csv')
- metabolome_extractor = MetabolomeExtractor(bacteria_files_map)
- # %%
- bacteria_files_map[bacteria_files_map.name == 'Bacillus atrophaeus']['files'].tolist()
- # %%
- bacteria_files_map
- # %%
- all_data = None
- index = 0
- for run_id in run_ids:
- index += 1
- print(index, '/', len(run_ids))
- temp = df[df.run_id == run_id]
- metabolites_df = metabolome_extractor.compute_metabolites_restrictive(temp)
- if metabolites_df is None:
- continue
- metabolites_df['project_id'] = temp.iloc[0].project_id
- metabolites_df['run_id'] = temp.iloc[0].run_id
- metabolites_df['host_age'] = temp.iloc[0].host_age
- metabolites_df['sex'] = temp.iloc[0].sex
- metabolites_df['BMI'] = temp.iloc[0].BMI
- metabolites_df['country'] = temp.iloc[0].country
- metabolites_df['phenotype'] = temp.iloc[0].phenotype
- if all_data is None:
- all_data = metabolites_df.copy()
- else:
- all_data = pd.concat([all_data, metabolites_df.copy()])
- # %%
- temp
- # %%
- len(all_data.run_id.unique())
- # %%
- all_data.to_csv('data/all_species_metabolites_asd_epi_health_restrictive.csv', index=False)
- # %% [markdown]
- # # Pivoting data
- # %%
- import pandas as pd
- import numpy as np
- import matplotlib.pyplot as plt
- from sklearn.model_selection import train_test_split
- from sklearn.ensemble import RandomForestClassifier
- from sklearn.metrics import classification_report, confusion_matrix, roc_auc_score
- from sklearn.metrics import ConfusionMatrixDisplay
- # %%
- df = pd.read_csv('data/all_species_metabolites_asd_epi_health_restrictive.csv')
- # %%
- df.head()
- # %%
- all_metabolites = list(df.metabolite.unique())
- # %%
- len(all_metabolites)
- # %%
- run_ids = list(df.run_id.unique())
- # %%
- individuals = []
- i = 0
- for run_id in run_ids:
- i += 1
- print(i,'/', len(run_ids))
- individual = []
- temp = df[df.run_id == run_id]
- individual.append(temp.iloc[0]['run_id'])
- individual.append(temp.iloc[0]['project_id'])
- individual.append(temp.iloc[0]['host_age'])
- individual.append(temp.iloc[0]['sex'])
- individual.append(temp.iloc[0]['BMI'])
- individual.append(temp.iloc[0]['country'])
- individual.append(temp.iloc[0]['phenotype'])
- for metabolite in all_metabolites:
- bacter = temp[temp.metabolite == metabolite]
- if len(bacter) == 0:
- individual.append(0)
- else:
- individual.append(bacter.iloc[0]['relative_abundance'])
- individuals.append(individual)
- individual
- # %%
- columns = ['run_id', 'project_id', 'host_age', 'sex', 'BMI', 'country','phenotype'] + all_metabolites
- columns
- # %%
- final_df = pd.DataFrame(individuals, columns=columns)
- final_df.head()
- # %%
- final_df.to_csv('data/df_metabolites_species_restrictive.csv', index=False)
- # %% [markdown]
- # # The Classifier
- # %%
- df = pd.read_csv('data/df_metabolites_species_extensive.csv')
- df.head()
- # %%
- df = df[df.host_age >= 25]
- # %%
- df.phenotype.unique()
- # %%
- len(df), len(df[df.phenotype == 'health']), len(df[df.phenotype == 'ASD'])
- # %%
- df.host_age.hist()
- # %%
- #df[df.phenotype == 'health'].host_age.hist()
- df[df.phenotype == 'ASD'].host_age.hist()
- # %%
- df.country.hist(xrot=90)
- # %%
- #df[df.phenotype == 'health'].country.hist(xrot=90)
- df[df.phenotype == 'ASD'].country.hist(xrot=90)
- # %%
- df[df.phenotype == 'ASD'].host_age.hist()
- # %%
- df[df.phenotype == 'ASD'].country.hist(xrot=90)
- # %%
- len(df)
- # %%
- len(df[df.phenotype == 'ASD'])
- # %%
- n_models = round(len(df[df.phenotype == 'health'])/len(df[df.phenotype == 'ASD']))
- n_models
- # %%
- dfs = []
- for i in range(n_models):
- dfs.append(pd.concat([df[df.phenotype == 'ASD'], df[df.phenotype == 'health'].sample(len(df[df.phenotype == 'ASD']), random_state=41)]))
- # %%
- all_metabolites = df.columns[7:]
- # %%
- feature_importances = []
- accuracies = []
- specificities = []
- sensitivities = []
- precisions = []
- f1_scores = []
- roc_auc_scores = []
- all_test = []
- all_pred = []
- all_probs = []
- from statistics import mean
- for df in dfs:
- X = df[all_metabolites]
- y = df.phenotype
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33)
- clf = RandomForestClassifier(n_estimators=300, max_depth=20, random_state=42)
- clf.fit(X_train, y_train)
- y_pred = clf.predict(X_test)
- y_prob = [ x[0] for x in clf.predict_proba(X_test)]
- all_test.extend(y_test)
- all_pred.extend(y_pred)
- all_probs.extend(y_prob)
- tp, fn, fp, tn = confusion_matrix(y_test, y_pred).ravel()
- accuracy = (tp+tn)/(tp+fn+fp+tn)
- specificity = tn/(tn+fp)
- sensitivity = tp/(tp+fn)
- precision = tp/(tp+fp)
- f1_score = (2*tp)/(2*tp+fp+fn)
- roc_auc_score_value = roc_auc_score([int(x) for x in (y_test == 'ASD').tolist()], y_prob)
- print('Accuracy:',accuracy, '%')
- print('Specificity:',specificity, '%')
- print('Sensitivity:',sensitivity, '%')
- print('Precision:',precision, '%')
- print('F1 Score:',f1_score, '%')
- print('ROC AUC score:', roc_auc_score_value)
- accuracies.append(accuracy)
- specificities.append(specificity)
- sensitivities.append(sensitivity)
- precisions.append(precision)
- f1_scores.append(f1_score)
- roc_auc_scores.append(roc_auc_score_value)
- importances = clf.feature_importances_
- std = np.std([tree.feature_importances_ for tree in clf.estimators_], axis=0)
- forest_importances = pd.DataFrame(zip(importances,std), index=all_metabolites, columns=['importance', 'std'])
- #forest_importances = forest_importances[forest_importances.importance >= forest_importances.importance.quantile(0.99)]
- feature_importances.append(forest_importances)
- #sensitivity, specificity, precision, F1-score, ROC-AUC
- print("accuracy:", "mean:", mean(accuracies), "std:", np.std(accuracies))
- print("specificity:", "mean:", mean(specificities), "std:", np.std(specificities))
- print("sensitivity:", "mean:", mean(sensitivities), "std:", np.std(sensitivities))
- print("precision:", "mean:", mean(precisions), "std:", np.std(precisions))
- print("f1 score:", "mean", mean(f1_scores), "std:", np.std(f1_scores))
- print("ROC AUC score:", "mean", mean(roc_auc_scores), "std:", np.std(roc_auc_scores))
- # %%
- print(classification_report(all_test, all_pred))
- # %%
- ConfusionMatrixDisplay.from_predictions(all_test, all_pred, normalize='true')
- # %%
- from sklearn.metrics import roc_curve, roc_auc_score
- import matplotlib.pyplot as plt
- y_true = [ 1 if x=='ASD' else 0 for x in all_test]
- # y_true: true binary labels (0 or 1)
- # y_proba: predicted probabilities for the positive class
- fpr, tpr, thresholds = roc_curve(y_true, all_probs)
- roc_auc = roc_auc_score(y_true, all_probs)
- plt.figure()
- plt.plot(fpr, tpr, label='ROC curve (area = %0.2f)' % roc_auc)
- plt.plot([0, 1], [0, 1], 'r--') # Diagonal line (random classifier)
- plt.xlim([0.0, 1.0])
- plt.ylim([0.0, 1.05])
- plt.xlabel('False Positive Rate')
- plt.ylabel('True Positive Rate')
- plt.title('Receiver Operating Characteristic (ROC)')
- plt.legend(loc="lower right")
- plt.show()
- # %%
- roc_auc
- # %%
- df3 = pd.concat(feature_importances)
- df3 = df3.groupby(df3.index).mean()
- len(df3)
- # %%
- forest_importances = df3[df3.importance >= df3.importance.quantile(0.95)]
- # %%
- len(forest_importances)
- # %%
- print('\n'.join(forest_importances.index.tolist()))
- # %%
- fig, ax = plt.subplots()
- forest_importances.importance.plot.bar(ax=ax, figsize=(15,5))
- ax.set_title("Feature importances using MDI")
- ax.set_ylabel("Mean decrease in impurity")
- fig.tight_layout()
- # %%
- list(forest_importances.index)
- # %% [markdown]
- # # Shap Explainer
- # %%
- feature_importances = []
- accuracies = []
- from statistics import mean
- for df in dfs:
- X = df[all_metabolites]
- y = df.phenotype
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
- clf = RandomForestClassifier(n_estimators=300, max_depth=20, random_state=0)
- clf.fit(X_train, y_train)
- y_pred = clf.predict(X_test)
- accuracy = sum(y_pred == y_test)/len(y_test)*100
- print('Accuracy:',accuracy, '%')
- accuracies.append(accuracy)
- shap_values = explainer.shap_values(X_test)
- feature_importances.append(shap_values)
- print("mean accuracy", mean(accuracies), '%')
- # %%
- feature_importances = np.array(feature_importances)
- # %%
- shap_values = feature_importances.mean(axis=0)
- # %%
- shap.summary_plot([shap_values[:,:,0], shap_values[:,:,1]], X_test, max_display=40, plot_type='bar')
- # %%
- df_important_features = df[list(forest_importances.index) + ['phenotype']].groupby('phenotype').mean()
- # %%
- df_important_features.head()
- # %%
- ratios = []
- for column in df_important_features.columns:
- ratios.append(np.log10(df_important_features.loc['ASD', column]/df_important_features.loc['health', column]))
- # %%
- df_t = pd.DataFrame(ratios).T
- # %%
- df_t.columns = df_important_features.columns
- # %%
- df_t
- # %%
- ratio = df_t.T
- # %%
- ratio
- # %%
- ratio.replace([np.inf, -np.inf], np.nan, inplace=True)
- # %%
- ratio
- # %%
- ratio.dropna(how="all", inplace=True)
- # %%
- ratio
- # %%
- ratio.columns = ['ratio']
- # %%
- ratio
- # %%
- ratio[(ratio.ratio > 0)].plot.bar()
- # %%
- ratio[(ratio.ratio > 0) & (ratio.ratio < 300)].plot.bar()
- # %%
- ratio[ratio.ratio < 0].plot.bar()
- # %%
- ratio.plot.bar(figsize=(15,5))
- # %%
Metabolites-Based Classifier for Species-Over 25.ipynb at commit a88e78e, under MIT · at the source
Overview
- Child Neurology and Psychiatry Unit, Department of Wellbeing of Mental and Neurological, Dental and Sensory Organ Health, Policlinico Tor Vergata Hospital, Viale Oxford,00133 Rome, Italy
- IMME Research Centre, Via San Francesco d’Assisi 20, 81100 Caserta, Italy
- Department of Biomedicine and Prevention, University of Rome Tor Vergata,Via Montpellier 1, 00133 Rome, Italy
- Systems Medicine Department, University of Rome Tor Vergata,via Montpellier 1, 00133 Rome, Italy
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.
dec0der0b/IMPC
a88e78ed5649f065bce53f065dae12593c8f7a64, 28 November 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
14 files
- Metabolites-Based Classifier for Species-Over 25.ipynb, Jupyter, 379 lines, 2 matches
- Metabolites-Based Classifier for Species-Under 25.ipynb, Jupyter, 379 lines, 2 matches
- Metabolites-Based Classifier for Species.ipynb, Jupyter, 419 lines
- src/
__init__.py , Python, 1 line - src/
data_loaders/ , Python, 1 line__init__.py - src/
data_loaders/ , Python, 202 linesgmrepo_loader.py - src/
metabolome/ , Python, 1 line__init__.py - src/
metabolome/ , Python, 18 linesmetabo_analyst.py - src/
metabolome/ , Python, 171 linesmetabolome_extractor.py - test/
gmrepo_loader_test.py , Python, 207 lines - test/
metabo_analyst_test.py , Python, 16 lines - test/
metabolome_extractor_tes , Python, 49 linest.py - LICENSE, License, 21 lines
- README.md, Text, 63 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 12 scripts, each with its path and the digest of its content;
- 4 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: dec0der0b/
IMPC - it says that the data are available on request
Read it in the paper: doi.org/10.1186/s12888-026-08178-8.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 8 keywords, 9 MeSH terms, 89 references.
Cite
This paper
Babolin, S., Enea, R., Cicala, M., Di Giovanni, D., Mazzone, L., & Emberti Gialloreti, L. (2026). Machine learning model to identify gut microbiome-derived metabolites as potential biomarkers of autism spectrum disorder: a pilot study. BMC psychiatry, 26(1), 622. https://
BibTeX
@article{babolin2026mach
author = {Babolin, Silvia and Enea, Roberto and Cicala, Mariagrazia and Di Giovanni, Daniele and Mazzone, Luigi and Emberti Gialloreti, Leonardo},
title = {{Machine learning model to identify gut microbiome-derived metabolites as potential biomarkers of autism spectrum disorder: a pilot study}},
journal = {BMC psychiatry},
year = {2026},
month = jun,
volume = {26},
number = {1},
pages = {622},
publisher = {BMC},
issn = {1471-244X},
doi = {10.1186/
url = {https://
pmid = {42260510},
pmcid = {PMC13471347}
}
RIS
TY - JOUR
AU - Babolin, Silvia
AU - Enea, Roberto
AU - Cicala, Mariagrazia
AU - Di Giovanni, Daniele
AU - Mazzone, Luigi
AU - Emberti Gialloreti, Leonardo
TI - Machine learning model to identify gut microbiome-derived metabolites as potential biomarkers of autism spectrum disorder: a pilot study
T2 - BMC psychiatry
J2 - BMC Psychiatry
PY - 2026
DA - 2026/
VL - 26
IS - 1
SP - 622
SN - 1471-244X
PB - BMC
DO - 10.1186/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1186/
"type": "article-journal",
"title": "Machine learning model to identify gut microbiome-derived metabolites as potential biomarkers of autism spectrum disorder: a pilot study",
"container-title": "BMC psychiatry",
"author": [
{
"family": "Babolin",
"given": "Silvia"
},
{
"family": "Enea",
"given": "Roberto"
},
{
"family": "Cicala",
"given": "Mariagrazia"
},
{
"family": "Di Giovanni",
"given": "Daniele"
},
{
"family": "Mazzone",
"given": "Luigi"
},
{
"family": "Emberti Gialloreti",
"given": "Leonardo"
}
],
"container-title-short":
"volume": "26",
"issue": "1",
"page": "622",
"DOI": "10.1186/
"PMID": "42260510",
"PMCID": "PMC13471347",
"ISSN": "1471-244X",
"publisher": "BMC",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
8
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.3390/nu15071620
- Intestinal Barrier Dysfunction and Microbiota-Gut-Brain Axis: Possible Implications in the Pathogenesis and Treatment of Autism Spectrum Disorder.Journal: NutrientsIn common: autism, clinical / translational, 13 references
- [2] doi:10.1038/s41593-023-01361-0 [code]
- Multi-level analysis of the gut-brain axis shows autism spectrum disorder-associated molecular and microbial profiles.Journal: Nature neuroscienceIn common: seaborn, scikit-learn, pandas, 2 other tools, autism, genetics / omics, 6 references
- [3] doi:10.1080/19490976.2024.2447822
- Mouse strain-specific responses along the gut-brain axis upon fecal microbiota transplantation from children with autism.Journal: Gut microbesIn common: autism, 8 references
- [4] doi:10.1038/s41467-025-58459-1 [code]
- Relationships between brain activity, tryptophan-related gut metabolites, and autism symptomatology.Journal: Nature communicationsIn common: NumPy, autism, genetics / omics, 6 references
- [5] doi:10.1080/19490976.2022.2102878
- Microbiota-derived metabolites as drivers of gut-brain communication.Journal: Gut microbesIn common: autism, 6 references
- [6] doi:10.3389/frmbi.2026.1777385 [code]
- Gut microbiota and its association with gastrointestinal symptoms and pharmacological treatments in a sibling-matched cohort with autism spectrum disorder.Journal: Frontiers in microbiomesIn common: autism, clinical / translational, genetics / omics, 5 references
- [7] doi:10.1007/s12264-022-00993-9
- Leaky Gut Plays a Critical Role in the Pathophysiology of Autism in Mice by Activating the Lipopolysaccharide-Media
ted Toll-Like Receptor 4-Myeloid Differentiation Factor 88-Nuclear Factor Kappa B Signaling Pathway. Journal: Neuroscience bulletinIn common: autism, 5 references - [8] doi:10.1016/j.xcrm.2026.102655 [code]
- An integrative multi-omics approach identifies microbiome alterations linked to pathological and behavioral features in autism spectrum disorder.Journal: Cell reports. MedicineIn common: seaborn, scikit-learn, pandas, 2 other tools, autism, genetics / omics, 2 references
- [9] doi:10.3389/fnins.2026.1858005 [code]
- Targeted stool metabolomics suggests exploratory catecholamine- and tryptophan-linked metabolic features in autism spectrum disorder.Journal: Frontiers in neuroscienceIn common: autism, clinical / translational, genetics / omics, 4 references
- [10] doi:10.3389/fmicb.2026.1811435
- Research on the role of gut microbiota metabolites in autism by multi-omics and network pharmacology.Journal: Frontiers in microbiologyIn common: autism, genetics / omics, 4 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 12 scripts, and 4 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:48a5d7659e895e0d…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1186/s12888-026-08178-8)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1186/s12888-026-08178-8.svg
:target: https://openscicode.org/badge/doi/10.1186/s12888-026-08178-8
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1186/s12888-026-08178-8"><img src="https://openscicode.org/badge/doi/10.1186/s12888-026-08178-8.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
