Skip to content

Commit

Permalink
Merge pull request #309 from eweitz/gene-structure-tooltips
Browse files Browse the repository at this point in the history
Show gene structure diagrams in tooltips
  • Loading branch information
eweitz committed Aug 4, 2022
2 parents 2347493 + f28256a commit 9a5d4cc
Show file tree
Hide file tree
Showing 14 changed files with 877 additions and 22 deletions.
Binary file not shown.
Binary file modified dist/data/cache/homo-sapiens-genes.tsv.gz
Binary file not shown.
1 change: 1 addition & 0 deletions examples/vanilla/related-genes.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ <h1>Related genes | Ideogram</h1>
onLoad: plotGeneFromUrl,
onPlotRelatedGenes: reportRelatedGenes,
showParalogNeighborhoods: true,
showGeneStructureInTooltip: true,
onClickAnnot
}

Expand Down
10 changes: 8 additions & 2 deletions scripts/python/cache/gene_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

from lib import download_gzip

def fetch_gff(organism, output_dir="data/", reuse_gff=True):
gcache = GeneCache(output_dir, reuse_gff)
[gff_path, gff_url] = gcache.fetch_ensembl_gff(organism)
return [gff_path, gff_url]

# Organisms configured for gene caching, and their genome assembly names
assemblies_by_org = {
"Homo sapiens": "GRCh38",
Expand Down Expand Up @@ -70,7 +75,7 @@ def parse_gff_info_field(info):
Example INFO field:
gene_id "ENSMUSG00000102628"; gene_version "2"; gene_name "Gm37671"; gene_source "havana"; gene_biotype "TEC";
"""
fields = [f.strip() for f in info.split(';')][:-1]
fields = [f.strip() for f in info.split(';')]
kvs = [f.split("=") for f in fields]
info_dict = {}
for kv in kvs:
Expand Down Expand Up @@ -289,7 +294,8 @@ def populate(self):
Consider parallelizing this.
"""
for organism in assemblies_by_org:
# for organism in assemblies_by_org:
for organism in ["Homo sapiens"]:
self.populate_by_org(organism)

# Command-line handler
Expand Down
Loading

0 comments on commit 9a5d4cc

Please sign in to comment.