--- 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](https://www.ncbi.nlm.nih.gov/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. ```python from datasets import load_dataset ds = load_dataset("macwiatrak/bacbench-phenotypic-traits-protein-sequences", split="train", streaming=True) ``` ### Fetch the labels for the genome ```python 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("/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: 1. Splitting the data into `60 / 20 / 20` (%) train, validation and test partitions respectively 2. Training the model on the train set and monitoring the results on the validation set using macro `AUROC`. 3. Using the best performing model on validation to evaluate the model on the test set. 4. Repeat the (1-3) steps 5 times and report the average result across the runs. See [github repository](https://github.com/macwiatrak/Bacbench) 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](https://huggingface.co/datasets/macwiatrak/bacbench-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. --- dataset_info: features: - name: genome_name dtype: string - name: contig_name sequence: string - name: protein_id sequence: sequence: string - name: protein_sequence sequence: sequence: string - name: taxid dtype: string - name: locus_tag sequence: sequence: string - name: start sequence: sequence: int64 - name: end sequence: sequence: int64 - name: product sequence: sequence: string splits: - name: train num_bytes: 37098323931 num_examples: 24462 download_size: 31451416670 dataset_size: 37098323931 configs: - config_name: default data_files: - split: train path: data/train-* ---