From 237aff236fb20a06f8ec14af7bae177b38fe8e60 Mon Sep 17 00:00:00 2001 From: Nezar Abdennur Date: Wed, 5 Jul 2023 20:52:06 -0400 Subject: [PATCH] maint: Upgrade to higlass-python v1.0 (#89) * maint: Upgrade to higlass-python v1.0 * chore: Update changelog * maint: fix dep syntax for install_requires --- CHANGELOG | 4 ++++ higlass_manage/view.py | 26 ++++++++------------------ requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d3f7b5c..fb3a271 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v0.8.2 + +- Use new higlass-python v1.0 API + v0.8.0 - Ran black on the entire code base diff --git a/higlass_manage/view.py b/higlass_manage/view.py index da7f6b8..42f7be5 100644 --- a/higlass_manage/view.py +++ b/higlass_manage/view.py @@ -154,7 +154,7 @@ def view( # couldn't ingest the file return - from higlass.client import Track, View, ViewConf + import higlass as hg if datatype is None: datatype = inferred_datatype @@ -166,25 +166,15 @@ def view( print("ERROR: Unknown track type for the given datatype:", datatype) return - view = View( - [ - Track( - track_type=tracktype, - position=position, - tileset_uuid=uuid, - server="http://localhost:{}/api/v1/".format(port), - height=200, - ), - ] + tileset = hg.remote( + uid=uuid, + server="http://localhost:{}/api/v1/".format(port), ) + track = tileset.track(tracktype, position=position, height=200) + view = hg.view(track) + conf = view.viewconf().dict() - viewconf = ViewConf([view]) - - conf = viewconf.to_dict() - - conf["trackSourceServers"] = [] - conf["trackSourceServers"] += ["http://localhost:{}/api/v1/".format(port)] - + conf["trackSourceServers"] = ["http://localhost:{}/api/v1/".format(port)] if public_data: conf["trackSourceServers"] += ["http://higlass.io/api/v1/"] diff --git a/requirements.txt b/requirements.txt index 15e5003..b534714 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ clodius==0.10.13 -higlass-python==0.1.13 +higlass-python==1.0.0 docker==4.0.2 ipywidgets==7.5.1 slugid==2.0.0 diff --git a/setup.py b/setup.py index 45678ac..bc4ca9c 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ "clodius>=0.10.3", "cooler>=0.8.1", "pandas>=0.19", - "higlass-python==0.4.4", + "higlass-python>=1.0.0", "docker", "requests", ],