danieltslz commited on
Commit
33111e8
·
verified ·
1 Parent(s): 3540501

Update curated single-cell model README documentation: data/embeddings/uce_33l/README.md

Browse files
Files changed (1) hide show
  1. data/embeddings/uce_33l/README.md +63 -44
data/embeddings/uce_33l/README.md CHANGED
@@ -1,40 +1,22 @@
1
- # UCE-33L-v1.1
2
 
3
- Embedding ID: `uce_33l`
4
-
5
- Former processing ID: `uce_33l_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: `19082 genes × 1280 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
 
@@ -49,33 +31,70 @@ assert X.shape[0] == len(genes)
49
  | `canonical_protein_id` | 19082 | 19082 | ENSP00000362111<br>ENSP00000362122<br>ENSP00000360644<br>ENSP00000356745 | Canonical protein identifier recorded or used for this gene. |
50
  | `source_embedding` | 19082 | 1 | official_UCE_33L_8ep_1024t_1280 | Name of the original source embedding. |
51
  | `source_identifier_type` | 19082 | 1 | UCE species_chrom human gene symbol | Type of source identifier used by the original embedding. |
52
- | `source_key_count` | 19082 | 2 | 1<br>2 | Number of source keys mapped or collapsed to this final gene. |
53
- | `source_keys_examples` | 19082 | 19082 | TSPAN6<br>TNMD<br>DPM1<br>SCYL3 | Example source keys mapped to this final gene. |
54
  | `source_row_indices_examples` | 19082 | 19082 | 18962<br>18961<br>12000<br>750 | Example source row indices mapped to this final gene. |
55
- | `source_chromosomes_examples` | 19082 | 32 | X<br>20<br>1<br>6 | TODO: define this source-specific column during manual curation. |
56
- | `source_starts_examples` | 19082 | 19078 | 100632063<br>100584936<br>50936148<br>169853074 | TODO: define this source-specific column during manual curation. |
57
  | `mapping_methods` | 19082 | 3 | symbol_current_or_hgnc_approved_exact_unique<br>symbol_hgnc_previous_exact_unique<br>symbol_current_or_hgnc_approved_exact_unique;symbol_hgnc_previous_exact_unique | Mapping methods used to connect source records to the master gene table. |
58
 
59
- ## Basic metadata
60
 
61
- | Field | Value |
62
- |---|---|
63
- | `modality` | single_cell_expression_foundation_model / protein-informed gene-token embedding |
64
- | `embedding_name` | UCE-33L-v1.1 |
65
- | `download_source` | Official UCE GitHub repository plus official Figshare model files |
66
- | `original_model_or_method` | Universal Cell Embeddings (UCE) |
67
- | `embedding_generated_by` | Extracted locally from official UCE all_tokens and 33-layer checkpoint gene encoder |
68
 
69
  ## Detailed processing notes
70
 
71
- TODO: manually paste and curate the processing explanation for this embedding from the central project README.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
- Please include, when relevant:
74
 
75
- - original source/model/checkpoint;
76
- - whether the embedding was downloaded or generated locally;
77
- - input data used;
78
- - identifier mapping and filtering decisions;
79
- - pooling, aggregation, PCA, or normalization method;
80
- - coverage and important caveats;
81
- - license or redistribution notes.
 
1
+ # Embedding name: UCE-33L
2
 
3
+ - Modality: Single-cell expression foundation model / protein-informed gene-token embedding
4
+ - Algorithm: UCE fixed gene-token vector from official token table and encoder projection
5
+ - Embedding source URL: https://github.com/snap-stanford/UCE
6
+ - Original model/code URL: https://github.com/snap-stanford/UCE
7
 
8
  ## Public files
9
 
10
  - `embeddings.npz`: compressed NumPy archive containing the embedding matrix under key `embeddings`.
11
  - `genes.tsv`: row metadata table. Row order matches the embedding matrix.
12
  - `metadata.json`: machine-readable provenance and processing metadata.
 
13
 
14
  ## Matrix
15
 
16
  - Shape: `19082 genes × 1280 dimensions`
17
  - Dtype: `float32`
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
 
 
19
 
 
 
 
20
 
21
  ## genes.tsv columns
22
 
 
31
  | `canonical_protein_id` | 19082 | 19082 | ENSP00000362111<br>ENSP00000362122<br>ENSP00000360644<br>ENSP00000356745 | Canonical protein identifier recorded or used for this gene. |
32
  | `source_embedding` | 19082 | 1 | official_UCE_33L_8ep_1024t_1280 | Name of the original source embedding. |
33
  | `source_identifier_type` | 19082 | 1 | UCE species_chrom human gene symbol | Type of source identifier used by the original embedding. |
34
+ | `source_key_count` | 19082 | 2 | 1<br>2 | Number of source gene tokens mapped or collapsed to this final master-table gene. |
35
+ | `source_keys_examples` | 19082 | 19082 | TSPAN6<br>TNMD<br>DPM1<br>SCYL3 | Example source gene-token identifiers mapped to this final master-table gene. |
36
  | `source_row_indices_examples` | 19082 | 19082 | 18962<br>18961<br>12000<br>750 | Example source row indices mapped to this final gene. |
37
+ | `source_chromosomes_examples` | 19082 | 32 | X<br>20<br>1<br>6 | Example source chromosome labels from the UCE token metadata for source records mapped to this final gene. |
38
+ | `source_starts_examples` | 19082 | 19078 | 100632063<br>100584936<br>50936148<br>169853074 | Example source genomic start coordinates from the UCE token metadata for source records mapped to this final gene. |
39
  | `mapping_methods` | 19082 | 3 | symbol_current_or_hgnc_approved_exact_unique<br>symbol_hgnc_previous_exact_unique<br>symbol_current_or_hgnc_approved_exact_unique;symbol_hgnc_previous_exact_unique | Mapping methods used to connect source records to the master gene table. |
40
 
 
41
 
 
 
 
 
 
 
 
42
 
43
  ## Detailed processing notes
44
 
45
+ ### Source and interpretation
46
+
47
+ This embedding is a fixed gene-level representation derived from the official Universal Cell Embedding model resources. UCE is a single-cell foundation model, but this project required one stable vector per gene rather than cell-context-dependent transformer outputs.
48
+
49
+ The retained representation uses the official human token segment from the UCE token resources and the UCE encoder projection to generate fixed 1,280-dimensional gene vectors. Contextual transformer layers were not used because those outputs depend on the input cell context and would not define a single reproducible vector per gene.
50
+
51
+ This embedding should therefore be interpreted as a protein-informed UCE gene-token representation, not as a contextualized UCE cell embedding.
52
+
53
+ ### Provenance fields
54
+
55
+ source_name: UCE 33L fixed gene-token embedding
56
+ original_model_or_method: Universal Cell Embedding / UCE 33L
57
+ input_data_type: official UCE token resources and model projection
58
+ embedding_generated_by: local extraction/generation from official UCE all_tokens and encoder projection
59
+ source_code_page: https://github.com/snap-stanford/UCE
60
+ source_files: all_tokens.torch and associated UCE model files
61
+ source_identifier_type: human UCE token gene symbol / token table entry
62
+ mapping_identifier_type: prioritized gene-symbol mapping to master_gene_table.csv
63
+ raw_or_token_aligned_human_rows: 19,790
64
+ model_output_dimension: 1,280
65
+ contextual_transformer_layers_used: no
66
+ fixed_gene_representation: yes
67
+ training_or_finetuning: none
68
+ final_embedding_dtype: float32
69
+
70
+ ### Mapping and extraction decisions
71
+
72
+ The UCE source was restricted to the human token-aligned segment. Source gene symbols were mapped to master_gene_table.csv using the project’s prioritized symbol mapping strategy. Only unique mappings were retained.
73
+
74
+ Contextual transformer layers were deliberately not used. Those layers are useful for cell-level analysis, but they require an input cell expression context. For this resource, the goal is a fixed gene vector that can be aligned with all other embeddings.
75
+
76
+ ### Processing workflow
77
+
78
+ For the UCE embedding:
79
+
80
+ 1. Load the official UCE token resources, including all_tokens.torch.
81
+ 2. Select the human token-aligned rows.
82
+ 3. Generate fixed gene vectors using the UCE encoder projection.
83
+ 4. Map source human gene tokens to master_gene_table.csv by prioritized symbol mapping.
84
+ 5. Exclude unmapped or ambiguous source tokens.
85
+ 6. Save the final matrix as float32.
86
+
87
+ ### Important implementation decisions
88
+
89
+ This is a fixed gene-token representation. It is not a cell embedding and not a contextualized transformer output averaged across cells.
90
+
91
+ The UCE contextual layers were not used because their output would vary depending on the input cell. This decision makes the result directly comparable to other static gene embeddings in the resource.
92
 
93
+ ### Summary of final mapping:
94
 
95
+ Source identifiers / token-aligned human rows: 19,790
96
+ Dimensions: 1,280
97
+ Final mapped genes: 19,082
98
+ Master table rows: 20,097
99
+ Master coverage: 94.95%
100
+ Contextual transformer layers used: no