The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationError
Exception: CastError
Message: Couldn't cast
embedding: string
shape: list<item: int64>
child 0, item: int64
dtype: string
gene_identifier: string
row_order: string
processing: string
source_dtypes: list<item: string>
child 0, item: string
max_absolute_float32_cast_error: double
sources: list<item: struct<filename: string, sha256: string>>
child 0, item: struct<filename: string, sha256: string>
child 0, filename: string
child 1, sha256: string
files: struct<embeddings.npy: struct<sha256: string, bytes: int64>, genes.json: struct<sha256: string, byte (... 10 chars omitted)
child 0, embeddings.npy: struct<sha256: string, bytes: int64>
child 0, sha256: string
child 1, bytes: int64
child 1, genes.json: struct<sha256: string, bytes: int64>
child 0, sha256: string
child 1, bytes: int64
verification: string
species: string
source_record: string
source_record_title: string
source_record_license: string
attribution: string
provenance_note: string
human_filter: struct<filename: string, source_directory: string, sha256: string, unique_genes: int64, matched_gene (... 33 chars omitted)
child 0, filename: string
child 1, source_directory: string
child 2, sha256: string
child 3, unique_genes: int64
child 4, matched_genes: int64
child 5, unmatched_genes: int64
previous_unfiltered_rows: int64
previous_revision: string
to
{'text': Value('string')}
because column names don't match
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
writer.write_table(table)
~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 764, in write_table
self.write_rows_on_file() # in case there are buffered rows to write first
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 663, in write_rows_on_file
self._write_table(table)
~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
embedding: string
shape: list<item: int64>
child 0, item: int64
dtype: string
gene_identifier: string
row_order: string
processing: string
source_dtypes: list<item: string>
child 0, item: string
max_absolute_float32_cast_error: double
sources: list<item: struct<filename: string, sha256: string>>
child 0, item: struct<filename: string, sha256: string>
child 0, filename: string
child 1, sha256: string
files: struct<embeddings.npy: struct<sha256: string, bytes: int64>, genes.json: struct<sha256: string, byte (... 10 chars omitted)
child 0, embeddings.npy: struct<sha256: string, bytes: int64>
child 0, sha256: string
child 1, bytes: int64
child 1, genes.json: struct<sha256: string, bytes: int64>
child 0, sha256: string
child 1, bytes: int64
verification: string
species: string
source_record: string
source_record_title: string
source_record_license: string
attribution: string
provenance_note: string
human_filter: struct<filename: string, source_directory: string, sha256: string, unique_genes: int64, matched_gene (... 33 chars omitted)
child 0, filename: string
child 1, source_directory: string
child 2, sha256: string
child 3, unique_genes: int64
child 4, matched_genes: int64
child 5, unmatched_genes: int64
previous_unfiltered_rows: int64
previous_revision: string
to
{'text': Value('string')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
...<4 lines>...
)
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 20 new columns ({'attribution', 'provenance_note', 'sources', 'source_dtypes', 'previous_unfiltered_rows', 'source_record_title', 'dtype', 'species', 'previous_revision', 'shape', 'processing', 'max_absolute_float32_cast_error', 'verification', 'human_filter', 'files', 'row_order', 'source_record', 'source_record_license', 'embedding', 'gene_identifier'}) and 1 missing columns ({'text'}).
This happened while the json dataset builder was generating data using
hf://datasets/weililab/perturbation-embeddings/gears/genes.json (at revision 5b01881945b81d9250cf600fb07968539ed8292b), ['hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/esm2/genes.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/esm2/metadata.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/gears/genes.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/gears/metadata.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/genept/genes.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/genept/metadata.json'], ['hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/esm2/genes.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/esm2/metadata.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/gears/genes.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/gears/metadata.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/genept/genes.json', 'hf://datasets/weililab/perturbation-embeddings@5b01881945b81d9250cf600fb07968539ed8292b/genept/metadata.json']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1869, in _prepare_split_single
num_examples, num_bytes = writer.finalize()
~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 781, in finalize
self.write_rows_on_file()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 663, in write_rows_on_file
self._write_table(table)
~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
embedding: string
shape: list<item: int64>
child 0, item: int64
dtype: string
gene_identifier: string
row_order: string
processing: string
source_dtypes: list<item: string>
child 0, item: string
max_absolute_float32_cast_error: double
sources: list<item: struct<filename: string, sha256: string>>
child 0, item: struct<filename: string, sha256: string>
child 0, filename: string
child 1, sha256: string
files: struct<embeddings.npy: struct<sha256: string, bytes: int64>, genes.json: struct<sha256: string, byte (... 10 chars omitted)
child 0, embeddings.npy: struct<sha256: string, bytes: int64>
child 0, sha256: string
child 1, bytes: int64
child 1, genes.json: struct<sha256: string, bytes: int64>
child 0, sha256: string
child 1, bytes: int64
verification: string
species: string
source_record: string
source_record_title: string
source_record_license: string
attribution: string
provenance_note: string
human_filter: struct<filename: string, source_directory: string, sha256: string, unique_genes: int64, matched_gene (... 33 chars omitted)
child 0, filename: string
child 1, source_directory: string
child 2, sha256: string
child 3, unique_genes: int64
child 4, matched_genes: int64
child 5, unmatched_genes: int64
previous_unfiltered_rows: int64
previous_revision: string
to
{'text': Value('string')}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1880, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text string |
|---|
A1BG |
A1CF |
A2M |
A2ML1 |
A3GALT2 |
A4GALT |
A4GNT |
AAAS |
AACS |
AADAC |
AADACL2 |
AADACL3 |
AADACL4 |
AADAT |
AAGAB |
AAK1 |
AAMDC |
AAMP |
AANAT |
AAR2 |
AARD |
AARS1 |
AARS2 |
AARSD1 |
AASDH |
AASDHPPT |
AASS |
AATF |
AATK |
ABAT |
ABCA1 |
ABCA10 |
ABCA12 |
ABCA13 |
ABCA2 |
ABCA3 |
ABCA4 |
ABCA5 |
ABCA6 |
ABCA7 |
ABCA8 |
ABCA9 |
ABCB1 |
ABCB10 |
ABCB11 |
ABCB4 |
ABCB5 |
ABCB6 |
ABCB7 |
ABCB8 |
ABCB9 |
ABCC1 |
ABCC10 |
ABCC11 |
ABCC12 |
ABCC2 |
ABCC3 |
ABCC4 |
ABCC5 |
ABCC6 |
ABCC8 |
ABCC9 |
ABCD1 |
ABCD2 |
ABCD3 |
ABCD4 |
ABCE1 |
ABCF1 |
ABCF2 |
ABCF2-H2BE1 |
ABCF3 |
ABCG1 |
ABCG2 |
ABCG4 |
ABCG5 |
ABCG8 |
ABHD1 |
ABHD10 |
ABHD11 |
ABHD12 |
ABHD12B |
ABHD13 |
ABHD14A |
ABHD14A-ACY1 |
ABHD14B |
ABHD15 |
ABHD16A |
ABHD16B |
ABHD17A |
ABHD17B |
ABHD17C |
ABHD18 |
ABHD2 |
ABHD3 |
ABHD4 |
ABHD5 |
ABHD6 |
ABHD8 |
ABI1 |
ABI2 |
Gene embeddings for perturbation modeling
This repository distributes three existing gene embedding tables in a common NumPy/JSON format for use with pertTF and other perturbation models. These are gene-level features, not measured perturbation responses or pertTF-generated predictions. The original embedding models were not trained by this release.
Tables
| Directory | Representation | Rows | Dimensions | Published dtype |
|---|---|---|---|---|
esm2 |
ESM2 protein embeddings distributed with UCE | 19,516 | 5,120 | float32 |
genept |
GenePT gene/protein text embeddings, model-3 release | 19,134 | 3,072 | float32 |
gears |
Learned perturbation embeddings from a legacy GEARS checkpoint | 9,853 | 32 | float32 |
Each directory contains:
embeddings.npy: a dense matrix with shape(n_genes, embedding_dim).genes.json: an ordered JSON list;genes[i]labels rowiin the matrix.metadata.json: source identifiers, processing details, file hashes, and conversion verification results.
ESM2 and GenePT are restricted to gene symbols in the first column of their
respective human_prot_names.csv files. Only listed genes present in each
embedding table are retained, preserving original gene identifiers and row
order. Gene-list hashes, matched counts, and unmatched counts are recorded
in each table's metadata. GEARS is unchanged. No normalization, identifier
conversion, concatenation, or synthetic control (WT) row was added.
This corrects the initial release, which included the complete unfiltered
GenePT mapping. The earlier revision 5db008c45c77caaf5ce9e7c9783c89ce1d8a2f25 remains
available for reproducing that release.
The ESM2 and GEARS inputs were float32. The GenePT input was float64, but its values were exactly representable in float32: the maximum absolute conversion error was zero for all three tables. Every exported row was checked against its corresponding source vector after reloading the output files, and the saved gene ordering was verified.
Loading
These are ordinary files hosted in an HF dataset repository; the datasets
package is not required.
import json
import numpy as np
from huggingface_hub import HfApi, hf_hub_download
repo_id = "weililab/perturbation-embeddings"
embedding = "esm2" # "genept" or "gears"
# Resolve once so the matrix and gene list come from the same snapshot.
# Save this commit SHA with your experiment, or supply a previously saved SHA.
revision = HfApi().dataset_info(repo_id).sha
matrix_path = hf_hub_download(
repo_id, f"{embedding}/embeddings.npy",
repo_type="dataset", revision=revision,
)
genes_path = hf_hub_download(
repo_id, f"{embedding}/genes.json",
repo_type="dataset", revision=revision,
)
matrix = np.load(matrix_path, mmap_mode="r", allow_pickle=False)
with open(genes_path) as handle:
genes = json.load(handle)
assert matrix.shape[0] == len(genes)
Gene coverage differs between tables. Align by gene identifier rather than row position when comparing or concatenating representations. A trained model's input representation cannot generally be replaced with another embedding choice without retraining.
Sources, attribution, and licenses
Licensing is recorded per source; no single license is asserted for all three tables.
ESM2 / UCE
- Source record: Yusuf Roohani (2023), Universal Cell Embedding Model Files, Figshare, version 5: https://doi.org/10.6084/m9.figshare.24320806.v5.
- The record distributes
protein_embeddings.tar.gzand specifies CC BY 4.0. - The local input was
Homo_sapiens.GRCh38.gene_symbol_to_embedding_ESM2.pt, associated with that UCE download. This release did not byte-compare the individual file against the original archive. - Credit the UCE authors and the ESM2 authors when using these embeddings. ESM2 reference: Lin et al. (2023), Evolutionary-scale prediction of atomic-level protein structure with a language model, https://doi.org/10.1126/science.ade2574.
GenePT
- Source record: Yiqun Chen (2024), Gene embeddings used in GenePT, Zenodo: https://doi.org/10.5281/zenodo.10833191.
- The record specifies CC BY 4.0
and identifies the model-3 embedding as
text-embedding-3-large. - The input filename,
GenePT_gene_protein_embedding_model_3_text.pickle, matches the file described inGenePT_emebdding_v2.zip. This release did not byte-compare the local file against the original archive. - Please cite Chen and Zou, GenePT: A Simple But Effective Foundation Model for Genes and Cells Built From ChatGPT: https://doi.org/10.1101/2023.10.16.562533.
- Project: https://github.com/yiqunchen/GenePT.
GEARS
- Extracted
pert_emb.weightfrom the legacy checkpointgears_gwps-Mar25-03-38/best_model/model.pt, using the orderedpert_gene_listfrom its accompanyingpert_gene_list.pkl. - Training provenance is unknown. The training dataset, split, and exact training configuration were not reconstructed for this release.
- The checkpoint's license is unknown; the CC BY 4.0 licenses of the other sources are not attributed to this checkpoint.
- GEARS project: https://github.com/snap-stanford/GEARS.
The changes made by this release are human-gene filtering, format conversion, and float32 storage, as described above. Original-file SHA-256 hashes are recorded in each table's metadata to identify the exact local inputs used.
- Downloads last month
- 94