Create Visualization Templates (Abstractions)

A visualization template, commonly known as an Abstraction, can be crafted within an Integrated Development Environment (IDE). An Abstraction acts as a visualization template in its initial state, devoid of any data. It transforms into a fully-functional visualization application only when data is introduced into the abstraction. Much like hp.save_dash_app(), the creator of the abstraction is required to develop an 'app.py' file that outlines the visualization's layout. Once the 'app.py' script is developed, simply call hp.save_abstraction() to save your visualization template to HISE. Once saved, any users with access to the same Account can stream their own chosen datasets into an Abstraction and generate an interactive visualization application. 

It's important to note that these visualization templates are stored at the Account-level. This ensures that all projects possess the capability to generate visualizations tailored to their specific datasets.

Steps to Save an Abstraction 

HISE users interested in saving an abstraction should follow a three-step process. Firstly, select the Result File Type for which you aim to create interactive visualization applications, whether it pertains to demographic or sample metadata such as lab results, or stems from an automated pipeline like fixed-RNA. After identifying the data type, proceed to develop an 'app.py' script that outlines the layout and interactive components of the visualization. Lastly, upon finalizing the script, execute hp.save_abstraction() to store the visualization template within HISE. Once saved, any user can effortlessly generate a visualization application with their personally chosen samples, utilizing the layout that was developed.

Choose Result File Type

Before writing any code, you should determine the Result File for which the Abstraction will be created. This step is crucial because an Abstraction designed for a specific dataset, such as Olink, cannot be utilized to visualize TEA-seq data.

Please refer to this page for a list of available Result File Types

Additionally, careful consideration should be given to the structure of the data, especially the column names of a data.frame, during the Abstraction creation process. Abstractions that exclusively read data directly from HISE adhere to standardized column names. However, the introduction of the BIO SDK opens the door to custom-defined column names, as analytical processes can generate any number of new columns.

Create "app.py" Script

Creating an Abstraction is straightforward—all you need is a bug-free 'app.py' script. However, the code structure within 'app.py' varies based on the chosen visualization framework. For instance, the code to generate two tabs with scatterplots will differ between a Dash application and Vitessce. In the IDE environment, you will find 'app.py' scripts for the various visualization frameworks that you can use as a reference.

Use the HISE SDK

After development of the 'app.py' script is complete, saving the Abstraction to HISE requires the utilization of the HISE SDK. In a notebook with a Python kernel, import the hisepy module and invoke hisepy.save_abstraction(). This method requires the filepath to the 'app.py' script, along with additional information such as a description, title, and specification of the Result File for which the Abstraction is intended.

The following is an example notebook on how to save a visualiation template: . This notebook can also be found in an IDE under the "/examples" directory.