diff --git a/.pybiomart.sqlite b/.pybiomart.sqlite new file mode 100644 index 00000000..56cd8403 Binary files /dev/null and b/.pybiomart.sqlite differ diff --git a/ci/tests/test_transcriptformer/test_transcriptformer_model.py b/ci/tests/test_transcriptformer/test_transcriptformer_model.py index 60c5adb5..900088c0 100644 --- a/ci/tests/test_transcriptformer/test_transcriptformer_model.py +++ b/ci/tests/test_transcriptformer/test_transcriptformer_model.py @@ -22,11 +22,11 @@ def test_process_data__correct_ensembl_ids(self): dataset = self.transcriptformer.process_data([self.data]) assert len(dataset) == 1 assert all( - dataset.files_list[0].var["ensembl_id"].astype(str).values + dataset.files_list[0].var["ensembl_id"].values == [ "ENSG00000121410", "ENSG00000036549", - "nan", + None, "ENSG00000074755", ] ) diff --git a/helical/utils/mapping.py b/helical/utils/mapping.py index 605cd1c6..8ac6daa8 100644 --- a/helical/utils/mapping.py +++ b/helical/utils/mapping.py @@ -105,7 +105,7 @@ def convert_list_ensembl_ids_to_gene_symbols( """ df = _get_ensembl_mart_df(species=species) mapping = df.drop_duplicates(subset="ensembl_id").set_index("ensembl_id")["gene_name"] - return list(pd.Series(ensembl_ids, dtype="object").map(mapping)) + return list(pd.Series(list(ensembl_ids), dtype="object").map(mapping).where(pd.notna, None)) def convert_list_gene_symbols_to_ensembl_ids( @@ -128,4 +128,4 @@ def convert_list_gene_symbols_to_ensembl_ids( """ df = _get_ensembl_mart_df(species=species) mapping = df.drop_duplicates(subset="gene_name").set_index("gene_name")["ensembl_id"] - return list(pd.Series(gene_symbols, dtype="object").map(mapping)) + return list(pd.Series(list(gene_symbols), dtype="object").map(mapping).where(pd.notna, None)) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 14704b54..92f757a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "helical" -version = "1.4.8" +version = "1.4.9" authors = [ { name="Helical Team", email="support@helical-ai.com" }, ]