cmatkhan commited on
Commit
3c8f60f
·
1 Parent(s): 8e15bdc

adding an deduplicated analysis set that selects a single strain for each experimental condition

Browse files
README.md CHANGED
@@ -24,11 +24,150 @@ experimental_conditions:
24
  doi: https://doi.org/10.15252/msb.20199174
25
  citation: >-
26
  Hackett, SR, Baltz, EA, Coram, M, Wranik, BJ, Kim, et al. 2020. Learning causal networks using inducible transcription factors and transcriptome-wide time series. Molecular Systems Biology.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  configs:
28
  - config_name: hackett_2020
29
  description: >-
30
  Microarray expression data comparing cells without estradiol inducer, which express a TF at a very low level and post-induction, which express the TF at a high level by 15-30 minutes post induction. Contains many time points. Cells were grown in minimal medium with glucose in continuous-flow chemostats. In most experiments growth was limited by phosphate limitation.
31
- default: true
32
  dataset_type: annotated_features
33
  metadata_fields: ["sample_id", "regulator_locus_tag", "regulator_symbol", "time", "mechanism", "restriction", "date", "strain"]
34
  data_files:
@@ -47,141 +186,43 @@ configs:
47
  an old unique identifer, for use internally only. Deprecated and will be removed eventually.
48
  Do not use in analysis. db_id = 0, for GEV and Z3EV, means that those samples are not
49
  included in the original DB.
50
- - name: regulator_locus_tag
51
- dtype: string
52
- description: >-
53
- induced transcriptional regulator systematic ID.
54
- See hf/BrentLab/yeast_genome_resources
55
- role: regulator_identifier
56
- - name: regulator_symbol
57
- dtype: string
58
- description: >-
59
- induced transcriptional regulator common name. If no common name exists,
60
- then the `regulator_locus_tag` is used.
61
- role: regulator_identifier
62
- - name: target_locus_tag
63
- dtype: string
64
- description: >-
65
- The systematic ID of the feature to which the effect/pvalue is assigned.
66
- See hf/BrentLab/yeast_genome_resources
67
- role: target_identifier
68
- - name: target_symbol
69
- dtype: string
70
- description: >-
71
- The common name of the feature to which the effect/pvalue is assigned.
72
- If there is no common name, the `target_locus_tag` is used.
73
- role: target_identifier
74
- - name: time
75
- dtype:
76
- class_label:
77
- names: [0, 2, 5, 7, 8, 10, 12, 15, 20, 30, 45, 60, 90, 100, 120, 180, 290]
78
- description: time point (minutes)
79
- role: experimental_condition
80
- - name: mechanism
81
- dtype:
82
- class_label:
83
- names: ["GEV", "ZEV"]
84
- description: Synthetic TF induction system (GEV or ZEV)
85
- role: experimental_condition
86
- definitions:
87
- GEV:
88
- perturbation_method:
89
- type: inducible_overexpression
90
- system: GEV
91
- inducer: beta-estradiol
92
- description: "Galactose-inducible estrogen receptor-VP16 fusion system"
93
- ZEV:
94
- perturbation_method:
95
- type: inducible_overexpression
96
- system: ZEV
97
- inducer: beta-estradiol
98
- description: "Z3 (synthetic zinc finger)-estrogen receptor-VP16 fusion system"
99
- - name: restriction
100
- dtype:
101
- class_label:
102
- names: ["M", "N", "P"]
103
- description: >-
104
- nutrient limitation, one of P (phosphate limitation (20 mg/l).),
105
- N (Nitrogen‐limited cultures were maintained at 40 mg/l ammonium sulfate) or
106
- M (Not defined in the paper or on the Calico website)
107
- role: experimental_condition
108
- definitions:
109
- P:
110
- media:
111
- nitrogen_source:
112
- - compound: ammonium_sulfate
113
- # Saldanha et al 2004: 5 g/l
114
- concentration_percent: 0.5
115
- phosphate_source:
116
- - compound: potassium_phosphate_monobasic
117
- # Hackett et al 2020: 20 mg/l
118
- concentration_percent: 0.002
119
- N:
120
- media:
121
- nitrogen_source:
122
- - compound: ammonium_sulfate
123
- # Hackett et al 2020: 40 mg/l
124
- concentration_percent: 0.004
125
- M:
126
- description: "Not defined in the paper or on the Calico website"
127
- - name: date
128
- dtype: string
129
- description: date performed
130
- role: experimental_condition
131
- - name: strain
132
- dtype: string
133
- description: strain name
134
- role: experimental_condition
135
- - name: green_median
136
- dtype: float
137
- description: median of green (reference) channel fluorescence
138
- role: quantitative_measure
139
- - name: red_median
140
- dtype: float
141
- description: median of red (experimental) channel fluorescence
142
- role: quantitative_measure
143
- - name: log2_ratio
144
- dtype: float
145
- description: log2(red / green) subtracting value at time zero
146
- role: quantitative_measure
147
- - name: log2_cleaned_ratio
148
- dtype: float
149
- description: Non-specific stress response and prominent outliers removed
150
- role: quantitative_measure
151
- - name: log2_noise_model
152
- dtype: float
153
- description: estimated noise standard deviation
154
- role: quantitative_measure
155
- - name: log2_cleaned_ratio_zth2d
156
- dtype: float
157
- description: >-
158
- cleaned timecourses hard-thresholded based on
159
- multiple observations (or last observation) passing the noise model
160
- role: quantitative_measure
161
- - name: log2_selected_timecourses
162
- dtype: float
163
- description: >-
164
- cleaned timecourses hard-thresholded based on single observations
165
- passing noise model and impulse evaluation of biological feasibility
166
- role: quantitative_measure
167
- - name: log2_shrunken_timecourses
168
- dtype: float
169
  description: >-
