Skip to content

Commit

Permalink
Re-create data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Dec 7, 2023
1 parent e94a359 commit b42b452
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 7 additions & 8 deletions jbrowse_jupyter/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import re
import os
import json
import pkg_resources
from importlib.resources import files

import dash_jbrowse as jb
from dash import html, Dash
from urllib.parse import urlparse
Expand Down Expand Up @@ -55,14 +56,12 @@ def get_name_regex(assembly_file):

def get_default(name, view_type="LGV"):
"""Returns the configuration object given a genome name."""
base = pkg_resources.resource_filename("jbrowse_jupyter")
file_name = f"{base}/{name}.json"
base = pkg_resources.resource_filename("jbrowse_jupyter", "data")
# Reads contents with UTF-8 encoding and returns str.
if view_type == "CGV":
file_name = f"{base}/{name}_cgv.json"
conf = {}
with open(file_name) as json_data:
conf = json.load(json_data)
return conf
return files(f"jbrowse_jupyter.data.${name}_cgv.json").read_json()
else:
return files(f"jbrowse_jupyter.data.${name}.json").read_json()


def create_component(conf, **kwargs):
Expand Down

0 comments on commit b42b452

Please sign in to comment.