File size: 9,431 Bytes
1613b52
 
 
 
 
 
 
 
 
 
 
 
 
 
6bea8e8
4fef197
 
 
 
 
 
 
 
b9d3953
 
 
 
60b3ecf
93549e2
b9d3953
 
 
60b3ecf
 
f85ee2c
 
c037dfa
 
 
f85ee2c
 
d0b842f
f85ee2c
 
 
60b3ecf
 
c037dfa
 
 
 
60b3ecf
 
c037dfa
 
 
 
60b3ecf
 
c037dfa
 
 
 
60b3ecf
 
c037dfa
 
 
 
60b3ecf
 
 
c037dfa
60b3ecf
 
 
 
6bea8e8
c037dfa
5b09fb3
 
 
 
 
 
 
 
 
 
 
 
 
60b3ecf
 
 
 
6bea8e8
 
 
 
c037dfa
5b09fb3
 
4fef197
 
 
 
 
 
 
 
 
5b09fb3
4fef197
 
 
 
 
5b09fb3
 
60b3ecf
 
 
c037dfa
60b3ecf
 
 
c037dfa
60b3ecf
 
 
c037dfa
60b3ecf
 
 
c037dfa
60b3ecf
 
 
c037dfa
60b3ecf
 
 
c037dfa
60b3ecf
 
 
c037dfa
60b3ecf
 
c037dfa
 
 
 
60b3ecf
 
c037dfa
 
 
 
60b3ecf
 
c037dfa
 
 
 
 
1613b52
 
 
ca25003
 
 
 
1613b52
 
ca25003
 
 
 
 
7f7e9b7
ca25003
1613b52
ca25003
1613b52
ca25003
1613b52
ca25003
 
 
 
 
1613b52
ca25003
1613b52
ca25003
 
 
 
1613b52
ca25003
2c19686
ca25003
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2c19686
ca25003
 
 
 
2c19686
 
 
 
ca25003
2c19686
 
 
ca25003
 
2c19686
 
 
ca25003
 
2c19686
 
ca25003
2c19686
ca25003
2c19686
ca25003
 
 
 
 
2c19686
ca25003
2c19686
 
 
 
 
 
 
 
 
 
f85ee2c
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
---
license: mit
language:
- en
tags:
- genomics
- yeast
- transcription
- perturbation
- response
- overexpression
pretty_name: Hackett, 2020 Overexpression
size_categories:
- 1M<n<10M
experimental_conditions:
  temperature_celsius: 30
  cultivation_method: chemostat
  media:
    name: minimal
    carbon_source:
      - compound: D-glucose
        # Saldanha et al 2004: 10 g/l
        concentration_percent: 1
configs:
  - config_name: hackett_2020
    description: TF overexpression data from Hackett 2020
    default: true
    dataset_type: annotated_features
    metadata_fields: ["sample_id", "regulator_locus_tag", "regulator_symbol", "time", "mechanism", "restriction", "date", "strain"]
    data_files:
      - split: train
        path: hackett_2020.parquet
    dataset_info:
      features:
        - name: sample_id
          dtype: integer
          description: >-
            unique identifier for a specific sample. The sample ID identifies a unique
            (regulator_locus_tag, time, mechanism, restriction, date, strain) tuple.
        - name: db_id
          dtype: integer
          description: >-
            an old unique identifer, for use internally only. Deprecated and will be removed eventually.
            Do not use in analysis. db_id = 0, for GEV and Z3EV, means that those samples are not
            included in the original DB.
        - name: regulator_locus_tag
          dtype: string
          description: >-
            induced transcriptional regulator systematic ID.
            See hf/BrentLab/yeast_genome_resources
          role: regulator_identifier
        - name: regulator_symbol
          dtype: string
          description: >-
            induced transcriptional regulator common name. If no common name exists,
            then the `regulator_locus_tag` is used.
          role: regulator_identifier
        - name: target_locus_tag
          dtype: string
          description: >-
            The systematic ID of the feature to which the effect/pvalue is assigned.
            See hf/BrentLab/yeast_genome_resources
          role: target_identifier
        - name: target_symbol
          dtype: string
          description: >-
            The common name of the feature to which the effect/pvalue is assigned.
            If there is no common name, the `target_locus_tag` is used.
          role: target_identifier
        - name: time
          dtype: float
          description: time point (minutes)
          role: experimental_condition
        - name: mechanism
          dtype:
            class_label:
              names: ["GEV", "ZEV"]
          description: Synthetic TF induction system (GEV or ZEV)
          role: experimental_condition
          definitions:
            GEV:
              perturbation_method:
                type: inducible_overexpression
                system: GEV
                inducer: beta-estradiol
                description: "Galactose-inducible estrogen receptor-VP16 fusion system"
            ZEV:
              perturbation_method:
                type: inducible_overexpression
                system: ZEV
                inducer: beta-estradiol
                description: "Z3 (synthetic zinc finger)-estrogen receptor-VP16 fusion system"
        - name: restriction
          dtype:
            class_label:
              names: ["M", "N", "P"]
          description: >-
            nutrient limitation, one of P (phosphate limitation (20 mg/l).),
            N (Nitrogen‐limited cultures were maintained at 40 mg/l ammonium sulfate) or
            M (Not defined in the paper or on the Calico website)
          role: experimental_condition
          definitions:
            P:
              media:
                nitrogen_source:
                  - compound: ammonium_sulfate
                    # Saldanha et al 2004: 5 g/l
                    concentration_percent: 0.5
                phosphate_source:
                  - compound: potassium_phosphate_monobasic
                    # Hackett et al 2020: 20 mg/l
                    concentration_percent: 0.002
            N:
              media:
                nitrogen_source:
                  - compound: ammonium_sulfate
                    # Hackett et al 2020: 40 mg/l
                    concentration_percent: 0.004
            M:
              description: "Not defined in the paper or on the Calico website"
        - name: date
          dtype: string
          description: date performed
          role: experimental_condition
        - name: strain
          dtype: string
          description: strain name
          role: experimental_condition
        - name: green_median
          dtype: float
          description: median of green (reference) channel fluorescence
          role: quantitative_measure
        - name: red_median
          dtype: float
          description: median of red (experimental) channel fluorescence
          role: quantitative_measure
        - name: log2_ratio
          dtype: float
          description: log2(red / green) subtracting value at time zero
          role: quantitative_measure
        - name: log2_cleaned_ratio
          dtype: float
          description: Non-specific stress response and prominent outliers removed
          role: quantitative_measure
        - name: log2_noise_model
          dtype: float
          description: estimated noise standard deviation
          role: quantitative_measure
        - name: log2_cleaned_ratio_zth2d
          dtype: float
          description: >-
            cleaned timecourses hard-thresholded based on
            multiple observations (or last observation) passing the noise model
          role: quantitative_measure
        - name: log2_selected_timecourses
          dtype: float
          description: >-
            cleaned timecourses hard-thresholded based on single observations
            passing noise model and impulse evaluation of biological feasibility
          role: quantitative_measure
        - name: log2_shrunken_timecourses
          dtype: float
          description: >-
            selected timecourses with observation-level shrinkage based on
            local FDR (false discovery rate). Most users of the data will want
            to use this column.
          role: quantitative_measure
---
# Hackett 2020

This Dataset is a parsed version of the data provided by
[Calicolabs](https://idea.research.calicolabs.com/data) under the heading "Raw &
processed gene expression data". See `scripts/` for more details on the parsing from the
data provided by Calico to this Dataset.


[Hackett SR, Baltz EA, Coram M, Wranik BJ, Kim G, Baker A, Fan M, Hendrickson DG, Berndl
M, McIsaac RS. Learning causal networks using inducible transcription factors and
transcriptome-wide time series. Mol Syst Biol. 2020 Mar;16(3):e9174. doi:
10.15252/msb.20199174. PMID: 32181581; PMCID:
PMC7076914.](https://doi.org/10.15252/msb.20199174)

This repo provides 1 dataset:

- **hackett_2020**: TF overexpression data from Hackett 2020.

## 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/hackett_2020" dataset from Hugging Face Hub.

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

card = ModelCard.load("BrentLab/hackett_2020", 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)
```

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
from huggingface_hub import snapshot_download
import duckdb
import os

repo_id = "BrentLab/hackett_2020"

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 hackett_2020 parquet file
parquet_path = os.path.join(repo_path, "hackett_2020.parquet")
print(f"✓ Parquet file at: {parquet_path}")
```

Use your favorite method of interacting with `parquet` files (eg duckDB, but you could
use dplyr in R or pandas, too).

```python
# Connect to DuckDB and query the parquet file
conn = duckdb.connect()

query = """
SELECT DISTINCT time, mechanism, restriction, date
FROM read_parquet(?)
WHERE regulator_symbol = 'ACA1'
"""
result = conn.execute(query, [parquet_path]).df()
print(f"Found {result}")
```