The Dataset Viewer has been disabled on this dataset.

Overview

Welcome to the Friend or Foe Collection!

Logo

Friend or Foe is a collection of synthetic environmental tabular datasets generated by solving metabolic models for 10,000 pairs of bacteria.

This README contains the description of the Friend or Foe collection of bacterial datasets. The general tree structure of the repository is described by Friend-or-Foe Structure figure.

Logo

Friend or Foe Collection (panel a) contains data suitable for 5 different ML methods stored in corresponding folders (panel b): Classification, Regression, Transfer Learning, Clustering and Generative modeling.

Each folder contains data obtained from two sources of metabolic models, AGORA and CARVEME (panel c). For each source there is 100 and 50 additional compounds used in the metabolic modeling and the data corresponds to each folder - panel d.

Next on the panel e, the datasets are named according to the Table 3 in the manuscript, i.e Binary Classification for Facultative Cooperation vs Competition is BC-I.

Finally, each subfolder contains .csv train/test files. Note that for Clustering task data is stored as raw .npy arrays for compilatibility with clustering algorightms (see manuscript).

In addition to tabular data, we provide useful information regarding the metab models and species (panel g). Specifically, General Info contains information about organism names and abbreviations of environmental compounds (to convert the abbreviation to a name, see Agora_env_compounds.xlsx for AGORA and the Bigg database at http://bigg.ucsd.edu for CARVEME).

MetabModels stores used metabolic models in .mat format for both AGORA and CARVEME. On top of that, we provide raw results of metabolic modeling in raw subfolder (panel h).

Finally, we store reference weights of ML models for benchmarks in Models subfolder.

Tabular structure

First 424 columns for AGORA and 499 for CARVEME identify the abreviations for chemical compounds. The values are binary 0 or 1, identifying the presense or absence of a particular compound in the environment.

The last column is the target, for classification is an integer, e.g num of class; while for regression the target is growth rate.

Overview of the dataset compendium

The compendium comprises 64 datasets, each corresponding to a distinct machine learning Task. The Samples column indicates the number of environments used per task, with additional 100 or 50 compounds added to enhance diversity. The Group denotes the number of additional compounds, while Collection specifies whether the dataset belongs to AGORA or CARVEME. AGORA datasets contain 424 unique chemical features, whereas CARVEME datasets contain 499.

Task AGORA (100) AGORA (50) CARVEME (100) CARVEME (50) Metric
BC-I 326,331 89,500 332,938 167,918 Acc / MCC
BC-II 624,743 547,175 399,751 466,814 Acc / MCC
BC-III 509,298 491,167 478,057 486,646 Acc / MCC
BC-IV 339,006 198,485 237,535 211,179 Acc / MCC
BC-V 223,561 142,477 315,841 231,011 Acc / MCC
MC-I 730,186 563,922 605,373 560,689 Acc / MCC
MC-II 925,828 1,074,570 655,089 922,678 Acc / MCC
MC-III 1,252,159 1,164,072 988,027 1,090,596 Acc / MCC
GR-I 105,443 16,747 339,004 93,875 RMSE / r²
GR-II 220,888 72,755 205,622 93,875 RMSE / r²
GR-III 403,855 474,420 272,435 392,771 RMSE / r²
TL-I 659,269 257,420 494,249 454,572 Acc / MCC
TL-II 1,997,248 1,580,917 1,848,506 1,729,659 Acc / MCC
US-I 12,002 12,000 9,004 8,000 DCSI / SC
US-II 12,001 3,000 11,000 8,000 DCSI / SC
GEN 40,000 20,000 40,000 20,000 α-Precision / β-Recall

Getting started

from huggingface_hub import hf_hub_download
import pandas as pd

REPO_ID = "powidla/Friend-Or-Foe"
X_train_ID = "Classification/AGORA/100/BC-I/X_train_BC-I-100.csv"
X_val_ID = "Classification/AGORA/100/BC-I/X_val_BC-I-100.csv"
X_test_ID = "Classification/AGORA/100/BC-I/X_test_BC-I-100.csv"

y_train_ID = "Classification/AGORA/100/BC-I/y_train_BC-I-100.csv"
y_val_ID = "Classification/AGORA/100/BC-I/y_val_BC-I-100.csv"
y_test_ID = "Classification/AGORA/100/BC-I/y_test_BC-I-100.csv"

X_train = pd.read_csv(hf_hub_download(repo_id=REPO_ID, filename=X_train_ID, repo_type="dataset"))
X_val = pd.read_csv(hf_hub_download(repo_id=REPO_ID, filename=X_val_ID, repo_type="dataset"))
X_test = pd.read_csv(hf_hub_download(repo_id=REPO_ID, filename=X_test_ID, repo_type="dataset"))

y_train = pd.read_csv(hf_hub_download(repo_id=REPO_ID, filename=y_train_ID, repo_type="dataset"))
y_val = pd.read_csv(hf_hub_download(repo_id=REPO_ID, filename=y_val_ID, repo_type="dataset"))
y_test = pd.read_csv(hf_hub_download(repo_id=REPO_ID, filename=y_test_ID, repo_type="dataset"))

A quick-start example is available in our github repository.

Citation Information

@ARTICLE{Solowiej-Wedderburn2025-ar,
  title     = "Competition and cooperation: The plasticity of bacterial
               interactions across environments",
  author    = "Solowiej-Wedderburn, Josephine and Pentz, Jennifer T and Lizana,
               Ludvig and Schroeder, Bjoern O and Lind, Peter A and Libby, Eric",
  journal   = "PLoS Comput. Biol.",
  publisher = "Public Library of Science (PLoS)",
  volume    =  21,
  number    =  7,
  pages     = "e1013213",
  month     =  jul,
  year      =  2025,
  copyright = "http://creativecommons.org/licenses/by/4.0/",
  language  = "en"
}

@misc{cherednichenko2025friendfoe,
      title={Friend or Foe}, 
      author={Oleksandr Cherednichenko and Josephine Solowiej-Wedderburn and Laura M. Carroll and Eric Libby},
      year={2025},
      eprint={2509.00123},
      archivePrefix={arXiv},
      primaryClass={q-bio.QM},
      url={https://arxiv.org/abs/2509.00123}, 
}
Downloads last month
5,250

Paper for powidla/Friend-Or-Foe