File size: 14,710 Bytes
899ec5d
 
 
 
 
 
 
 
3fd7af2
 
899ec5d
3e5fc7c
5c9546d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e5fc7c
 
 
 
 
 
 
 
 
 
899ec5d
 
 
dcf5294
899ec5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e69d55f
dcf5294
899ec5d
 
 
 
 
 
 
 
 
 
e69d55f
899ec5d
 
e69d55f
c329a72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3fd7af2
c329a72
 
3fd7af2
 
c329a72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824bf51
 
c329a72
 
824bf51
 
c329a72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f387567
 
c329a72
 
f387567
 
c329a72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
899ec5d
 
 
628113d
 
899ec5d
 
 
628113d
899ec5d
628113d
 
 
 
 
899ec5d
628113d
899ec5d
628113d
 
 
899ec5d
628113d
899ec5d
5dd2b69
628113d
 
 
 
 
 
 
899ec5d
628113d
 
 
 
 
 
 
 
 
 
 
 
899ec5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2601644
628113d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
---
license: mit
tags:
- transcription-factor
- binding
- chipexo
- genomics
- biology
language:
- en
pretty_name: Rossi ChIP-exo 2021
experimental_conditions:
  temperature_celsius: 25
  cultivation_method: unspecified
  growth_phase_at_harvest:
    phase: mid_log
    od600: 0.8
  media:
    name: yeast_peptone_dextrose
    carbon_source:
      - compound: D-glucose
        concentration_percent: unspecified
    nitrogen_source:
      - compound: yeast_extract
        concentration_percent: unspecified
      - compound: peptone
        concentration_percent: unspecified

  # Heat shock applied only to SAGA strains
  # note that im not sure which strains this
  # applies to -- it is a TODO to better
  # document this
  heat_shock:
    induced: true
    temperature_celsius: 37
    duration_minutes: 6
    pre_induction_temperature_celsius: 25
    method: equal_volume_medium_transfer
configs:
- config_name: metadata
  description: Metadata describing the tagged regulator in each experiment
  dataset_type: metadata
  data_files:
  - split: train
    path: rossi_2021_metadata.parquet
  dataset_info:
    features:
    - name: regulator_locus_tag
      dtype: string
      description: Systematic gene name (ORF identifier) of the transcription factor
    - name: regulator_symbol
      dtype: string
      description: Standard gene symbol of the transcription factor
    - name: run_accession
      dtype: string
      description: GEO run accession identifier for the sample
    - name: yeastepigenome_id
      dtype: string
      description: Sample identifier used by yeastepigenome.org