170
- selected timecourses with observation-level shrinkage based on
171
- local FDR (false discovery rate). Most users of the data will want
172
- to use this column.
173
- role: quantitative_measure
174
- - name: responsive
175
- dtype: bool
176
  description: >-
177
- This labels targets, for a given regulator, with abs(log2_shrunken_timecourses) `>` 0
 
 
 
178
  - config_name: zev_gev
179
  description: These are the Z3EV and GEV control strains (no specifically tagged TF)
180
  dataset_type: annotated_features
181
- metadata_fields: ["sample_id", "regulator_locus_tag", "regulator_symbol", "time", "mechanism", "restriction", "date", "strain"]
182
  data_files:
183
  - split: train
184
- path: hackett_2020.parquet
185
  dataset_info:
186
  features:
187
  - name: sample_id
@@ -189,120 +230,6 @@ configs:
189
  description: >-
190
  unique identifier for a specific sample. The sample ID identifies a unique
191
  (regulator_locus_tag, time, mechanism, restriction, date, strain) tuple.
192
- - name: target_locus_tag
193
- dtype: string
194
- description: >-
195
- The systematic ID of the feature to which the effect/pvalue is assigned.
196
- See hf/BrentLab/yeast_genome_resources
197
- role: target_identifier
198
- - name: target_symbol
199
- dtype: string
200
- description: >-
201
- The common name of the feature to which the effect/pvalue is assigned.
202
- If there is no common name, the `target_locus_tag` is used.
203
- role: target_identifier
204
- - name: time
205
- dtype: float
206
- description: time point (minutes)
207
- role: experimental_condition
208
- - name: mechanism
209
- dtype:
210
- class_label:
211
- names: ["GEV", "ZEV"]
212
- description: Synthetic TF induction system (GEV or ZEV)
213
- role: experimental_condition
214
- definitions:
215
- GEV:
216
- perturbation_method:
217
- type: inducible_overexpression
218
- system: GEV
219
- inducer: beta-estradiol
220
- description: "Galactose-inducible estrogen receptor-VP16 fusion system"
221
- ZEV:
222
- perturbation_method:
223
- type: inducible_overexpression
224
- system: ZEV
225
- inducer: beta-estradiol
226
- description: "Z3 (synthetic zinc finger)-estrogen receptor-VP16 fusion system"
227
- - name: restriction
228
- dtype:
229
- class_label:
230
- names: ["M", "N", "P"]
231
- description: >-
232
- nutrient limitation, one of P (phosphate limitation (20 mg/l).),
233
- N (Nitrogen‐limited cultures were maintained at 40 mg/l ammonium sulfate) or
234
- M (Not defined in the paper or on the Calico website)
235
- role: experimental_condition
236
- definitions:
237
- P:
238
- media:
239
- nitrogen_source:
240
- - compound: ammonium_sulfate
241
- # Saldanha et al 2004: 5 g/l
242
- concentration_percent: 0.5
243
- phosphate_source:
244
- - compound: potassium_phosphate_monobasic
245
- # Hackett et al 2020: 20 mg/l
246
- concentration_percent: 0.002
247
- N:
248
- media:
249
- nitrogen_source:
250
- - compound: ammonium_sulfate
251
- # Hackett et al 2020: 40 mg/l
252
- concentration_percent: 0.004
253
- M:
254
- description: "Not defined in the paper or on the Calico website"
255
- - name: date
256
- dtype: string
257
- description: date performed
258
- role: experimental_condition
259
- - name: strain
260
- dtype: string
261
- description: strain name
262
- role: experimental_condition
263
- - name: green_median
264
- dtype: float
265
- description: median of green (reference) channel fluorescence
266
- role: quantitative_measure
267
- - name: red_median
268
- dtype: float
269
- description: median of red (experimental) channel fluorescence
270
- role: quantitative_measure
271
- - name: log2_ratio
272
- dtype: float
273
- description: log2(red / green) subtracting value at time zero
274
- role: quantitative_measure
275
- - name: log2_cleaned_ratio
276
- dtype: float
277
- description: Non-specific stress response and prominent outliers removed
278
- role: quantitative_measure
279
- - name: log2_noise_model
280
- dtype: float
281
- description: estimated noise standard deviation
282
- role: quantitative_measure
283
- - name: log2_cleaned_ratio_zth2d
284
- dtype: float
285
- description: >-
286
- cleaned timecourses hard-thresholded based on
287
- multiple observations (or last observation) passing the noise model
288
- role: quantitative_measure
289
- - name: log2_selected_timecourses
290
- dtype: float
291
- description: >-
292
- cleaned timecourses hard-thresholded based on single observations
293
- passing noise model and impulse evaluation of biological feasibility
294
- role: quantitative_measure
295
- - name: log2_shrunken_timecourses
296
- dtype: float
297
- description: >-
298
- selected timecourses with observation-level shrinkage based on
299
- local FDR (false discovery rate). Most users of the data will want
300
- to use this column.
301
- role: quantitative_measure
302
- - name: responsive
303
- dtype: bool
304
- description: >-
305
- This labels targets, for a given regulator, with abs(log2_shrunken_timecourses) `>` 0
306
  ---
