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–234 · score 0.63 · ROC AUC score, confusion matrices, F1 Score, accuracy, ASD
- [2] § Results ↔ Metabolites-Based Classifier for Species-Under 25.ipynb, lines 184–237 · score 0.63 · ROC AUC score, confusion matrices, F1 Score, accuracy, ASD
- [3] § Methods ↔ Metabolites-Based Classifier for Species-Over 25.ipynb, lines 181–234 · score 0.62 · ROC AUC score, F1 score, sensitivity, precision, accuracy, classification
- [4] § Methods ↔ Metabolites-Based Classifier for Species-Under 25.ipynb, lines 184–237 · score 0.62 · ROC AUC score, F1 score, sensitivity, precision, accuracy, classification
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: 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.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
- [2] 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
- [3] 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
- [4] doi:10.1186/s12866-026-05296-x
- Gut bacterial characteristics in children with autism spectrum disorder according to symptom severity: a cross-sectional study.Journal: BMC microbiologyIn common: autism, genetics / omics, 4 references
- [5] doi:10.3390/nu18152441 [code]
- Clinical Improvement and Taxonomic-Functional Gut Microbiome Remodeling After Six Months of Multi-Strain Synbiotic Supplementation in Mexican Children with Autism Spectrum Disorder.Journal: NutrientsIn common: Matplotlib, NumPy, autism, clinical / translational, 2 references
- [6] doi:10.1038/s41380-026-03609-0 [code]
- Gut microbiome alterations are sex-dependently associated with brain abnormalities in a mouse model of Neurofibromatosis type I.Journal: Molecular psychiatryIn common: autism, 3 references
- [7] doi:10.3389/fgene.2026.1742595 [code]
- An in silico protocol for predicting genetic biomarkers in rare diseases: a case study in sporadic amyotrophic lateral sclerosis.Journal: Frontiers in geneticsIn common: seaborn, scikit-learn, pandas, 2 other tools, clinical / translational, genetics / omics, 1 reference
- [8] doi:10.1016/j.ebiom.2026.106291 [code]
- Metabolomic signatures of SSRI exposure during neural differentiation and correlation of lysophosphatidylcholines
with early symptoms of neurodevelopmental disorders. Journal: EBioMedicineIn common: genetics / omics, 3 references - [9] doi:10.64898/2026.03.09.710596 [code]
- Infant gut microbiomes contribute to metabolic states that impact brain functionJournal: bioRxiv (preprint)In common: seaborn, scikit-learn, pandas, 2 other tools, 1 reference
- [10] doi:10.1093/bib/bbag490 [code]
- Systematic benchmarking and optimal strategy selection of cross-species integration methods.Journal: Briefings in bioinformaticsIn common: seaborn, scikit-learn, pandas, 2 other tools, genetics / omics, 1 reference
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:9e360c222c956d56…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
