danieltslz commited on
Commit
73d1bef
·
verified ·
1 Parent(s): 841162c

Update curated README: enformer_tss_393kb_human_central3

Browse files
data/embeddings/enformer_tss_393kb_human_central3/README.md CHANGED
@@ -1,40 +1,23 @@
1
- # Enformer-TSS-393kb-human-central3-log1p-zscore-v1.1
2
 
3
- Embedding ID: `enformer_tss_393kb_human_central3`
4
-
5
- Former processing ID: `enformer_tss_393kb_human_central3_v1_1`
 
 
6
 
7
  ## Public files
8
 
9
  - `embeddings.npz`: compressed NumPy archive containing the embedding matrix under key `embeddings`.
10
  - `genes.tsv`: row metadata table. Row order matches the embedding matrix.
11
  - `metadata.json`: machine-readable provenance and processing metadata.
12
- - `README.md`: this per-embedding documentation file.
13
 
14
  ## Matrix
15
 
16
  - Shape: `20097 genes × 5313 dimensions`
17
  - Dtype: `float32`
18
- - NPZ array key: `embeddings`
19
-
20
- The row order is authoritative:
21
-
22
- ```text
23
- embeddings.npz['embeddings'][i, :] corresponds to genes.tsv row i
24
- ```
25
 
26
- ## Loading example
27
 
28
- ```python
29
- import numpy as np
30
- import pandas as pd
31
-
32
- with np.load('embeddings.npz') as z:
33
- X = z['embeddings']
34
-
35
- genes = pd.read_csv('genes.tsv', sep='\t')
36
- assert X.shape[0] == len(genes)
37
- ```
38
 
39
  ## genes.tsv columns
40
 
@@ -54,24 +37,72 @@ assert X.shape[0] == len(genes)
54
  | `assembly` | 20097 | 1 | GRCh38 | Genome assembly used for coordinates. |
55
  | `gencode_release` | 20097 | 1 | 49 | GENCODE release used for annotation. |
56
 
57
- ## Basic metadata
58
 
59
- | Field | Value |
60
- |---|---|
61
- | `status` | processed_qc_passed |
62
- | `modality` | regulatory DNA / long-range TSS sequence model |
63
- | `embedding_name` | Enformer-TSS-393kb-human-central3-log1p-zscore-v1.1 |
64
 
65
  ## Detailed processing notes
66
 
67
- TODO: manually paste and curate the processing explanation for this embedding from the central project README.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
- Please include, when relevant:
70
 
71
- - original source/model/checkpoint;
72
- - whether the embedding was downloaded or generated locally;
73
- - input data used;
74
- - identifier mapping and filtering decisions;
75
- - pooling, aggregation, PCA, or normalization method;
76
- - coverage and important caveats;
77
- - license or redistribution notes.
 
 
 
1
+ # Embedding name: Enformer-TSS-393kb-human-central3-log1p-zscore
2
 
3
+ - Modality: Regulatory DNA / long-range TSS sequence-to-activity profile
4
+ - Algorithm: Transformer-based sequence-to-function model
5
+ - Source used here: Local inference with official DeepMind Enformer TensorFlow Hub model
6
+ - Embedding source URL: Local generation from master_gene_table.csv TSS windows
7
+ - Original model/code URL: https://tfhub.dev/deepmind/enformer/1
8
 
9
  ## Public files
10
 
11
  - `embeddings.npz`: compressed NumPy archive containing the embedding matrix under key `embeddings`.
12
  - `genes.tsv`: row metadata table. Row order matches the embedding matrix.
13
  - `metadata.json`: machine-readable provenance and processing metadata.
 
14
 
15
  ## Matrix
16
 
17
  - Shape: `20097 genes × 5313 dimensions`
18
  - Dtype: `float32`
 
 
 
 
 
 
 
19
 
 
20
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  ## genes.tsv columns
23
 
 
37
  | `assembly` | 20097 | 1 | GRCh38 | Genome assembly used for coordinates. |
38
  | `gencode_release` | 20097 | 1 | 49 | GENCODE release used for annotation. |
39
 
 
40
 
 
 
 
 
 
41
 
42
  ## Detailed processing notes
43
 
