File size: 9,170 Bytes
b22f0d5
 
3582e14
 
 
 
 
 
3806fd0
b22f0d5
3582e14
 
 
 
 
 
cb1b9bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3582e14
 
 
 
 
 
 
 
 
 
 
7e6b421
3582e14
 
c423653
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3582e14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c03a28b
3582e14
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
---
license: cc-by-nc-sa-4.0
language:
- en
tags:
- biology
- genomics
pretty_name: Genomics Long Range Benchmark
viewer: false
---

## Summary
The motivation of the genomics long range benchmark (LRB) is to compile a set of biologically relevant genomic tasks requiring long-range dependencies which will act as a robust evaluation tool for genomic language models. 
While serving as a strong basis of evaluation, the benchmark must also be efficient and user-friendly. 
To achieve this we strike a balance between task complexity and computational cost through strategic decisions, such as down-sampling or combining datasets.

## Quick Start Guide
Below is an example of how to use these benchmark datasets with the Huggingface `datasets` library:

```python
def find_variant_idx(examples):
    """Find token location that differs between reference and variant sequence.

    Args:
        examples: (batch of) items from the dataset.
    Returns:
        dict with values index of difference.
    """
    idx = -1
    for i, (ref, alt) in enumerate(zip(examples["ref_input_ids"], examples["alt_input_ids"])):
        if ref != alt:
            idx = i
    rc_idx = -1
    for i, (ref, alt) in enumerate(zip(examples["ref_rc_input_ids"], examples["alt_rc_input_ids"])):
        if ref != alt:
            rc_idx = i
    return {"variant_idx": idx, "rc_variant_idx": rc_idx}

dataset = dataset.map(find_variant_idx, desc="Find variant idx")
```

## Dataset Tasks
The Genomics LRB is a collection of tasks which can be loaded by passing in the corresponding `task_name` into the `load_dataset` function. All of the following datasets 
allow the user to specify an arbitrarily long sequence length, giving more context to the task, by passing `sequence_length` kwarg to `load_dataset`. Additional task specific kwargs, if applicable,
 are mentioend in the sections below.<br>
*Note that as you increase the context length to very large numbers you may start to reduce the size of the dataset since a large context size may 
cause indexing outside the boundaries of chromosomes.

|        Task         |        `task_name`        |      Sample Output          | # Train Seqs | # Test Seqs |
|        ---------         |         ----------        |      ------          | ------------ | ----------- |
| CAGE Prediction | `cage_prediction`|  {sequence, labels, chromosome}  |     36086        |     1922    |
| Bulk RNA Expression |   `bulk_rna_expression`    |  {sequence, labels, chromosome}  |     22827       |     990     |
| Variant Effect Gene Expression |   `variant_effect_gene_expression`    |  {ref sequence, alt sequence, label, tissue, chromosome, distance to nearest TSS}  |     89060  |     8862    |


## Usage Example
```python
from datasets import load_dataset

# Use this parameter to download sequences of arbitrary length (see docs below for edge cases)
sequence_length=2048

# One of ["cage_prediction", "bulk_rna_expression", "variant_effect_gene_expression"] 
task_name = "variant_effect_gene_expression"

dataset = load_dataset(
    "InstaDeepAI/genomics-long-range-benchmark",
    task_name=task_name,
    sequence_length=sequence_length,
)

```



### 1. CAGE Prediction
Cap Analysis Gene Expression(CAGE) is a biological assay used to measure the level of mRNA production rather than steady state values, taking into account both production and 
degradation. Being able to accurately predict mRNA levels as measured by CAGE is essential for deciphering tissue-specific expression patterns, transcriptional networks, and 
identifying differentially expressed genes with functional significance. 

