updating text of readme
Browse files
README.md
CHANGED
|
@@ -297,10 +297,74 @@ configs:
|
|
| 297 |
# Harbison 2004
|
| 298 |
|
| 299 |
This Dataset is a parsed version of the data provided by Richard A. Young's lab at
|
| 300 |
-
[their website](http://younglab.wi.mit.edu/regulatory_code).
|
| 301 |
-
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
# Harbison 2004
|
| 298 |
|
| 299 |
This Dataset is a parsed version of the data provided by Richard A. Young's lab at
|
| 300 |
+
[their website](http://younglab.wi.mit.edu/regulatory_code). DOI and citation are in
|
| 301 |
+
the dataset card above, or see the [ArrayExpress entry](https://www.ebi.ac.uk/biostudies/ArrayExpress/studies/E-WMIT-10?query=%22richard%20young%22)
|
| 302 |
|
| 303 |
+
## Accessing Data
|
| 304 |
+
|
| 305 |
+
The examples below require
|
| 306 |
+
[labretriever](https://github.com/cmatKhan/labretriever#installation)
|
| 307 |
+
(`pip install labretriever`) and/or the
|
| 308 |
+
[HuggingFace Hub client](https://huggingface.co/docs/huggingface_hub/installation)
|
| 309 |
+
(`pip install huggingface_hub`).
|
| 310 |
+
|
| 311 |
+
### Accessing Data with labretriever
|
| 312 |
+
|
| 313 |
+
This repository is part of a collection configured as a unified database using
|
| 314 |
+
[labretriever.VirtualDB](https://cmatkhan.github.io/labretriever/virtual_db_configuration/).
|
| 315 |
+
Download the
|
| 316 |
+
[collection config](https://github.com/BrentLab/tfbpshiny/blob/main/tfbpshiny/brentlab_yeast_collection.yaml)
|
| 317 |
+
and use it to query the data directly in Python, or with an AI assistant using the
|
| 318 |
+
[labretriever plugin](https://cmatkhan.github.io/labretriever/mcp_server/#quick-install-claude-code-plugin).
|
| 319 |
+
|
| 320 |
+
```python
|
| 321 |
+
from labretriever.virtual_db import VirtualDB
|
| 322 |
+
from labretriever.datacard import DataCard
|
| 323 |
+
|
| 324 |
+
# Citation and metadata
|
| 325 |
+
card = DataCard("BrentLab/harbison_2004")
|
| 326 |
+
info = card.info()
|
| 327 |
+
print(info["doi"])
|
| 328 |
+
print(info["citation"])
|
| 329 |
+
|
| 330 |
+
# path to the downloaded brentlab_yeast_collection.yaml
|
| 331 |
+
vdb = VirtualDB("/path/to/brentlab_yeast_collection.yaml")
|
| 332 |
+
|
| 333 |
+
print(vdb.get_dataset_description("harbison"))
|
| 334 |
+
vdb.query("SELECT * FROM harbison LIMIT 5")
|
| 335 |
+
```
|
| 336 |
+
|
| 337 |
+
### Direct parquet access
|
| 338 |
+
|
| 339 |
+
The repository contains more data than what is exposed through the collection
|
| 340 |
+
configuration. Use `DataCard.info()` to inspect available files, then download
|
| 341 |
+
and query with DuckDB.
|
| 342 |
+
|
| 343 |
+
Most files in this repository are single parquet files and can be read directly:
|
| 344 |
+
|
| 345 |
+
```python
|
| 346 |
+
from huggingface_hub import snapshot_download
|
| 347 |
+
import duckdb
|
| 348 |
+
|
| 349 |
+
repo_path = snapshot_download(
|
| 350 |
+
repo_id="BrentLab/harbison_2004",
|
| 351 |
+
repo_type="dataset",
|
| 352 |
+
allow_patterns="harbison_2004.parquet",
|
| 353 |
+
)
|
| 354 |
+
conn = duckdb.connect()
|
| 355 |
+
# returns a pandas DataFrame with the first 5 rows
|
| 356 |
+
conn.execute(
|
| 357 |
+
"SELECT * FROM read_parquet(?) LIMIT 5",
|
| 358 |
+
[f"{repo_path}/harbison_2004.parquet"],
|
| 359 |
+
).df()
|
| 360 |
+
```
|
| 361 |
+
|
| 362 |
+
### Accessing using R
|
| 363 |
+
|
| 364 |
+
Clone the repository and read parquet files directly with
|
| 365 |
+
[arrow](https://arrow.apache.org/docs/r/):
|
| 366 |
+
|
| 367 |
+
```r
|
| 368 |
+
# install.packages("arrow")
|
| 369 |
+
arrow::read_parquet("harbison_2004.parquet")
|
| 370 |
+
```
|