cmatkhan commited on
Commit
628113d
·
verified ·
1 Parent(s): dcf5294

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -24
README.md CHANGED
@@ -158,48 +158,67 @@ configs:
158
  dtype: float64
159
  description: Adjusted p-value for multiple testing for the gene
160
  ---
161
-
162
  # Rossi 2021
163
 
164
- This data is gathered from [yeastepigenome.org](https://yeastepigenome.org/). This work was published in
 
165
 
166
  [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)
167
 
168
- ## Dataset details
169
 
170
- `genome_map` is fully reprocessed data from the sequence files. I used the nf-core/chipseq pipeline, details for which can be found in `scripts/`. With
171
- those bams, I filtered the reads using `samtools` and the same settings specified in Rossi et al 2021, and then counted 5' ends using bedtools. See
172
- `scripts/count_tags.sh`.
 
 
 
 
173
 
174
- ## Data Structure
175
 
176
- ### Metadata
 
 
 
 
177
 
178
- | Field | Description |
179
- |-----------------------|-------------------------------------------------------------------|
180
- | `regulator_locus_tag` | Systematic gene name (ORF identifier) of the transcription factor |
181
- | `regulator_symbol` | Standard gene symbol of the transcription factor |
182
- | `run_accession` | GEO run accession identifier for the sample |
183
- | `yeastepigenome_id` | Sample identifier used by yeastepigenome.org |
184
 
185
- ### Genome Map
 
 
186
 
187
- | Field | Description |
188
- |----------|----------------------------------------------------------------|
189
- | `chr` | Chromosome name, ucsc (e.g., chrI, chrII, etc.) |
190
- | `pos` | Genomic position of the 5' tag |
191
- | `pileup` | Depth of coverage (number of 5' tags) at this genomic position |
192
 
193
- ## Usage
 
 
 
 
 
 
 
194
 
195
- The entire repository is large. It may be preferable to only retrieve specific files or partitions.
196
- You can use the metadata files to choose which files to pull.
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  ```python
199
  from huggingface_hub import snapshot_download
200
  import duckdb
201
  import os
202
-
203
  # Download only the metadata first
204
  repo_path = snapshot_download(
205
  repo_id="BrentLab/rossi_2021",
@@ -229,3 +248,28 @@ result = conn.execute("SELECT * FROM read_parquet(?) LIMIT 10",
229
  [f"{dataset_path}/**/*.parquet"]).df()
230
  print(result)
231
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  dtype: float64
159
  description: Adjusted p-value for multiple testing for the gene
160
  ---
 
161
  # Rossi 2021
162
 
163
+ This data is gathered from [yeastepigenome.org](https://yeastepigenome.org/).
164
+ This work was published in
165
 
166
  [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)
167
 
168
+ This repo provides 4 datasets:
169
 
170
+ - rossi_2021_metadata: Metadata describing the tagged regulator in each
171
+ experiment.
172
+ - genome_map: ChIP-exo 5' tag coverage data partitioned by sample accession.
173
+ - reprocess_annotatedfeatures: This data was reprocessed from the fastq files
174
+ on GEO. See scripts/reprocessing_details.txt for more information.
175
+ - yeastepigenome_annotatedfeatures: ChIP-exo regulator-target binding features
176
+ with peak statistics.
177
 
178
+ ## Usage
179
 
180
+ The python package `tfbpapi` provides an interface to this data which eases
181
+ examining the datasets, field definitions and other operations. You may also
182
+ download the parquet datasets directly from hugging face by clicking on
183
+ "Files and Versions", or by using the huggingface_cli and duckdb directly.
184
+ In both cases, this provides a method of retrieving dataset and field definitions.
185
 
186
+ ### `tfbpapi`
 
 
 
 
 
187
 
188
+ After [installing tfbpapi](https://github.com/BrentLab/tfbpapi/?tab=readme-ov-file#installation),
189
+ you can adapt this [tutorial](https://brentlab.github.io/tfbpapi/tutorials/hfqueryapi_tutorial/)
190
+ in order to explore the contents of this repository.
191
 
192
+ ### huggingface_cli/duckdb
 
 
 
 
193
 
194
+ You can retrieves and displays the file paths for each configuration of0
195
+ the "BrentLab/rossi_2021" dataset from Hugging Face Hub.
196
+
197
+ ```python
198
+ from huggingface_hub import ModelCard
199
+ from pprint import pprint
200
+
201
+ card = ModelCard.load("BrentLab/rossi_2021", repo_type="dataset")
202
 
203
+ # cast to dict
204
+ card_dict = card.data.to_dict()
205
+
206
+ # Get partition information
207
+ dataset_paths_dict = {d.get("config_name"): d.get("data_files")[0].get("path") for d in card_dict.get("configs")}
208
+
209
+ pprint(dataset_paths_dict)
210
+ ```
211
+
212
+ ### explore metadata
213
+
214
+ The entire repository is large. It may be preferable to only retrieve
215
+ specific files or partitions. You can use the metadata files to choose
216
+ which files to pull.
217
 
218
  ```python
219
  from huggingface_hub import snapshot_download
220
  import duckdb
221
  import os
 
222
  # Download only the metadata first
223
  repo_path = snapshot_download(
224
  repo_id="BrentLab/rossi_2021",
 
248
  [f"{dataset_path}/**/*.parquet"]).df()
249
  print(result)
250
  ```
251
+
252
+ If you wish to pull the entire repo, due to its size you may need to use an
253
+ [authentication token](https://huggingface.co/docs/hub/en/security-tokens).
254
+ If you do not have one, try omitting the token related code below and see if
255
+ it works. Else, create a token and provide it like so:
256
+
257
+ ```python
258
+
259
+ repo_id = "BrentLab/rossi_2021"
260
+
261
+ hf_token = os.getenv("HF_TOKEN")
262
+
263
+ # Download entire repo to local directory
264
+ repo_path = snapshot_download(
265
+ repo_id=repo_id,
266
+ repo_type="dataset",
267
+ token=hf_token
268
+ )
269
+
270
+ print(f"\n✓ Repository downloaded to: {repo_path}")
271
+
272
+ # Construct path to the rossi_annotated_features parquet file
273
+ parquet_path = os.path.join(repo_path, "yeastepigenome_annotatedfeatures.parquet")
274
+ print(f"✓ Parquet file at: {parquet_path}")
275
+ ```