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 6d8378c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 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
import importlib

import dash_jbrowse as jb
from dash import html, Dash
from urllib.parse import urlparse
Expand Down Expand Up @@ -55,14 +56,14 @@ 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"
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
with importlib.resources.open_text(
"jbrowse-jupyter", f"{name}_cgv.json"
) as file:
return json.load(file)
else:
with importlib.resources.open_text("jbrowse-jupyter", f"{name}.json") as file:
return json.load(file)


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

0 comments on commit 6d8378c

Please sign in to comment.