Update README.md
Browse files
README.md
CHANGED
|
@@ -285,39 +285,36 @@ Output:
|
|
| 285 |
'levels': [
|
| 286 |
'YPD',
|
| 287 |
'SM',
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
'H2O2Lo',
|
| 291 |
-
'Acid',
|
| 292 |
-
'Alpha',
|
| 293 |
-
'BUT14',
|
| 294 |
-
'BUT90',
|
| 295 |
-
'Thi-',
|
| 296 |
-
'GAL',
|
| 297 |
-
'HEAT',
|
| 298 |
-
'Pi-',
|
| 299 |
-
'RAFF']},
|
| 300 |
-
{'name': 'regulator_symbol',
|
| 301 |
'dtype': 'string',
|
| 302 |
'levels': [
|
| 303 |
'YSC0017',
|
| 304 |
'YKL112W',
|
| 305 |
'YNR054C',
|
| 306 |
'YER045C',
|
| 307 |
-
...
|
| 308 |
```
|
| 309 |
|
| 310 |
You can use this information to pull only the partition you're interested in, eg
|
| 311 |
|
| 312 |
```python
|
| 313 |
-
from
|
|
|
|
|
|
|
| 314 |
|
| 315 |
-
#
|
| 316 |
-
|
| 317 |
-
repo_id="BrentLab/
|
| 318 |
repo_type="dataset",
|
| 319 |
-
|
|
|
|
|
|
|
| 320 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
```
|
| 322 |
|
| 323 |
<details>
|
|
|
|
| 285 |
'levels': [
|
| 286 |
'YPD',
|
| 287 |
'SM',
|
| 288 |
+
...]},
|
| 289 |
+
{'name': 'regulator_locus_tag',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
'dtype': 'string',
|
| 291 |
'levels': [
|
| 292 |
'YSC0017',
|
| 293 |
'YKL112W',
|
| 294 |
'YNR054C',
|
| 295 |
'YER045C',
|
| 296 |
+
...
|
| 297 |
```
|
| 298 |
|
| 299 |
You can use this information to pull only the partition you're interested in, eg
|
| 300 |
|
| 301 |
```python
|
| 302 |
+
from pathlib import Path
|
| 303 |
+
from huggingface_hub import snapshot_download
|
| 304 |
+
import pyarrow.dataset as ds
|
| 305 |
|
| 306 |
+
# pull all data for regulator `YAL051W`
|
| 307 |
+
root = snapshot_download(
|
| 308 |
+
repo_id="BrentLab/hackett_2020",
|
| 309 |
repo_type="dataset",
|
| 310 |
+
allow_patterns=[
|
| 311 |
+
"data/*/regulator_locus_tag=YSC0017/part-0.parquet"
|
| 312 |
+
],
|
| 313 |
)
|
| 314 |
+
|
| 315 |
+
base = Path(root) / "data" # the dataset root directory
|
| 316 |
+
dataset = ds.dataset(base, format="parquet", partitioning="hive")
|
| 317 |
+
print(dataset.schema)
|
| 318 |
```
|
| 319 |
|
| 320 |
<details>
|