Python API

The HiGlass python API provides a functionality for starting a lightweight server, creating viewconfs and displaying a HiGlass component within Jupyter.


class higlass.server.Server(tilesets, port=None, host='localhost', tmp_dir='/tmp/hgflask')[source]

A lightweight HiGlass server.

__init__(tilesets, port=None, host='localhost', tmp_dir='/tmp/hgflask')[source]

Maintain a reference to a running higlass server

  • port (int) – The port that this server will run on
  • tileset ([]) – A list of tilesets to serve (see higlass.tilesets)
  • host (string) – The host this server is running on. Usually just localhost
  • tmp_dir (string) – A temporary directory into which to mount the http and https files
start(log_file='/tmp/hgserver.log', log_level=20)[source]

Start a lightweight higlass server.

  • log_file (string) – Where to place diagnostic log files
  • log_level (logging.*) – What level to log at


View.__init__(tracks=[], x=0, y=0, width=12, height=6, initialXDomain=None, initialYDomain=None, uid=None)[source]

Add a new view

  • tracks ([]) – A list of Tracks to include in this view
  • x (int) – The position of this view on the grid
  • y (int) – The position of this view on the grid
  • width (int) – The width of this of view on a 12 unit grid
  • height (int) – The height of the this view. The height is proportional to the height of all the views present.
  • initialXDoamin ([int, int]) – The initial x range of the view
  • initialYDomain ([int, int]) – The initial y range of the view
  • uid (string) – The uid of new view
Track.__init__(track_type, position=None, tileset=None, height=None, width=None, tileset_uuid=None, server=None, file_url=None, filetype=None, options={})[source]

Add a track to a position.

  • track_type (string) – The type of track to add (e.g. “heatmap”, “line”)
  • position (string) – One of ‘top’, ‘bottom’, ‘center’, ‘left’, ‘right’
  • tileset_uuid – The of uuid of the tileset being displayed in this track
  • height (int) – The height of the track (in pixels)
  • width (int) – The width of the track (in pixels)
  • server (string) – The server name (usually just ‘localhost’)
  • file_url (string) – An http accessible tileset file
  • filetype (string) – The type of the remote tilesets (e.g. ‘bigwig’ or ‘cooler’)
  • options ({}) – The options to pass onto the track