- config_name: genome_map
  description: "ChIP-exo 5' tag coverage data partitioned by sample accession"
  dataset_type: genome_map
  data_files:
  - split: train
    path: genome_map/*/*.parquet
  dataset_info:
    features:
    - name: chr
      dtype: string
      description: Chromosome name (e.g., chrI, chrII, etc.)
    - name: pos
      dtype: int32
      description: "Genomic position of the 5' tag"
    - name: pileup
      dtype: int32
      description: "Depth of coverage (number of 5' tags) at this genomic position"

- config_name: rossi_2021_metadata
  description: Replicate-level metadata for ChIP-exo experiments including experimental conditions and sample information
  dataset_type: metadata
  applies_to: ["rossi_2021_af_replicates"]
  data_files:
  - split: train
    path: rossi_2021_metadata.parquet
  dataset_info:
    features:
    - name: regulator_locus_tag
      dtype: string
      description: Systematic gene identifier for the transcription factor
      role: regulator_identifier
    - name: regulator_symbol
      dtype: string
      description: Standard gene symbol for the transcription factor
      role: regulator_identifier
    - name: run_accession
      dtype: string
      description: SRA run accession identifier for this biological replicate
    - name: yeastepigenome_id
      dtype: string
      description: Identifier from the Yeast Epigenome Project
    - name: treatment
      dtype: string
      description: Experimental treatment condition
      role: experimental_condition
    - name: growth_media
      dtype: string
      description: Growth media composition
      role: experimental_condition
    - name: antibody
      dtype: string
      description: Antibody used for ChIP-exo immunoprecipitation
    - name: sample_id
      dtype: string
      description: Unique identifier for the biological replicate

- config_name: rossi_2021_metadata_sample
  description: Sample-level metadata for combined ChIP-exo experiments including experimental conditions
  dataset_type: metadata
  applies_to: ["rossi_2021_af_combined"]
  data_files:
  - split: train
    path: rossi_2021_metadata_sample.parquet
  dataset_info:
    features:
    - name: regulator_locus_tag
      dtype: string
      description: Systematic gene identifier for the transcription factor
      role: regulator_identifier
    - name: regulator_symbol
      dtype: string
      description: Standard gene symbol for the transcription factor
      role: regulator_identifier
    - name: treatment
      dtype: string
      description: Experimental treatment condition
      role: experimental_condition
    - name: growth_media
      dtype: string
      description: Growth media composition
      role: experimental_condition
    - name: antibody
      dtype: string
      description: Antibody used for ChIP-exo immunoprecipitation
    - name: sample_id
      dtype: string
      description: Unique identifier combining regulator and replicates

- config_name: rossi_2021_af_replicates
  description: ChIP-exo annotated features at biological replicate level with binding peaks and statistical significance metrics
  dataset_type: annotated_features
  data_files:
  - split: train
    path: rossi_2021_af_replicates.parquet
  dataset_info:
    features:
    - name: sample_id
      dtype: string
      description: Unique identifier for the biological replicate
      role: sample_id
    - name: run_accession
      dtype: string
      description: SRA run accession identifier for this biological replicate
    - name: regulator_locus_tag
      dtype: string
      description: Systematic gene identifier for the transcription factor
      role: regulator_identifier
    - name: regulator_symbol
      dtype: string
      description: Standard gene symbol for the transcription factor
      role: regulator_identifier
    - name: target_locus_tag
      dtype: string
      description: Systematic gene identifier for the target gene
      role: target_identifier
    - name: target_symbol
      dtype: string
      description: Standard gene symbol for the target gene
      role: target_identifier
    - name: seqnames
      dtype: string
      description: Chromosome identifier (e.g., chrI, chrII, chrXVI)
    - name: start
      dtype: int64
      description: Promoter region start position (1-based coordinate)
    - name: end
      dtype: int64
      description: Promoter region end position (1-based, inclusive)
    - name: background_counts
      dtype: int64
      description: Read counts in the background/control sample for this peak region
      role: quantitative_measure
    - name: experiment_counts
      dtype: int64
      description: Read counts in the ChIP-exo experiment sample for this peak region
      role: quantitative_measure
    - name: total_background_counts
      dtype: int64
      description: Total read counts across the entire genome in the background sample
      role: quantitative_measure
    - name: total_experiment_counts
      dtype: int64
      description: Total read counts across the entire genome in the experiment sample
      role: quantitative_measure
    - name: enrichment
      dtype: float64
      description: Enrichment score for the binding peak
      role: quantitative_measure
    - name: poisson_pval
      dtype: float64
      description: P-value from Poisson distribution test for peak significance
      role: quantitative_measure
    - name: log_poisson_pval
      dtype: float64
      description: Log-transformed Poisson p-value
      role: quantitative_measure
    - name: hypergeometric_pval
      dtype: float64
      description: P-value from hypergeometric distribution test for peak significance
      role: quantitative_measure
    - name: log_hypergeometric_pval
      dtype: float64
      description: Log-transformed hypergeometric p-value
      role: quantitative_measure
    - name: poisson_qval
      dtype: float64
      description: FDR-adjusted q-value from Poisson test (multiple testing correction)
      role: quantitative_measure
    - name: hypergeometric_qval
      dtype: float64
      description: FDR-adjusted q-value from hypergeometric test (multiple testing correction)
      role: quantitative_measure

- config_name: rossi_2021_af_combined
  description: Combined ChIP-exo annotated features with binding peaks and statistical significance metrics aggregated across biological replicates
  dataset_type: annotated_features
  data_files:
  - split: train
    path: rossi_2021_af_combined.parquet
  dataset_info:
    features:
    - name: sample_id
      dtype: string
      description: Unique identifier combining regulator and replicates
      role: sample_id
    - name: regulator_locus_tag
      dtype: string
      description: Systematic gene identifier for the transcription factor
      role: regulator_identifier
    - name: regulator_symbol
      dtype: string
      description: Standard gene symbol for the transcription factor
      role: regulator_identifier
    - name: target_locus_tag
      dtype: string
      description: Systematic gene identifier for the target gene
      role: target_identifier
    - name: target_symbol
      dtype: string
      description: Standard gene symbol for the target gene
      role: target_identifier
    - name: seqnames
      dtype: string
      description: Chromosome identifier (e.g., chrI, chrII, chrXVI)
    - name: start
      dtype: int64
      description: Promoter region start position (1-based coordinate)
    - name: end
      dtype: int64
      description: Promoter region end position (1-based, inclusive)
    - name: background_counts
      dtype: int64
      description: Combined read counts in the background/control sample for this peak region
      role: quantitative_measure
    - name: experiment_counts
      dtype: int64
      description: Combined read counts in the ChIP-exo experiment sample for this peak region
      role: quantitative_measure
    - name: total_background_counts
      dtype: int64
      description: Total read counts across the entire genome in the combined background sample
      role: quantitative_measure
    - name: total_experiment_counts
      dtype: int64
      description: Total read counts across the entire genome in the combined experiment sample
      role: quantitative_measure
    - name: enrichment
      dtype: float64
      description: Enrichment score for the binding peak calculated from combined replicates
      role: quantitative_measure
    - name: poisson_pval
      dtype: float64
      description: P-value from Poisson distribution test for peak significance
      role: quantitative_measure
    - name: log_poisson_pval
      dtype: float64
      description: Log-transformed Poisson p-value
      role: quantitative_measure
    - name: hypergeometric_pval
      dtype: float64
      description: P-value from hypergeometric distribution test for peak significance
      role: quantitative_measure
    - name: log_hypergeometric_pval
      dtype: float64
      description: Log-transformed hypergeometric p-value
      role: quantitative_measure
    - name: poisson_qval
      dtype: float64
      description: FDR-adjusted q-value from Poisson test (multiple testing correction)
      role: quantitative_measure
    - name: hypergeometric_qval
      dtype: float64
      description: FDR-adjusted q-value from hypergeometric test (multiple testing correction)
      role: quantitative_measure
---
# Rossi 2021

This data is gathered from [yeastepigenome.org](https://yeastepigenome.org/).
This work was published in

[Rossi MJ, Kuntala PK, Lai WKM, Yamada N, Badjatia N, Mittal C, Kuzu G, Bocklund K, Farrell NP, Blanda TR, Mairose JD, Basting AV, Mistretta KS, Rocco DJ, Perkinson ES, Kellogg GD, Mahony S, Pugh BF. A high-resolution protein architecture of the budding yeast genome. Nature. 2021 Apr;592(7853):309-314. doi: 10.1038/s41586-021-03314-8. Epub 2021 Mar 10. PMID: 33692541; PMCID: PMC8035251.](https://doi.org/10.1038/s41586-021-03314-8)

## Usage

The python package `tfbpapi` provides an interface to this data which eases
examining the datasets, field definitions and other operations. You may also 
download the parquet datasets directly from hugging face by clicking on
"Files and Versions", or by using the huggingface_cli and duckdb directly.
In both cases, this provides a method of retrieving dataset and field definitions.

### `tfbpapi`

After [installing tfbpapi](https://github.com/BrentLab/tfbpapi/?tab=readme-ov-file#installation),
you can adapt this [tutorial](https://brentlab.github.io/tfbpapi/tutorials/hfqueryapi_tutorial/)
in order to explore the contents of this repository.

### huggingface_cli/duckdb

You can retrieves and displays the file paths for each configuration of
the "BrentLab/rossi_2021" dataset from Hugging Face Hub.

```python
from huggingface_hub import ModelCard
from pprint import pprint

card = ModelCard.load("BrentLab/rossi_2021", repo_type="dataset")

# cast to dict
card_dict = card.data.to_dict()

# Get partition information
dataset_paths_dict = {d.get("config_name"): d.get("data_files")[0].get("path") for d in card_dict.get("configs")}

pprint(dataset_paths_dict)
```

The entire repository is large. It may be preferable to only retrieve
specific files or partitions. You can use the metadata files to choose
which files to pull.

```python
from huggingface_hub import snapshot_download
import duckdb
import os
# Download only the metadata first
repo_path = snapshot_download(
    repo_id="BrentLab/rossi_2021",
    repo_type="dataset",
    allow_patterns="rossi_2021_metadata.parquet"
)

dataset_path = os.path.join(repo_path, "rossi_2021_metadata.parquet")
conn = duckdb.connect()
meta_res = conn.execute("SELECT * FROM read_parquet(?) LIMIT 10", [dataset_path]).df()
print(meta_res)
```

We might choose to take a look at the file with accession SRR11466106:

```python
# Download only a specific sample's genome coverage data
repo_path = snapshot_download(
    repo_id="BrentLab/rossi_2021",
    repo_type="dataset",
    allow_patterns="genome_map/accession=SRR11466106/*.parquet"
)

# Query the specific partition
dataset_path = os.path.join(repo_path, "genome_map")
result = conn.execute("SELECT * FROM read_parquet(?) LIMIT 10", 
                     [f"{dataset_path}/**/*.parquet"]).df()
print(result)
```

If you wish to pull the entire repo, due to its size you may need to use an
[authentication token](https://huggingface.co/docs/hub/en/security-tokens).
If you do not have one, try omitting the token related code below and see if
it works. Else, create a token and provide it like so:

```python

repo_id = "BrentLab/rossi_2021"

hf_token = os.getenv("HF_TOKEN")

# Download entire repo to local directory
repo_path = snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    token=hf_token
)

print(f"\n✓ Repository downloaded to: {repo_path}")

# Construct path to the rossi_annotated_features parquet file
parquet_path = os.path.join(repo_path, "yeastepigenome_annotatedfeatures.parquet")
print(f"✓ Parquet file at: {parquet_path}")
```