pvd232 commited on
Commit
6d49d90
·
verified ·
1 Parent(s): aaada7f

Restore pre-migration small artifacts 1

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/MANIFEST.json +124 -0
  2. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/README.md +73 -0
  3. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/REPRODUCE.md +83 -0
  4. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_manifest.json +0 -0
  5. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_protein_sequences.json +0 -0
  6. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_summary.json +19 -0
  7. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_vocab.json +0 -0
  8. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/scripts/build_tf_atlas_morf_isoform_inputs.py +146 -0
  9. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/scripts/generate_esmc.py +393 -0
  10. processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/tf_atlas_morf_isoforms_esmc_600m_mean_non_special.meta.json +30 -0
  11. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/MANIFEST.json +139 -0
  12. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/README.md +58 -0
  13. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/REPRODUCE.md +93 -0
  14. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/rebuilt_from_raw/tf_atlas_raw_direct_identity_records.json +0 -0
  15. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/rebuilt_from_raw/tf_atlas_raw_direct_identity_summary.json +14 -0
  16. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/rebuilt_from_raw/tf_atlas_raw_direct_tf_symbol_vocab.json +719 -0
  17. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_identity_records.json +0 -0
  18. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_identity_summary.json +14 -0
  19. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_regulator_sequences.json +0 -0
  20. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_tf_symbol_vocab.json +719 -0
  21. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_identity_audit.json +305 -0
  22. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/scripts/acquire_protein_sequences.py +282 -0
  23. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/scripts/build_tf_atlas_raw_direct_inputs.py +96 -0
  24. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/scripts/generate_esmc.py +393 -0
  25. processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/tf_atlas_raw_direct_esmc_600m_mean_non_special.meta.json +30 -0
  26. raw_sources/protein_models/esm3/MANIFEST.json +256 -0
  27. raw_sources/protein_models/esm3/README.md +54 -0
  28. raw_sources/protein_models/esm3/esm3-sm-open-v1/.gitattributes +35 -0
  29. raw_sources/protein_models/esm3/esm3-sm-open-v1/DOWNLOAD_STARTED_UTC.txt +1 -0
  30. raw_sources/protein_models/esm3/esm3-sm-open-v1/README.md +70 -0
  31. raw_sources/protein_models/esm3/esm3-sm-open-v1/config.json +1 -0
  32. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/1utn.pdb +0 -0
  33. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/ParentChildTreeFile.txt +0 -0
  34. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/entry_list_safety_29026.list +0 -0
  35. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/esm3_entry.list +0 -0
  36. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/interpro2keywords.csv +0 -0
  37. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/interpro_29026_to_keywords_58641.csv +0 -0
  38. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/keyword_vocabulary_safety_filtered_58641.txt +0 -0
  39. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/keywords.txt +0 -0
  40. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/tag_dict_4.json +0 -0
  41. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/tag_dict_4_safety_filtered.json +0 -0
  42. raw_sources/protein_models/esm3/esm3-sm-open-v1/data/uniref90_and_mgnify90_residue_annotations_gt_1k_proteins.csv +0 -0
  43. raw_sources/protein_models/esm3/esm3-sm-open-v1/download.log +78 -0
  44. raw_sources/protein_models/esm3/requirements-esm3.txt +2 -0
  45. raw_sources/protein_models/esmc/MANIFEST.json +117 -0
  46. raw_sources/protein_models/esmc/README.md +53 -0
  47. raw_sources/protein_models/esmc/esmc-300m-2024-12/.gitattributes +35 -0
  48. raw_sources/protein_models/esmc/esmc-300m-2024-12/DOWNLOAD_STARTED_UTC.txt +1 -0
  49. raw_sources/protein_models/esmc/esmc-300m-2024-12/README.md +30 -0
  50. raw_sources/protein_models/esmc/esmc-300m-2024-12/config.json +1 -0
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/MANIFEST.json ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "1.0",
3
+ "generated_utc": "2026-04-15T22:31:24Z",
4
+ "artifact_name": "tf_atlas_morf_isoforms_esmc_600m_mean_non_special",
5
+ "source": {
6
+ "paper": "Joung et al. TF Atlas",
7
+ "local_pdf": "readings/Joung_TFAtlas.pdf",
8
+ "source_table": "source/Sup_data_1.xlsx",
9
+ "source_table_title": "Data S1 | TF splice isoforms in the MORF library",
10
+ "source_table_sha256": "5b228ad02760a85fa5d38cf1408a9fd3e662e46ff2c1dc211bf1ec37c84f0dd5",
11
+ "library_rows_including_controls": 3550,
12
+ "tf_isoforms_excluding_controls": 3548,
13
+ "unique_tf_genes_excluding_controls": 1836,
14
+ "excluded_controls": [
15
+ "GFP",
16
+ "mCherry"
17
+ ],
18
+ "source_counts": {
19
+ "Genewiz": 2955,
20
+ "Broad GPP": 593,
21
+ "Neither": 2
22
+ }
23
+ },
24
+ "sequence_input": {
25
+ "vocab_path": "metadata/tf_atlas_morf_isoform_vocab.json",
26
+ "sequence_path": "metadata/tf_atlas_morf_isoform_protein_sequences.json",
27
+ "isoform_manifest_path": "metadata/tf_atlas_morf_isoform_manifest.json",
28
+ "translation": "standard genetic code from Data S1 ORF sequence column",
29
+ "min_protein_aa_length": 50,
30
+ "max_protein_aa_length": 3230,
31
+ "protein_aa_length_gt_2048": 49,
32
+ "max_length_used_for_embedding": 4096,
33
+ "vocab_sha256": "7764fe311387fffee349dbe85faa4705cc63eb3519fe767d691eac3167bc5121",
34
+ "sequence_sha256": "75d724d97145bf364bdf3f74e11737c418f3f3f6d600ea5b14d9becafd694499"
35
+ },
36
+ "model": {
37
+ "name": "esmc-600m-2024-12",
38
+ "hf_repo_id": "EvolutionaryScale/esmc-600m-2024-12",
39
+ "snapshot_commit": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
40
+ "snapshot_dir": "data/raw/protein/esmc/esmc-600m-2024-12",
41
+ "pool": "mean_non_special",
42
+ "max_length": 4096,
43
+ "dimension": 1152,
44
+ "device": "cuda",
45
+ "use_flash_attn": true,
46
+ "packages": {
47
+ "esm": "3.2.1",
48
+ "torch": "2.10.0+cu129",
49
+ "numpy": "1.26.4"
50
+ }
51
+ },
52
+ "embedding": {
53
+ "path": "tf_atlas_morf_isoforms_esmc_600m_mean_non_special.npy",
54
+ "mask_path": "tf_atlas_morf_isoforms_esmc_600m_mean_non_special_mask.npy",
55
+ "meta_path": "tf_atlas_morf_isoforms_esmc_600m_mean_non_special.meta.json",
56
+ "shape": [
57
+ 3548,
58
+ 1152
59
+ ],
60
+ "dtype": "float32",
61
+ "finite": true,
62
+ "mask_sum": 3548,
63
+ "mean_abs": 0.013355808332562447,
64
+ "row_l2_norm_min": 0.7018150091171265,
65
+ "row_l2_norm_max": 1.7721850872039795
66
+ },
67
+ "reproducibility": {
68
+ "scripts": [
69
+ "scripts/build_tf_atlas_morf_isoform_inputs.py",
70
+ "scripts/generate_esmc.py"
71
+ ],
72
+ "commands": "REPRODUCE.md"
73
+ },
74
+ "checksums": {
75
+ "README.md": {
76
+ "sha256": "2b7c6c9a3235693e6f600f744922563dc4555ec5ebfb7d361c612d4655c0390a",
77
+ "bytes": 2550
78
+ },
79
+ "REPRODUCE.md": {
80
+ "sha256": "04a41d8e3c352dace8d8265dcf46aa4ae8410d97c8ab87739e2437da27161a2d",
81
+ "bytes": 2605
82
+ },
83
+ "metadata/tf_atlas_morf_isoform_manifest.json": {
84
+ "sha256": "f2aa5e015c8967a73583547d8e6cffe1cf7847c92cfb5aa8ac943109739390c4",
85
+ "bytes": 1416236
86
+ },
87
+ "metadata/tf_atlas_morf_isoform_protein_sequences.json": {
88
+ "sha256": "75d724d97145bf364bdf3f74e11737c418f3f3f6d600ea5b14d9becafd694499",
89
+ "bytes": 2152477
90
+ },
91
+ "metadata/tf_atlas_morf_isoform_summary.json": {
92
+ "sha256": "97dd8ff6b48e420ae4bdf3ac65bfebbdb05bd781874a23abc2e05ce2d0110464",
93
+ "bytes": 598
94
+ },
95
+ "metadata/tf_atlas_morf_isoform_vocab.json": {
96
+ "sha256": "7764fe311387fffee349dbe85faa4705cc63eb3519fe767d691eac3167bc5121",
97
+ "bytes": 103546
98
+ },
99
+ "scripts/build_tf_atlas_morf_isoform_inputs.py": {
100
+ "sha256": "bbb85e35ee7b77788ad377fc0f563b2a59e37be81d5c39ff1232e3cb90ab0895",
101
+ "bytes": 5549
102
+ },
103
+ "scripts/generate_esmc.py": {
104
+ "sha256": "7f800d3ab6fc9e4191fa92e44c4a4e4de65dbe83a0e2ef60c0a3f8fc1bb05b3b",
105
+ "bytes": 14896
106
+ },
107
+ "source/Sup_data_1.xlsx": {
108
+ "sha256": "5b228ad02760a85fa5d38cf1408a9fd3e662e46ff2c1dc211bf1ec37c84f0dd5",
109
+ "bytes": 2479253
110
+ },
111
+ "tf_atlas_morf_isoforms_esmc_600m_mean_non_special.meta.json": {
112
+ "sha256": "4c127557ad4fb3c3443e023c166fee9ce81c8bb0a25f1fb1837f88bfeb962e1b",
113
+ "bytes": 1525
114
+ },
115
+ "tf_atlas_morf_isoforms_esmc_600m_mean_non_special.npy": {
116
+ "sha256": "727a7f3bb3677b527f34c921a460e423fa7e4ff1b92699d984a4d2f8c0f19957",
117
+ "bytes": 16349312
118
+ },
119
+ "tf_atlas_morf_isoforms_esmc_600m_mean_non_special_mask.npy": {
120
+ "sha256": "fd6ed7fd4c0e0c59e8ef4ddaedac6af4b762544421e99fb34e01b9de6bbf5072",
121
+ "bytes": 3676
122
+ }
123
+ }
124
+ }
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TF Atlas MORF isoform ESM-C 600M embeddings
2
+
3
+ This directory contains the corrected full isoform-level ESM-C embedding artifact for the Joung TF Atlas MORF library.
4
+
5
+ The identity source is `Data S1 | TF splice isoforms in the MORF library`, downloaded from the Joung TF Atlas PMC supplement. Data S1 defines the full MORF library as 3,548 TF splice isoforms across 1,836 TF genes, plus two controls.
6
+
7
+ ## Artifact
8
+
9
+ - Embedding matrix: `tf_atlas_morf_isoforms_esmc_600m_mean_non_special.npy`
10
+ - Mask: `tf_atlas_morf_isoforms_esmc_600m_mean_non_special_mask.npy`
11
+ - Model metadata: `tf_atlas_morf_isoforms_esmc_600m_mean_non_special.meta.json`
12
+ - Shape: `3548 x 1152`
13
+ - Dtype: `float32`
14
+ - Pooling: mean over non-special ESM-C tokens
15
+ - Model: `EvolutionaryScale/esmc-600m-2024-12`
16
+ - Snapshot commit: `d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e`
17
+ - Maximum sequence length: `4096`
18
+
19
+ ## Identity Contract
20
+
21
+ The MORF library table contains 3,550 rows:
22
+
23
+ - TF splice isoforms: `3,548`
24
+ - Unique TF genes: `1,836`
25
+ - Controls excluded from the embedding matrix: `GFP`, `mCherry`
26
+ - Genewiz constructs: `2,955`
27
+ - Broad GPP constructs: `593`
28
+ - Control constructs: `2`
29
+
30
+ Each embedding row is keyed by:
31
+
32
+ ```text
33
+ <TFORF id>-<gene symbol>-<isoform id>
34
+ ```
35
+
36
+ Example:
37
+
38
+ ```text
39
+ TFORF0001-HIF3A-HIF3A-1
40
+ ```
41
+
42
+ ## Sequence Contract
43
+
44
+ The input sequence is translated directly from the Data S1 `ORF sequence` column using the standard genetic code.
45
+
46
+ - Minimum protein length: `50`
47
+ - Maximum protein length: `3230`
48
+ - Proteins longer than 2048 amino acids: `49`
49
+ - ESM-C generation used `--max-length 4096`, so none of the MORF proteins are truncated by the generator.
50
+
51
+ ## Files
52
+
53
+ - `source/Sup_data_1.xlsx`: downloaded Data S1 source table.
54
+ - `metadata/tf_atlas_morf_isoform_manifest.json`: per-isoform metadata.
55
+ - `metadata/tf_atlas_morf_isoform_vocab.json`: embedding row order.
56
+ - `metadata/tf_atlas_morf_isoform_protein_sequences.json`: translated amino-acid sequences.
57
+ - `metadata/tf_atlas_morf_isoform_summary.json`: count and length summary.
58
+ - `scripts/build_tf_atlas_morf_isoform_inputs.py`: Data S1 parser and translator.
59
+ - `scripts/generate_esmc.py`: ESM-C embedding generator.
60
+ - `REPRODUCE.md`: exact reproduction commands.
61
+ - `MANIFEST.json`: machine-readable provenance, shape, validation, and checksums.
62
+
63
+ ## Validation
64
+
65
+ The generated matrix was validated locally:
66
+
67
+ - Shape: `3548 x 1152`
68
+ - Mask sum: `3548`
69
+ - Finite values: `true`
70
+ - Mean absolute embedding value: `0.013355808332562447`
71
+ - Minimum row L2 norm: `0.7018150091171265`
72
+ - Maximum row L2 norm: `1.7721850872039795`
73
+
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/REPRODUCE.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Reproduce TF Atlas MORF isoform ESM-C embeddings
2
+
3
+ Run from the MANTRA repository root.
4
+
5
+ ## 1. Build isoform-level protein sequences
6
+
7
+ ```bash
8
+ python data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/scripts/build_tf_atlas_morf_isoform_inputs.py \
9
+ --sup-data-1 data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/source/Sup_data_1.xlsx \
10
+ --out-dir data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/metadata
11
+ ```
12
+
13
+ Expected summary:
14
+
15
+ ```json
16
+ {
17
+ "library_rows_including_controls": 3550,
18
+ "tf_isoforms_excluding_controls": 3548,
19
+ "unique_tf_genes_excluding_controls": 1836,
20
+ "controls": [
21
+ "GFP",
22
+ "mCherry"
23
+ ],
24
+ "source_counts": {
25
+ "Genewiz": 2955,
26
+ "Broad GPP": 593,
27
+ "Neither": 2
28
+ },
29
+ "min_protein_aa_length": 50,
30
+ "max_protein_aa_length": 3230,
31
+ "protein_aa_length_gt_2048": 49
32
+ }
33
+ ```
34
+
35
+ ## 2. Generate ESM-C 600M embeddings
36
+
37
+ ```bash
38
+ PYTHONPATH=src:. PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python -m mantra.embeddings.generate_esmc \
39
+ --model-size 600m \
40
+ --device cuda \
41
+ --max-length 4096 \
42
+ --vocab-path data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_vocab.json \
43
+ --sequence-path data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_protein_sequences.json \
44
+ --out-dir data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m \
45
+ --out-prefix tf_atlas_morf_isoforms_esmc_600m_mean_non_special
46
+ ```
47
+
48
+ Expected output:
49
+
50
+ - `tf_atlas_morf_isoforms_esmc_600m_mean_non_special.npy`
51
+ - `tf_atlas_morf_isoforms_esmc_600m_mean_non_special_mask.npy`
52
+ - `tf_atlas_morf_isoforms_esmc_600m_mean_non_special.meta.json`
53
+
54
+ ## 3. Validate
55
+
56
+ ```bash
57
+ python - <<'PY'
58
+ import json
59
+ import numpy as np
60
+ from pathlib import Path
61
+
62
+ base = Path("data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/tf_atlas_morf_isoforms_esmc_600m_mean_non_special")
63
+ E = np.load(str(base) + ".npy")
64
+ mask = np.load(str(base) + "_mask.npy")
65
+ meta = json.load(open(str(base) + ".meta.json"))
66
+ print(E.shape)
67
+ print(E.dtype)
68
+ print(np.isfinite(E).all())
69
+ print(int(mask.sum()), len(mask))
70
+ print(meta["n_vocab"], meta["n_embedded"], meta["dimension"], meta["max_length"])
71
+ PY
72
+ ```
73
+
74
+ Expected validation:
75
+
76
+ ```text
77
+ (3548, 1152)
78
+ float32
79
+ True
80
+ 3548 3548
81
+ 3548 3548 1152 4096
82
+ ```
83
+
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_manifest.json ADDED
The diff for this file is too large to render. See raw diff
 
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_protein_sequences.json ADDED
The diff for this file is too large to render. See raw diff
 
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_summary.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source_file": "data/processed/embeddings/registry/compat_mechanistic_context/source_bundles/tf_atlas_joung_2023/Sup_data_1.pmc_download.xlsx",
3
+ "source_sha256": "5b228ad02760a85fa5d38cf1408a9fd3e662e46ff2c1dc211bf1ec37c84f0dd5",
4
+ "library_rows_including_controls": 3550,
5
+ "tf_isoforms_excluding_controls": 3548,
6
+ "unique_tf_genes_excluding_controls": 1836,
7
+ "controls": [
8
+ "GFP",
9
+ "mCherry"
10
+ ],
11
+ "source_counts": {
12
+ "Genewiz": 2955,
13
+ "Broad GPP": 593,
14
+ "Neither": 2
15
+ },
16
+ "min_protein_aa_length": 50,
17
+ "max_protein_aa_length": 3230,
18
+ "protein_aa_length_gt_2048": 49
19
+ }
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/scripts/build_tf_atlas_morf_isoform_inputs.py ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build ESM-C inputs for the full Joung MORF TF isoform library."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import hashlib
8
+ import json
9
+ import re
10
+ from collections import Counter
11
+ from pathlib import Path
12
+
13
+ import pandas as pd
14
+
15
+
16
+ CONTROLS = {"GFP", "mCherry"}
17
+ CODON_TABLE = {
18
+ "TTT": "F", "TTC": "F", "TTA": "L", "TTG": "L",
19
+ "TCT": "S", "TCC": "S", "TCA": "S", "TCG": "S",
20
+ "TAT": "Y", "TAC": "Y", "TAA": "*", "TAG": "*",
21
+ "TGT": "C", "TGC": "C", "TGA": "*", "TGG": "W",
22
+ "CTT": "L", "CTC": "L", "CTA": "L", "CTG": "L",
23
+ "CCT": "P", "CCC": "P", "CCA": "P", "CCG": "P",
24
+ "CAT": "H", "CAC": "H", "CAA": "Q", "CAG": "Q",
25
+ "CGT": "R", "CGC": "R", "CGA": "R", "CGG": "R",
26
+ "ATT": "I", "ATC": "I", "ATA": "I", "ATG": "M",
27
+ "ACT": "T", "ACC": "T", "ACA": "T", "ACG": "T",
28
+ "AAT": "N", "AAC": "N", "AAA": "K", "AAG": "K",
29
+ "AGT": "S", "AGC": "S", "AGA": "R", "AGG": "R",
30
+ "GTT": "V", "GTC": "V", "GTA": "V", "GTG": "V",
31
+ "GCT": "A", "GCC": "A", "GCA": "A", "GCG": "A",
32
+ "GAT": "D", "GAC": "D", "GAA": "E", "GAG": "E",
33
+ "GGT": "G", "GGC": "G", "GGA": "G", "GGG": "G",
34
+ }
35
+
36
+
37
+ def sha256_file(path: Path) -> str:
38
+ digest = hashlib.sha256()
39
+ with path.open("rb") as handle:
40
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
41
+ digest.update(chunk)
42
+ return digest.hexdigest()
43
+
44
+
45
+ def clean_dna(value: object) -> str:
46
+ dna = re.sub(r"\s+", "", str(value).upper())
47
+ if not re.fullmatch(r"[ACGTN]+", dna):
48
+ raise ValueError("ORF sequence contains non-DNA characters")
49
+ if len(dna) % 3:
50
+ raise ValueError("ORF sequence length is not divisible by three")
51
+ return dna
52
+
53
+
54
+ def translate_orf(dna: str) -> str:
55
+ aa = "".join(CODON_TABLE.get(dna[idx : idx + 3], "X") for idx in range(0, len(dna), 3))
56
+ if "*" in aa:
57
+ raise ValueError("translated ORF contains a stop codon")
58
+ return aa
59
+
60
+
61
+ def make_isoform_id(row: pd.Series) -> str:
62
+ name = str(row["Name"]).strip()
63
+ gene = str(row["RefSeq Gene Name"]).strip()
64
+ isoform = str(row["Isoform ID"]).strip()
65
+ return f"{name}-{gene}-{isoform}"
66
+
67
+
68
+ def main() -> int:
69
+ parser = argparse.ArgumentParser()
70
+ parser.add_argument("--sup-data-1", required=True, type=Path)
71
+ parser.add_argument("--out-dir", required=True, type=Path)
72
+ args = parser.parse_args()
73
+
74
+ args.out_dir.mkdir(parents=True, exist_ok=True)
75
+ df = pd.read_excel(args.sup_data_1, sheet_name="Data S1", header=1)
76
+ required = [
77
+ "Source",
78
+ "Name",
79
+ "RefSeq Gene Name",
80
+ "RefSeq and Gencode ID",
81
+ "Isoform ID",
82
+ "ORF sequence",
83
+ "Barcode Sequence",
84
+ "Epitope Tag",
85
+ ]
86
+ missing = [column for column in required if column not in df.columns]
87
+ if missing:
88
+ raise ValueError(f"missing expected columns: {missing}")
89
+
90
+ records = []
91
+ sequences = {}
92
+ for _, row in df.iterrows():
93
+ gene = str(row["RefSeq Gene Name"]).strip()
94
+ is_control = gene in CONTROLS
95
+ dna = clean_dna(row["ORF sequence"])
96
+ aa = translate_orf(dna)
97
+ isoform_id = make_isoform_id(row)
98
+ record = {
99
+ "isoform_embedding_id": isoform_id,
100
+ "name": str(row["Name"]).strip(),
101
+ "source": str(row["Source"]).strip(),
102
+ "gene_symbol": gene,
103
+ "refseq_and_gencode_id": str(row["RefSeq and Gencode ID"]).strip(),
104
+ "isoform_id": str(row["Isoform ID"]).strip(),
105
+ "barcode_sequence": str(row["Barcode Sequence"]).strip(),
106
+ "epitope_tag": str(row["Epitope Tag"]).strip(),
107
+ "orf_nt_length": len(dna),
108
+ "protein_aa_length": len(aa),
109
+ "is_control": is_control,
110
+ }
111
+ records.append(record)
112
+ if not is_control:
113
+ sequences[isoform_id] = aa
114
+
115
+ vocab = [record["isoform_embedding_id"] for record in records if not record["is_control"]]
116
+ if len(records) != 3550:
117
+ raise ValueError(f"expected 3550 MORF rows including controls; got {len(records)}")
118
+ if len(vocab) != 3548:
119
+ raise ValueError(f"expected 3548 non-control TF isoforms; got {len(vocab)}")
120
+ if len(vocab) != len(set(vocab)):
121
+ raise ValueError("isoform embedding ids are not unique")
122
+
123
+ lengths = [record["protein_aa_length"] for record in records if not record["is_control"]]
124
+ summary = {
125
+ "source_file": str(args.sup_data_1),
126
+ "source_sha256": sha256_file(args.sup_data_1),
127
+ "library_rows_including_controls": len(records),
128
+ "tf_isoforms_excluding_controls": len(vocab),
129
+ "unique_tf_genes_excluding_controls": len({r["gene_symbol"] for r in records if not r["is_control"]}),
130
+ "controls": [r["gene_symbol"] for r in records if r["is_control"]],
131
+ "source_counts": dict(Counter(r["source"] for r in records)),
132
+ "min_protein_aa_length": min(lengths),
133
+ "max_protein_aa_length": max(lengths),
134
+ "protein_aa_length_gt_2048": sum(length > 2048 for length in lengths),
135
+ }
136
+
137
+ (args.out_dir / "tf_atlas_morf_isoform_manifest.json").write_text(json.dumps(records, indent=2) + "\n")
138
+ (args.out_dir / "tf_atlas_morf_isoform_vocab.json").write_text(json.dumps(vocab, indent=2) + "\n")
139
+ (args.out_dir / "tf_atlas_morf_isoform_protein_sequences.json").write_text(json.dumps(sequences, indent=2) + "\n")
140
+ (args.out_dir / "tf_atlas_morf_isoform_summary.json").write_text(json.dumps(summary, indent=2) + "\n")
141
+ print(json.dumps(summary, indent=2))
142
+ return 0
143
+
144
+
145
+ if __name__ == "__main__":
146
+ raise SystemExit(main())
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/scripts/generate_esmc.py ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ from dataclasses import dataclass, field
5
+ from datetime import datetime, timezone
6
+ import hashlib
7
+ import json
8
+ from pathlib import Path
9
+ from typing import Any, Protocol
10
+
11
+ import numpy as np
12
+
13
+ from mantra.embeddings.generate_esm3 import POOL_MODES, pool_token_embeddings, sanitize_sequence
14
+
15
+
16
+ DEFAULT_META_DIR = Path("data/processed/metadata")
17
+ DEFAULT_SNAPSHOT_ROOT = Path("data/raw/protein/esmc")
18
+ DEFAULT_OUT_ROOT = Path("data/processed/embeddings/registry/protein_sequence/source_gene_artifacts")
19
+ DEFAULT_MODEL_SIZE = "300m"
20
+ DEFAULT_POOL = "mean_non_special"
21
+
22
+ ESMC_MODELS: dict[str, dict[str, Any]] = {
23
+ "300m": {
24
+ "repo_id": "EvolutionaryScale/esmc-300m-2024-12",
25
+ "revision": "a19d363f07313a10a64d08a2d6b41376a73df5c8",
26
+ "snapshot_name": "esmc-300m-2024-12",
27
+ "weight_path": "data/weights/esmc_300m_2024_12_v0.pth",
28
+ "builder": "ESMC_300M_202412",
29
+ "dimension": 960,
30
+ },
31
+ "600m": {
32
+ "repo_id": "EvolutionaryScale/esmc-600m-2024-12",
33
+ "revision": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
34
+ "snapshot_name": "esmc-600m-2024-12",
35
+ "weight_path": "data/weights/esmc_600m_2024_12_v0.pth",
36
+ "builder": "ESMC_600M_202412",
37
+ "dimension": 1152,
38
+ },
39
+ }
40
+
41
+
42
+ class SequenceExtractor(Protocol):
43
+ def embed(self, sequence: str) -> np.ndarray:
44
+ raise NotImplementedError
45
+
46
+
47
+ @dataclass(frozen=True)
48
+ class EsmcGenerationConfig:
49
+ model_size: str = DEFAULT_MODEL_SIZE
50
+ meta_dir: Path = DEFAULT_META_DIR
51
+ snapshot_root: Path = DEFAULT_SNAPSHOT_ROOT
52
+ snapshot_dir: Path | None = None
53
+ out_root: Path = DEFAULT_OUT_ROOT
54
+ out_dir: Path | None = None
55
+ out_prefix: str | None = None
56
+ vocab_path: Path | None = None
57
+ sequence_path: Path | None = None
58
+ device: str = "auto"
59
+ pool: str = DEFAULT_POOL
60
+ max_length: int = 2048
61
+ limit: int | None = None
62
+ use_flash_attn: bool = True
63
+
64
+ @property
65
+ def model_info(self) -> dict[str, Any]:
66
+ if self.model_size not in ESMC_MODELS:
67
+ raise ValueError(f"model_size must be one of {tuple(ESMC_MODELS)}; got {self.model_size!r}")
68
+ return ESMC_MODELS[self.model_size]
69
+
70
+ @property
71
+ def resolved_snapshot_dir(self) -> Path:
72
+ return self.snapshot_dir if self.snapshot_dir is not None else self.snapshot_root / self.model_info["snapshot_name"]
73
+
74
+ @property
75
+ def resolved_out_dir(self) -> Path:
76
+ return self.out_dir if self.out_dir is not None else self.out_root / self.model_info["snapshot_name"].replace("-", "_")
77
+
78
+ @property
79
+ def resolved_out_prefix(self) -> str:
80
+ return self.out_prefix if self.out_prefix is not None else f"{self.model_info['snapshot_name'].replace('-', '_')}_{self.pool}"
81
+
82
+ @property
83
+ def resolved_vocab_path(self) -> Path:
84
+ return self.vocab_path if self.vocab_path is not None else self.meta_dir / "vocab_k562_gwps_full.json"
85
+
86
+ @property
87
+ def resolved_sequence_path(self) -> Path:
88
+ return self.sequence_path if self.sequence_path is not None else self.meta_dir / "regulator_sequences.json"
89
+
90
+ @property
91
+ def embedding_path(self) -> Path:
92
+ return self.resolved_out_dir / f"{self.resolved_out_prefix}.npy"
93
+
94
+ @property
95
+ def mask_path(self) -> Path:
96
+ return self.resolved_out_dir / f"{self.resolved_out_prefix}_mask.npy"
97
+
98
+ @property
99
+ def metadata_path(self) -> Path:
100
+ return self.resolved_out_dir / f"{self.resolved_out_prefix}.meta.json"
101
+
102
+
103
+ @dataclass
104
+ class EsmcSequenceExtractor:
105
+ model_size: str = DEFAULT_MODEL_SIZE
106
+ snapshot_root: Path = DEFAULT_SNAPSHOT_ROOT
107
+ snapshot_dir: Path | None = None
108
+ device: str = "auto"
109
+ pool: str = DEFAULT_POOL
110
+ max_length: int = 2048
111
+ use_flash_attn: bool = True
112
+ _model: Any = field(default=None, init=False, repr=False)
113
+ _esm_protein: Any = field(default=None, init=False, repr=False)
114
+ _logits_config: Any = field(default=None, init=False, repr=False)
115
+ _resolved_device: str | None = field(default=None, init=False, repr=False)
116
+
117
+ def __post_init__(self) -> None:
118
+ if self.model_size not in ESMC_MODELS:
119
+ raise ValueError(f"model_size must be one of {tuple(ESMC_MODELS)}; got {self.model_size!r}")
120
+ if self.pool not in POOL_MODES:
121
+ raise ValueError(f"pool must be one of {POOL_MODES}; got {self.pool!r}")
122
+ if self.max_length <= 0:
123
+ raise ValueError("max_length must be positive")
124
+
125
+ @property
126
+ def model_info(self) -> dict[str, Any]:
127
+ return ESMC_MODELS[self.model_size]
128
+
129
+ @property
130
+ def resolved_snapshot_dir(self) -> Path:
131
+ return self.snapshot_dir if self.snapshot_dir is not None else self.snapshot_root / self.model_info["snapshot_name"]
132
+
133
+ @property
134
+ def model(self) -> Any:
135
+ if self._model is None:
136
+ self._load_model()
137
+ return self._model
138
+
139
+ @property
140
+ def resolved_device(self) -> str:
141
+ if self._resolved_device is None:
142
+ self._resolved_device = resolve_device(self.device)
143
+ return self._resolved_device
144
+
145
+ def _load_model(self) -> None:
146
+ import esm.pretrained as pretrained
147
+ import esm.utils.constants.esm3 as constants
148
+ from esm.sdk.api import ESMProtein, LogitsConfig
149
+
150
+ snapshot_dir = self.resolved_snapshot_dir
151
+ assert_snapshot_complete(snapshot_dir, model_size=self.model_size)
152
+
153
+ def local_data_root(model: str) -> Path:
154
+ if str(model).startswith("esmc-300"):
155
+ return snapshot_dir if self.model_size == "300m" else self.snapshot_root / ESMC_MODELS["300m"]["snapshot_name"]
156
+ if str(model).startswith("esmc-600"):
157
+ return snapshot_dir if self.model_size == "600m" else self.snapshot_root / ESMC_MODELS["600m"]["snapshot_name"]
158
+ return snapshot_dir
159
+
160
+ constants.data_root = local_data_root
161
+ pretrained.data_root = local_data_root
162
+ builder = getattr(pretrained, self.model_info["builder"])
163
+ self._esm_protein = ESMProtein
164
+ self._logits_config = LogitsConfig
165
+ self._model = builder(self.resolved_device, use_flash_attn=self.use_flash_attn)
166
+ self._model.eval()
167
+
168
+ def embed(self, sequence: str) -> np.ndarray:
169
+ sequence_clean = sanitize_sequence(sequence, self.max_length)
170
+ if not sequence_clean:
171
+ raise ValueError("cannot embed an empty sequence")
172
+ protein = self._esm_protein(sequence=sequence_clean) if self._esm_protein is not None else None
173
+ if protein is None:
174
+ self._load_model()
175
+ protein = self._esm_protein(sequence=sequence_clean)
176
+ tokens = self.model.encode(protein)
177
+ logits_config = self._logits_config(return_embeddings=True)
178
+ import torch
179
+
180
+ with torch.inference_mode():
181
+ output = self.model.logits(tokens, logits_config)
182
+ embedding = output.embeddings.detach().float().cpu().numpy()
183
+ return pool_token_embeddings(embedding, pool=self.pool)
184
+
185
+
186
+ def resolve_device(device: str) -> str:
187
+ if device != "auto":
188
+ return device
189
+ import torch
190
+
191
+ return "cuda" if torch.cuda.is_available() else "cpu"
192
+
193
+
194
+ def utc_now_iso() -> str:
195
+ return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
196
+
197
+
198
+ def load_json(path: Path) -> Any:
199
+ with path.open("r", encoding="utf-8") as handle:
200
+ return json.load(handle)
201
+
202
+
203
+ def load_vocab(path: Path) -> list[str]:
204
+ payload = load_json(path)
205
+ if not isinstance(payload, list) or not all(isinstance(item, str) for item in payload):
206
+ raise ValueError(f"vocab must be a JSON string list: {path}")
207
+ return payload
208
+
209
+
210
+ def load_sequence_map(path: Path) -> dict[str, str]:
211
+ payload = load_json(path)
212
+ if not isinstance(payload, dict):
213
+ raise ValueError(f"sequence map must be a JSON object: {path}")
214
+ return {str(key): str(value) for key, value in payload.items() if str(value)}
215
+
216
+
217
+ def sha256_file(path: Path) -> str:
218
+ digest = hashlib.sha256()
219
+ with path.open("rb") as handle:
220
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
221
+ digest.update(chunk)
222
+ return digest.hexdigest()
223
+
224
+
225
+ def assert_snapshot_complete(snapshot_dir: Path, *, model_size: str) -> None:
226
+ if model_size not in ESMC_MODELS:
227
+ raise ValueError(f"model_size must be one of {tuple(ESMC_MODELS)}; got {model_size!r}")
228
+ required = (
229
+ ".gitattributes",
230
+ "README.md",
231
+ "config.json",
232
+ ESMC_MODELS[model_size]["weight_path"],
233
+ )
234
+ missing = [str(snapshot_dir / rel_path) for rel_path in required if not (snapshot_dir / rel_path).exists()]
235
+ if missing:
236
+ raise FileNotFoundError("ESM-C snapshot is incomplete:\n" + "\n".join(missing))
237
+
238
+
239
+ def package_versions() -> dict[str, str | None]:
240
+ versions: dict[str, str | None] = {}
241
+ for package in ("esm", "torch", "numpy"):
242
+ try:
243
+ module = __import__(package)
244
+ versions[package] = getattr(module, "__version__", None)
245
+ except Exception:
246
+ versions[package] = None
247
+ return versions
248
+
249
+
250
+ def build_metadata(
251
+ *,
252
+ config: EsmcGenerationConfig,
253
+ genes: list[str],
254
+ mask: np.ndarray,
255
+ dim: int,
256
+ embedding_path: Path,
257
+ ) -> dict[str, Any]:
258
+ info = config.model_info
259
+ return {
260
+ "schema_version": "1.0",
261
+ "generated_utc": utc_now_iso(),
262
+ "model": info["snapshot_name"],
263
+ "model_size": config.model_size,
264
+ "hf_repo_id": info["repo_id"],
265
+ "snapshot_dir": str(config.resolved_snapshot_dir),
266
+ "snapshot_commit": info["revision"],
267
+ "pool": config.pool,
268
+ "max_length": config.max_length,
269
+ "device": config.device,
270
+ "limit": config.limit,
271
+ "use_flash_attn": config.use_flash_attn,
272
+ "vocab_path": str(config.resolved_vocab_path),
273
+ "sequence_path": str(config.resolved_sequence_path),
274
+ "vocab_sha256": sha256_file(config.resolved_vocab_path),
275
+ "sequence_sha256": sha256_file(config.resolved_sequence_path),
276
+ "embedding_path": str(embedding_path),
277
+ "mask_path": str(config.mask_path),
278
+ "n_vocab": len(genes),
279
+ "n_embedded": int(mask.sum()),
280
+ "dimension": int(dim),
281
+ "expected_dimension": int(info["dimension"]),
282
+ "dtype": "float32",
283
+ "packages": package_versions(),
284
+ }
285
+
286
+
287
+ def generate_esmc_embeddings(
288
+ config: EsmcGenerationConfig,
289
+ *,
290
+ extractor: SequenceExtractor | None = None,
291
+ ) -> dict[str, Any]:
292
+ if config.pool not in POOL_MODES:
293
+ raise ValueError(f"pool must be one of {POOL_MODES}; got {config.pool!r}")
294
+ genes_all = load_vocab(config.resolved_vocab_path)
295
+ genes = genes_all[: config.limit] if config.limit is not None else genes_all
296
+ seq_map = load_sequence_map(config.resolved_sequence_path)
297
+ sequence_extractor = extractor or EsmcSequenceExtractor(
298
+ model_size=config.model_size,
299
+ snapshot_root=config.snapshot_root,
300
+ snapshot_dir=config.snapshot_dir,
301
+ device=config.device,
302
+ pool=config.pool,
303
+ max_length=config.max_length,
304
+ use_flash_attn=config.use_flash_attn,
305
+ )
306
+ rows: list[np.ndarray] = []
307
+ mask = np.zeros(len(genes), dtype=bool)
308
+ dim: int | None = None
309
+ for idx, gene in enumerate(genes):
310
+ sequence = sanitize_sequence(seq_map.get(gene, ""), config.max_length)
311
+ if not sequence:
312
+ if dim is None:
313
+ rows.append(np.zeros((0,), dtype=np.float32))
314
+ else:
315
+ rows.append(np.zeros((dim,), dtype=np.float32))
316
+ continue
317
+ vector = np.asarray(sequence_extractor.embed(sequence), dtype=np.float32)
318
+ if vector.ndim != 1:
319
+ raise ValueError(f"extractor returned non-vector embedding for {gene}: {vector.shape}")
320
+ if dim is None:
321
+ dim = int(vector.shape[0])
322
+ rows = [np.zeros((dim,), dtype=np.float32) if row.size == 0 else row for row in rows]
323
+ elif vector.shape[0] != dim:
324
+ raise ValueError(f"extractor dimension changed from {dim} to {vector.shape[0]} for {gene}")
325
+ rows.append(vector)
326
+ mask[idx] = True
327
+ if dim is None:
328
+ raise ValueError("no sequences were embedded; check the vocabulary and sequence map")
329
+ matrix = np.vstack(rows).astype(np.float32, copy=False)
330
+ config.resolved_out_dir.mkdir(parents=True, exist_ok=True)
331
+ np.save(config.embedding_path, matrix)
332
+ np.save(config.mask_path, mask)
333
+ metadata = build_metadata(
334
+ config=config,
335
+ genes=genes,
336
+ mask=mask,
337
+ dim=dim,
338
+ embedding_path=config.embedding_path,
339
+ )
340
+ config.metadata_path.write_text(json.dumps(metadata, indent=2) + "\n", encoding="utf-8")
341
+ return metadata
342
+
343
+
344
+ def parse_args(argv: list[str] | None = None) -> EsmcGenerationConfig:
345
+ parser = argparse.ArgumentParser(description="Generate local ESM-C protein embeddings.")
346
+ parser.add_argument("--model-size", choices=tuple(ESMC_MODELS), default=DEFAULT_MODEL_SIZE)
347
+ parser.add_argument("--meta-dir", type=Path, default=DEFAULT_META_DIR)
348
+ parser.add_argument("--snapshot-root", type=Path, default=DEFAULT_SNAPSHOT_ROOT)
349
+ parser.add_argument("--snapshot-dir", type=Path)
350
+ parser.add_argument("--out-root", type=Path, default=DEFAULT_OUT_ROOT)
351
+ parser.add_argument("--out-dir", type=Path)
352
+ parser.add_argument("--out-prefix", type=str)
353
+ parser.add_argument("--vocab-path", type=Path)
354
+ parser.add_argument("--sequence-path", type=Path)
355
+ parser.add_argument("--device", type=str, default="auto")
356
+ parser.add_argument("--pool", choices=POOL_MODES, default=DEFAULT_POOL)
357
+ parser.add_argument("--max-length", type=int, default=2048)
358
+ parser.add_argument("--limit", type=int)
359
+ parser.add_argument("--no-flash-attn", action="store_true")
360
+ args = parser.parse_args(argv)
361
+ return EsmcGenerationConfig(
362
+ model_size=args.model_size,
363
+ meta_dir=args.meta_dir,
364
+ snapshot_root=args.snapshot_root,
365
+ snapshot_dir=args.snapshot_dir,
366
+ out_root=args.out_root,
367
+ out_dir=args.out_dir,
368
+ out_prefix=args.out_prefix,
369
+ vocab_path=args.vocab_path,
370
+ sequence_path=args.sequence_path,
371
+ device=args.device,
372
+ pool=args.pool,
373
+ max_length=args.max_length,
374
+ limit=args.limit,
375
+ use_flash_attn=not args.no_flash_attn,
376
+ )
377
+
378
+ # Example invocation:
379
+ # PYTHONPATH=src:. python -m mantra.embeddings.generate_esmc \
380
+ # --device cuda \
381
+ # --vocab-path /tmp/mantra_one_tf_vocab.json \
382
+ # --sequence-path data/processed/metadata/regulator_sequences.json \
383
+ # --out-dir /tmp/mantra_esm3_gata1 \
384
+ # --out-prefix GATA1_esm3
385
+
386
+ def main(argv: list[str] | None = None) -> int:
387
+ metadata = generate_esmc_embeddings(parse_args(argv))
388
+ print(json.dumps(metadata, indent=2))
389
+ return 0
390
+
391
+
392
+ if __name__ == "__main__": # pragma: no cover
393
+ raise SystemExit(main())
processed/protein_embeddings/tf_atlas_morf_isoforms_esmc_600m/tf_atlas_morf_isoforms_esmc_600m_mean_non_special.meta.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "1.0",
3
+ "generated_utc": "2026-04-15T22:29:59Z",
4
+ "model": "esmc-600m-2024-12",
5
+ "model_size": "600m",
6
+ "hf_repo_id": "EvolutionaryScale/esmc-600m-2024-12",
7
+ "snapshot_dir": "data/raw/protein/esmc/esmc-600m-2024-12",
8
+ "snapshot_commit": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
9
+ "pool": "mean_non_special",
10
+ "max_length": 4096,
11
+ "device": "cuda",
12
+ "limit": null,
13
+ "use_flash_attn": true,
14
+ "vocab_path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_vocab.json",
15
+ "sequence_path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/metadata/tf_atlas_morf_isoform_protein_sequences.json",
16
+ "vocab_sha256": "7764fe311387fffee349dbe85faa4705cc63eb3519fe767d691eac3167bc5121",
17
+ "sequence_sha256": "75d724d97145bf364bdf3f74e11737c418f3f3f6d600ea5b14d9becafd694499",
18
+ "embedding_path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/tf_atlas_morf_isoforms_esmc_600m_mean_non_special.npy",
19
+ "mask_path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_morf_isoforms_esmc_600m/tf_atlas_morf_isoforms_esmc_600m_mean_non_special_mask.npy",
20
+ "n_vocab": 3548,
21
+ "n_embedded": 3548,
22
+ "dimension": 1152,
23
+ "expected_dimension": 1152,
24
+ "dtype": "float32",
25
+ "packages": {
26
+ "esm": "3.2.1",
27
+ "torch": "2.10.0+cu129",
28
+ "numpy": "1.26.4"
29
+ }
30
+ }
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/MANIFEST.json ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "1.0",
3
+ "generated_utc": "2026-04-15T22:17:54Z",
4
+ "artifact_name": "tf_atlas_raw_direct_esmc_600m_mean_non_special",
5
+ "source": {
6
+ "raw_tar": "/home/machina/MANTRA/data/raw/tf_atlas/GSE216481_RAW.tar",
7
+ "geo_accession": "GSE216481",
8
+ "identity_source": "direct TFmap identities recovered from GSE216481_RAW.tar",
9
+ "not_identity_source": "supplement-derived ORF table",
10
+ "tfatlas_matrix_files": 20,
11
+ "raw_direct_identity_labels": 1021,
12
+ "unique_symbols_including_controls": 719,
13
+ "excluded_controls": [
14
+ "GFP",
15
+ "mCherry"
16
+ ],
17
+ "unique_non_control_symbols_embedded": 717,
18
+ "identity_kinds": {
19
+ "tforf": 934,
20
+ "transcript_label": 87
21
+ }
22
+ },
23
+ "sequence_input": {
24
+ "path": "metadata/tf_atlas_raw_direct_regulator_sequences.json",
25
+ "coverage_numerator": 717,
26
+ "coverage_denominator": 717,
27
+ "vocab_path": "metadata/tf_atlas_raw_direct_tf_symbol_vocab.json",
28
+ "vocab_sha256": "0addfbe186798e3064c38be48351218f30c37b5032ab28615055cf802ebd2f73",
29
+ "sequence_sha256": "b883576e8c9e78bd843fe1884d0e0e775e619bf232ce6a2d53a46b6a3503c416"
30
+ },
31
+ "model": {
32
+ "name": "esmc-600m-2024-12",
33
+ "hf_repo_id": "EvolutionaryScale/esmc-600m-2024-12",
34
+ "snapshot_commit": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
35
+ "snapshot_dir": "data/raw/protein/esmc/esmc-600m-2024-12",
36
+ "pool": "mean_non_special",
37
+ "max_length": 2048,
38
+ "dimension": 1152,
39
+ "device": "cuda",
40
+ "use_flash_attn": true,
41
+ "packages": {
42
+ "esm": "3.2.1",
43
+ "torch": "2.10.0+cu129",
44
+ "numpy": "1.26.4"
45
+ }
46
+ },
47
+ "embedding": {
48
+ "path": "tf_atlas_raw_direct_esmc_600m_mean_non_special.npy",
49
+ "mask_path": "tf_atlas_raw_direct_esmc_600m_mean_non_special_mask.npy",
50
+ "meta_path": "tf_atlas_raw_direct_esmc_600m_mean_non_special.meta.json",
51
+ "shape": [
52
+ 717,
53
+ 1152
54
+ ],
55
+ "dtype": "float32",
56
+ "finite": true,
57
+ "mask_sum": 717,
58
+ "mean_abs": 0.013141286559402943,
59
+ "row_l2_norm_min": 0.7521712183952332,
60
+ "row_l2_norm_max": 1.4539622068405151
61
+ },
62
+ "reproducibility": {
63
+ "scripts": [
64
+ "scripts/build_tf_atlas_raw_direct_inputs.py",
65
+ "scripts/acquire_protein_sequences.py",
66
+ "scripts/generate_esmc.py"
67
+ ],
68
+ "commands": "REPRODUCE.md",
69
+ "rebuilt_identity_inputs_dir": "metadata/rebuilt_from_raw",
70
+ "rebuilt_vocab_matches_cached_vocab": true,
71
+ "rebuilt_identity_keys_match_cached_identity_keys": true
72
+ },
73
+ "checksums": {
74
+ "README.md": {
75
+ "sha256": "7c07d9a69ac12b56c01641d5757be47a0bf9679dd6b6e2175649f857573b3fb2",
76
+ "bytes": 2812
77
+ },
78
+ "REPRODUCE.md": {
79
+ "sha256": "487e9da046a833c53df0c1fdb530e59bbe24d0a144c84c705fe557a98cbcdac5",
80
+ "bytes": 2552
81
+ },
82
+ "metadata/rebuilt_from_raw/tf_atlas_raw_direct_identity_records.json": {
83
+ "sha256": "08adef73abcccd41a9d8399f1075d94ad2d02ec68b9f31f526864a8208a19643",
84
+ "bytes": 162687
85
+ },
86
+ "metadata/rebuilt_from_raw/tf_atlas_raw_direct_identity_summary.json": {
87
+ "sha256": "8da55ec552612d2595e947ae3055fee0821b05b2058a241f3fc4f054a9371a11",
88
+ "bytes": 315
89
+ },
90
+ "metadata/rebuilt_from_raw/tf_atlas_raw_direct_tf_symbol_vocab.json": {
91
+ "sha256": "0addfbe186798e3064c38be48351218f30c37b5032ab28615055cf802ebd2f73",
92
+ "bytes": 8061
93
+ },
94
+ "metadata/tf_atlas_raw_direct_identity_records.json": {
95
+ "sha256": "4185c178dd86bd119607a3a7080888c5cf1524459f18c4cdfbd0e232d098b532",
96
+ "bytes": 162687
97
+ },
98
+ "metadata/tf_atlas_raw_direct_identity_summary.json": {
99
+ "sha256": "5b9c0e95795f0a33c8076c7849d53c7a5b873fa683ecc4faf001668ea1840275",
100
+ "bytes": 315
101
+ },
102
+ "metadata/tf_atlas_raw_direct_regulator_sequences.json": {
103
+ "sha256": "b883576e8c9e78bd843fe1884d0e0e775e619bf232ce6a2d53a46b6a3503c416",
104
+ "bytes": 526087
105
+ },
106
+ "metadata/tf_atlas_raw_direct_tf_symbol_vocab.json": {
107
+ "sha256": "0addfbe186798e3064c38be48351218f30c37b5032ab28615055cf802ebd2f73",
108
+ "bytes": 8061
109
+ },
110
+ "metadata/tf_atlas_raw_identity_audit.json": {
111
+ "sha256": "38f5ea96c6b136b8251bd395da66c1567c06f84dff9b86858d78731652628a5b",
112
+ "bytes": 8471
113
+ },
114
+ "scripts/acquire_protein_sequences.py": {
115
+ "sha256": "43ef3c8be5fdf45d378f6f6e718af5f7ca1f4d67932b21a7b1477e492aa8d43c",
116
+ "bytes": 10021
117
+ },
118
+ "scripts/build_tf_atlas_raw_direct_inputs.py": {
119
+ "sha256": "256740b0da0618fa1277d9a2ad06b5a570048769bd5dab100e106fed13931d49",
120
+ "bytes": 3306
121
+ },
122
+ "scripts/generate_esmc.py": {
123
+ "sha256": "7f800d3ab6fc9e4191fa92e44c4a4e4de65dbe83a0e2ef60c0a3f8fc1bb05b3b",
124
+ "bytes": 14896
125
+ },
126
+ "tf_atlas_raw_direct_esmc_600m_mean_non_special.meta.json": {
127
+ "sha256": "51c42f8090d8873bf9726bab0c1f910b2dee9a0f6935369b52ba19f840a8effb",
128
+ "bytes": 1335
129
+ },
130
+ "tf_atlas_raw_direct_esmc_600m_mean_non_special.npy": {
131
+ "sha256": "97323b4d9b864bc7956f9562f048310beeca6ffdce877f9365e8fb1f53a46f4c",
132
+ "bytes": 3304064
133
+ },
134
+ "tf_atlas_raw_direct_esmc_600m_mean_non_special_mask.npy": {
135
+ "sha256": "50cccf9deeae753d45f733d145bfe084b4f8b0ad32a5e409e9c0d806380bdd63",
136
+ "bytes": 845
137
+ }
138
+ }
139
+ }
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TF Atlas raw-direct ESM-C 600M embeddings
2
+
3
+ This directory contains ESM-C protein embeddings for the directly recoverable TF identities in the full raw TF Atlas archive `GSE216481_RAW.tar`.
4
+
5
+ The source of truth is the raw tar at `/home/machina/MANTRA/data/raw/tf_atlas/GSE216481_RAW.tar`. The upload does not use the supplement-derived ORF table as the identity source.
6
+
7
+ ## Artifact
8
+
9
+ - Embedding matrix: `tf_atlas_raw_direct_esmc_600m_mean_non_special.npy`
10
+ - Mask: `tf_atlas_raw_direct_esmc_600m_mean_non_special_mask.npy`
11
+ - Model metadata: `tf_atlas_raw_direct_esmc_600m_mean_non_special.meta.json`
12
+ - Shape: `717 x 1152`
13
+ - Dtype: `float32`
14
+ - Pooling: mean over non-special ESM-C tokens
15
+ - Model: `EvolutionaryScale/esmc-600m-2024-12`
16
+ - Snapshot commit: `d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e`
17
+
18
+ ## Raw TF Atlas identity contract
19
+
20
+ The raw tar contains 20 full TFAtlas expression matrix files named `*_TFAtlas_*.csv.gz`. Those matrices are expression tables with barcode-like construct columns, not direct protein sequence identifiers.
21
+
22
+ For ESM-C, the recoverable protein identity source is the raw `TFmap` content inside the same tar. The raw-direct parser recovers:
23
+
24
+ - Direct identity labels: `1,021`
25
+ - TFORF labels: `934`
26
+ - transcript labels: `87`
27
+ - Unique symbols including controls: `719`
28
+ - Controls excluded from embedding: `GFP`, `mCherry`
29
+ - Unique non-control TF symbols embedded: `717`
30
+ - Sequence coverage after acquisition: `717 / 717`
31
+
32
+ The matrix therefore represents the full raw-direct TF identity set recoverable from `GSE216481_RAW.tar`, not a supplement-only ORF library.
33
+
34
+ ## Files
35
+
36
+ - `metadata/tf_atlas_raw_identity_audit.json`: raw tar audit, including TFAtlas matrix count and TFmap identity counts.
37
+ - `metadata/tf_atlas_raw_direct_identity_records.json`: deduplicated raw-direct identity labels.
38
+ - `metadata/tf_atlas_raw_direct_tf_symbol_vocab.json`: embedded non-control TF symbol order.
39
+ - `metadata/tf_atlas_raw_direct_regulator_sequences.json`: protein sequences used for ESM-C.
40
+ - `metadata/tf_atlas_raw_direct_identity_summary.json`: compact count summary.
41
+ - `metadata/rebuilt_from_raw/`: regenerated identity inputs from the included raw-direct parser.
42
+ - `scripts/build_tf_atlas_raw_direct_inputs.py`: raw tar identity extraction script.
43
+ - `scripts/acquire_protein_sequences.py`: sequence acquisition script used to fill missing TF sequences.
44
+ - `scripts/generate_esmc.py`: ESM-C embedding generator.
45
+ - `REPRODUCE.md`: exact commands.
46
+ - `MANIFEST.json`: machine-readable provenance, shape, checksums, and validation.
47
+
48
+ ## Validation
49
+
50
+ The generated matrix was validated locally:
51
+
52
+ - Shape: `717 x 1152`
53
+ - Mask sum: `717`
54
+ - Finite values: `true`
55
+ - Mean absolute embedding value: `0.013141286559402943`
56
+ - Minimum row L2 norm: `0.7521712183952332`
57
+ - Maximum row L2 norm: `1.4539622068405151`
58
+
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/REPRODUCE.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Reproduce TF Atlas raw-direct ESM-C embeddings
2
+
3
+ Run from the MANTRA repository root.
4
+
5
+ ## 1. Extract raw-direct TF identities
6
+
7
+ ```bash
8
+ python data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_raw_direct_esmc_600m/scripts/build_tf_atlas_raw_direct_inputs.py \
9
+ --raw-tar /home/machina/MANTRA/data/raw/tf_atlas/GSE216481_RAW.tar \
10
+ --out-dir data/processed/metadata
11
+ ```
12
+
13
+ Expected summary:
14
+
15
+ ```json
16
+ {
17
+ "direct_identity_records_unique": 1021,
18
+ "unique_symbols_excluding_controls": 717,
19
+ "unique_symbols_including_controls": 719,
20
+ "kinds": {
21
+ "transcript_label": 87,
22
+ "tforf": 934
23
+ },
24
+ "controls": [
25
+ "GFP",
26
+ "mCherry"
27
+ ]
28
+ }
29
+ ```
30
+
31
+ ## 2. Acquire protein sequences
32
+
33
+ ```bash
34
+ PYTHONPATH=src:. python src/mantra/embeddings/acquire_protein_sequences.py \
35
+ --vocab-path data/processed/metadata/tf_atlas_raw_direct_tf_symbol_vocab.json \
36
+ --existing-path data/processed/metadata/regulator_sequences.json \
37
+ --out-path data/processed/metadata/tf_atlas_raw_direct_regulator_sequences.json \
38
+ --only-missing \
39
+ --fallback-gene \
40
+ --ensembl-fallback \
41
+ --include-unreviewed
42
+ ```
43
+
44
+ Expected coverage: `717 / 717` non-control TF symbols.
45
+
46
+ ## 3. Generate ESM-C 600M embeddings
47
+
48
+ ```bash
49
+ PYTHONPATH=src:. PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python -m mantra.embeddings.generate_esmc \
50
+ --model-size 600m \
51
+ --device cuda \
52
+ --vocab-path data/processed/metadata/tf_atlas_raw_direct_tf_symbol_vocab.json \
53
+ --sequence-path data/processed/metadata/tf_atlas_raw_direct_regulator_sequences.json \
54
+ --out-dir data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_raw_direct_esmc_600m \
55
+ --out-prefix tf_atlas_raw_direct_esmc_600m_mean_non_special
56
+ ```
57
+
58
+ Expected output:
59
+
60
+ - `tf_atlas_raw_direct_esmc_600m_mean_non_special.npy`
61
+ - `tf_atlas_raw_direct_esmc_600m_mean_non_special_mask.npy`
62
+ - `tf_atlas_raw_direct_esmc_600m_mean_non_special.meta.json`
63
+
64
+ ## 4. Validate
65
+
66
+ ```bash
67
+ python - <<'PY'
68
+ import json
69
+ import numpy as np
70
+ from pathlib import Path
71
+
72
+ base = Path("data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_raw_direct_esmc_600m/tf_atlas_raw_direct_esmc_600m_mean_non_special")
73
+ E = np.load(str(base) + ".npy")
74
+ mask = np.load(str(base) + "_mask.npy")
75
+ meta = json.load(open(str(base) + ".meta.json"))
76
+ print(E.shape)
77
+ print(E.dtype)
78
+ print(np.isfinite(E).all())
79
+ print(int(mask.sum()), len(mask))
80
+ print(meta["n_vocab"], meta["n_embedded"], meta["dimension"])
81
+ PY
82
+ ```
83
+
84
+ Expected validation:
85
+
86
+ ```text
87
+ (717, 1152)
88
+ float32
89
+ True
90
+ 717 717
91
+ 717 717 1152
92
+ ```
93
+
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/rebuilt_from_raw/tf_atlas_raw_direct_identity_records.json ADDED
The diff for this file is too large to render. See raw diff
 
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/rebuilt_from_raw/tf_atlas_raw_direct_identity_summary.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "raw_tar": "/home/machina/MANTRA/data/raw/tf_atlas/GSE216481_RAW.tar",
3
+ "direct_identity_records_unique": 1021,
4
+ "unique_symbols_excluding_controls": 717,
5
+ "unique_symbols_including_controls": 719,
6
+ "kinds": {
7
+ "transcript_label": 87,
8
+ "tforf": 934
9
+ },
10
+ "controls": [
11
+ "GFP",
12
+ "mCherry"
13
+ ]
14
+ }
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/rebuilt_from_raw/tf_atlas_raw_direct_tf_symbol_vocab.json ADDED
@@ -0,0 +1,719 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "ABL1",
3
+ "ADAR",
4
+ "ADNP",
5
+ "ADNP2",
6
+ "AFF1",
7
+ "AFF2",
8
+ "AFF3",
9
+ "AFF4",
10
+ "AHR",
11
+ "AKNA",
12
+ "AP2B1",
13
+ "ARID1A",
14
+ "ARID1B",
15
+ "ARID3A",
16
+ "ARID3B",
17
+ "ARID4A",
18
+ "ARID4B",
19
+ "ARID5B",
20
+ "ARNTL",
21
+ "ARNTL2",
22
+ "ARX",
23
+ "ASCL1",
24
+ "ASCL3",
25
+ "ASCL4",
26
+ "ATF6",
27
+ "ATF7",
28
+ "ATOH7",
29
+ "BARHL1",
30
+ "BARX1",
31
+ "BATF2",
32
+ "BBX",
33
+ "BCL11A",
34
+ "BCL11B",
35
+ "BCLAF1",
36
+ "BHLHA9",
37
+ "BHLHE22",
38
+ "BLZF1",
39
+ "BNC1",
40
+ "BNC2",
41
+ "BNIP3",
42
+ "BRIP1",
43
+ "BRPF1",
44
+ "CAMTA2",
45
+ "CASZ1",
46
+ "CCNH",
47
+ "CCNT1",
48
+ "CDC5L",
49
+ "CDK1",
50
+ "CDK2",
51
+ "CDX1",
52
+ "CDX2",
53
+ "CEBPZ",
54
+ "CENPA",
55
+ "CHAF1A",
56
+ "CHD7",
57
+ "CIC",
58
+ "CIITA",
59
+ "CIZ1",
60
+ "CRAMP1",
61
+ "CREB3L3",
62
+ "CREB3L4",
63
+ "CSDE1",
64
+ "CTCF",
65
+ "CTCFL",
66
+ "CXXC1",
67
+ "DAXX",
68
+ "DLX6",
69
+ "DMRTA2",
70
+ "DMRTC2",
71
+ "DMTF1",
72
+ "DNAJC2",
73
+ "DND1",
74
+ "DPRX",
75
+ "E2F1",
76
+ "E2F2",
77
+ "E2F7",
78
+ "E2F8",
79
+ "E4F1",
80
+ "EGR1",
81
+ "EGR3",
82
+ "ELF2",
83
+ "ELF3",
84
+ "ELF5",
85
+ "ELK3",
86
+ "EMX2",
87
+ "ENO1",
88
+ "EOMES",
89
+ "ERCC6",
90
+ "ESR2",
91
+ "ETV1",
92
+ "ETV4",
93
+ "ETV7",
94
+ "EWSR1",
95
+ "EZH1",
96
+ "EZH2",
97
+ "FANCD2",
98
+ "FERD3L",
99
+ "FEZF2",
100
+ "FIGLA",
101
+ "FLII",
102
+ "FOS",
103
+ "FOSL1",
104
+ "FOXA1",
105
+ "FOXA2",
106
+ "FOXC2",
107
+ "FOXG1",
108
+ "FOXK2",
109
+ "FOXM1",
110
+ "FOXN4",
111
+ "FOXP1",
112
+ "FOXP3",
113
+ "FUBP1",
114
+ "FXN",
115
+ "GATA1",
116
+ "GATA4",
117
+ "GBX1",
118
+ "GLI1",
119
+ "GLI2",
120
+ "GLI3",
121
+ "GLIS1",
122
+ "GLIS2",
123
+ "GMEB1",
124
+ "GMEB2",
125
+ "GRHL2",
126
+ "GRHL3",
127
+ "GSC",
128
+ "GTF2I",
129
+ "GTF2IRD1",
130
+ "GTF2IRD2",
131
+ "GTF2IRD2B",
132
+ "GTF3C2",
133
+ "GZF1",
134
+ "H2AFX",
135
+ "HDAC3",
136
+ "HDAC4",
137
+ "HDX",
138
+ "HELLS",
139
+ "HELZ2",
140
+ "HES1",
141
+ "HES5",
142
+ "HESX1",
143
+ "HEY1",
144
+ "HIC1",
145
+ "HIC2",
146
+ "HIF1A",
147
+ "HINFP",
148
+ "HLTF",
149
+ "HLX",
150
+ "HMGB1",
151
+ "HMGB2",
152
+ "HMGXB3",
153
+ "HNF4A",
154
+ "HNF4G",
155
+ "HOPX",
156
+ "HOXC12",
157
+ "HOXC13",
158
+ "HOXC5",
159
+ "HOXD1",
160
+ "HOXD11",
161
+ "HOXD13",
162
+ "HOXD9",
163
+ "HSF2",
164
+ "HSF5",
165
+ "HSFY1",
166
+ "ID3",
167
+ "ID4",
168
+ "IFI16",
169
+ "IKZF1",
170
+ "IKZF2",
171
+ "IKZF3",
172
+ "ILF3",
173
+ "INSM1",
174
+ "IRF2",
175
+ "IRF6",
176
+ "IRF8",
177
+ "JARID2",
178
+ "JUND",
179
+ "KAT7",
180
+ "KCNIP2",
181
+ "KDM5B",
182
+ "KDM5C",
183
+ "KDM5D",
184
+ "KDR",
185
+ "KLF10",
186
+ "KLF11",
187
+ "KLF15",
188
+ "KLF16",
189
+ "KLF2",
190
+ "KLF7",
191
+ "LHX2",
192
+ "LIN28A",
193
+ "LIN54",
194
+ "LMO3",
195
+ "LRRFIP1",
196
+ "MAML1",
197
+ "MAZ",
198
+ "MBD1",
199
+ "MBD2",
200
+ "MBD4",
201
+ "MECOM",
202
+ "MECP2",
203
+ "MEF2C",
204
+ "MEF2D",
205
+ "MEIS1",
206
+ "MEOX1",
207
+ "MESP1",
208
+ "MGA",
209
+ "MITF",
210
+ "MLLT10",
211
+ "MNX1",
212
+ "MSGN1",
213
+ "MTA1",
214
+ "MTF1",
215
+ "MXD3",
216
+ "MXI1",
217
+ "MYB",
218
+ "MYBBP1A",
219
+ "MYBL1",
220
+ "MYBL2",
221
+ "MYC",
222
+ "MYEF2",
223
+ "MYOD1",
224
+ "MYRF",
225
+ "MYSM1",
226
+ "MYT1",
227
+ "NCL",
228
+ "NCOA1",
229
+ "NCOA2",
230
+ "NCOA3",
231
+ "NCOA6",
232
+ "NCOR1",
233
+ "NEUROD4",
234
+ "NEUROG1",
235
+ "NFAT5",
236
+ "NFATC1",
237
+ "NFATC2",
238
+ "NFATC3",
239
+ "NFATC4",
240
+ "NFIB",
241
+ "NFIC",
242
+ "NFKB1",
243
+ "NFKBIL1",
244
+ "NFRKB",
245
+ "NFX1",
246
+ "NFXL1",
247
+ "NFYB",
248
+ "NFYC",
249
+ "NHP2",
250
+ "NKRF",
251
+ "NKX1-1",
252
+ "NKX2-5",
253
+ "NKX2-6",
254
+ "NKX6-1",
255
+ "NOTCH2",
256
+ "NPAS1",
257
+ "NPAS3",
258
+ "NPAS4",
259
+ "NR0B1",
260
+ "NR1D1",
261
+ "NR1D2",
262
+ "NR1I3",
263
+ "NR2C2",
264
+ "NR3C1",
265
+ "NR3C2",
266
+ "NR4A3",
267
+ "NR6A1",
268
+ "OLIG1",
269
+ "OSR1",
270
+ "OTX1",
271
+ "PARP1",
272
+ "PAX1",
273
+ "PAX6",
274
+ "PAXBP1",
275
+ "PBRM1",
276
+ "PBX3",
277
+ "PDX1",
278
+ "PES1",
279
+ "PGR",
280
+ "PHF20",
281
+ "PKNOX1",
282
+ "PLAG1",
283
+ "PLK4",
284
+ "PMS1",
285
+ "POGZ",
286
+ "POU2F2",
287
+ "POU3F2",
288
+ "POU4F1",
289
+ "PPARG",
290
+ "PPARGC1A",
291
+ "PPP1R13B",
292
+ "PPP1R13L",
293
+ "PRDM1",
294
+ "PRDM10",
295
+ "PRDM15",
296
+ "PRDM16",
297
+ "PRDM5",
298
+ "PRDM6",
299
+ "PRDM9",
300
+ "PRMT7",
301
+ "PROX1",
302
+ "PSIP1",
303
+ "PTF1A",
304
+ "RAD54L",
305
+ "RB1",
306
+ "RB1CC1",
307
+ "RBAK",
308
+ "RBL1",
309
+ "RBL2",
310
+ "RCOR2",
311
+ "RELB",
312
+ "RERE",
313
+ "REST",
314
+ "RFX1",
315
+ "RFX2",
316
+ "RFX4",
317
+ "RFX6",
318
+ "RFXANK",
319
+ "RORB",
320
+ "RREB1",
321
+ "RUNX1",
322
+ "RUNX1T1",
323
+ "RUNX2",
324
+ "RUNX3",
325
+ "RUVBL1",
326
+ "SALL1",
327
+ "SALL3",
328
+ "SALL4",
329
+ "SATB1",
330
+ "SATB2",
331
+ "SCX",
332
+ "SETDB1",
333
+ "SETDB2",
334
+ "SHOX2",
335
+ "SIX4",
336
+ "SKIL",
337
+ "SKP2",
338
+ "SLC15A1",
339
+ "SMAD1",
340
+ "SMARCA1",
341
+ "SMARCA2",
342
+ "SMARCA5",
343
+ "SMARCC1",
344
+ "SMARCC2",
345
+ "SNAPC4",
346
+ "SNW1",
347
+ "SOX1",
348
+ "SOX11",
349
+ "SOX15",
350
+ "SOX2",
351
+ "SOX21",
352
+ "SOX4",
353
+ "SOX5",
354
+ "SOX6",
355
+ "SOX7",
356
+ "SOX9",
357
+ "SP1",
358
+ "SP100",
359
+ "SP110",
360
+ "SP140",
361
+ "SP2",
362
+ "SP3",
363
+ "SP4",
364
+ "SP5",
365
+ "SP7",
366
+ "SP9",
367
+ "SREBF1",
368
+ "SRY",
369
+ "SS18",
370
+ "SSRP1",
371
+ "ST18",
372
+ "STAT3",
373
+ "STOX1",
374
+ "STOX2",
375
+ "SUPT5H",
376
+ "SUZ12",
377
+ "T",
378
+ "TAF9",
379
+ "TAZ",
380
+ "TBR1",
381
+ "TBX2",
382
+ "TBX3",
383
+ "TCEB1",
384
+ "TCEB2",
385
+ "TCERG1",
386
+ "TCF12",
387
+ "TCF3",
388
+ "TCF4",
389
+ "TCF7",
390
+ "TCF7L2",
391
+ "TEAD1",
392
+ "TEAD2",
393
+ "TEAD4",
394
+ "TERB1",
395
+ "TFAP2E",
396
+ "TFDP1",
397
+ "TFDP2",
398
+ "TGIF1",
399
+ "THAP10",
400
+ "THAP12",
401
+ "THRA",
402
+ "THRB",
403
+ "TLX3",
404
+ "TMF1",
405
+ "TONSL",
406
+ "TP53BP1",
407
+ "TP53BP2",
408
+ "TP63",
409
+ "TP73",
410
+ "TRERF1",
411
+ "TRIM24",
412
+ "TRIM28",
413
+ "TRIM33",
414
+ "TSHZ1",
415
+ "TSHZ2",
416
+ "TSHZ3",
417
+ "TTF1",
418
+ "TULP4",
419
+ "UBTF",
420
+ "UHRF1",
421
+ "UNCX",
422
+ "VAV1",
423
+ "VAX1",
424
+ "VEZF1",
425
+ "WDHD1",
426
+ "WHSC1",
427
+ "YAF2",
428
+ "YAP1",
429
+ "YEATS4",
430
+ "ZBED4",
431
+ "ZBTB10",
432
+ "ZBTB11",
433
+ "ZBTB14",
434
+ "ZBTB17",
435
+ "ZBTB2",
436
+ "ZBTB21",
437
+ "ZBTB22",
438
+ "ZBTB34",
439
+ "ZBTB40",
440
+ "ZBTB44",
441
+ "ZBTB46",
442
+ "ZBTB47",
443
+ "ZBTB7B",
444
+ "ZBTB7C",
445
+ "ZEB1",
446
+ "ZEB2",
447
+ "ZFAT",
448
+ "ZFP28",
449
+ "ZFP3",
450
+ "ZFP36L1",
451
+ "ZFP37",
452
+ "ZFP42",
453
+ "ZFP69",
454
+ "ZFP82",
455
+ "ZFP90",
456
+ "ZFP91",
457
+ "ZFPM1",
458
+ "ZFPM2",
459
+ "ZFX",
460
+ "ZFY",
461
+ "ZHX1",
462
+ "ZHX2",
463
+ "ZHX3",
464
+ "ZKSCAN2",
465
+ "ZKSCAN5",
466
+ "ZKSCAN7",
467
+ "ZKSCAN8",
468
+ "ZMIZ1",
469
+ "ZMIZ2",
470
+ "ZMYND11",
471
+ "ZNF10",
472
+ "ZNF107",
473
+ "ZNF112",
474
+ "ZNF117",
475
+ "ZNF12",
476
+ "ZNF121",
477
+ "ZNF124",
478
+ "ZNF131",
479
+ "ZNF132",
480
+ "ZNF133",
481
+ "ZNF134",
482
+ "ZNF136",
483
+ "ZNF138",
484
+ "ZNF140",
485
+ "ZNF142",
486
+ "ZNF143",
487
+ "ZNF16",
488
+ "ZNF160",
489
+ "ZNF165",
490
+ "ZNF175",
491
+ "ZNF180",
492
+ "ZNF181",
493
+ "ZNF182",
494
+ "ZNF189",
495
+ "ZNF195",
496
+ "ZNF197",
497
+ "ZNF200",
498
+ "ZNF211",
499
+ "ZNF214",
500
+ "ZNF217",
501
+ "ZNF219",
502
+ "ZNF221",
503
+ "ZNF222",
504
+ "ZNF224",
505
+ "ZNF226",
506
+ "ZNF227",
507
+ "ZNF229",
508
+ "ZNF23",
509
+ "ZNF233",
510
+ "ZNF234",
511
+ "ZNF235",
512
+ "ZNF248",
513
+ "ZNF251",
514
+ "ZNF253",
515
+ "ZNF254",
516
+ "ZNF26",
517
+ "ZNF260",
518
+ "ZNF263",
519
+ "ZNF266",
520
+ "ZNF267",
521
+ "ZNF268",
522
+ "ZNF273",
523
+ "ZNF274",
524
+ "ZNF276",
525
+ "ZNF28",
526
+ "ZNF280C",
527
+ "ZNF280D",
528
+ "ZNF281",
529
+ "ZNF282",
530
+ "ZNF286A",
531
+ "ZNF286B",
532
+ "ZNF287",
533
+ "ZNF30",
534
+ "ZNF300",
535
+ "ZNF304",
536
+ "ZNF311",
537
+ "ZNF32",
538
+ "ZNF329",
539
+ "ZNF333",
540
+ "ZNF334",
541
+ "ZNF33A",
542
+ "ZNF341",
543
+ "ZNF347",
544
+ "ZNF354A",
545
+ "ZNF354B",
546
+ "ZNF366",
547
+ "ZNF37A",
548
+ "ZNF382",
549
+ "ZNF384",
550
+ "ZNF394",
551
+ "ZNF41",
552
+ "ZNF415",
553
+ "ZNF418",
554
+ "ZNF420",
555
+ "ZNF423",
556
+ "ZNF426",
557
+ "ZNF429",
558
+ "ZNF43",
559
+ "ZNF431",
560
+ "ZNF432",
561
+ "ZNF433",
562
+ "ZNF436",
563
+ "ZNF438",
564
+ "ZNF44",
565
+ "ZNF443",
566
+ "ZNF445",
567
+ "ZNF45",
568
+ "ZNF451",
569
+ "ZNF468",
570
+ "ZNF470",
571
+ "ZNF471",
572
+ "ZNF473",
573
+ "ZNF479",
574
+ "ZNF480",
575
+ "ZNF483",
576
+ "ZNF484",
577
+ "ZNF485",
578
+ "ZNF486",
579
+ "ZNF488",
580
+ "ZNF490",
581
+ "ZNF493",
582
+ "ZNF502",
583
+ "ZNF507",
584
+ "ZNF510",
585
+ "ZNF512B",
586
+ "ZNF516",
587
+ "ZNF518A",
588
+ "ZNF518B",
589
+ "ZNF521",
590
+ "ZNF527",
591
+ "ZNF528",
592
+ "ZNF529",
593
+ "ZNF532",
594
+ "ZNF536",
595
+ "ZNF541",
596
+ "ZNF544",
597
+ "ZNF546",
598
+ "ZNF549",
599
+ "ZNF550",
600
+ "ZNF551",
601
+ "ZNF554",
602
+ "ZNF555",
603
+ "ZNF559",
604
+ "ZNF560",
605
+ "ZNF561",
606
+ "ZNF563",
607
+ "ZNF564",
608
+ "ZNF566",
609
+ "ZNF567",
610
+ "ZNF568",
611
+ "ZNF569",
612
+ "ZNF570",
613
+ "ZNF572",
614
+ "ZNF574",
615
+ "ZNF578",
616
+ "ZNF581",
617
+ "ZNF583",
618
+ "ZNF585A",
619
+ "ZNF585B",
620
+ "ZNF586",
621
+ "ZNF587B",
622
+ "ZNF592",
623
+ "ZNF594",
624
+ "ZNF595",
625
+ "ZNF596",
626
+ "ZNF599",
627
+ "ZNF600",
628
+ "ZNF605",
629
+ "ZNF606",
630
+ "ZNF611",
631
+ "ZNF613",
632
+ "ZNF614",
633
+ "ZNF615",
634
+ "ZNF616",
635
+ "ZNF618",
636
+ "ZNF621",
637
+ "ZNF624",
638
+ "ZNF628",
639
+ "ZNF639",
640
+ "ZNF644",
641
+ "ZNF658",
642
+ "ZNF665",
643
+ "ZNF668",
644
+ "ZNF675",
645
+ "ZNF677",
646
+ "ZNF681",
647
+ "ZNF682",
648
+ "ZNF687",
649
+ "ZNF688",
650
+ "ZNF692",
651
+ "ZNF699",
652
+ "ZNF7",
653
+ "ZNF700",
654
+ "ZNF708",
655
+ "ZNF709",
656
+ "ZNF711",
657
+ "ZNF713",
658
+ "ZNF716",
659
+ "ZNF717",
660
+ "ZNF718",
661
+ "ZNF721",
662
+ "ZNF726",
663
+ "ZNF727",
664
+ "ZNF728",
665
+ "ZNF729",
666
+ "ZNF730",
667
+ "ZNF732",
668
+ "ZNF736",
669
+ "ZNF746",
670
+ "ZNF75D",
671
+ "ZNF76",
672
+ "ZNF761",
673
+ "ZNF765",
674
+ "ZNF768",
675
+ "ZNF77",
676
+ "ZNF777",
677
+ "ZNF778",
678
+ "ZNF780A",
679
+ "ZNF780B",
680
+ "ZNF782",
681
+ "ZNF783",
682
+ "ZNF786",
683
+ "ZNF789",
684
+ "ZNF791",
685
+ "ZNF799",
686
+ "ZNF8",
687
+ "ZNF808",
688
+ "ZNF81",
689
+ "ZNF813",
690
+ "ZNF814",
691
+ "ZNF816",
692
+ "ZNF823",
693
+ "ZNF827",
694
+ "ZNF836",
695
+ "ZNF841",
696
+ "ZNF844",
697
+ "ZNF845",
698
+ "ZNF846",
699
+ "ZNF85",
700
+ "ZNF850",
701
+ "ZNF860",
702
+ "ZNF865",
703
+ "ZNF879",
704
+ "ZNF880",
705
+ "ZNF891",
706
+ "ZNF90",
707
+ "ZNF91",
708
+ "ZNF93",
709
+ "ZNF99",
710
+ "ZSCAN18",
711
+ "ZSCAN2",
712
+ "ZSCAN20",
713
+ "ZSCAN29",
714
+ "ZSCAN30",
715
+ "ZSCAN32",
716
+ "ZSCAN9",
717
+ "ZXDB",
718
+ "ZZZ3"
719
+ ]
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_identity_records.json ADDED
The diff for this file is too large to render. See raw diff
 
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_identity_summary.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "raw_tar": "/home/machina/MANTRA/data/raw/tf_atlas/GSE216481_RAW.tar",
3
+ "direct_identity_records_unique": 1021,
4
+ "unique_symbols_excluding_controls": 717,
5
+ "unique_symbols_including_controls": 719,
6
+ "kinds": {
7
+ "tforf": 934,
8
+ "transcript_label": 87
9
+ },
10
+ "controls": [
11
+ "GFP",
12
+ "mCherry"
13
+ ]
14
+ }
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_regulator_sequences.json ADDED
The diff for this file is too large to render. See raw diff
 
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_direct_tf_symbol_vocab.json ADDED
@@ -0,0 +1,719 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "ABL1",
3
+ "ADAR",
4
+ "ADNP",
5
+ "ADNP2",
6
+ "AFF1",
7
+ "AFF2",
8
+ "AFF3",
9
+ "AFF4",
10
+ "AHR",
11
+ "AKNA",
12
+ "AP2B1",
13
+ "ARID1A",
14
+ "ARID1B",
15
+ "ARID3A",
16
+ "ARID3B",
17
+ "ARID4A",
18
+ "ARID4B",
19
+ "ARID5B",
20
+ "ARNTL",
21
+ "ARNTL2",
22
+ "ARX",
23
+ "ASCL1",
24
+ "ASCL3",
25
+ "ASCL4",
26
+ "ATF6",
27
+ "ATF7",
28
+ "ATOH7",
29
+ "BARHL1",
30
+ "BARX1",
31
+ "BATF2",
32
+ "BBX",
33
+ "BCL11A",
34
+ "BCL11B",
35
+ "BCLAF1",
36
+ "BHLHA9",
37
+ "BHLHE22",
38
+ "BLZF1",
39
+ "BNC1",
40
+ "BNC2",
41
+ "BNIP3",
42
+ "BRIP1",
43
+ "BRPF1",
44
+ "CAMTA2",
45
+ "CASZ1",
46
+ "CCNH",
47
+ "CCNT1",
48
+ "CDC5L",
49
+ "CDK1",
50
+ "CDK2",
51
+ "CDX1",
52
+ "CDX2",
53
+ "CEBPZ",
54
+ "CENPA",
55
+ "CHAF1A",
56
+ "CHD7",
57
+ "CIC",
58
+ "CIITA",
59
+ "CIZ1",
60
+ "CRAMP1",
61
+ "CREB3L3",
62
+ "CREB3L4",
63
+ "CSDE1",
64
+ "CTCF",
65
+ "CTCFL",
66
+ "CXXC1",
67
+ "DAXX",
68
+ "DLX6",
69
+ "DMRTA2",
70
+ "DMRTC2",
71
+ "DMTF1",
72
+ "DNAJC2",
73
+ "DND1",
74
+ "DPRX",
75
+ "E2F1",
76
+ "E2F2",
77
+ "E2F7",
78
+ "E2F8",
79
+ "E4F1",
80
+ "EGR1",
81
+ "EGR3",
82
+ "ELF2",
83
+ "ELF3",
84
+ "ELF5",
85
+ "ELK3",
86
+ "EMX2",
87
+ "ENO1",
88
+ "EOMES",
89
+ "ERCC6",
90
+ "ESR2",
91
+ "ETV1",
92
+ "ETV4",
93
+ "ETV7",
94
+ "EWSR1",
95
+ "EZH1",
96
+ "EZH2",
97
+ "FANCD2",
98
+ "FERD3L",
99
+ "FEZF2",
100
+ "FIGLA",
101
+ "FLII",
102
+ "FOS",
103
+ "FOSL1",
104
+ "FOXA1",
105
+ "FOXA2",
106
+ "FOXC2",
107
+ "FOXG1",
108
+ "FOXK2",
109
+ "FOXM1",
110
+ "FOXN4",
111
+ "FOXP1",
112
+ "FOXP3",
113
+ "FUBP1",
114
+ "FXN",
115
+ "GATA1",
116
+ "GATA4",
117
+ "GBX1",
118
+ "GLI1",
119
+ "GLI2",
120
+ "GLI3",
121
+ "GLIS1",
122
+ "GLIS2",
123
+ "GMEB1",
124
+ "GMEB2",
125
+ "GRHL2",
126
+ "GRHL3",
127
+ "GSC",
128
+ "GTF2I",
129
+ "GTF2IRD1",
130
+ "GTF2IRD2",
131
+ "GTF2IRD2B",
132
+ "GTF3C2",
133
+ "GZF1",
134
+ "H2AFX",
135
+ "HDAC3",
136
+ "HDAC4",
137
+ "HDX",
138
+ "HELLS",
139
+ "HELZ2",
140
+ "HES1",
141
+ "HES5",
142
+ "HESX1",
143
+ "HEY1",
144
+ "HIC1",
145
+ "HIC2",
146
+ "HIF1A",
147
+ "HINFP",
148
+ "HLTF",
149
+ "HLX",
150
+ "HMGB1",
151
+ "HMGB2",
152
+ "HMGXB3",
153
+ "HNF4A",
154
+ "HNF4G",
155
+ "HOPX",
156
+ "HOXC12",
157
+ "HOXC13",
158
+ "HOXC5",
159
+ "HOXD1",
160
+ "HOXD11",
161
+ "HOXD13",
162
+ "HOXD9",
163
+ "HSF2",
164
+ "HSF5",
165
+ "HSFY1",
166
+ "ID3",
167
+ "ID4",
168
+ "IFI16",
169
+ "IKZF1",
170
+ "IKZF2",
171
+ "IKZF3",
172
+ "ILF3",
173
+ "INSM1",
174
+ "IRF2",
175
+ "IRF6",
176
+ "IRF8",
177
+ "JARID2",
178
+ "JUND",
179
+ "KAT7",
180
+ "KCNIP2",
181
+ "KDM5B",
182
+ "KDM5C",
183
+ "KDM5D",
184
+ "KDR",
185
+ "KLF10",
186
+ "KLF11",
187
+ "KLF15",
188
+ "KLF16",
189
+ "KLF2",
190
+ "KLF7",
191
+ "LHX2",
192
+ "LIN28A",
193
+ "LIN54",
194
+ "LMO3",
195
+ "LRRFIP1",
196
+ "MAML1",
197
+ "MAZ",
198
+ "MBD1",
199
+ "MBD2",
200
+ "MBD4",
201
+ "MECOM",
202
+ "MECP2",
203
+ "MEF2C",
204
+ "MEF2D",
205
+ "MEIS1",
206
+ "MEOX1",
207
+ "MESP1",
208
+ "MGA",
209
+ "MITF",
210
+ "MLLT10",
211
+ "MNX1",
212
+ "MSGN1",
213
+ "MTA1",
214
+ "MTF1",
215
+ "MXD3",
216
+ "MXI1",
217
+ "MYB",
218
+ "MYBBP1A",
219
+ "MYBL1",
220
+ "MYBL2",
221
+ "MYC",
222
+ "MYEF2",
223
+ "MYOD1",
224
+ "MYRF",
225
+ "MYSM1",
226
+ "MYT1",
227
+ "NCL",
228
+ "NCOA1",
229
+ "NCOA2",
230
+ "NCOA3",
231
+ "NCOA6",
232
+ "NCOR1",
233
+ "NEUROD4",
234
+ "NEUROG1",
235
+ "NFAT5",
236
+ "NFATC1",
237
+ "NFATC2",
238
+ "NFATC3",
239
+ "NFATC4",
240
+ "NFIB",
241
+ "NFIC",
242
+ "NFKB1",
243
+ "NFKBIL1",
244
+ "NFRKB",
245
+ "NFX1",
246
+ "NFXL1",
247
+ "NFYB",
248
+ "NFYC",
249
+ "NHP2",
250
+ "NKRF",
251
+ "NKX1-1",
252
+ "NKX2-5",
253
+ "NKX2-6",
254
+ "NKX6-1",
255
+ "NOTCH2",
256
+ "NPAS1",
257
+ "NPAS3",
258
+ "NPAS4",
259
+ "NR0B1",
260
+ "NR1D1",
261
+ "NR1D2",
262
+ "NR1I3",
263
+ "NR2C2",
264
+ "NR3C1",
265
+ "NR3C2",
266
+ "NR4A3",
267
+ "NR6A1",
268
+ "OLIG1",
269
+ "OSR1",
270
+ "OTX1",
271
+ "PARP1",
272
+ "PAX1",
273
+ "PAX6",
274
+ "PAXBP1",
275
+ "PBRM1",
276
+ "PBX3",
277
+ "PDX1",
278
+ "PES1",
279
+ "PGR",
280
+ "PHF20",
281
+ "PKNOX1",
282
+ "PLAG1",
283
+ "PLK4",
284
+ "PMS1",
285
+ "POGZ",
286
+ "POU2F2",
287
+ "POU3F2",
288
+ "POU4F1",
289
+ "PPARG",
290
+ "PPARGC1A",
291
+ "PPP1R13B",
292
+ "PPP1R13L",
293
+ "PRDM1",
294
+ "PRDM10",
295
+ "PRDM15",
296
+ "PRDM16",
297
+ "PRDM5",
298
+ "PRDM6",
299
+ "PRDM9",
300
+ "PRMT7",
301
+ "PROX1",
302
+ "PSIP1",
303
+ "PTF1A",
304
+ "RAD54L",
305
+ "RB1",
306
+ "RB1CC1",
307
+ "RBAK",
308
+ "RBL1",
309
+ "RBL2",
310
+ "RCOR2",
311
+ "RELB",
312
+ "RERE",
313
+ "REST",
314
+ "RFX1",
315
+ "RFX2",
316
+ "RFX4",
317
+ "RFX6",
318
+ "RFXANK",
319
+ "RORB",
320
+ "RREB1",
321
+ "RUNX1",
322
+ "RUNX1T1",
323
+ "RUNX2",
324
+ "RUNX3",
325
+ "RUVBL1",
326
+ "SALL1",
327
+ "SALL3",
328
+ "SALL4",
329
+ "SATB1",
330
+ "SATB2",
331
+ "SCX",
332
+ "SETDB1",
333
+ "SETDB2",
334
+ "SHOX2",
335
+ "SIX4",
336
+ "SKIL",
337
+ "SKP2",
338
+ "SLC15A1",
339
+ "SMAD1",
340
+ "SMARCA1",
341
+ "SMARCA2",
342
+ "SMARCA5",
343
+ "SMARCC1",
344
+ "SMARCC2",
345
+ "SNAPC4",
346
+ "SNW1",
347
+ "SOX1",
348
+ "SOX11",
349
+ "SOX15",
350
+ "SOX2",
351
+ "SOX21",
352
+ "SOX4",
353
+ "SOX5",
354
+ "SOX6",
355
+ "SOX7",
356
+ "SOX9",
357
+ "SP1",
358
+ "SP100",
359
+ "SP110",
360
+ "SP140",
361
+ "SP2",
362
+ "SP3",
363
+ "SP4",
364
+ "SP5",
365
+ "SP7",
366
+ "SP9",
367
+ "SREBF1",
368
+ "SRY",
369
+ "SS18",
370
+ "SSRP1",
371
+ "ST18",
372
+ "STAT3",
373
+ "STOX1",
374
+ "STOX2",
375
+ "SUPT5H",
376
+ "SUZ12",
377
+ "T",
378
+ "TAF9",
379
+ "TAZ",
380
+ "TBR1",
381
+ "TBX2",
382
+ "TBX3",
383
+ "TCEB1",
384
+ "TCEB2",
385
+ "TCERG1",
386
+ "TCF12",
387
+ "TCF3",
388
+ "TCF4",
389
+ "TCF7",
390
+ "TCF7L2",
391
+ "TEAD1",
392
+ "TEAD2",
393
+ "TEAD4",
394
+ "TERB1",
395
+ "TFAP2E",
396
+ "TFDP1",
397
+ "TFDP2",
398
+ "TGIF1",
399
+ "THAP10",
400
+ "THAP12",
401
+ "THRA",
402
+ "THRB",
403
+ "TLX3",
404
+ "TMF1",
405
+ "TONSL",
406
+ "TP53BP1",
407
+ "TP53BP2",
408
+ "TP63",
409
+ "TP73",
410
+ "TRERF1",
411
+ "TRIM24",
412
+ "TRIM28",
413
+ "TRIM33",
414
+ "TSHZ1",
415
+ "TSHZ2",
416
+ "TSHZ3",
417
+ "TTF1",
418
+ "TULP4",
419
+ "UBTF",
420
+ "UHRF1",
421
+ "UNCX",
422
+ "VAV1",
423
+ "VAX1",
424
+ "VEZF1",
425
+ "WDHD1",
426
+ "WHSC1",
427
+ "YAF2",
428
+ "YAP1",
429
+ "YEATS4",
430
+ "ZBED4",
431
+ "ZBTB10",
432
+ "ZBTB11",
433
+ "ZBTB14",
434
+ "ZBTB17",
435
+ "ZBTB2",
436
+ "ZBTB21",
437
+ "ZBTB22",
438
+ "ZBTB34",
439
+ "ZBTB40",
440
+ "ZBTB44",
441
+ "ZBTB46",
442
+ "ZBTB47",
443
+ "ZBTB7B",
444
+ "ZBTB7C",
445
+ "ZEB1",
446
+ "ZEB2",
447
+ "ZFAT",
448
+ "ZFP28",
449
+ "ZFP3",
450
+ "ZFP36L1",
451
+ "ZFP37",
452
+ "ZFP42",
453
+ "ZFP69",
454
+ "ZFP82",
455
+ "ZFP90",
456
+ "ZFP91",
457
+ "ZFPM1",
458
+ "ZFPM2",
459
+ "ZFX",
460
+ "ZFY",
461
+ "ZHX1",
462
+ "ZHX2",
463
+ "ZHX3",
464
+ "ZKSCAN2",
465
+ "ZKSCAN5",
466
+ "ZKSCAN7",
467
+ "ZKSCAN8",
468
+ "ZMIZ1",
469
+ "ZMIZ2",
470
+ "ZMYND11",
471
+ "ZNF10",
472
+ "ZNF107",
473
+ "ZNF112",
474
+ "ZNF117",
475
+ "ZNF12",
476
+ "ZNF121",
477
+ "ZNF124",
478
+ "ZNF131",
479
+ "ZNF132",
480
+ "ZNF133",
481
+ "ZNF134",
482
+ "ZNF136",
483
+ "ZNF138",
484
+ "ZNF140",
485
+ "ZNF142",
486
+ "ZNF143",
487
+ "ZNF16",
488
+ "ZNF160",
489
+ "ZNF165",
490
+ "ZNF175",
491
+ "ZNF180",
492
+ "ZNF181",
493
+ "ZNF182",
494
+ "ZNF189",
495
+ "ZNF195",
496
+ "ZNF197",
497
+ "ZNF200",
498
+ "ZNF211",
499
+ "ZNF214",
500
+ "ZNF217",
501
+ "ZNF219",
502
+ "ZNF221",
503
+ "ZNF222",
504
+ "ZNF224",
505
+ "ZNF226",
506
+ "ZNF227",
507
+ "ZNF229",
508
+ "ZNF23",
509
+ "ZNF233",
510
+ "ZNF234",
511
+ "ZNF235",
512
+ "ZNF248",
513
+ "ZNF251",
514
+ "ZNF253",
515
+ "ZNF254",
516
+ "ZNF26",
517
+ "ZNF260",
518
+ "ZNF263",
519
+ "ZNF266",
520
+ "ZNF267",
521
+ "ZNF268",
522
+ "ZNF273",
523
+ "ZNF274",
524
+ "ZNF276",
525
+ "ZNF28",
526
+ "ZNF280C",
527
+ "ZNF280D",
528
+ "ZNF281",
529
+ "ZNF282",
530
+ "ZNF286A",
531
+ "ZNF286B",
532
+ "ZNF287",
533
+ "ZNF30",
534
+ "ZNF300",
535
+ "ZNF304",
536
+ "ZNF311",
537
+ "ZNF32",
538
+ "ZNF329",
539
+ "ZNF333",
540
+ "ZNF334",
541
+ "ZNF33A",
542
+ "ZNF341",
543
+ "ZNF347",
544
+ "ZNF354A",
545
+ "ZNF354B",
546
+ "ZNF366",
547
+ "ZNF37A",
548
+ "ZNF382",
549
+ "ZNF384",
550
+ "ZNF394",
551
+ "ZNF41",
552
+ "ZNF415",
553
+ "ZNF418",
554
+ "ZNF420",
555
+ "ZNF423",
556
+ "ZNF426",
557
+ "ZNF429",
558
+ "ZNF43",
559
+ "ZNF431",
560
+ "ZNF432",
561
+ "ZNF433",
562
+ "ZNF436",
563
+ "ZNF438",
564
+ "ZNF44",
565
+ "ZNF443",
566
+ "ZNF445",
567
+ "ZNF45",
568
+ "ZNF451",
569
+ "ZNF468",
570
+ "ZNF470",
571
+ "ZNF471",
572
+ "ZNF473",
573
+ "ZNF479",
574
+ "ZNF480",
575
+ "ZNF483",
576
+ "ZNF484",
577
+ "ZNF485",
578
+ "ZNF486",
579
+ "ZNF488",
580
+ "ZNF490",
581
+ "ZNF493",
582
+ "ZNF502",
583
+ "ZNF507",
584
+ "ZNF510",
585
+ "ZNF512B",
586
+ "ZNF516",
587
+ "ZNF518A",
588
+ "ZNF518B",
589
+ "ZNF521",
590
+ "ZNF527",
591
+ "ZNF528",
592
+ "ZNF529",
593
+ "ZNF532",
594
+ "ZNF536",
595
+ "ZNF541",
596
+ "ZNF544",
597
+ "ZNF546",
598
+ "ZNF549",
599
+ "ZNF550",
600
+ "ZNF551",
601
+ "ZNF554",
602
+ "ZNF555",
603
+ "ZNF559",
604
+ "ZNF560",
605
+ "ZNF561",
606
+ "ZNF563",
607
+ "ZNF564",
608
+ "ZNF566",
609
+ "ZNF567",
610
+ "ZNF568",
611
+ "ZNF569",
612
+ "ZNF570",
613
+ "ZNF572",
614
+ "ZNF574",
615
+ "ZNF578",
616
+ "ZNF581",
617
+ "ZNF583",
618
+ "ZNF585A",
619
+ "ZNF585B",
620
+ "ZNF586",
621
+ "ZNF587B",
622
+ "ZNF592",
623
+ "ZNF594",
624
+ "ZNF595",
625
+ "ZNF596",
626
+ "ZNF599",
627
+ "ZNF600",
628
+ "ZNF605",
629
+ "ZNF606",
630
+ "ZNF611",
631
+ "ZNF613",
632
+ "ZNF614",
633
+ "ZNF615",
634
+ "ZNF616",
635
+ "ZNF618",
636
+ "ZNF621",
637
+ "ZNF624",
638
+ "ZNF628",
639
+ "ZNF639",
640
+ "ZNF644",
641
+ "ZNF658",
642
+ "ZNF665",
643
+ "ZNF668",
644
+ "ZNF675",
645
+ "ZNF677",
646
+ "ZNF681",
647
+ "ZNF682",
648
+ "ZNF687",
649
+ "ZNF688",
650
+ "ZNF692",
651
+ "ZNF699",
652
+ "ZNF7",
653
+ "ZNF700",
654
+ "ZNF708",
655
+ "ZNF709",
656
+ "ZNF711",
657
+ "ZNF713",
658
+ "ZNF716",
659
+ "ZNF717",
660
+ "ZNF718",
661
+ "ZNF721",
662
+ "ZNF726",
663
+ "ZNF727",
664
+ "ZNF728",
665
+ "ZNF729",
666
+ "ZNF730",
667
+ "ZNF732",
668
+ "ZNF736",
669
+ "ZNF746",
670
+ "ZNF75D",
671
+ "ZNF76",
672
+ "ZNF761",
673
+ "ZNF765",
674
+ "ZNF768",
675
+ "ZNF77",
676
+ "ZNF777",
677
+ "ZNF778",
678
+ "ZNF780A",
679
+ "ZNF780B",
680
+ "ZNF782",
681
+ "ZNF783",
682
+ "ZNF786",
683
+ "ZNF789",
684
+ "ZNF791",
685
+ "ZNF799",
686
+ "ZNF8",
687
+ "ZNF808",
688
+ "ZNF81",
689
+ "ZNF813",
690
+ "ZNF814",
691
+ "ZNF816",
692
+ "ZNF823",
693
+ "ZNF827",
694
+ "ZNF836",
695
+ "ZNF841",
696
+ "ZNF844",
697
+ "ZNF845",
698
+ "ZNF846",
699
+ "ZNF85",
700
+ "ZNF850",
701
+ "ZNF860",
702
+ "ZNF865",
703
+ "ZNF879",
704
+ "ZNF880",
705
+ "ZNF891",
706
+ "ZNF90",
707
+ "ZNF91",
708
+ "ZNF93",
709
+ "ZNF99",
710
+ "ZSCAN18",
711
+ "ZSCAN2",
712
+ "ZSCAN20",
713
+ "ZSCAN29",
714
+ "ZSCAN30",
715
+ "ZSCAN32",
716
+ "ZSCAN9",
717
+ "ZXDB",
718
+ "ZZZ3"
719
+ ]
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/metadata/tf_atlas_raw_identity_audit.json ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "raw_tar": "/home/machina/MANTRA/data/raw/tf_atlas/GSE216481_RAW.tar",
3
+ "tfatlas_matrix_files": 20,
4
+ "tfatlas_header_audit": [
5
+ {
6
+ "file": "GSM6719950_210322_TFAtlas_S05.csv.gz",
7
+ "n_columns_excluding_gene": 849424,
8
+ "first_columns": [
9
+ "R1.01,R2.01,R3.01,P1.54",
10
+ "R1.01,R2.01,R3.02,P1.54",
11
+ "R1.01,R2.01,R3.03,P1.54",
12
+ "R1.01,R2.01,R3.04,P1.54",
13
+ "R1.01,R2.01,R3.05,P1.54"
14
+ ]
15
+ },
16
+ {
17
+ "file": "GSM6719951_210322_TFAtlas_S06.csv.gz",
18
+ "n_columns_excluding_gene": 818182,
19
+ "first_columns": [
20
+ "R1.01,R2.01,R3.01,P1.62",
21
+ "R1.01,R2.01,R3.02,P1.62",
22
+ "R1.01,R2.01,R3.03,P1.62",
23
+ "R1.01,R2.01,R3.04,P1.62",
24
+ "R1.01,R2.01,R3.05,P1.62"
25
+ ]
26
+ },
27
+ {
28
+ "file": "GSM6719952_210322_TFAtlas_S07.csv.gz",
29
+ "n_columns_excluding_gene": 856110,
30
+ "first_columns": [
31
+ "R1.01,R2.01,R3.01,P1.07",
32
+ "R1.01,R2.01,R3.02,P1.07",
33
+ "R1.01,R2.01,R3.03,P1.07",
34
+ "R1.01,R2.01,R3.04,P1.07",
35
+ "R1.01,R2.01,R3.05,P1.07"
36
+ ]
37
+ },
38
+ {
39
+ "file": "GSM6719953_210322_TFAtlas_S08.csv.gz",
40
+ "n_columns_excluding_gene": 835134,
41
+ "first_columns": [
42
+ "R1.01,R2.01,R3.01,P1.15",
43
+ "R1.01,R2.01,R3.02,P1.15",
44
+ "R1.01,R2.01,R3.03,P1.15",
45
+ "R1.01,R2.01,R3.04,P1.15",
46
+ "R1.01,R2.01,R3.05,P1.15"
47
+ ]
48
+ },
49
+ {
50
+ "file": "GSM6719954_210322_TFAtlas_S09.csv.gz",
51
+ "n_columns_excluding_gene": 837674,
52
+ "first_columns": [
53
+ "R1.01,R2.01,R3.01,P1.23",
54
+ "R1.01,R2.01,R3.02,P1.23",
55
+ "R1.01,R2.01,R3.03,P1.23",
56
+ "R1.01,R2.01,R3.04,P1.23",
57
+ "R1.01,R2.01,R3.05,P1.23"
58
+ ]
59
+ },
60
+ {
61
+ "file": "GSM6719955_210322_TFAtlas_S10.csv.gz",
62
+ "n_columns_excluding_gene": 836406,
63
+ "first_columns": [
64
+ "R1.01,R2.01,R3.01,P1.31",
65
+ "R1.01,R2.01,R3.02,P1.31",
66
+ "R1.01,R2.01,R3.03,P1.31",
67
+ "R1.01,R2.01,R3.04,P1.31",
68
+ "R1.01,R2.01,R3.05,P1.31"
69
+ ]
70
+ },
71
+ {
72
+ "file": "GSM6719956_210322_TFAtlas_S11.csv.gz",
73
+ "n_columns_excluding_gene": 835130,
74
+ "first_columns": [
75
+ "R1.01,R2.01,R3.01,P1.39",
76
+ "R1.01,R2.01,R3.02,P1.39",
77
+ "R1.01,R2.01,R3.03,P1.39",
78
+ "R1.01,R2.01,R3.04,P1.39",
79
+ "R1.01,R2.01,R3.05,P1.39"
80
+ ]
81
+ },
82
+ {
83
+ "file": "GSM6719957_210322_TFAtlas_S12.csv.gz",
84
+ "n_columns_excluding_gene": 840635,
85
+ "first_columns": [
86
+ "R1.01,R2.01,R3.01,P1.47",
87
+ "R1.01,R2.01,R3.02,P1.47",
88
+ "R1.01,R2.01,R3.03,P1.47",
89
+ "R1.01,R2.01,R3.04,P1.47",
90
+ "R1.01,R2.01,R3.05,P1.47"
91
+ ]
92
+ },
93
+ {
94
+ "file": "GSM6719958_210322_TFAtlas_S13.csv.gz",
95
+ "n_columns_excluding_gene": 821042,
96
+ "first_columns": [
97
+ "R1.01,R2.01,R3.01,P1.55",
98
+ "R1.01,R2.01,R3.02,P1.55",
99
+ "R1.01,R2.01,R3.03,P1.55",
100
+ "R1.01,R2.01,R3.04,P1.55",
101
+ "R1.01,R2.01,R3.05,P1.55"
102
+ ]
103
+ },
104
+ {
105
+ "file": "GSM6719959_210322_TFAtlas_S14.csv.gz",
106
+ "n_columns_excluding_gene": 831524,
107
+ "first_columns": [
108
+ "R1.01,R2.01,R3.01,P1.63",
109
+ "R1.01,R2.01,R3.02,P1.63",
110
+ "R1.01,R2.01,R3.03,P1.63",
111
+ "R1.01,R2.01,R3.04,P1.63",
112
+ "R1.01,R2.01,R3.05,P1.63"
113
+ ]
114
+ },
115
+ {
116
+ "file": "GSM6719960_210322_TFAtlas_S15.csv.gz",
117
+ "n_columns_excluding_gene": 831725,
118
+ "first_columns": [
119
+ "R1.01,R2.01,R3.01,P1.08",
120
+ "R1.01,R2.01,R3.02,P1.08",
121
+ "R1.01,R2.01,R3.03,P1.08",
122
+ "R1.01,R2.01,R3.04,P1.08",
123
+ "R1.01,R2.01,R3.05,P1.08"
124
+ ]
125
+ },
126
+ {
127
+ "file": "GSM6719961_210322_TFAtlas_S16.csv.gz",
128
+ "n_columns_excluding_gene": 803507,
129
+ "first_columns": [
130
+ "R1.01,R2.01,R3.01,P1.16",
131
+ "R1.01,R2.01,R3.02,P1.16",
132
+ "R1.01,R2.01,R3.03,P1.16",
133
+ "R1.01,R2.01,R3.04,P1.16",
134
+ "R1.01,R2.01,R3.05,P1.16"
135
+ ]
136
+ },
137
+ {
138
+ "file": "GSM6719962_210322_TFAtlas_S17.csv.gz",
139
+ "n_columns_excluding_gene": 810711,
140
+ "first_columns": [
141
+ "R1.01,R2.01,R3.01,P1.24",
142
+ "R1.01,R2.01,R3.02,P1.24",
143
+ "R1.01,R2.01,R3.03,P1.24",
144
+ "R1.01,R2.01,R3.04,P1.24",
145
+ "R1.01,R2.01,R3.05,P1.24"
146
+ ]
147
+ },
148
+ {
149
+ "file": "GSM6719963_210322_TFAtlas_S18.csv.gz",
150
+ "n_columns_excluding_gene": 103563,
151
+ "first_columns": [
152
+ "R1.01,R2.01,R3.03,P1.32",
153
+ "R1.01,R2.01,R3.09,P1.32",
154
+ "R1.01,R2.01,R3.11,P1.32",
155
+ "R1.01,R2.01,R3.18,P1.32",
156
+ "R1.01,R2.01,R3.25,P1.32"
157
+ ]
158
+ },
159
+ {
160
+ "file": "GSM6719964_210322_TFAtlas_S19.csv.gz",
161
+ "n_columns_excluding_gene": 826598,
162
+ "first_columns": [
163
+ "R1.01,R2.01,R3.01,P1.40",
164
+ "R1.01,R2.01,R3.02,P1.40",
165
+ "R1.01,R2.01,R3.03,P1.40",
166
+ "R1.01,R2.01,R3.04,P1.40",
167
+ "R1.01,R2.01,R3.05,P1.40"
168
+ ]
169
+ },
170
+ {
171
+ "file": "GSM6719965_210322_TFAtlas_S20.csv.gz",
172
+ "n_columns_excluding_gene": 759031,
173
+ "first_columns": [
174
+ "R1.01,R2.01,R3.01,P1.48",
175
+ "R1.01,R2.01,R3.02,P1.48",
176
+ "R1.01,R2.01,R3.03,P1.48",
177
+ "R1.01,R2.01,R3.04,P1.48",
178
+ "R1.01,R2.01,R3.05,P1.48"
179
+ ]
180
+ },
181
+ {
182
+ "file": "GSM6719966_210322_TFAtlas_S21.csv.gz",
183
+ "n_columns_excluding_gene": 879222,
184
+ "first_columns": [
185
+ "R1.01,R2.01,R3.01,P1.22",
186
+ "R1.01,R2.01,R3.02,P1.22",
187
+ "R1.01,R2.01,R3.03,P1.22",
188
+ "R1.01,R2.01,R3.04,P1.22",
189
+ "R1.01,R2.01,R3.05,P1.22"
190
+ ]
191
+ },
192
+ {
193
+ "file": "GSM6719967_210322_TFAtlas_S22.csv.gz",
194
+ "n_columns_excluding_gene": 878189,
195
+ "first_columns": [
196
+ "R1.01,R2.01,R3.01,P1.30",
197
+ "R1.01,R2.01,R3.02,P1.30",
198
+ "R1.01,R2.01,R3.03,P1.30",
199
+ "R1.01,R2.01,R3.04,P1.30",
200
+ "R1.01,R2.01,R3.05,P1.30"
201
+ ]
202
+ },
203
+ {
204
+ "file": "GSM6719968_210322_TFAtlas_S23.csv.gz",
205
+ "n_columns_excluding_gene": 880081,
206
+ "first_columns": [
207
+ "R1.01,R2.01,R3.01,P1.38",
208
+ "R1.01,R2.01,R3.02,P1.38",
209
+ "R1.01,R2.01,R3.03,P1.38",
210
+ "R1.01,R2.01,R3.04,P1.38",
211
+ "R1.01,R2.01,R3.05,P1.38"
212
+ ]
213
+ },
214
+ {
215
+ "file": "GSM6719969_210322_TFAtlas_S24.csv.gz",
216
+ "n_columns_excluding_gene": 879076,
217
+ "first_columns": [
218
+ "R1.01,R2.01,R3.01,P1.62",
219
+ "R1.01,R2.01,R3.02,P1.62",
220
+ "R1.01,R2.01,R3.03,P1.62",
221
+ "R1.01,R2.01,R3.04,P1.62",
222
+ "R1.01,R2.01,R3.05,P1.62"
223
+ ]
224
+ }
225
+ ],
226
+ "direct_tforf_records": 3350721,
227
+ "direct_tforf_unique": 934,
228
+ "direct_gene_transcript_records": 59640,
229
+ "direct_gene_transcript_unique": 87,
230
+ "barcode_like_records_sampled_all": 26225671,
231
+ "barcode_like_unique": 3346,
232
+ "direct_tforf_files": {
233
+ "GSM6719990_210322_TFmap_S21.csv.gz": 841045,
234
+ "GSM6719991_210322_TFmap_S22.csv.gz": 839113,
235
+ "GSM6719992_210322_TFmap_S23.csv.gz": 832880,
236
+ "GSM6719993_210322_TFmap_S24.csv.gz": 837683
237
+ },
238
+ "direct_gene_transcript_files": {
239
+ "GSM6681047_180124_TFmap.csv.gz": 59640
240
+ },
241
+ "direct_tforf_values_sample": [
242
+ "TFORF0006-TULP4",
243
+ "TFORF0008-ZNF709",
244
+ "TFORF0009-ZNF708",
245
+ "TFORF0010-ZNF879",
246
+ "TFORF0012-ZNF700",
247
+ "TFORF0013-ZNF700",
248
+ "TFORF0026-ZNF45",
249
+ "TFORF0027-ZNF44",
250
+ "TFORF0028-ZNF44",
251
+ "TFORF0029-ZNF43",
252
+ "TFORF0030-ZNF43",
253
+ "TFORF0033-SP1",
254
+ "TFORF0034-SP2",
255
+ "TFORF0035-SP3",
256
+ "TFORF0036-SP3",
257
+ "TFORF0037-SP5",
258
+ "TFORF0038-SP7",
259
+ "TFORF0039-SP7",
260
+ "TFORF0041-ZNF675",
261
+ "TFORF0063-GTF3C2",
262
+ "TFORF0067-ZNF451",
263
+ "TFORF0068-ZNF451",
264
+ "TFORF0072-CSDE1",
265
+ "TFORF0082-KCNIP2",
266
+ "TFORF0085-KCNIP2",
267
+ "TFORF0087-LIN28A",
268
+ "TFORF0091-ZEB1",
269
+ "TFORF0092-ZEB1",
270
+ "TFORF0095-ZEB2",
271
+ "TFORF0098-MSGN1"
272
+ ],
273
+ "direct_gene_transcript_values_sample": [
274
+ "ARX-NM_139058",
275
+ "ASCL1-NM_004316",
276
+ "BCL11A-NM_022893",
277
+ "BCL11A-NM_138559",
278
+ "BRIP1-NM_032043",
279
+ "CDK1-NM_001170407",
280
+ "CDK1-NM_001786",
281
+ "CENPA-NM_001042426",
282
+ "CHAF1A-NM_005483",
283
+ "CXXC1-NM_014593",
284
+ "E2F1-NM_005225",
285
+ "E2F2-NM_004091",
286
+ "E2F7-NM_203394",
287
+ "E2F8-NM_001256372",
288
+ "EGR1-NM_001964",
289
+ "EMX2-NM_001165924",
290
+ "EMX2-NM_004098",
291
+ "ENO1-NM_001201483",
292
+ "ENO1-NM_001428",
293
+ "EOMES-NM_001278183",
294
+ "EOMES-NM_005442",
295
+ "FEZF2-NM_018008",
296
+ "FOS-NM_005252",
297
+ "FOXG1-NM_005249",
298
+ "FOXM1-NM_001243089",
299
+ "FOXM1-NM_202003",
300
+ "FOXN4-NM_213596",
301
+ "GLI3-NM_000168",
302
+ "H2AFX-NM_002105",
303
+ "HELLS-NM_001289068"
304
+ ]
305
+ }
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/scripts/acquire_protein_sequences.py ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import argparse
3
+ import json
4
+ import time
5
+ from pathlib import Path
6
+ from typing import Dict, List, Optional, Tuple
7
+
8
+ import requests
9
+ from tqdm import tqdm
10
+
11
+ from mantra.embeddings.config import PentupletConfig
12
+
13
+ ENSEMBL_BASE = "https://rest.ensembl.org"
14
+
15
+ def fetch_sequences(
16
+ gene_names: List[str],
17
+ batch_size: int = 50,
18
+ *,
19
+ reviewed: bool = True,
20
+ gene_field: str = "gene_exact",
21
+ ) -> Dict[str, str]:
22
+ base_url = "https://rest.uniprot.org/uniprotkb/search"
23
+ seq_map = {}
24
+ query_set = set(gene_names)
25
+
26
+ # We want CANONICAL sequences for human genes
27
+ # query: (gene:A OR gene:B) AND organism_id:9606 AND reviewed:true
28
+
29
+ print(f"Fetching sequences for {len(gene_names)} genes in batches of {batch_size}...")
30
+
31
+ for i in range(0, len(gene_names), batch_size):
32
+ batch = gene_names[i:i+batch_size]
33
+ query = "(" + " OR ".join([f"{gene_field}:{g}" for g in batch]) + ") AND organism_id:9606"
34
+ if reviewed:
35
+ query += " AND reviewed:true"
36
+
37
+ params = {
38
+ "query": query,
39
+ "fields": "gene_names,sequence",
40
+ "format": "json",
41
+ "size": batch_size
42
+ }
43
+
44
+ try:
45
+ r = requests.get(base_url, params=params)
46
+ r.raise_for_status()
47
+ results = r.json().get("results", [])
48
+
49
+ for entry in results:
50
+ seq = entry["sequence"]["value"]
51
+ gene_hits = []
52
+ for gene in entry.get("genes", []):
53
+ gene_hits.append(gene["geneName"]["value"])
54
+ for syn in gene.get("synonyms", []):
55
+ gene_hits.append(syn["value"])
56
+
57
+ for hit in gene_hits:
58
+ if hit in query_set and hit not in seq_map:
59
+ seq_map[hit] = seq
60
+
61
+ except Exception as e:
62
+ print(f"Error fetching batch {i}: {e}")
63
+ time.sleep(1)
64
+
65
+ return seq_map
66
+
67
+
68
+ def _ensembl_get_json(path: str, params: Optional[Dict[str, str]] = None) -> Optional[dict]:
69
+ url = f"{ENSEMBL_BASE}{path}"
70
+ try:
71
+ resp = requests.get(
72
+ url,
73
+ params=params,
74
+ headers={"Accept": "application/json", "Content-Type": "application/json"},
75
+ timeout=30,
76
+ )
77
+ resp.raise_for_status()
78
+ return resp.json()
79
+ except Exception as exc:
80
+ print(f"[Ensembl] request failed for {url}: {exc}")
81
+ return None
82
+
83
+
84
+ def _ensembl_get_seq(translation_id: str) -> Optional[str]:
85
+ url = f"{ENSEMBL_BASE}/sequence/id/{translation_id}"
86
+ try:
87
+ resp = requests.get(
88
+ url,
89
+ params={"type": "protein"},
90
+ headers={"Accept": "text/plain", "Content-Type": "text/plain"},
91
+ timeout=30,
92
+ )
93
+ resp.raise_for_status()
94
+ seq = resp.text.strip()
95
+ return seq or None
96
+ except Exception as exc:
97
+ print(f"[Ensembl] sequence fetch failed for {translation_id}: {exc}")
98
+ return None
99
+
100
+
101
+ def fetch_ensembl_translations(
102
+ gene_names: List[str],
103
+ *,
104
+ species: str = "homo_sapiens",
105
+ sleep_s: float = 0.1,
106
+ ) -> Dict[str, str]:
107
+ seq_map: Dict[str, str] = {}
108
+ for gene in tqdm(gene_names, desc="Ensembl translations", dynamic_ncols=True):
109
+ data = _ensembl_get_json(f"/xrefs/symbol/{species}/{gene}")
110
+ if not data:
111
+ time.sleep(sleep_s)
112
+ continue
113
+ gene_ids = [d["id"] for d in data if d.get("type") == "gene"]
114
+ translation_id = None
115
+ for gid in gene_ids:
116
+ lookup = _ensembl_get_json(f"/lookup/id/{gid}", params={"expand": "1"})
117
+ if not lookup:
118
+ continue
119
+ canonical = lookup.get("canonical_transcript")
120
+ transcripts = lookup.get("Transcript", [])
121
+ if canonical:
122
+ for tx in transcripts:
123
+ if tx.get("id") == canonical and tx.get("Translation"):
124
+ translation_id = tx["Translation"]["id"]
125
+ break
126
+ if not translation_id:
127
+ for tx in transcripts:
128
+ if tx.get("Translation"):
129
+ translation_id = tx["Translation"]["id"]
130
+ break
131
+ if translation_id:
132
+ break
133
+ if translation_id:
134
+ seq = _ensembl_get_seq(translation_id)
135
+ if seq:
136
+ seq_map[gene] = seq
137
+ time.sleep(sleep_s)
138
+ return seq_map
139
+
140
+
141
+ def _pick_best_homology(homologies: List[dict]) -> Optional[dict]:
142
+ if not homologies:
143
+ return None
144
+ type_rank = {
145
+ "ortholog_one2one": 0,
146
+ "ortholog_one2many": 1,
147
+ "ortholog_many2many": 2,
148
+ }
149
+ def key_fn(h: dict) -> Tuple[int, float]:
150
+ target = h.get("target", {})
151
+ rank = type_rank.get(h.get("type"), 9)
152
+ return (rank, -float(target.get("perc_id", 0.0)))
153
+ return sorted(homologies, key=key_fn)[0]
154
+
155
+
156
+ def fetch_ensembl_orthologs(
157
+ gene_names: List[str],
158
+ *,
159
+ species: str = "homo_sapiens",
160
+ target_species: str = "mus_musculus",
161
+ sleep_s: float = 0.1,
162
+ ) -> Dict[str, str]:
163
+ seq_map: Dict[str, str] = {}
164
+ for gene in tqdm(gene_names, desc=f"Ensembl orthologs ({target_species})", dynamic_ncols=True):
165
+ data = _ensembl_get_json(
166
+ f"/homology/symbol/{species}/{gene}",
167
+ params={"target_species": target_species, "type": "orthologues"},
168
+ )
169
+ if not data or not data.get("data"):
170
+ time.sleep(sleep_s)
171
+ continue
172
+ homologies = data["data"][0].get("homologies", [])
173
+ best = _pick_best_homology(homologies)
174
+ if not best:
175
+ time.sleep(sleep_s)
176
+ continue
177
+ target = best.get("target", {})
178
+ translation_id = target.get("protein_id")
179
+ if translation_id:
180
+ seq = _ensembl_get_seq(translation_id)
181
+ if seq:
182
+ seq_map[gene] = seq
183
+ time.sleep(sleep_s)
184
+ continue
185
+ time.sleep(sleep_s)
186
+ return seq_map
187
+
188
+ def main():
189
+ cfg = PentupletConfig()
190
+
191
+ parser = argparse.ArgumentParser()
192
+ parser.add_argument("--vocab-path", type=str, default=str(cfg.vocab_9866))
193
+ parser.add_argument("--out-path", type=str, default=str(cfg.regulator_seqs))
194
+ parser.add_argument("--existing-path", type=str, default=None,
195
+ help="Optional existing regulator_sequences.json to merge into.")
196
+ parser.add_argument("--only-missing", action="store_true",
197
+ help="Fetch only missing genes from existing-path.")
198
+ parser.add_argument("--include-unreviewed", action="store_true",
199
+ help="Allow unreviewed UniProt entries.")
200
+ parser.add_argument("--fallback-gene", action="store_true",
201
+ help="If still missing, retry with gene: instead of gene_exact:.")
202
+ parser.add_argument("--ensembl-fallback", action="store_true",
203
+ help="Try Ensembl translation IDs for missing genes.")
204
+ parser.add_argument("--ensembl-species", type=str, default="homo_sapiens",
205
+ help="Ensembl species name for primary lookup.")
206
+ parser.add_argument("--ortholog-species", type=str, default="",
207
+ help="If set, try Ensembl orthologs in this species for missing genes.")
208
+ args = parser.parse_args()
209
+
210
+ print(f"Loading vocab from {args.vocab_path}...")
211
+ with open(args.vocab_path, "r") as f:
212
+ data = json.load(f)
213
+ if isinstance(data, list):
214
+ genes = data
215
+ else:
216
+ genes = data.get("symbols", data)
217
+
218
+ print(f"Target: {len(genes)} genes.")
219
+
220
+ existing: Dict[str, str] = {}
221
+ if args.existing_path:
222
+ existing_path = Path(args.existing_path)
223
+ if existing_path.exists():
224
+ with open(existing_path, "r") as f:
225
+ existing = json.load(f)
226
+ print(f"Loaded {len(existing)} existing sequences from {existing_path}.")
227
+
228
+ if args.only_missing and existing:
229
+ fetch_genes = [g for g in genes if g not in existing]
230
+ print(f"Fetching only missing genes: {len(fetch_genes)}")
231
+ else:
232
+ fetch_genes = genes
233
+
234
+ reviewed = not args.include_unreviewed
235
+ seq_map = fetch_sequences(fetch_genes, reviewed=reviewed, gene_field="gene_exact")
236
+ merged = {**existing, **seq_map}
237
+
238
+ if args.fallback_gene:
239
+ missing = [g for g in genes if g not in merged]
240
+ if missing:
241
+ print(f"Fallback gene: retrying for {len(missing)} genes.")
242
+ seq_fallback = fetch_sequences(missing, reviewed=reviewed, gene_field="gene")
243
+ merged.update(seq_fallback)
244
+
245
+ if args.ensembl_fallback:
246
+ missing = [g for g in genes if g not in merged]
247
+ if missing:
248
+ print(f"Ensembl translation fallback for {len(missing)} genes.")
249
+ seq_ensembl = fetch_ensembl_translations(missing, species=args.ensembl_species)
250
+ merged.update(seq_ensembl)
251
+
252
+ if args.ortholog_species:
253
+ missing = [g for g in genes if g not in merged]
254
+ if missing:
255
+ print(f"Ensembl ortholog fallback for {len(missing)} genes.")
256
+ seq_ortho = fetch_ensembl_orthologs(
257
+ missing,
258
+ species=args.ensembl_species,
259
+ target_species=args.ortholog_species,
260
+ )
261
+ merged.update(seq_ortho)
262
+
263
+ print(f"Acquired {len(seq_map)} new sequences.")
264
+
265
+ merged = {g: merged[g] for g in genes if g in merged}
266
+ print(f"Total sequences: {len(merged)}")
267
+
268
+ # Validation
269
+ missing = set(genes) - set(merged.keys())
270
+ if missing:
271
+ print(f"⚠️ Missing {len(missing)} genes (e.g., {list(missing)[:5]})")
272
+
273
+ out_dir = Path(args.out_path).parent
274
+ out_dir.mkdir(parents=True, exist_ok=True)
275
+
276
+ with open(args.out_path, "w") as f:
277
+ json.dump(merged, f, indent=2)
278
+
279
+ print(f"Saved to {args.out_path}")
280
+
281
+ if __name__ == "__main__":
282
+ main()
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/scripts/build_tf_atlas_raw_direct_inputs.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build raw-direct TF Atlas identity inputs from GSE216481_RAW.tar.
3
+
4
+ The raw TFAtlas expression matrices use barcode-like construct columns, so ESM-C
5
+ protein embeddings need a recoverable gene/protein identity table. This script
6
+ extracts direct TF identities from the raw TFmap files in the tar archive.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import argparse
12
+ import gzip
13
+ import json
14
+ import re
15
+ import tarfile
16
+ from collections import Counter
17
+ from pathlib import Path
18
+
19
+
20
+ TFORF_RE = re.compile(r"TFORF\d+-[A-Za-z0-9_.-]+")
21
+ TRANSCRIPT_RE = re.compile(r"[A-Za-z0-9_.-]+-N[MR]_\d+")
22
+ CONTROLS = {"GFP", "mCherry"}
23
+
24
+
25
+ def iter_tfmap_text(tar_path: Path):
26
+ with tarfile.open(tar_path, "r") as tar:
27
+ for member in tar:
28
+ name = Path(member.name).name
29
+ if "TFmap" not in name or not name.endswith(".csv.gz"):
30
+ continue
31
+ handle = tar.extractfile(member)
32
+ if handle is None:
33
+ continue
34
+ with gzip.GzipFile(fileobj=handle) as gz:
35
+ for raw_line in gz:
36
+ yield name, raw_line.decode("utf-8", errors="replace")
37
+
38
+
39
+ def parse_records(tar_path: Path):
40
+ by_key = {}
41
+ for file_name, line in iter_tfmap_text(tar_path):
42
+ for raw in TFORF_RE.findall(line):
43
+ orf_id, symbol = raw.split("-", 1)
44
+ by_key.setdefault((raw, "tforf"), {
45
+ "raw": raw,
46
+ "kind": "tforf",
47
+ "orf_id": orf_id,
48
+ "symbol": symbol,
49
+ "file": file_name,
50
+ })
51
+ for raw in TRANSCRIPT_RE.findall(line):
52
+ symbol = re.split(r"-N[MR]_", raw, maxsplit=1)[0]
53
+ by_key.setdefault((raw, "transcript_label"), {
54
+ "raw": raw,
55
+ "kind": "transcript_label",
56
+ "orf_id": "",
57
+ "symbol": symbol,
58
+ "file": file_name,
59
+ })
60
+ return sorted(by_key.values(), key=lambda r: (r["file"], r["kind"], r["raw"]))
61
+
62
+
63
+ def main() -> int:
64
+ parser = argparse.ArgumentParser()
65
+ parser.add_argument("--raw-tar", required=True, type=Path)
66
+ parser.add_argument("--out-dir", required=True, type=Path)
67
+ args = parser.parse_args()
68
+
69
+ args.out_dir.mkdir(parents=True, exist_ok=True)
70
+ records = parse_records(args.raw_tar)
71
+ symbols_all = sorted({r["symbol"] for r in records})
72
+ symbols_tf = [s for s in symbols_all if s not in CONTROLS]
73
+ summary = {
74
+ "raw_tar": str(args.raw_tar),
75
+ "direct_identity_records_unique": len(records),
76
+ "unique_symbols_excluding_controls": len(symbols_tf),
77
+ "unique_symbols_including_controls": len(symbols_all),
78
+ "kinds": dict(Counter(r["kind"] for r in records)),
79
+ "controls": sorted(s for s in symbols_all if s in CONTROLS),
80
+ }
81
+
82
+ (args.out_dir / "tf_atlas_raw_direct_identity_records.json").write_text(
83
+ json.dumps(records, indent=2) + "\n"
84
+ )
85
+ (args.out_dir / "tf_atlas_raw_direct_tf_symbol_vocab.json").write_text(
86
+ json.dumps(symbols_tf, indent=2) + "\n"
87
+ )
88
+ (args.out_dir / "tf_atlas_raw_direct_identity_summary.json").write_text(
89
+ json.dumps(summary, indent=2) + "\n"
90
+ )
91
+ print(json.dumps(summary, indent=2))
92
+ return 0
93
+
94
+
95
+ if __name__ == "__main__":
96
+ raise SystemExit(main())
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/scripts/generate_esmc.py ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ from dataclasses import dataclass, field
5
+ from datetime import datetime, timezone
6
+ import hashlib
7
+ import json
8
+ from pathlib import Path
9
+ from typing import Any, Protocol
10
+
11
+ import numpy as np
12
+
13
+ from mantra.embeddings.generate_esm3 import POOL_MODES, pool_token_embeddings, sanitize_sequence
14
+
15
+
16
+ DEFAULT_META_DIR = Path("data/processed/metadata")
17
+ DEFAULT_SNAPSHOT_ROOT = Path("data/raw/protein/esmc")
18
+ DEFAULT_OUT_ROOT = Path("data/processed/embeddings/registry/protein_sequence/source_gene_artifacts")
19
+ DEFAULT_MODEL_SIZE = "300m"
20
+ DEFAULT_POOL = "mean_non_special"
21
+
22
+ ESMC_MODELS: dict[str, dict[str, Any]] = {
23
+ "300m": {
24
+ "repo_id": "EvolutionaryScale/esmc-300m-2024-12",
25
+ "revision": "a19d363f07313a10a64d08a2d6b41376a73df5c8",
26
+ "snapshot_name": "esmc-300m-2024-12",
27
+ "weight_path": "data/weights/esmc_300m_2024_12_v0.pth",
28
+ "builder": "ESMC_300M_202412",
29
+ "dimension": 960,
30
+ },
31
+ "600m": {
32
+ "repo_id": "EvolutionaryScale/esmc-600m-2024-12",
33
+ "revision": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
34
+ "snapshot_name": "esmc-600m-2024-12",
35
+ "weight_path": "data/weights/esmc_600m_2024_12_v0.pth",
36
+ "builder": "ESMC_600M_202412",
37
+ "dimension": 1152,
38
+ },
39
+ }
40
+
41
+
42
+ class SequenceExtractor(Protocol):
43
+ def embed(self, sequence: str) -> np.ndarray:
44
+ raise NotImplementedError
45
+
46
+
47
+ @dataclass(frozen=True)
48
+ class EsmcGenerationConfig:
49
+ model_size: str = DEFAULT_MODEL_SIZE
50
+ meta_dir: Path = DEFAULT_META_DIR
51
+ snapshot_root: Path = DEFAULT_SNAPSHOT_ROOT
52
+ snapshot_dir: Path | None = None
53
+ out_root: Path = DEFAULT_OUT_ROOT
54
+ out_dir: Path | None = None
55
+ out_prefix: str | None = None
56
+ vocab_path: Path | None = None
57
+ sequence_path: Path | None = None
58
+ device: str = "auto"
59
+ pool: str = DEFAULT_POOL
60
+ max_length: int = 2048
61
+ limit: int | None = None
62
+ use_flash_attn: bool = True
63
+
64
+ @property
65
+ def model_info(self) -> dict[str, Any]:
66
+ if self.model_size not in ESMC_MODELS:
67
+ raise ValueError(f"model_size must be one of {tuple(ESMC_MODELS)}; got {self.model_size!r}")
68
+ return ESMC_MODELS[self.model_size]
69
+
70
+ @property
71
+ def resolved_snapshot_dir(self) -> Path:
72
+ return self.snapshot_dir if self.snapshot_dir is not None else self.snapshot_root / self.model_info["snapshot_name"]
73
+
74
+ @property
75
+ def resolved_out_dir(self) -> Path:
76
+ return self.out_dir if self.out_dir is not None else self.out_root / self.model_info["snapshot_name"].replace("-", "_")
77
+
78
+ @property
79
+ def resolved_out_prefix(self) -> str:
80
+ return self.out_prefix if self.out_prefix is not None else f"{self.model_info['snapshot_name'].replace('-', '_')}_{self.pool}"
81
+
82
+ @property
83
+ def resolved_vocab_path(self) -> Path:
84
+ return self.vocab_path if self.vocab_path is not None else self.meta_dir / "vocab_k562_gwps_full.json"
85
+
86
+ @property
87
+ def resolved_sequence_path(self) -> Path:
88
+ return self.sequence_path if self.sequence_path is not None else self.meta_dir / "regulator_sequences.json"
89
+
90
+ @property
91
+ def embedding_path(self) -> Path:
92
+ return self.resolved_out_dir / f"{self.resolved_out_prefix}.npy"
93
+
94
+ @property
95
+ def mask_path(self) -> Path:
96
+ return self.resolved_out_dir / f"{self.resolved_out_prefix}_mask.npy"
97
+
98
+ @property
99
+ def metadata_path(self) -> Path:
100
+ return self.resolved_out_dir / f"{self.resolved_out_prefix}.meta.json"
101
+
102
+
103
+ @dataclass
104
+ class EsmcSequenceExtractor:
105
+ model_size: str = DEFAULT_MODEL_SIZE
106
+ snapshot_root: Path = DEFAULT_SNAPSHOT_ROOT
107
+ snapshot_dir: Path | None = None
108
+ device: str = "auto"
109
+ pool: str = DEFAULT_POOL
110
+ max_length: int = 2048
111
+ use_flash_attn: bool = True
112
+ _model: Any = field(default=None, init=False, repr=False)
113
+ _esm_protein: Any = field(default=None, init=False, repr=False)
114
+ _logits_config: Any = field(default=None, init=False, repr=False)
115
+ _resolved_device: str | None = field(default=None, init=False, repr=False)
116
+
117
+ def __post_init__(self) -> None:
118
+ if self.model_size not in ESMC_MODELS:
119
+ raise ValueError(f"model_size must be one of {tuple(ESMC_MODELS)}; got {self.model_size!r}")
120
+ if self.pool not in POOL_MODES:
121
+ raise ValueError(f"pool must be one of {POOL_MODES}; got {self.pool!r}")
122
+ if self.max_length <= 0:
123
+ raise ValueError("max_length must be positive")
124
+
125
+ @property
126
+ def model_info(self) -> dict[str, Any]:
127
+ return ESMC_MODELS[self.model_size]
128
+
129
+ @property
130
+ def resolved_snapshot_dir(self) -> Path:
131
+ return self.snapshot_dir if self.snapshot_dir is not None else self.snapshot_root / self.model_info["snapshot_name"]
132
+
133
+ @property
134
+ def model(self) -> Any:
135
+ if self._model is None:
136
+ self._load_model()
137
+ return self._model
138
+
139
+ @property
140
+ def resolved_device(self) -> str:
141
+ if self._resolved_device is None:
142
+ self._resolved_device = resolve_device(self.device)
143
+ return self._resolved_device
144
+
145
+ def _load_model(self) -> None:
146
+ import esm.pretrained as pretrained
147
+ import esm.utils.constants.esm3 as constants
148
+ from esm.sdk.api import ESMProtein, LogitsConfig
149
+
150
+ snapshot_dir = self.resolved_snapshot_dir
151
+ assert_snapshot_complete(snapshot_dir, model_size=self.model_size)
152
+
153
+ def local_data_root(model: str) -> Path:
154
+ if str(model).startswith("esmc-300"):
155
+ return snapshot_dir if self.model_size == "300m" else self.snapshot_root / ESMC_MODELS["300m"]["snapshot_name"]
156
+ if str(model).startswith("esmc-600"):
157
+ return snapshot_dir if self.model_size == "600m" else self.snapshot_root / ESMC_MODELS["600m"]["snapshot_name"]
158
+ return snapshot_dir
159
+
160
+ constants.data_root = local_data_root
161
+ pretrained.data_root = local_data_root
162
+ builder = getattr(pretrained, self.model_info["builder"])
163
+ self._esm_protein = ESMProtein
164
+ self._logits_config = LogitsConfig
165
+ self._model = builder(self.resolved_device, use_flash_attn=self.use_flash_attn)
166
+ self._model.eval()
167
+
168
+ def embed(self, sequence: str) -> np.ndarray:
169
+ sequence_clean = sanitize_sequence(sequence, self.max_length)
170
+ if not sequence_clean:
171
+ raise ValueError("cannot embed an empty sequence")
172
+ protein = self._esm_protein(sequence=sequence_clean) if self._esm_protein is not None else None
173
+ if protein is None:
174
+ self._load_model()
175
+ protein = self._esm_protein(sequence=sequence_clean)
176
+ tokens = self.model.encode(protein)
177
+ logits_config = self._logits_config(return_embeddings=True)
178
+ import torch
179
+
180
+ with torch.inference_mode():
181
+ output = self.model.logits(tokens, logits_config)
182
+ embedding = output.embeddings.detach().float().cpu().numpy()
183
+ return pool_token_embeddings(embedding, pool=self.pool)
184
+
185
+
186
+ def resolve_device(device: str) -> str:
187
+ if device != "auto":
188
+ return device
189
+ import torch
190
+
191
+ return "cuda" if torch.cuda.is_available() else "cpu"
192
+
193
+
194
+ def utc_now_iso() -> str:
195
+ return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
196
+
197
+
198
+ def load_json(path: Path) -> Any:
199
+ with path.open("r", encoding="utf-8") as handle:
200
+ return json.load(handle)
201
+
202
+
203
+ def load_vocab(path: Path) -> list[str]:
204
+ payload = load_json(path)
205
+ if not isinstance(payload, list) or not all(isinstance(item, str) for item in payload):
206
+ raise ValueError(f"vocab must be a JSON string list: {path}")
207
+ return payload
208
+
209
+
210
+ def load_sequence_map(path: Path) -> dict[str, str]:
211
+ payload = load_json(path)
212
+ if not isinstance(payload, dict):
213
+ raise ValueError(f"sequence map must be a JSON object: {path}")
214
+ return {str(key): str(value) for key, value in payload.items() if str(value)}
215
+
216
+
217
+ def sha256_file(path: Path) -> str:
218
+ digest = hashlib.sha256()
219
+ with path.open("rb") as handle:
220
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
221
+ digest.update(chunk)
222
+ return digest.hexdigest()
223
+
224
+
225
+ def assert_snapshot_complete(snapshot_dir: Path, *, model_size: str) -> None:
226
+ if model_size not in ESMC_MODELS:
227
+ raise ValueError(f"model_size must be one of {tuple(ESMC_MODELS)}; got {model_size!r}")
228
+ required = (
229
+ ".gitattributes",
230
+ "README.md",
231
+ "config.json",
232
+ ESMC_MODELS[model_size]["weight_path"],
233
+ )
234
+ missing = [str(snapshot_dir / rel_path) for rel_path in required if not (snapshot_dir / rel_path).exists()]
235
+ if missing:
236
+ raise FileNotFoundError("ESM-C snapshot is incomplete:\n" + "\n".join(missing))
237
+
238
+
239
+ def package_versions() -> dict[str, str | None]:
240
+ versions: dict[str, str | None] = {}
241
+ for package in ("esm", "torch", "numpy"):
242
+ try:
243
+ module = __import__(package)
244
+ versions[package] = getattr(module, "__version__", None)
245
+ except Exception:
246
+ versions[package] = None
247
+ return versions
248
+
249
+
250
+ def build_metadata(
251
+ *,
252
+ config: EsmcGenerationConfig,
253
+ genes: list[str],
254
+ mask: np.ndarray,
255
+ dim: int,
256
+ embedding_path: Path,
257
+ ) -> dict[str, Any]:
258
+ info = config.model_info
259
+ return {
260
+ "schema_version": "1.0",
261
+ "generated_utc": utc_now_iso(),
262
+ "model": info["snapshot_name"],
263
+ "model_size": config.model_size,
264
+ "hf_repo_id": info["repo_id"],
265
+ "snapshot_dir": str(config.resolved_snapshot_dir),
266
+ "snapshot_commit": info["revision"],
267
+ "pool": config.pool,
268
+ "max_length": config.max_length,
269
+ "device": config.device,
270
+ "limit": config.limit,
271
+ "use_flash_attn": config.use_flash_attn,
272
+ "vocab_path": str(config.resolved_vocab_path),
273
+ "sequence_path": str(config.resolved_sequence_path),
274
+ "vocab_sha256": sha256_file(config.resolved_vocab_path),
275
+ "sequence_sha256": sha256_file(config.resolved_sequence_path),
276
+ "embedding_path": str(embedding_path),
277
+ "mask_path": str(config.mask_path),
278
+ "n_vocab": len(genes),
279
+ "n_embedded": int(mask.sum()),
280
+ "dimension": int(dim),
281
+ "expected_dimension": int(info["dimension"]),
282
+ "dtype": "float32",
283
+ "packages": package_versions(),
284
+ }
285
+
286
+
287
+ def generate_esmc_embeddings(
288
+ config: EsmcGenerationConfig,
289
+ *,
290
+ extractor: SequenceExtractor | None = None,
291
+ ) -> dict[str, Any]:
292
+ if config.pool not in POOL_MODES:
293
+ raise ValueError(f"pool must be one of {POOL_MODES}; got {config.pool!r}")
294
+ genes_all = load_vocab(config.resolved_vocab_path)
295
+ genes = genes_all[: config.limit] if config.limit is not None else genes_all
296
+ seq_map = load_sequence_map(config.resolved_sequence_path)
297
+ sequence_extractor = extractor or EsmcSequenceExtractor(
298
+ model_size=config.model_size,
299
+ snapshot_root=config.snapshot_root,
300
+ snapshot_dir=config.snapshot_dir,
301
+ device=config.device,
302
+ pool=config.pool,
303
+ max_length=config.max_length,
304
+ use_flash_attn=config.use_flash_attn,
305
+ )
306
+ rows: list[np.ndarray] = []
307
+ mask = np.zeros(len(genes), dtype=bool)
308
+ dim: int | None = None
309
+ for idx, gene in enumerate(genes):
310
+ sequence = sanitize_sequence(seq_map.get(gene, ""), config.max_length)
311
+ if not sequence:
312
+ if dim is None:
313
+ rows.append(np.zeros((0,), dtype=np.float32))
314
+ else:
315
+ rows.append(np.zeros((dim,), dtype=np.float32))
316
+ continue
317
+ vector = np.asarray(sequence_extractor.embed(sequence), dtype=np.float32)
318
+ if vector.ndim != 1:
319
+ raise ValueError(f"extractor returned non-vector embedding for {gene}: {vector.shape}")
320
+ if dim is None:
321
+ dim = int(vector.shape[0])
322
+ rows = [np.zeros((dim,), dtype=np.float32) if row.size == 0 else row for row in rows]
323
+ elif vector.shape[0] != dim:
324
+ raise ValueError(f"extractor dimension changed from {dim} to {vector.shape[0]} for {gene}")
325
+ rows.append(vector)
326
+ mask[idx] = True
327
+ if dim is None:
328
+ raise ValueError("no sequences were embedded; check the vocabulary and sequence map")
329
+ matrix = np.vstack(rows).astype(np.float32, copy=False)
330
+ config.resolved_out_dir.mkdir(parents=True, exist_ok=True)
331
+ np.save(config.embedding_path, matrix)
332
+ np.save(config.mask_path, mask)
333
+ metadata = build_metadata(
334
+ config=config,
335
+ genes=genes,
336
+ mask=mask,
337
+ dim=dim,
338
+ embedding_path=config.embedding_path,
339
+ )
340
+ config.metadata_path.write_text(json.dumps(metadata, indent=2) + "\n", encoding="utf-8")
341
+ return metadata
342
+
343
+
344
+ def parse_args(argv: list[str] | None = None) -> EsmcGenerationConfig:
345
+ parser = argparse.ArgumentParser(description="Generate local ESM-C protein embeddings.")
346
+ parser.add_argument("--model-size", choices=tuple(ESMC_MODELS), default=DEFAULT_MODEL_SIZE)
347
+ parser.add_argument("--meta-dir", type=Path, default=DEFAULT_META_DIR)
348
+ parser.add_argument("--snapshot-root", type=Path, default=DEFAULT_SNAPSHOT_ROOT)
349
+ parser.add_argument("--snapshot-dir", type=Path)
350
+ parser.add_argument("--out-root", type=Path, default=DEFAULT_OUT_ROOT)
351
+ parser.add_argument("--out-dir", type=Path)
352
+ parser.add_argument("--out-prefix", type=str)
353
+ parser.add_argument("--vocab-path", type=Path)
354
+ parser.add_argument("--sequence-path", type=Path)
355
+ parser.add_argument("--device", type=str, default="auto")
356
+ parser.add_argument("--pool", choices=POOL_MODES, default=DEFAULT_POOL)
357
+ parser.add_argument("--max-length", type=int, default=2048)
358
+ parser.add_argument("--limit", type=int)
359
+ parser.add_argument("--no-flash-attn", action="store_true")
360
+ args = parser.parse_args(argv)
361
+ return EsmcGenerationConfig(
362
+ model_size=args.model_size,
363
+ meta_dir=args.meta_dir,
364
+ snapshot_root=args.snapshot_root,
365
+ snapshot_dir=args.snapshot_dir,
366
+ out_root=args.out_root,
367
+ out_dir=args.out_dir,
368
+ out_prefix=args.out_prefix,
369
+ vocab_path=args.vocab_path,
370
+ sequence_path=args.sequence_path,
371
+ device=args.device,
372
+ pool=args.pool,
373
+ max_length=args.max_length,
374
+ limit=args.limit,
375
+ use_flash_attn=not args.no_flash_attn,
376
+ )
377
+
378
+ # Example invocation:
379
+ # PYTHONPATH=src:. python -m mantra.embeddings.generate_esmc \
380
+ # --device cuda \
381
+ # --vocab-path /tmp/mantra_one_tf_vocab.json \
382
+ # --sequence-path data/processed/metadata/regulator_sequences.json \
383
+ # --out-dir /tmp/mantra_esm3_gata1 \
384
+ # --out-prefix GATA1_esm3
385
+
386
+ def main(argv: list[str] | None = None) -> int:
387
+ metadata = generate_esmc_embeddings(parse_args(argv))
388
+ print(json.dumps(metadata, indent=2))
389
+ return 0
390
+
391
+
392
+ if __name__ == "__main__": # pragma: no cover
393
+ raise SystemExit(main())
processed/protein_embeddings/tf_atlas_raw_direct_esmc_600m/tf_atlas_raw_direct_esmc_600m_mean_non_special.meta.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "1.0",
3
+ "generated_utc": "2026-04-15T22:11:07Z",
4
+ "model": "esmc-600m-2024-12",
5
+ "model_size": "600m",
6
+ "hf_repo_id": "EvolutionaryScale/esmc-600m-2024-12",
7
+ "snapshot_dir": "data/raw/protein/esmc/esmc-600m-2024-12",
8
+ "snapshot_commit": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
9
+ "pool": "mean_non_special",
10
+ "max_length": 2048,
11
+ "device": "cuda",
12
+ "limit": null,
13
+ "use_flash_attn": true,
14
+ "vocab_path": "data/processed/metadata/tf_atlas_raw_direct_tf_symbol_vocab.json",
15
+ "sequence_path": "data/processed/metadata/tf_atlas_raw_direct_regulator_sequences.json",
16
+ "vocab_sha256": "0addfbe186798e3064c38be48351218f30c37b5032ab28615055cf802ebd2f73",
17
+ "sequence_sha256": "b883576e8c9e78bd843fe1884d0e0e775e619bf232ce6a2d53a46b6a3503c416",
18
+ "embedding_path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_raw_direct_esmc_600m/tf_atlas_raw_direct_esmc_600m_mean_non_special.npy",
19
+ "mask_path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/tf_atlas_raw_direct_esmc_600m/tf_atlas_raw_direct_esmc_600m_mean_non_special_mask.npy",
20
+ "n_vocab": 717,
21
+ "n_embedded": 717,
22
+ "dimension": 1152,
23
+ "expected_dimension": 1152,
24
+ "dtype": "float32",
25
+ "packages": {
26
+ "esm": "3.2.1",
27
+ "torch": "2.10.0+cu129",
28
+ "numpy": "1.26.4"
29
+ }
30
+ }
raw_sources/protein_models/esm3/MANIFEST.json ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "artifact_family": "ESM-3",
3
+ "status": "downloaded_snapshot_complete_runtime_ready",
4
+ "checked_utc": "2026-04-15T17:35:29Z",
5
+ "local_root": "data/raw/protein/esm3",
6
+ "target_snapshot": {
7
+ "repo_id": "EvolutionaryScale/esm3-sm-open-v1",
8
+ "repo_type": "model",
9
+ "revision": "2feda652c51c57f9797fc1b01f8d6181b38fb488",
10
+ "gated": "auto",
11
+ "private": false,
12
+ "expected_total_bytes": 5495563528
13
+ },
14
+ "download_attempt": {
15
+ "attempted_utc": "2026-04-15T17:35:00Z",
16
+ "command_log": "data/raw/protein/esm3/esm3-sm-open-v1/download.log",
17
+ "result": "initial_attempt_failed_then_manual_or_authenticated_download_completed",
18
+ "failure_type": "huggingface_hub.errors.GatedRepoError",
19
+ "failure_summary": "File access requires authentication to a Hugging Face account that has accepted the EvolutionaryScale ESM-3 model terms."
20
+ },
21
+ "expected_files": [
22
+ {
23
+ "path": ".gitattributes",
24
+ "bytes": 1519
25
+ },
26
+ {
27
+ "path": "README.md",
28
+ "bytes": 3057
29
+ },
30
+ {
31
+ "path": "config.json",
32
+ "bytes": 3
33
+ },
34
+ {
35
+ "path": "data/1utn.pdb",
36
+ "bytes": 568701
37
+ },
38
+ {
39
+ "path": "data/ParentChildTreeFile.txt",
40
+ "bytes": 594786
41
+ },
42
+ {
43
+ "path": "data/entry_list_safety_29026.list",
44
+ "bytes": 1595245
45
+ },
46
+ {
47
+ "path": "data/esm3_entry.list",
48
+ "bytes": 1929090
49
+ },
50
+ {
51
+ "path": "data/hyperplanes_8bit_58641.npz",
52
+ "bytes": 30026086
53
+ },
54
+ {
55
+ "path": "data/hyperplanes_8bit_68103.npz",
56
+ "bytes": 34870630
57
+ },
58
+ {
59
+ "path": "data/interpro2keywords.csv",
60
+ "bytes": 7320318
61
+ },
62
+ {
63
+ "path": "data/interpro_29026_to_keywords_58641.csv",
64
+ "bytes": 10061298
65
+ },
66
+ {
67
+ "path": "data/keyword_idf_safety_filtered_58641.npy",
68
+ "bytes": 469256
69
+ },
70
+ {
71
+ "path": "data/keyword_vocabulary_safety_filtered_58641.txt",
72
+ "bytes": 787696
73
+ },
74
+ {
75
+ "path": "data/keywords.txt",
76
+ "bytes": 787695
77
+ },
78
+ {
79
+ "path": "data/tag_dict_4.json",
80
+ "bytes": 691190
81
+ },
82
+ {
83
+ "path": "data/tag_dict_4_safety_filtered.json",
84
+ "bytes": 569410
85
+ },
86
+ {
87
+ "path": "data/tfidf_safety_filtered_58641.pkl",
88
+ "bytes": 2022460
89
+ },
90
+ {
91
+ "path": "data/uniref90_and_mgnify90_residue_annotations_gt_1k_proteins.csv",
92
+ "bytes": 109468
93
+ },
94
+ {
95
+ "path": "data/weights/esm3_function_decoder_v0.pth",
96
+ "bytes": 1299947178
97
+ },
98
+ {
99
+ "path": "data/weights/esm3_sm_open_v1.pth",
100
+ "bytes": 2803646068
101
+ },
102
+ {
103
+ "path": "data/weights/esm3_structure_decoder_v0.pth",
104
+ "bytes": 1237213098
105
+ },
106
+ {
107
+ "path": "data/weights/esm3_structure_encoder_v0.pth",
108
+ "bytes": 62349276
109
+ }
110
+ ],
111
+ "local_existing_files": [
112
+ "data/raw/protein/esm3/README.md",
113
+ "data/raw/protein/esm3/MANIFEST.json",
114
+ "data/raw/protein/esm3/esm3-sm-open-v1/DOWNLOAD_STARTED_UTC.txt",
115
+ "data/raw/protein/esm3/esm3-sm-open-v1/download.log"
116
+ ],
117
+ "notes": [
118
+ "Existing MANTRA ESM embeddings are ESM-2-derived, not ESM-3.",
119
+ "Do not mix ESM-3 raw model files with processed perturbation-level embedding artifacts.",
120
+ "After download, record file hashes and snapshot completeness before generating MANTRA-aligned embeddings."
121
+ ],
122
+ "validated_utc": "2026-04-15T17:48:51Z",
123
+ "runtime_validation": {
124
+ "validated_utc": "2026-04-15T18:11:23Z",
125
+ "python_packages": {
126
+ "esm": "3.2.1",
127
+ "torch": "2.10.0+cu129",
128
+ "numpy": "1.26.4",
129
+ "transformers": "4.48.1",
130
+ "httpx": "0.28.1"
131
+ },
132
+ "real_weight_smoke_artifact": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/esm3_sm_open_v1/esm3_sm_open_v1_mean_non_special_smoke1.npy",
133
+ "real_weight_smoke_shape": [
134
+ 1,
135
+ 1536
136
+ ],
137
+ "real_weight_smoke_device": "cuda"
138
+ },
139
+ "local_file_hashes": [
140
+ {
141
+ "path": ".gitattributes",
142
+ "bytes": 1519,
143
+ "sha256": "11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361"
144
+ },
145
+ {
146
+ "path": "README.md",
147
+ "bytes": 3057,
148
+ "sha256": "f6a256d01ab215536af5cb6d09777eef7c02162c56c78729c4703b505ed5cd02"
149
+ },
150
+ {
151
+ "path": "config.json",
152
+ "bytes": 3,
153
+ "sha256": "ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356"
154
+ },
155
+ {
156
+ "path": "data/1utn.pdb",
157
+ "bytes": 568701,
158
+ "sha256": "d6c4891dfbad579a5ef597eb111e46ca2851c37f099febab28b50f443d4af4fd"
159
+ },
160
+ {
161
+ "path": "data/ParentChildTreeFile.txt",
162
+ "bytes": 594786,
163
+ "sha256": "f2290e27c1fcd2b684d06ab7a71143072f922f5901a70d09dcff7124e40d90cb"
164
+ },
165
+ {
166
+ "path": "data/entry_list_safety_29026.list",
167
+ "bytes": 1595245,
168
+ "sha256": "58eda77a7c0c89f8c04b62d0a584bdd758a23a7632ee834fcdfdbedc697ed897"
169
+ },
170
+ {
171
+ "path": "data/esm3_entry.list",
172
+ "bytes": 1929090,
173
+ "sha256": "0e19e8aa2341e5c34a227ff9e2973a26525b5a1f3682c032a16e6d1867841af6"
174
+ },
175
+ {
176
+ "path": "data/hyperplanes_8bit_58641.npz",
177
+ "bytes": 30026086,
178
+ "sha256": "25e680def9abb366a31bdea8fe26720828c778dce80689294744afdbe341e13e"
179
+ },
180
+ {
181
+ "path": "data/hyperplanes_8bit_68103.npz",
182
+ "bytes": 34870630,
183
+ "sha256": "886d79883bfc4efb2e160cc327dbdbd25d88bfb3f9774120bb6210cb0ea7efa2"
184
+ },
185
+ {
186
+ "path": "data/interpro2keywords.csv",
187
+ "bytes": 7320318,
188
+ "sha256": "fc5ef7d0b4b6bc2aec4d2b1e6189ba97e2d70a19017e358f870b9f47e2c9b22f"
189
+ },
190
+ {
191
+ "path": "data/interpro_29026_to_keywords_58641.csv",
192
+ "bytes": 10061298,
193
+ "sha256": "e560a84c9953b4d8cf30e3c11e6673151d20de5ea9b0aaf11adf7bf7a6bb70fd"
194
+ },
195
+ {
196
+ "path": "data/keyword_idf_safety_filtered_58641.npy",
197
+ "bytes": 469256,
198
+ "sha256": "d83bfb4cda19dcd3bac939c82d369310dbd09b07d30affe7dffc2e4af82200f6"
199
+ },
200
+ {
201
+ "path": "data/keyword_vocabulary_safety_filtered_58641.txt",
202
+ "bytes": 787696,
203
+ "sha256": "503309e9b62a5155bc34a7338af39fb8fc13a0c1d78bad50603f2f81f47a4123"
204
+ },
205
+ {
206
+ "path": "data/keywords.txt",
207
+ "bytes": 787695,
208
+ "sha256": "8ebd6d6e3bc47bc8939988d7e72f7d6ba79a0f1604909703ec609430da4b72dc"
209
+ },
210
+ {
211
+ "path": "data/tag_dict_4.json",
212
+ "bytes": 691190,
213
+ "sha256": "b2c79640bded97d6307124e8b46146d9304a442f1251c1937a320e884f7b3aad"
214
+ },
215
+ {
216
+ "path": "data/tag_dict_4_safety_filtered.json",
217
+ "bytes": 569410,
218
+ "sha256": "c468c6596d85165490368d599cb5f41ae797dc1805798b815b2f38954cdbfc36"
219
+ },
220
+ {
221
+ "path": "data/tfidf_safety_filtered_58641.pkl",
222
+ "bytes": 2022460,
223
+ "sha256": "36255389d481cffd04f1bcd4a3193360abde685ccafcf03ee26feb50048cfe20"
224
+ },
225
+ {
226
+ "path": "data/uniref90_and_mgnify90_residue_annotations_gt_1k_proteins.csv",
227
+ "bytes": 109468,
228
+ "sha256": "557a053405eddbdf64f13532eabb4a38aa7a652014185a12406940b7fa61d86d"
229
+ },
230
+ {
231
+ "path": "data/weights/esm3_function_decoder_v0.pth",
232
+ "bytes": 1299947178,
233
+ "sha256": "f76d074efcaccfe21365a4fa96f212dadd66798e1e49d809ab7ffbe025d227c9"
234
+ },
235
+ {
236
+ "path": "data/weights/esm3_sm_open_v1.pth",
237
+ "bytes": 2803646068,
238
+ "sha256": "5ead5a135c658068db6a4f1b933e72d6110992c4668822e1c0e2dcc53e38acd9"
239
+ },
240
+ {
241
+ "path": "data/weights/esm3_structure_decoder_v0.pth",
242
+ "bytes": 1237213098,
243
+ "sha256": "3b726258a44274792b40ce7ea307e10c5da09936368a4ffa2970264d909da65b"
244
+ },
245
+ {
246
+ "path": "data/weights/esm3_structure_encoder_v0.pth",
247
+ "bytes": 62349276,
248
+ "sha256": "467acbaee703ba3ccde6e75241a912a316952e5ff071355f85c1d33c68704f40"
249
+ }
250
+ ],
251
+ "completeness_check": {
252
+ "missing_files": [],
253
+ "wrong_size_files": [],
254
+ "file_count": 22
255
+ }
256
+ }
raw_sources/protein_models/esm3/README.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ESM-3 Raw Model Sequestration
2
+
3
+ This directory is reserved for ESM-3 model artifacts and download provenance. It is intentionally separate from existing MANTRA ESM embeddings, which are ESM-2-derived artifacts generated from `facebook/esm2_t33_650M_UR50D`.
4
+
5
+ ## Current Status
6
+
7
+ The ESM-3 small-open snapshot is downloaded and validated in this checkout.
8
+
9
+ The local target is:
10
+
11
+ - Hugging Face repo: `EvolutionaryScale/esm3-sm-open-v1`
12
+ - Revision: `2feda652c51c57f9797fc1b01f8d6181b38fb488`
13
+ - Local target: `data/raw/protein/esm3/esm3-sm-open-v1/`
14
+ - Expected files present: `22`
15
+ - Snapshot size on disk: approximately `5.2G`
16
+
17
+ The first unauthenticated download attempt failed with `GatedRepoError`. The completed snapshot was obtained after access was available for the gated repository.
18
+
19
+ ## Download Command
20
+
21
+ To reproduce the raw snapshot on a machine with accepted model terms:
22
+
23
+ ```bash
24
+ huggingface-cli login
25
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download EvolutionaryScale/esm3-sm-open-v1 \
26
+ --revision 2feda652c51c57f9797fc1b01f8d6181b38fb488 \
27
+ --local-dir data/raw/protein/esm3/esm3-sm-open-v1 \
28
+ --max-workers 8
29
+ ```
30
+
31
+ The expected snapshot size from Hugging Face metadata is approximately 5.50 GB.
32
+
33
+ ## Runtime Setup
34
+
35
+ The local generator uses the `esm` Python package and patches its ESM-3 data root to this local snapshot, avoiding an implicit Hugging Face download during embedding generation.
36
+
37
+ ```bash
38
+ python -m pip install -r data/raw/protein/esm3/requirements-esm3.txt
39
+ PYTHONPATH=src:. python -m mantra.embeddings.generate_esm3 --device cuda
40
+ ```
41
+
42
+ The installed `esm` package constrains `transformers` to the ESM-compatible range. In this environment, installing `esm==3.2.1.post1` selected `transformers==4.48.1`.
43
+
44
+ A real-weight one-gene smoke has been run successfully:
45
+
46
+ ```text
47
+ data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/esm3_sm_open_v1/esm3_sm_open_v1_mean_non_special_smoke1.npy
48
+ ```
49
+
50
+ ## Provenance Boundary
51
+
52
+ Artifacts under this directory are raw model assets. They are not MANTRA perturbation-level embeddings until a separate, documented generation step produces aligned matrices under the processed embedding registry.
53
+
54
+ Existing ESM artifacts elsewhere in the repository should be treated as ESM-2 unless their provenance explicitly says otherwise.
raw_sources/protein_models/esm3/esm3-sm-open-v1/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
raw_sources/protein_models/esm3/esm3-sm-open-v1/DOWNLOAD_STARTED_UTC.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 2026-04-15T17:35:10Z
raw_sources/protein_models/esm3/esm3-sm-open-v1/README.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - biology
6
+ - esm
7
+ - protein
8
+ extra_gated_heading: Agree to license and to share information
9
+ extra_gated_description: "The information you provide will be collected, stored, processed and shared in accordance with the [EvolutionaryScale Privacy Policy](https://www.evolutionaryscale.ai/legal/privacy)"
10
+ extra_gated_prompt: >-
11
+
12
+ [Cambrian Non-Commercial License Agreement](https://www.evolutionaryscale.ai/policies/cambrian-non-commercial-license-agreement)
13
+
14
+ **The Big Picture:**
15
+
16
+ 1. The weights of the EvolutionaryScale AI Models (ESM-3 and ESMC 600M) are available under this License Agreement for **non-commercial use** by users at **non-commercial organizations**. Note that other terms apply for API access.
17
+ 2. You **may not** use the EvolutionaryScale AI Models or any derivative works:
18
+ a. for any **commercial activities** or monetary compensation
19
+ b. to provide **outputs as a service**
20
+ c. without proper attribution ("Built with ESM" and "ESM" in derivative work titles)
21
+ 3. You **can** reproduce and distribute copies with modifications for **non-commercial purposes** (e.g. fine-tuning weights or modifying code), provided you:
22
+ a. include the license agreement
23
+ b. mark modified files
24
+ c. maintain all copyright and attribution notices
25
+
26
+ extra_gated_fields:
27
+ Name: text
28
+ Country: country
29
+ Role: text
30
+ Affiliation (Lab/group/division and Institution): text
31
+ Please describe your intended use of ESM3: text
32
+ Is your background primarily computational or experimental:
33
+ type: select
34
+ options:
35
+ - Computational
36
+ - Experimental
37
+ - Mixed
38
+ How did you learn about ESM3?:
39
+ type: select
40
+ options:
41
+ - Social media post
42
+ - News article
43
+ - Paper pre-print
44
+ - Word of mouth
45
+ - Other
46
+ I accept the CLA: checkbox
47
+ I agree to use this dataset for non-commercial use ONLY: checkbox
48
+ ---
49
+
50
+ # Model Card for esm3-sm-open-v1
51
+
52
+ `esm3-sm-open-v1` is trained on 2.78 billion natural proteins. With synthetic data augmentation, this led to 3.15 billion protein sequences, 236 million protein structures, and 539 million proteins with function annotations, totaling 771 billion tokens.
53
+ `esm3-sm-open-v1` is a generative model capable of designing proteins conditioned on partial prompts of sequence, structure and function.
54
+
55
+ Safety is an important part of our model - data related to viruses has been removed from the training dataset, as well as some proteins belonging to organisms on the [USDA Select Agents and Toxins](https://www.selectagents.gov/sat/list.htm) list.
56
+ The function decoder has been filtered for potentially harmful keywords.
57
+
58
+ ## Usage
59
+
60
+ Using `ESM3` requires [esm](https://github.com/evolutionaryscale/esm)
61
+
62
+ ```
63
+ pip install esm
64
+ ```
65
+
66
+ Please refer to the readme and notebooks in the [esm repository](https://github.com/evolutionaryscale/esm?tab=readme-ov-file#quickstart) for details on how to use the model.
67
+
68
+ ## License
69
+
70
+ This repository is under a custom non-commercial [license](https://github.com/evolutionaryscale/esm/blob/main/LICENSE.md).
raw_sources/protein_models/esm3/esm3-sm-open-v1/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/1utn.pdb ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/ParentChildTreeFile.txt ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/entry_list_safety_29026.list ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/esm3_entry.list ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/interpro2keywords.csv ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/interpro_29026_to_keywords_58641.csv ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/keyword_vocabulary_safety_filtered_58641.txt ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/keywords.txt ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/tag_dict_4.json ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/tag_dict_4_safety_filtered.json ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/data/uniref90_and_mgnify90_residue_annotations_gt_1k_proteins.csv ADDED
The diff for this file is too large to render. See raw diff
 
raw_sources/protein_models/esm3/esm3-sm-open-v1/download.log ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ⚠️ Warning: 'huggingface-cli download' is deprecated. Use 'hf download' instead.
2
+ Traceback (most recent call last):
3
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/utils/_http.py", line 402, in hf_raise_for_status
4
+ response.raise_for_status()
5
+ ~~~~~~~~~~~~~~~~~~~~~~~~~^^
6
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/requests/models.py", line 1026, in raise_for_status
7
+ raise HTTPError(http_error_msg, response=self)
8
+ requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/EvolutionaryScale/esm3-sm-open-v1/resolve/2feda652c51c57f9797fc1b01f8d6181b38fb488/.gitattributes
9
+
10
+ The above exception was the direct cause of the following exception:
11
+
12
+ Traceback (most recent call last):
13
+ File "/home/machina/miniconda3/bin/huggingface-cli", line 7, in <module>
14
+ sys.exit(main())
15
+ ~~~~^^
16
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/commands/huggingface_cli.py", line 61, in main
17
+ service.run()
18
+ ~~~~~~~~~~~^^
19
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 157, in run
20
+ print(self._download()) # Print path to downloaded files
21
+ ~~~~~~~~~~~~~~^^
22
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 191, in _download
23
+ return snapshot_download(
24
+ repo_id=self.repo_id,
25
+ ...<10 lines>...
26
+ max_workers=self.max_workers,
27
+ )
28
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
29
+ return fn(*args, **kwargs)
30
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 330, in snapshot_download
31
+ _inner_hf_hub_download(file)
32
+ ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
33
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 306, in _inner_hf_hub_download
34
+ return hf_hub_download(
35
+ repo_id,
36
+ ...<15 lines>...
37
+ headers=headers,
38
+ )
39
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
40
+ return fn(*args, **kwargs)
41
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 987, in hf_hub_download
42
+ return _hf_hub_download_to_local_dir(
43
+ # Destination
44
+ ...<15 lines>...
45
+ local_files_only=local_files_only,
46
+ )
47
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1250, in _hf_hub_download_to_local_dir
48
+ _raise_on_head_call_error(head_call_error, force_download, local_files_only)
49
+ ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1655, in _raise_on_head_call_error
51
+ raise head_call_error
52
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1543, in _get_metadata_or_catch_error
53
+ metadata = get_hf_file_metadata(
54
+ url=url, proxies=proxies, timeout=etag_timeout, headers=headers, token=token, endpoint=endpoint
55
+ )
56
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
57
+ return fn(*args, **kwargs)
58
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1460, in get_hf_file_metadata
59
+ r = _request_wrapper(
60
+ method="HEAD",
61
+ ...<5 lines>...
62
+ timeout=timeout,
63
+ )
64
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 283, in _request_wrapper
65
+ response = _request_wrapper(
66
+ method=method,
67
+ ...<2 lines>...
68
+ **params,
69
+ )
70
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 307, in _request_wrapper
71
+ hf_raise_for_status(response)
72
+ ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
73
+ File "/home/machina/miniconda3/lib/python3.13/site-packages/huggingface_hub/utils/_http.py", line 419, in hf_raise_for_status
74
+ raise _format(GatedRepoError, message, response) from e
75
+ huggingface_hub.errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-69dfcc4f-59ad0eb474e11b827d575d27;14bdc681-02bd-431a-bd60-c4dd490c5bb4)
76
+
77
+ Cannot access gated repo for url https://huggingface.co/EvolutionaryScale/esm3-sm-open-v1/resolve/2feda652c51c57f9797fc1b01f8d6181b38fb488/.gitattributes.
78
+ Access to model EvolutionaryScale/esm3-sm-open-v1 is restricted. You must have access to it and be authenticated to access it. Please log in.
raw_sources/protein_models/esm3/requirements-esm3.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ esm==3.2.1.post1
2
+ httpx==0.28.1
raw_sources/protein_models/esmc/MANIFEST.json ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "artifact_family": "ESM-C",
3
+ "status": "downloaded_snapshot_complete_runtime_ready",
4
+ "validated_utc": "2026-04-15T20:27:09Z",
5
+ "local_root": "data/raw/protein/esmc",
6
+ "models": [
7
+ {
8
+ "repo_id": "EvolutionaryScale/esmc-300m-2024-12",
9
+ "revision": "a19d363f07313a10a64d08a2d6b41376a73df5c8",
10
+ "snapshot": "esmc-300m-2024-12",
11
+ "weight": "data/weights/esmc_300m_2024_12_v0.pth",
12
+ "expected_total_bytes": 1332098569,
13
+ "dimension": 960,
14
+ "model_size": "300m",
15
+ "local_dir": "data/raw/protein/esmc/esmc-300m-2024-12",
16
+ "files": [
17
+ {
18
+ "path": ".gitattributes",
19
+ "bytes": 1519,
20
+ "sha256": "11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361",
21
+ "exists": true
22
+ },
23
+ {
24
+ "path": "README.md",
25
+ "bytes": 1310,
26
+ "sha256": "27933d8c8148716fdf6af39a23569b5d51fcd9853a18f7834540f13e64fbb6b8",
27
+ "exists": true
28
+ },
29
+ {
30
+ "path": "config.json",
31
+ "bytes": 2,
32
+ "sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
33
+ "exists": true
34
+ },
35
+ {
36
+ "path": "data/weights/esmc_300m_2024_12_v0.pth",
37
+ "bytes": 1332095738,
38
+ "sha256": "323dff9fbf3fef297a74f4f18b6528e6f2e599b0bcf72b6927516804015becea",
39
+ "exists": true
40
+ }
41
+ ],
42
+ "complete": true
43
+ },
44
+ {
45
+ "repo_id": "EvolutionaryScale/esmc-600m-2024-12",
46
+ "revision": "d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e",
47
+ "snapshot": "esmc-600m-2024-12",
48
+ "weight": "data/weights/esmc_600m_2024_12_v0.pth",
49
+ "expected_total_bytes": 2300278717,
50
+ "dimension": 1152,
51
+ "model_size": "600m",
52
+ "local_dir": "data/raw/protein/esmc/esmc-600m-2024-12",
53
+ "files": [
54
+ {
55
+ "path": ".gitattributes",
56
+ "bytes": 1519,
57
+ "sha256": "11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361",
58
+ "exists": true
59
+ },
60
+ {
61
+ "path": "README.md",
62
+ "bytes": 1330,
63
+ "sha256": "ba21d2900bfdf8724e921e765c879dedba620e90043b7fd54f52864c7889979f",
64
+ "exists": true
65
+ },
66
+ {
67
+ "path": "config.json",
68
+ "bytes": 2,
69
+ "sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
70
+ "exists": true
71
+ },
72
+ {
73
+ "path": "data/weights/esmc_600m_2024_12_v0.pth",
74
+ "bytes": 2300275866,
75
+ "sha256": "8ef856e1a237ee3f995442df997a962e70057faadecf38fc0c8561bd3c2f4324",
76
+ "exists": true
77
+ }
78
+ ],
79
+ "complete": true
80
+ }
81
+ ],
82
+ "notes": [
83
+ "ESM-C raw model assets are sequestered separately from ESM-3 and from processed perturbation-level embeddings.",
84
+ "The 300M and 600M December 2024 open snapshots are public Hugging Face repositories.",
85
+ "Generated MANTRA-aligned embeddings belong under data/processed/embeddings/registry/protein_sequence/."
86
+ ],
87
+ "runtime_validation": {
88
+ "validated_utc": "2026-04-15T20:30:29Z",
89
+ "python_packages": {
90
+ "esm": "3.2.1",
91
+ "torch": "2.10.0+cu129",
92
+ "numpy": "1.26.4",
93
+ "transformers": "4.48.1",
94
+ "httpx": "0.28.1"
95
+ },
96
+ "real_weight_smoke_artifacts": [
97
+ {
98
+ "model_size": "300m",
99
+ "path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/esmc_300m_2024_12/esmc_300m_2024_12_mean_non_special_smoke1.npy",
100
+ "shape": [
101
+ 1,
102
+ 960
103
+ ],
104
+ "device": "cuda"
105
+ },
106
+ {
107
+ "model_size": "600m",
108
+ "path": "data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/esmc_600m_2024_12/esmc_600m_2024_12_mean_non_special_smoke1.npy",
109
+ "shape": [
110
+ 1,
111
+ 1152
112
+ ],
113
+ "device": "cuda"
114
+ }
115
+ ]
116
+ }
117
+ }
raw_sources/protein_models/esmc/README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ESM-C Raw Model Sequestration
2
+
3
+ This directory contains local ESM-C raw model snapshots from EvolutionaryScale. It is separate from ESM-3 and from processed MANTRA embedding matrices.
4
+
5
+ ## Downloaded Snapshots
6
+
7
+ | Model | Hugging Face repo | Revision | Local directory | Embedding dim |
8
+ | --- | --- | --- | --- | --- |
9
+ | ESM-C 300M | `EvolutionaryScale/esmc-300m-2024-12` | `a19d363f07313a10a64d08a2d6b41376a73df5c8` | `data/raw/protein/esmc/esmc-300m-2024-12/` | 960 |
10
+ | ESM-C 600M | `EvolutionaryScale/esmc-600m-2024-12` | `d11cc14d44078eaecbc6a843d5eb20f4eecc1e7e` | `data/raw/protein/esmc/esmc-600m-2024-12/` | 1152 |
11
+
12
+ Both snapshots are public in the installed `esm` package contract and were downloaded locally.
13
+
14
+ ## Runtime
15
+
16
+ The ESM-C generator uses the same `esm` runtime package already installed for ESM-3:
17
+
18
+ ```bash
19
+ python -m pip install -r data/raw/protein/esm3/requirements-esm3.txt
20
+ ```
21
+
22
+ ## Generate MANTRA-Aligned Embeddings
23
+
24
+ Default 300M generation:
25
+
26
+ ```bash
27
+ PYTHONPATH=src:. python -m mantra.embeddings.generate_esmc --model-size 300m --device cuda
28
+ ```
29
+
30
+ 600M generation:
31
+
32
+ ```bash
33
+ PYTHONPATH=src:. python -m mantra.embeddings.generate_esmc --model-size 600m --device cuda
34
+ ```
35
+
36
+ Default outputs are written under:
37
+
38
+ ```text
39
+ data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/
40
+ ```
41
+
42
+ These are source gene artifacts. They do not replace the promoted compressed ESM base embedding unless a later experiment validates and promotes them.
43
+
44
+ ## Smoke Artifacts
45
+
46
+ Real-weight one-gene CUDA smokes have been run successfully:
47
+
48
+ ```text
49
+ data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/esmc_300m_2024_12/esmc_300m_2024_12_mean_non_special_smoke1.npy
50
+ data/processed/embeddings/registry/protein_sequence/source_gene_artifacts/esmc_600m_2024_12/esmc_600m_2024_12_mean_non_special_smoke1.npy
51
+ ```
52
+
53
+ The smoke dimensions are `960` for 300M and `1152` for 600M.
raw_sources/protein_models/esmc/esmc-300m-2024-12/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
raw_sources/protein_models/esmc/esmc-300m-2024-12/DOWNLOAD_STARTED_UTC.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 2026-04-15T20:21:49Z
raw_sources/protein_models/esmc/esmc-300m-2024-12/README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - biology
6
+ - esm
7
+ - protein
8
+
9
+ ---
10
+
11
+ # Model Card for esmc-300m-2024-12
12
+
13
+ ESM Cambrian is a parallel model family to our flagship ESM3 generative models. While ESM3 focuses on controllable generation of proteins for therapeutic and many other applications, ESM C focuses on creating representations of the underlying biology of proteins. ESM C scales up data and training compute to deliver dramatic performance improvements over ESM2.
14
+
15
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6306e13e5b87d4feaad68405/F6SS--Yt9bLctcEE-Ydcl.png)
16
+
17
+ The ESM family of models has consistently set the state of the art for protein language models. Now ESM C unlocks a new frontier of performance with scaling up to 6 billion parameters. The ESM C family delivers significant inference time performance gains, matching and even exceeding the capabilities of far larger previous generation models.
18
+ ## Usage
19
+
20
+ Using `ESMC` requires [esm](https://github.com/evolutionaryscale/esm)
21
+
22
+ ```
23
+ pip install esm
24
+ ```
25
+
26
+ Please refer to the readme and notebooks in the [esm repository](https://github.com/evolutionaryscale/esm) for details on how to use the model.
27
+
28
+ ## License
29
+
30
+ This repository is under a custom open [license](https://www.evolutionaryscale.ai/policies//cambrian-open-license-agreement).
raw_sources/protein_models/esmc/esmc-300m-2024-12/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {}