From 7ccc56d6bf8c14e4d321c1fc99cfb3fc41cb7be8 Mon Sep 17 00:00:00 2001 From: Alessio Date: Tue, 7 Feb 2023 09:13:10 +0100 Subject: [PATCH] BUGFIX: truncating gene names. Version bump to 1.1.11 --- imaging_transcriptomics/__init__.py | 2 +- imaging_transcriptomics/inputs.py | 4 +++- imaging_transcriptomics/tests/inputs_test.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/imaging_transcriptomics/__init__.py b/imaging_transcriptomics/__init__.py index 93aae45..8c7a002 100644 --- a/imaging_transcriptomics/__init__.py +++ b/imaging_transcriptomics/__init__.py @@ -1,5 +1,5 @@ -__version__ = "1.1.10" +__version__ = "1.1.11" from . import inputs from . import reporting diff --git a/imaging_transcriptomics/inputs.py b/imaging_transcriptomics/inputs.py index 069f2f1..c802805 100644 --- a/imaging_transcriptomics/inputs.py +++ b/imaging_transcriptomics/inputs.py @@ -98,7 +98,9 @@ def load_gene_labels(): genes_labels_path = ( Path(__file__).resolve().parent / "data" / "gene_expression_labels.txt" ) - return pd.read_fwf(genes_labels_path, header=None).to_numpy() + # return pd.read_fwf(genes_labels_path, header=None).to_numpy() + return np.loadtxt(str(genes_labels_path), dtype="U", + delimiter="\n").reshape(-1, 1) def get_geneset(gene_set: str): diff --git a/imaging_transcriptomics/tests/inputs_test.py b/imaging_transcriptomics/tests/inputs_test.py index 4f0609b..635db20 100644 --- a/imaging_transcriptomics/tests/inputs_test.py +++ b/imaging_transcriptomics/tests/inputs_test.py @@ -81,6 +81,7 @@ def test_gene_labels_load(): assert labels[1635] == "C6orf106" assert "SLC7A10" in labels assert "audhd49b" not in labels + assert "LOC102723968" in labels # GENESET FUNCTION TESTS