307
  # Hackett 2020
308
 
@@ -318,85 +245,72 @@ transcriptome-wide time series. Mol Syst Biol. 2020 Mar;16(3):e9174. doi:
318
  10.15252/msb.20199174. PMID: 32181581; PMCID:
319
  PMC7076914.](https://doi.org/10.15252/msb.20199174)
320
 
321
- This repo provides 1 dataset:
322
-
323
- - **hackett_2020**: TF overexpression data from Hackett 2020.
324
-
325
- ## Usage
326
-
327
- The python package `tfbpapi` provides an interface to this data which eases
328
- examining the datasets, field definitions and other operations. You may also
329
- download the parquet datasets directly from hugging face by clicking on
330
- "Files and Versions", or by using the huggingface_cli and duckdb directly.
331
- In both cases, this provides a method of retrieving dataset and field definitions.
332
 
333
- ### `tfbpapi`
 
 
 
 
334
 
335
- After [installing
336
- tfbpapi](https://github.com/BrentLab/tfbpapi/?tab=readme-ov-file#installation), you can
337
- adapt this [tutorial](https://brentlab.github.io/tfbpapi/tutorials/hfqueryapi_tutorial/)
338
- in order to explore the contents of this repository.
339
 
340
- ### huggingface_cli/duckdb
341
-
342
- You can retrieves and displays the file paths for each configuration of
343
- the "BrentLab/hackett_2020" dataset from Hugging Face Hub.
 
 
344
 
345
  ```python
346
- from huggingface_hub import ModelCard
347
- from pprint import pprint
348
-
349
- card = ModelCard.load("BrentLab/hackett_2020", repo_type="dataset")
350
 
351
- # cast to dict
352
- card_dict = card.data.to_dict()
 
 
 
 
353
 
354
- # Get partition information
355
- dataset_paths_dict = {d.get("config_name"): d.get("data_files")[0].get("path") for d in card_dict.get("configs")}
356
 
357
- pprint(dataset_paths_dict)
 
358
  ```
359
 
360
- If you wish to pull the entire repo, due to its size you may need to use an
361
- [authentication token](https://huggingface.co/docs/hub/en/security-tokens).
362
- If you do not have one, try omitting the token related code below and see if
363
- it works. Else, create a token and provide it like so:
 
 
 
364
 
365
  ```python
366
  from huggingface_hub import snapshot_download
367
  import duckdb
368
- import os
369
 
370
- repo_id = "BrentLab/hackett_2020"
371
-
372
- hf_token = os.getenv("HF_TOKEN")
373
-
374
- # Download entire repo to local directory
375
  repo_path = snapshot_download(
376
- repo_id=repo_id,
377
  repo_type="dataset",
378
- token=hf_token
379
  )
380
-
381
- print(f"\n✓ Repository downloaded to: {repo_path}")
382
-
383
- # Construct path to the hackett_2020 parquet file
384
- parquet_path = os.path.join(repo_path, "hackett_2020.parquet")
385
- print(f"✓ Parquet file at: {parquet_path}")
386
  ```
387
 
388
- Use your favorite method of interacting with `parquet` files (eg duckDB, but you could
389
- use dplyr in R or pandas, too).
390
 
391
- ```python
392
- # Connect to DuckDB and query the parquet file
393
- conn = duckdb.connect()
394
 
395
- query = """
396
- SELECT DISTINCT time, mechanism, restriction, date
397
- FROM read_parquet(?)
398
- WHERE regulator_symbol = 'ACA1'
399
- """
400
- result = conn.execute(query, [parquet_path]).df()
401
- print(f"Found {result}")
402
  ```
 
24
  doi: https://doi.org/10.15252/msb.20199174
25
  citation: >-
26
  Hackett, SR, Baltz, EA, Coram, M, Wranik, BJ, Kim, et al. 2020. Learning causal networks using inducible transcription factors and transcriptome-wide time series. Molecular Systems Biology.
27
+
28
+ features:
29
+ - applies_to:
30
+ - hackett_2020
31
+ - hackett_2020_analysis_set
32
+ fields:
33
+ - name: regulator_locus_tag
34
+ dtype: string
35
+ description: >-
36
+ induced transcriptional regulator systematic ID.
37
+ See hf/BrentLab/yeast_genome_resources
38
+ role: regulator_identifier
39
+ - name: regulator_symbol
40
+ dtype: string
41
+ description: >-
42
+ induced transcriptional regulator common name. If no common name exists,
43
+ then the `regulator_locus_tag` is used.
44
+ role: regulator_identifier
45
+ - applies_to:
46
+ - hackett_2020
47
+ - zev_gev
48
+ - hackett_2020_analysis_set
49
+ fields:
50
+ - name: target_locus_tag
51
+ dtype: string
52
+ description: >-
53
+ The systematic ID of the feature to which the effect/pvalue is assigned.
54
+ See hf/BrentLab/yeast_genome_resources
55
+ role: target_identifier
56
+ - name: target_symbol
57
+ dtype: string
58
+ description: >-
59
+ The common name of the feature to which the effect/pvalue is assigned.
60
+ If there is no common name, the `target_locus_tag` is used.
61
+ role: target_identifier
62
+ - name: time
63
+ dtype:
64
+ class_label:
65
+ names: [0, 2, 5, 7, 8, 10, 12, 15, 20, 30, 45, 60, 90, 100, 120, 180, 290]
66
+ description: time point (minutes)
67
+ role: experimental_condition
68
+ - name: mechanism
69
+ dtype:
70
+ class_label:
71
+ names: ["GEV", "ZEV"]
72
+ description: Synthetic TF induction system (GEV or ZEV)
73
+ role: experimental_condition
74
+ definitions:
75
+ GEV:
76
+ perturbation_method:
77
+ type: inducible_overexpression
78
+ system: GEV
79
+ inducer: beta-estradiol
80
+ description: "Galactose-inducible estrogen receptor-VP16 fusion system"
81
+ ZEV:
82
+ perturbation_method:
83
+ type: inducible_overexpression
84
+ system: ZEV
85
+ inducer: beta-estradiol
86
+ description: "Z3 (synthetic zinc finger)-estrogen receptor-VP16 fusion system"
87
+ - name: restriction
88
+ dtype:
89
+ class_label:
90
+ names: ["M", "N", "P"]
91
+ description: >-
92
+ nutrient limitation, one of P (phosphate limitation (20 mg/l).),
93
+ N (Nitrogen‐limited cultures were maintained at 40 mg/l ammonium sulfate) or
94
+ M (Not defined in the paper or on the Calico website)
95
+ role: experimental_condition
96
+ definitions:
97
+ P:
98
+ media:
99
+ nitrogen_source:
100
+ - compound: ammonium_sulfate
101
+ # Saldanha et al 2004: 5 g/l
102
+ concentration_percent: 0.5
103
+ phosphate_source:
104
+ - compound: potassium_phosphate_monobasic
105
+ # Hackett et al 2020: 20 mg/l
106
+ concentration_percent: 0.002
107
+ N:
108
+ media:
109
+ nitrogen_source:
110
+ - compound: ammonium_sulfate
111
+ # Hackett et al 2020: 40 mg/l
112
+ concentration_percent: 0.004
113
+ M:
114
+ description: "Not defined in the paper or on the Calico website"
115
+ - name: date
116
+ dtype: string
117
+ description: date performed
118
+ role: experimental_condition
119
+ - name: strain
120
+ dtype: string
121
+ description: strain name
122
+ role: experimental_condition
123
+ - name: green_median
124
+ dtype: float
125
+ description: median of green (reference) channel fluorescence
126
+ role: quantitative_measure
127
+ - name: red_median
128
+ dtype: float
129
+ description: median of red (experimental) channel fluorescence
130
+ role: quantitative_measure
131
+ - name: log2_ratio
132
+ dtype: float
133
+ description: log2(red / green) subtracting value at time zero
134
+ role: quantitative_measure
135
+ - name: log2_cleaned_ratio
136
+ dtype: float
137
+ description: Non-specific stress response and prominent outliers removed
138
+ role: quantitative_measure
139
+ - name: log2_noise_model
140
+ dtype: float
141
+ description: estimated noise standard deviation
142
+ role: quantitative_measure
143
+ - name: log2_cleaned_ratio_zth2d
144
+ dtype: float
145
+ description: >-
146
+ cleaned timecourses hard-thresholded based on
147
+ multiple observations (or last observation) passing the noise model
148
+ role: quantitative_measure
149
+ - name: log2_selected_timecourses
150
+ dtype: float
151
+ description: >-
152
+ cleaned timecourses hard-thresholded based on single observations
153
+ passing noise model and impulse evaluation of biological feasibility
154
+ role: quantitative_measure
155
+ - name: log2_shrunken_timecourses
156
+ dtype: float
157
+ description: >-
158
+ selected timecourses with observation-level shrinkage based on
159
+ local FDR (false discovery rate). Most users of the data will want
160
+ to use this column.
161
+ role: quantitative_measure
162
+ - name: responsive
163
+ dtype: bool
164
+ description: >-
165
+ This labels targets, for a given regulator, with abs(log2_shrunken_timecourses) `>` 0
166
+
167
  configs:
168
  - config_name: hackett_2020
169
  description: >-
170
  Microarray expression data comparing cells without estradiol inducer, which express a TF at a very low level and post-induction, which express the TF at a high level by 15-30 minutes post induction. Contains many time points. Cells were grown in minimal medium with glucose in continuous-flow chemostats. In most experiments growth was limited by phosphate limitation.
 
171
  dataset_type: annotated_features
172
  metadata_fields: ["sample_id", "regulator_locus_tag", "regulator_symbol", "time", "mechanism", "restriction", "date", "strain"]
173
  data_files:
 
186
  an old unique identifer, for use internally only. Deprecated and will be removed eventually.
187
  Do not use in analysis. db_id = 0, for GEV and Z3EV, means that those samples are not
188
  included in the original DB.
189
+
190
+ - config_name: hackett_2020_analysis_set
191
+ description: >-
192
+ This dataset filters the full data such that a single strain is chosen for each
193
+ regulator. Where a ZEV with phosphate restriction is available, that is chosen,
194
+ otherwise a GEV with phosphate restriction is chosen, and if that is not
195
+ available, then the first available sample is chosen. There are 4 regulators,
196
+ GCN4, RDS2, SWI1, MAC1, which have multiple replicates of the same conditions.
197
+ For the time being, these regulators are entirely removed.
198
+ See `scripts/adding_analysis_set.R`
199
+ default: true
200
+ dataset_type: annotated_features
201
+ metadata_fields: ["sample_id", "regulator_locus_tag", "regulator_symbol", "time", "mechanism", "restriction", "date", "strain"]
202
+ data_files:
203
+ - split: train
204
+ path: hackett_2020_analysis_set.parquet
205
+ dataset_info:
206
+ features:
207
+ - name: sample_id
208
+ dtype: integer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  description: >-
210
+ unique identifier for a specific sample. The sample ID identifies a unique
211
+ (regulator_locus_tag, time, mechanism, restriction, date, strain) tuple.
212
+ - name: db_id
213
+ dtype: integer
 
 
214
  description: >-
215
+ an old unique identifer, for use internally only. Deprecated and will be removed eventually.
216
+ Do not use in analysis. db_id = 0, for GEV and Z3EV, means that those samples are not
217
+ included in the original DB.
218
+
219
  - config_name: zev_gev
220
  description: These are the Z3EV and GEV control strains (no specifically tagged TF)
221
  dataset_type: annotated_features
222
+ metadata_fields: ["sample_id", "time", "mechanism", "restriction", "date", "strain"]
223
  data_files:
224
  - split: train
225
+ path: zev_gev_strains.parquet
226
  dataset_info:
227
  features:
228
  - name: sample_id
 
230
  description: >-
231
  unique identifier for a specific sample. The sample ID identifies a unique
232
  (regulator_locus_tag, time, mechanism, restriction, date, strain) tuple.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  ---
234
  # Hackett 2020
235
 
 
245
  10.15252/msb.20199174. PMID: 32181581; PMCID:
246
  PMC7076914.](https://doi.org/10.15252/msb.20199174)
247
 
248
+ ## Accessing Data
 
 
 
 
 
 
 
 
 
 
249
 
250
+ The examples below require
251
+ [labretriever](https://github.com/cmatKhan/labretriever#installation)
252
+ (`pip install labretriever`) and/or the
253
+ [HuggingFace Hub client](https://huggingface.co/docs/huggingface_hub/installation)
254
+ (`pip install huggingface_hub`).
255
 
256
+ ### Accessing Data with labretriever
 
 
 
257
 
258
+ This repository is part of a collection configured as a unified database using
259
+ [labretriever.VirtualDB](https://cmatkhan.github.io/labretriever/virtual_db_configuration/).
260
+ Download the
261
+ [collection config](https://github.com/BrentLab/tfbpshiny/blob/main/tfbpshiny/brentlab_yeast_collection.yaml)
262
+ and use it to query the data directly in Python, or with an AI assistant using the
263
+ [labretriever plugin](https://cmatkhan.github.io/labretriever/mcp_server/#quick-install-claude-code-plugin).
264
 
265
  ```python
266
+ from labretriever.virtual_db import VirtualDB
267
+ from labretriever.datacard import DataCard
 
 
268
 
269
+ # Citation and metadata
270
+ card = DataCard("BrentLab/hackett_2020")
271
+ print([c.config_name for c in card.configs]) # list available datasets
272
+ info = card.info()
273
+ print(info["doi"])
274
+ print(info["citation"])
275
 
276
+ # path to the downloaded brentlab_yeast_collection.yaml
277
+ vdb = VirtualDB("/path/to/brentlab_yeast_collection.yaml")
278
 
279
+ print(vdb.get_dataset_description("hackett"))
280
+ vdb.query("SELECT * FROM hackett LIMIT 5")
281
  ```
282
 
283
+ ### Direct parquet access
284
+
285
+ The repository contains more data than what is exposed through the collection
286
+ configuration. Use `DataCard.info()` to inspect available files, then download
287
+ and query with DuckDB.
288
+
289
+ Most files in this repository are single parquet files and can be read directly:
290
 
291
  ```python
292
  from huggingface_hub import snapshot_download
293
  import duckdb
 
294
 
 
 
 
 
 
295
  repo_path = snapshot_download(
296
+ repo_id="BrentLab/hackett_2020",
297
  repo_type="dataset",
298
+ allow_patterns="hackett_2020.parquet",
299
  )
300
+ conn = duckdb.connect()
301
+ # returns a pandas DataFrame with the first 5 rows
302
+ conn.execute(
303
+ "SELECT * FROM read_parquet(?) LIMIT 5",
304
+ [f"{repo_path}/hackett_2020.parquet"],
305
+ ).df()
306
  ```
307
 
308
+ ### Accessing using R
 
309
 
310
+ Clone the repository and read parquet files directly with
311
+ [arrow](https://arrow.apache.org/docs/r/):
 
312
 
313
+ ```r
314
+ # install.packages("arrow")
315
+ arrow::read_parquet("hackett_2020.parquet")
 
 
 
 
316
  ```
hackett_2020.parquet.md5 DELETED
@@ -1 +0,0 @@
1
- f9b54be34c55efc1af32cf86c4ca368d hackett_2020.parquet
 
 
hackett_2020_analysis_set.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bf008a5e5c5d880c9f2eca127bfa4b14390df865b35469ec3f8b00ce58f1a5f
3
+ size 403003879
scripts/adding_analysis_set.R ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ library(arrow)
2
+ library(duckdb)
3
+ library(tidyverse)
4
+
5
+
6
+ full_data = arrow::read_parquet("~/code/hf/hackett_2020/hackett_2020.parquet")
7
+
8
+ con <- duckdb::dbConnect(duckdb::duckdb())
9
+ duckdb::duckdb_register_arrow(con, "hackett_meta", arrow::open_dataset("~/code/hf/hackett_2020/hackett_2020.parquet"))
10
+
11
+ query <- "
12
+ WITH regulator_tiers AS (
13
+ SELECT
14
+ regulator_locus_tag,
15
+ CASE
16
+ WHEN BOOL_OR(mechanism = 'ZEV' AND restriction = 'P') THEN 1
17
+ WHEN BOOL_OR(mechanism = 'GEV' AND restriction = 'P') THEN 2
18
+ ELSE 3
19
+ END AS tier
20
+ FROM hackett_meta
21
+ GROUP BY regulator_locus_tag
22
+ ),
23
+ tier_filtered AS (
24
+ SELECT
25
+ h.*,
26
+ t.tier
27
+ FROM hackett_meta h
28
+ JOIN regulator_tiers t USING (regulator_locus_tag)
29
+ WHERE
30
+ (t.tier = 1 AND h.mechanism = 'ZEV' AND h.restriction = 'P')
31
+ OR (t.tier = 2 AND h.mechanism = 'GEV' AND h.restriction = 'P')
32
+ OR (t.tier = 3 AND h.mechanism = 'GEV' AND h.restriction = 'M')
33
+ )
34
+ SELECT DISTINCT
35
+ sample_id,
36
+ db_id,
37
+ regulator_locus_tag,
38
+ regulator_symbol,
39
+ target_locus_tag,
40
+ target_symbol,
41
+ time,
42
+ mechanism,
43
+ restriction,
44
+ date,
45
+ strain,
46
+ green_median,
47
+ red_median,
48
+ log2_ratio,
49
+ log2_cleaned_ratio,
50
+ log2_noise_model,
51
+ log2_cleaned_ratio_zth2d,
52
+ log2_selected_timecourses,
53
+ log2_shrunken_timecourses,
54
+ responsive
55
+ FROM tier_filtered
56
+ WHERE regulator_symbol NOT IN ('GCN4', 'RDS2', 'SWI1', 'MAC1')
57
+ "
58
+
59
+ result <- DBI::dbGetQuery(con, query)
60
+ duckdb::dbDisconnect(con)
61
+
62
+ analysis_set_ids <- result |> distinct(sample_id) |> pull(sample_id)
63
+
64
+ full_data <- full_data |>
65
+ mutate(analysis_set = sample_id %in% analysis_set_ids)