All Projects → gosling-lang → gos

gosling-lang / gos

Licence: MIT License
a declarative (epi)genomics visualization library for Python

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
Makefile
30231 projects

Projects that are alternatives of or similar to gos

halyos
Redesigning the Patient Portal Experience with SMART on FHIR.
Stars: ✭ 20 (-59.18%)
Mutual labels:  gehlenborglab
gosling.js
Grammar of Scalable Linked Interactive Nucleotide Graphics
Stars: ✭ 89 (+81.63%)
Mutual labels:  gehlenborglab
vitessceR
R API and htmlwidget for Vitessce
Stars: ✭ 19 (-61.22%)
Mutual labels:  gehlenborglab
clodius
Clodius is a tool for breaking up large data sets into smaller tiles that can subsequently be displayed using an appropriate viewer.
Stars: ✭ 32 (-34.69%)
Mutual labels:  gehlenborglab
3d-genome-processing-tutorial
A 3D genome data processing tutorial for ISMB/ECCB 2017
Stars: ✭ 44 (-10.2%)
Mutual labels:  gehlenborglab
higlass-server
Server component for HiGlass that manages and serves tiled data
Stars: ✭ 17 (-65.31%)
Mutual labels:  gehlenborglab
vizarr
A minimal, purely client-side program for viewing Zarr-based images with Viv & ImJoy.
Stars: ✭ 54 (+10.2%)
Mutual labels:  gehlenborglab
higlass-docker
Builds a docker container wrapping higlass-server and higlass-client in nginx
Stars: ✭ 21 (-57.14%)
Mutual labels:  gehlenborglab

gos 🦆

License PyPI Python Version tests Binder Open In Colab

gos is a declarative (epi)genomics visualization library for Python. It is built on top of the Gosling JSON specification, providing a simplified interface for authoring interactive genomic visualizations.

Installation

The gos API is under active development. Feedback is appreciated and welcomed.

pip install gosling

Documentation

See the Documentation Site for more information.

Example

Gosling visualization

import gosling as gos

data = gos.multivec(
    url="https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec",
    row="sample",
    column="position",
    value="peak",
    categories=["sample 1", "sample 2", "sample 3", "sample 4"],
    binSize=5,
)

base_track = gos.Track(data, width=800, height=100)

heatmap = base_track.mark_rect().encode(
    x=gos.X("start:G", axis="top"),
    xe="end:G",
    row=gos.Row("sample:N", legend=True),
    color=gos.Color("peak:Q", legend=True),
)

bars = base_track.mark_bar().encode(
    x=gos.X("position:G", axis="top"),
    y="peak:Q",
    row="sample:N",
    color=gos.Color("sample:N", legend=True),
)

lines = base_track.mark_line().encode(
    x=gos.X("position:G", axis="top"),
    y="peak:Q",
    row="sample:N",
    color=gos.Color("sample:N", legend=True),
)

gos.vertical(heatmap, bars, lines).properties(
    title="Visual Encoding",
    subtitle="Gosling provides diverse visual encoding methods",
    layout="linear",
    centerRadius=0.8,
    xDomain=gos.GenomicDomain(chromosome="1", interval=[1, 3000500]),
)

Example Gallery

We have started a gallery of community examples in gosling/examples/. If you are interested in contributing, please feel free to submit a PR! Checkout the existing JSON examples if you are looking for inspiration.

Development

pip install -e '.[dev]'

The schema bindings (gosling/schema/) and docs (doc/user_guide/API.rst) are automatically generated using the following. Please do not edit these files directly.

# generate gosling/schema/*
python tools/generate_schema_wrapper.py

Release

git checkout main && git pull

Update version in setup.cfg and doc/conf.py:

git add setup.cfg doc/conf.py
git commit -m "v0.[minor].[patch]"
git tag -a v0.[minor].[patch] -m "v0.[minor].[patch]"
git push --follow-tags

Design & Implementation

gos is inspired by and borrows heavily from Altair both in project philosophy and implementation. The internal Python API is auto-generated from the Gosling specification using code adapted directly from Altair to generate Vega-Lite bindings. This design choice guarantees that visualizations are type-checked in complete concordance with the Gosling specification, and that the Python API remains consistent with the evolving schema over time. Special thanks to Jake Vanderplas and others on schemapi.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].