#### Source
Original CAGE data comes from FANTOM5. We used processed labeled data obtained from the [Basenji paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5932613/) which also used to train Enformer and is located [here](https://console.cloud.google.com/storage/browser/basenji_barnyard/data/human?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false).
Sequence data originates from the GRCh38 genome assembly.

#### Data Processing
The original dataset from the Basenji paper includes labels for 638 CAGE total tracks over 896 bins (each bin corresponding to 128 base pairs) 
totaling over ~70 GB. In the interest of dataset size and user friendliness, only a subset of the labels are selected. 
From the 638 CAGE tracks, 50 of these tracks are selected with the following criteria:

  1. Only select one cell line
  2. Only keep mock treated and remove other treatments
  3. Only select one donor
     
The [896 bins, 50 tracks] labels total in at ~7 GB. A description of the 50 included CAGE tracks can be found here `cage_prediction/label_mapping.csv`.

#### Task Structure

Type: Multi-variable regression<br>
Because this task involves predicting expression levels for 128bp bins and there are 896 total bins in the dataset, there are in essence labels for 896 * 128 = 114,688 basepair sequences. If
you request a sequence length smaller than 114,688 bps than the labels will be subsetted.

Task Args:<br>
`sequence_length`: an interger type, the desired final sequence length, *must be a multiple of 128 given the binned nature of labels<br>

Input: a genomic nucleotide sequence centered around the labeled region of the gene transcription start site<br>
Output: a variable length vector depending on the requested sequence length [requested_sequence_length / 128, 50]

#### Splits
Train/Test splits were maintained from Basenji and Enformer where randomly sampling was used to generate the splits. Note that for this dataset a validation set is also returned. In practice we merged the validation 
set with the train set and use cross validation to select a new train and validation set from this combined set.

#### Metrics
Mean Pearson correlation across tracks - compute Pearson correlation for a track using all positions for all genes in the test set, then mean over all tracks <br>
Mean Pearson correlation across genes - compute Pearson correlation for a gene using all positions and all tracks, then mean over all genes in the test set <br>
R<sup>2</sup>


---

### 2. Bulk RNA Expression
In comparison to CAGE, bulk RNA sequencing assays measure the steady state level (both transription and degradation) of mRNA in a population of cells.

#### Source
Original data comes from GTEx. We use processed data files from the [ExPecto paper](https://www.nature.com/articles/s41588-018-0160-6) found 
[here](https://github.com/FunctionLab/ExPecto/tree/master/resources). Sequence data originates from the GRCh37/hg19 genome assembly.

#### Data Processing
The continuous labels were log(1+x) transformed and standardized. A list of names of tissues corresponding to the labels can be found here: `bulk_rna_expression/label_mapping.csv`.

#### Task Structure

Type: Multi-variable regression<br>

Task Args:<br>
`sequence_length`: an interger type, the desired final sequence length<br>

Input: a genomic nucleotide sequence centered around the CAGE representative trancription start site<br>
Output: a 218 length vector of continuous values corresponding to the bulk RNA expression levels in 218 different tissue types

#### Splits
Train: chromosomes 1-7,9-22,X,Y<br>
Test: chromosome 8

#### Metrics
Mean Spearman correlation across tissues <br>
Mean Spearman correlation across genes <br>
R<sup>2</sup>

---

### 3. Variant Effect Gene Expression
In genomics, a key objective is to predict how genetic variants affect gene expression in specific cell types.

#### Source
Original data comes from GTEx. However, we used processed data files from the [Enformer paper](https://www.nature.com/articles/s41592-021-01252-x) located [here](https://console.cloud.google.com/storage/browser/dm-enformer/data/gtex_fine/vcf?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false). 
Sequence data originates from the GRCh38 genome assembly.

#### Data Processing
In Enformer the datasets were partitioned in 48 different sets based on the tissue types. In our framing of the task we combine all samples across all tissues into one set 
and provide the tissue type along with each sample.

As data files were used from Enformer, the labels were constructed according to their methodology - variants were labeled as 1 if their posterior inclusion probability was greater than 0.9 as 
assigned by the population-based fine-mapping tool SuSiE, while a matched set of negative variants was built with posterior inclusion probabilities of less than .01.

#### Task Structure

Type: Binary classification<br>

Task Args:<br>
`sequence_length`: an interger type, the desired final sequence length<br>

Input: a genomic nucleotide sequence centered on the SNP with the reference allele at the SNP location, a genomic nucleotide sequence centered on the SNP with the alternative allele at the SNP location, and tissue type<br>
Output: a binary value refering to whether the variant has an effect on gene expression 

#### Splits
Train: chromosomes 1-8, 11-22, X, Y<br>
Test: chromosomes 9,10

#### Metrics
Accuracy<br>
AUROC<br>
AUPRC