Python API¶
The HiGlass python API provides a functionality for starting a lightweight server, creating viewconfs and displaying a HiGlass component within Jupyter.
Connecting¶
- resgen.connect(username: str | None = None, password: str | None = None, host: str = 'https://resgen.io', bucket: str = 'resgen') ResgenConnection [source]¶
Open a connection to resgen.
ResgenConnection¶
- class resgen.ResgenConnection(username, password, host='https://resgen.io', bucket='resgen')[source]¶
Connection to the resgen server.
- download_progress(tileset_uuid)[source]¶
Get the download progress for a tileset.
Raise an exception if there’s no recorded tileset progress for this uuid.
- find_datasets(search_string='', project=None, limit=1000, datafile=None, **kwargs)[source]¶
Search for datasets.
- find_or_create_project(project_name: str, group: str | None = None, private: bool = True)[source]¶
Find or create a project.
For now this function can only create a project for the logged in user. If a project with the same name exists, do nothing.
- Parameters:
project_name – The name of the project to create.
private – Whether to make this a private project.
- list_projects(gruser: str | None = None)[source]¶
List the projects of the connected user or the specified group.
- Parameters:
gruser – The name of the user or group to list projects for. Defaults to the connected user if not specified.
ResgenProject¶
- class resgen.ResgenProject(uuid: str, conn: ResgenConnection, name: str | None = None)[source]¶
Encapsulates a project on the resgen service.
- add_download_dataset(filepath: str, index_filepath: str | None = None)[source]¶
Add a dataset by downloading it from a remote source
- Parameters:
filepath – The filename of the dataset to add. Can also be a url.
index_filepath – The filename of the index for this dataset
- Returns:
The uuid of the newly created dataset.
- add_link_dataset(filepath: str, index_filepath: str | None = None, name: str | None = None, parent: str | None = None, private: bool = True)[source]¶
Add a remote dataset
- Parameters:
filepath – The filename of the dataset to add. Can also be a url.
index_filepath – The filename of the index for this dataset
- Returns:
The uuid of the newly created dataset.
- add_upload_dataset(filepath: str, index_filepath: str | None = None, name: str | None = None, parent: str | None = None, private: bool = True)[source]¶
Add a dataset by uploading it to resgen
- Parameters:
filepath – The filename of the dataset to add. Can also be a url.
index_filepath – The filename of the index for this dataset
name – The name to add to this dataset
parent – The directory to put this dataset under
private – Whether to add this as a private dataset
- Returns:
The uuid of the newly created dataset.
- list_datasets(limit: int = 1000)[source]¶
List the datasets available in this project.
Returns up to a limit
- sync_dataset(filepath: str, sync_remote: bool = False, filetype=None, datatype=None, assembly=None, index_filepath=None, force_update: bool = False, sync_full_path: bool = False, **metadata)[source]¶
Check if this file already exists in this dataset.
Do nothing if it does and create it if it doesn’t. If a new dataset is created.
In both instances, ensure that the metadata is updated. The available metadata tags that can be updated are: name and tags
If more than one dataset with this name exists, raise a ValueError.
Args: