File size: 3,675 Bytes
b538177
 
 
 
 
0a1829d
 
b538177
 
 
 
 
 
 
 
 
0a1829d
 
 
b538177
 
 
 
 
 
 
 
 
0a1829d
 
b538177
0a1829d
 
 
 
 
 
 
b538177
 
 
 
 
 
 
0a1829d
 
e2c8c40
 
6094543
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
dataset_info:
  features:
  - name: strain_name
    dtype: string
  - name: tax_id
    dtype: string
  - name: start
    list:
      list: int64
  - name: end
    list:
      list: int64
  - name: strand
    list:
      list: int64
  - name: protein_sequence
    list:
      list: string
  - name: labels
    list:
      list:
        list: int64
  - name: protein_names
    list:
      list: string
  splits:
  - name: train
    num_bytes: 2101382233
    num_examples: 159
  - name: validation
    num_bytes: 462368004
    num_examples: 49
  - name: test
    num_bytes: 546202868
    num_examples: 53
  download_size: 791625495
  dataset_size: 3109953105
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
  - split: test
    path: data/test-*
license: apache-2.0
pretty_name: Dataset for predicting protein-protein interactions in bacterial genomes
tags:
- biology
- protein
- PPI
- genomics
- STRING-DB
- bacteria
- interactome
size_categories:
- n<1K
---

# Dataset for protein-protein interaction prediction across bacteria (Protein sequences)

A dataset of 261 bacterial genomes across 215 genera with protein-protein interaction (PPI) scores for each genome.

The genome protein sequences and PPI scores have been extracted from [STRING DB](https://string-db.org/). 
Each row contains a set of protein sequences from a genome, ordered by their location on the chromosome and plasmids and a set of associated PPI scores.
The PPI scores have been extracted using the `combined` score from STRING DB. 


The interaction between two proteins is represented by a triple: `[prot1_index, prot2_index, score]`. Where to get a probability score, you must divide the score by `1000` 
(i.e. if the score is `721` then to get a true score do `721/1000=0.721`). The index of a protein refers to the index of the protein in the `protein_sequences` column of the
row. See example below in [Usage](#usage)


## 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-ppi-stringdb-protein-sequences-small", split="validation", streaming=True)
item = next(iter(ds))

# select a contig_idx
contig_idx = 0
# fetch protein sequences from a genome (list of strings) for the contig_idx
prot_seqs = item["protein_sequence"][contig_idx]
# fetch PPI triples labels (i.e. [prot1_index, prot2_index, score])
ppi_triples = item["labels"][contig_idx]

# get protein seqs and label for one pair of proteins
prot1 = prot_seqs[ppi_triples[0][0]]
prot2 = prot_seqs[ppi_triples[0][1]]
score = ppi_triples[0][2] / 1000

# we recommend binarizing the labels based on the threshold of 0.6
binary_ppi_triples = [
  (prot1_index, prot2_index, int((score / 1000) >= 0.6)) for prot1_index, prot2_index, score in ppi_triples
]
```

## Split

We provide a phylogeny-aware `train`, `validation` and `test` split by genus with proportions of `60 / 10 / 20` (%) respectively as part of the dataset.
This means that the the genera in train, validation and test do not overlap.

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 
protein-protein interactions.

## Relevant resources:

* Equivalent dataset with DNA rather than protein sequences - https://huggingface.co/datasets/macwiatrak/bacbench-ppi-stringdb-dna-small
* Full dataset of bacterial organisms with associated PPI from STRING DB (10,533 genomes) - https://huggingface.co/datasets/macwiatrak/bacbench-ppi-stringdb-protein-sequences