From 068617af66748e592765f292fd6c087e2a610262 Mon Sep 17 00:00:00 2001 From: adkinsrs Date: Fri, 19 Jan 2024 16:58:38 -0500 Subject: [PATCH] orthology works. SVG tissue scoping works. SVG legend and tooltips does not work --- lib/gear/orthology.py | 15 ++ www/expression.html | 8 +- www/js/classes/tilegrid.js | 356 ++++++++++++++++++++++++++++++------- www/js/expression.js | 22 ++- 4 files changed, 333 insertions(+), 68 deletions(-) diff --git a/lib/gear/orthology.py b/lib/gear/orthology.py index 5559e7d4..60b99edf 100644 --- a/lib/gear/orthology.py +++ b/lib/gear/orthology.py @@ -155,6 +155,14 @@ def map_single_gene(gene_symbol:str, orthomap_file: Path): """ # Read HDF5 file using Pandas read_hdf gene_symbol_dict = create_orthology_gene_symbol_dict(orthomap_file) + + # Check if case-insensitive gene symbol is in dictionary + gene_symbol = gene_symbol.lower() + for key in gene_symbol_dict.keys(): + if gene_symbol == key.lower(): + gene_symbol = key + break + # NOTE: Not all genes can be mapped. Unmappable genes do not change in the original dataframe. return gene_symbol_dict.get(gene_symbol, None) @@ -172,5 +180,12 @@ def map_multiple_genes(gene_symbols:list, orthomap_file: Path): # Read HDF5 file using Pandas read_hdf gene_symbol_dict = create_orthology_gene_symbol_dict(orthomap_file) + # Check if case-insensitive gene symbols are in dictionary + gene_symbols = [gene_symbol.lower() for gene_symbol in gene_symbols] + for key in gene_symbol_dict.keys(): + if key.lower() in gene_symbols: + gene_symbols[gene_symbols.index(key.lower())] = key + + # NOTE: Not all genes can be mapped. Unmappable genes do not change in the original dataframe. return { gene_symbol: gene_symbol_dict[gene_symbol] for gene_symbol in gene_symbols if gene_symbol in gene_symbol_dict} \ No newline at end of file diff --git a/www/expression.html b/www/expression.html index a6297599..fc87aca7 100644 --- a/www/expression.html +++ b/www/expression.html @@ -185,10 +185,10 @@

miRNA tree

Scoring method:
- + + +
diff --git a/www/js/classes/tilegrid.js b/www/js/classes/tilegrid.js index 0d8bb65a..5ecbe1e3 100644 --- a/www/js/classes/tilegrid.js +++ b/www/js/classes/tilegrid.js @@ -8,6 +8,8 @@ For the given layout, a single-gene grid and a multi-gene grid are generated. const plotlyPlots = ["bar", "line", "scatter", "tsne/umap_dynamic", "violin"]; // "tsne_dynamic" is a legacy option const scanpyPlots = ["pca_static", "tsne_static", "umap_static"]; // "tsne" is a legacy option +// Epiviz overrides the