danieltslz commited on
Commit
6b7791b
·
verified ·
1 Parent(s): d57e83b

Update curated README documentation: data/embeddings/hpa_subcellular_location_multihot_zscore/README.md

Browse files
data/embeddings/hpa_subcellular_location_multihot_zscore/README.md CHANGED
@@ -1,40 +1,22 @@
1
- # HPA-subcellular-location-multihot-zscore-v1.1
2
 
3
- Embedding ID: `hpa_subcellular_location_multihot_zscore`
4
-
5
- Former processing ID: `hpa_subcellular_location_multihot_zscore_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: `13581 genes × 50 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
 
@@ -46,28 +28,81 @@ assert X.shape[0] == len(genes)
46
  | `gene_type` | 13581 | 1 | protein_coding | Gene biotype, usually protein_coding. |
47
  | `entrez_id` | 13487 | 13482 | 7105<br>57147<br>55732<br>2268 | NCBI Entrez Gene identifier, when available. |
48
  | `uniprot_id` | 13571 | 13485 | O43657<br>Q8IZE3<br>Q9NSG2<br>P09769 | UniProt accession or identifier, when available. |
49
- | `hpa_gene` | 13581 | 13581 | ENSG00000000003<br>ENSG00000000457<br>ENSG00000000460<br>ENSG00000000938 | TODO: define this source-specific column during manual curation. |
50
- | `hpa_gene_name` | 13581 | 13577 | TSPAN6<br>SCYL3<br>C1orf112<br>FGR | TODO: define this source-specific column during manual curation. |
51
- | `hpa_reliability` | 13581 | 4 | Approved<br>Supported<br>Uncertain<br>Enhanced | TODO: define this source-specific column during manual curation. |
52
 
53
- ## Basic metadata
54
 
55
- | Field | Value |
56
- |---|---|
57
- | `status` | processed_qc_passed |
58
- | `modality` | protein subcellular localization |
59
- | `embedding_name` | HPA-subcellular-location-multihot-zscore-v1.1 |
60
 
61
  ## Detailed processing notes
62
 
63
- TODO: manually paste and curate the processing explanation for this embedding from the central project README.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
- Please include, when relevant:
66
 
67
- - original source/model/checkpoint;
68
- - whether the embedding was downloaded or generated locally;
69
- - input data used;
70
- - identifier mapping and filtering decisions;
71
- - pooling, aggregation, PCA, or normalization method;
72
- - coverage and important caveats;
73
- - license or redistribution notes.
 
 
 
 
 
1
+ # Embedding name: HPA-subcellular-location-multihot-zscore
2
 
3
+ - Modality: Protein localization / subcellular immunofluorescence annotation
4
+ - Algorithm: Binary multi-hot subcellular-location feature vector
5
+ - Embedding source URL: https://www.proteinatlas.org/humanproteome/subcellular/data
6
+ - Original model/code URL: Not applicable; source is a Human Protein Atlas subcellular-location data table, not a model/code release
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: `13581 genes × 50 dimensions`
17
  - Dtype: `float32`
 
 
 
 
 
 
 
18
 
 
19
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  ## genes.tsv columns
22
 
 
28
  | `gene_type` | 13581 | 1 | protein_coding | Gene biotype, usually protein_coding. |
29
  | `entrez_id` | 13487 | 13482 | 7105<br>57147<br>55732<br>2268 | NCBI Entrez Gene identifier, when available. |
30
  | `uniprot_id` | 13571 | 13485 | O43657<br>Q8IZE3<br>Q9NSG2<br>P09769 | UniProt accession or identifier, when available. |
31
+ | `hpa_gene` | 13581 | 13581 | ENSG00000000003<br>ENSG00000000457<br>ENSG00000000460<br>ENSG00000000938 | Original Ensembl gene identifier from the HPA subcellular-location source file. |
32
+ | `hpa_gene_name` | 13581 | 13577 | TSPAN6<br>SCYL3<br>C1orf112<br>FGR | Original gene name or symbol from the HPA subcellular source file. |
33
+ | `hpa_reliability` | 13581 | 4 | Approved<br>Supported<br>Uncertain<br>Enhanced | HPA reliability category for the source subcellular annotation. |
34
 
 
35
 
 
 
 
 
 
36
 
37
  ## Detailed processing notes
38
 
39
+ ### Source and interpretation
40
+
41
+ This embedding is a gene-level protein subcellular-localization representation derived from Human Protein Atlas subcellular-location annotations. It was generated locally from the HPA `subcellular_location.tsv.zip` table and mapped to master_gene_table.csv using Ensembl gene IDs.
42
+
43
+ The HPA source contains annotated subcellular locations for proteins. The `Main location`, `Additional location`, and `Extracellular location` fields were parsed as semicolon-separated location labels. A binary multi-hot vector was created over all parsed locations, so each gene can have more than one active location. Duplicate source annotations for the same mapped gene were collapsed by taking the maximum value per location. The final gene x location matrix was then z-scored location-wise across mapped genes.
44
+
45
+ This embedding should therefore be interpreted as a protein subcellular-localization profile. It is not a sequence embedding and not a continuous expression measurement. Each dimension corresponds to one parsed HPA subcellular-location label after binary multi-hot encoding and location-column z-score normalization.
46
+
47
+ ### Provenance fields
48
+
49
+ source_name: Human Protein Atlas subcellular location
50
+ original_model_or_method: HPA subcellular immunofluorescence annotations
51
+ input_data_type: protein subcellular-location annotations
52
+ input_source_file: subcellular_location.tsv.zip
53
+ source_download_page: https://www.proteinatlas.org/humanproteome/subcellular/data
54
+ source_identifier_type: Ensembl gene ID
55
+ mapping_identifier_type: Ensembl gene ID matched to master_gene_table.csv
56
+ source_rows_or_genes: 13,603
57
+ parsed_location_labels: 50
58
+ reliability_counts: Approved=6,999; Supported=4,582; Enhanced=1,230; Uncertain=792
59
+ feature_construction: binary multi-hot vector over parsed subcellular-location labels
60
+ duplicate_source_handling: collapse duplicates by maximum value per location
61
+ transformation: location-column z-score across mapped genes
62
+ final_embedding_dtype: float32
63
+
64
+ ### Mapping and localization-processing decisions
65
+
66
+ The HPA source gene identifier was an Ensembl gene ID. HPA gene IDs were matched directly to `ensembl_gene_id` in master_gene_table.csv.
67
+
68
+ The location fields were treated as multi-label annotations. This is important because one protein can be annotated in multiple subcellular compartments. Therefore, the final representation uses binary multi-hot encoding rather than assigning each gene to only one location.
69
+
70
+ The z-score transformation was applied location-wise across mapped genes, not gene-wise across locations. This makes each location feature comparable across genes.
71
+
72
+ Coverage is lower than sequence-based embeddings because HPA subcellular localization is an experimentally annotated immunofluorescence resource and does not cover every master-table gene.
73
+
74
+ ### Processing workflow
75
+
76
+ For the HPA subcellular-location embedding:
77
+
78
+ 1. Read HPA subcellular_location.tsv.zip.
79
+ 2. Parse HPA Ensembl gene IDs and gene names.
80
+ 3. Parse Main location, Additional location, and Extracellular location as semicolon-separated labels.
81
+ 4. Build the full set of parsed subcellular-location labels.
82
+ 5. Create a binary multi-hot vector over the 50 parsed locations for each source gene.
83
+ 6. Match HPA Ensembl gene IDs to master_gene_table.csv.
84
+ 7. Collapse duplicate source annotations for the same mapped gene by maximum value per location.
85
+ 8. Z-score each location column across mapped genes.
86
+ 9. Save the final matrix as float32.
87
+
88
+ ### Important implementation decisions
89
+
90
+ Multi-hot encoding was used because subcellular localization is naturally multi-label. A single-label encoding would discard real biological information when proteins localize to multiple compartments.
91
+
92
+ Duplicates were collapsed by maximum value rather than averaging. This keeps the interpretation binary before z-scoring: if a location was annotated for a gene in any source row, that location is present.
93
+
94
+ The HPA reliability categories were retained as source provenance information, but the final embedding is based on parsed location labels rather than reliability scores.
95
 
96
+ ### Summary of final mapping:
97
 
98
+ Source identifiers / HPA subcellular source rows or genes: 13,603
99
+ Dimensions: 50
100
+ Parsed location labels: 50
101
+ Rows generated before duplicate collapse: 13,581
102
+ Unmapped source genes: 22
103
+ Ambiguous source rows: 0
104
+ Final mapped genes: 13,581
105
+ Master table rows: 20,097
106
+ Master coverage: 67.58%
107
+ Duplicate/source annotations collapsed by max: yes
108
+ Duplicate final mappings averaged: 0