Skip to content

Commit

Permalink
orthology works. SVG tissue scoping works. SVG legend and tooltips do…
Browse files Browse the repository at this point in the history
…es not work
  • Loading branch information
adkinsrs committed Jan 19, 2024
1 parent 6effba6 commit 068617a
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 68 deletions.
15 changes: 15 additions & 0 deletions lib/gear/orthology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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}
8 changes: 4 additions & 4 deletions www/expression.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ <h4>miRNA tree</h4>
<div id="result-panel-options">
<span class="option-label pr-1">Scoring method: </span>
<div class="control select is-small">
<select>
<option>Gene scope</option>
<option>Tissue scope</option>
<option>Sample scope</option>
<select id="svg-scoring-method">
<option value="gene" selected>Gene scope</option>
<option value="tissue">Tissue scope</option>
<option value="dataset">Sample scope</option>
</select>
</div>
</div>
Expand Down
Loading

0 comments on commit 068617a

Please sign in to comment.