44
+ ### Source and interpretation
45
+
46
+ This embedding is a gene-level long-range regulatory DNA representation derived from Enformer predictions around each gene transcription start site. In this project, it was generated locally from master-table GRCh38 gene coordinates and reference-genome TSS windows. It was not downloaded as a ready gene-level embedding table.
47
+
48
+ The model used was the official DeepMind Enformer TensorFlow Hub model. For each gene, a 393,216 bp window centered on the transcription start site was generated from the GRCh38 reference genome. The Enformer human output head was used, the mouse output head was discarded, and the central 3 output bins around the TSS were averaged. The resulting 5,313 human-track values were transformed with log1p and then z-scored dimension-wise across genes to create the final embedding matrix.
49
+
50
+ This embedding should therefore be interpreted as a long-range TSS regulatory sequence-to-activity embedding. It captures predicted human regulatory activity from a 393 kb reference-genome window around each gene TSS. It is directly comparable to DeepSEA-TSS-1kb and Basenji2-TSS-131kb, but differs in model architecture, context length, and output-resolution design.
51
+
52
+ ### Provenance fields
53
+
54
+ source_name: DeepMind Enformer / TensorFlow Hub enformer/1
55
+ original_model_or_method: Enformer sequence-to-function model
56
+ input_sequence_type: regulatory DNA sequence
57
+ input_sequence_source: GRCh38 primary assembly FASTA and master_gene_table.csv TSS coordinates
58
+ genome_build: GRCh38
59
+ model_interface: TensorFlow Hub Enformer model
60
+ model_url: https://tfhub.dev/deepmind/enformer/1
61
+ input_window: 393,216 bp centered on gene TSS
62
+ output_used: human head only
63
+ output_tracks: 5,313 human regulatory tracks
64
+ pooling_strategy: mean of central 3 output bins around the TSS
65
+ final_transformation: log1p raw predictions, then dimension-wise z-score across genes
66
+
67
+ ### Coordinate and sequence decisions
68
+
69
+ The source coordinates came from master_gene_table.csv. For plus-strand genes, the TSS was defined as gene_start. For minus-strand genes, the TSS was defined as gene_end. A 393,216 bp interval centered on this TSS was generated for each master-table gene.
70
+
71
+ Sequences were run in genomic reference orientation. They were not reverse-complemented by gene strand. Boundary windows were N-padded if needed. This means the embedding represents local reference-genome regulatory sequence context around the TSS, not transcript-oriented sequence.
72
+
73
+ ### Processing workflow
74
+
75
+ For each gene in the master table:
76
+
77
+ 1. Read gene coordinates and strand from master_gene_table.csv.
78
+ 2. Define the TSS using gene_start for plus-strand genes and gene_end for minus-strand genes.
79
+ 3. Build a 393,216 bp sequence window centered on the TSS.
80
+ 4. Extract the corresponding GRCh38 reference sequence, using N-padding at chromosome boundaries if needed.
81
+ 5. Run the official TensorFlow Hub Enformer model.
82
+ 6. Keep the human output head and discard the mouse output head.
83
+ 7. Average the central 3 output bins around the TSS.
84
+ 8. Apply log1p to the raw human-track predictions.
85
+ 9. Z-score each of the 5,313 dimensions across genes.
86
+ 10. Save the final matrix as float32.
87
+
88
+ ### Important implementation decisions
89
+
90
+ Only the human output head was kept. The mouse output head was discarded because this resource is standardized to human genes.
91
+
92
+ The central 3 output bins around the TSS were averaged instead of taking a single bin. This reduces single-bin noise while keeping the representation local to the TSS.
93
+
94
+ The raw Enformer predictions were transformed with log1p before z-scoring because the model outputs are non-negative and highly skewed across regulatory tracks.
95
+
96
+ The final run resumed from a valid checkpoint with 1,225 / 20,097 genes already processed. The resumed run completed all remaining genes and passed final QC.
97
 
98
+ ### Summary of final mapping:
99
 
100
+ Source identifiers / generated windows: 20,097
101
+ Dimensions: 5,313
102
+ Rows generated before duplicate collapse: 20,097
103
+ Unmapped source rows: 0
104
+ Ambiguous source rows: 0
105
+ Final mapped genes: 20,097
106
+ Master table rows: 20,097
107
+ Master coverage: 100.000%
108
+ Duplicate final mappings averaged: 0