Datasets:
license: apache-2.0
tags:
- biology
- phenotypes
- traits
- bacteria
- prokaryotes
- genomics
- genomes
- proteins
pretty_name: >-
Dataset for predicting phenotypic traits from bacterial genomes (protein
sequences)
Dataset for phenotypic traits prediction from whole-bacterial genomes (protein sequences)
A dataset of 24,462 bacterial genomes across 15,477 species with diverse phenotypic traits as labels.
The genome protein sequences have been extracted from GenBank. Each row contains a list of protein sequences present in the bacterial genome, ordered by their location on the chromosome and plasmids.
The phenotypic traits have been extracted from a number of sources [1, 2, 3] and include a diversity of categorical phenotypes. We exclude phenotypic traits with a low nr of samples, giving us 139
uniqe phenotypic traits. If the same or similar label appeared in two different sources,
we kept it as separate labels as the label collection setup may differ for the labels.
Labels
We provide labels in the Files and versions
(labels.csv
).
Usage
We recommend loading the dataset in a streaming mode to prevent memory errors.
from datasets import load_dataset
ds = load_dataset("macwiatrak/bacbench-phenotypic-traits-protein-sequences", split="train", streaming=True)
Fetch the labels for the genome
import pandas as pd
from datasets import load_dataset
ds = load_dataset("macwiatrak/bacbench-phenotypic-traits-protein-sequences", split="train", streaming=True)
item = next(iter(ds))
# read labels (available in repo root)
labels_df = pd.read_csv("<input-dir>/labels.csv").set_index("genome_name")
# fetch labels
labels = labels_df.loc[item["genome_name"]]
# drop labels without a value for the genome (NaN)
labels = labels.dropna()
Split
Due to low number of samples for many phenotypic traits and the variability between genomes, which may skew the results when using a single split, we recommend training and evaluating the model across numerous splits. Specifically, for each phenotypic traits we recommend:
- Splitting the data into
60 / 20 / 20
(%) train, validation and test partitions respectively - Training the model on the train set and monitoring the results on the validation set using macro
AUROC
. - Using the best performing model on validation to evaluate the model on the test set.
- Repeat the (1-3) steps 5 times and report the average result across the runs.
See github repository for details on how to embed the dataset with DNA and protein language models as well as code to predict antibiotic resistance from sequence. For DNA representation of the genome see the phenotypic-traits-dna dataset.
References
[1] Madin, Joshua S., et al. "A synthesis of bacterial and archaeal phenotypic trait data." Scientific data 7.1 (2020): 170.
[2] Weimann, Aaron, et al. "From genomes to phenotypes: Traitar, the microbial trait analyzer." MSystems 1.6 (2016): 10-1128.
[3] Brbić, Maria, et al. "The landscape of microbial phenotypic traits and associated genes." Nucleic acids research (2016): gkw964.