Pybioviz
bioinformatics visualization tools with pyviz/bokeh
Install / Use
/learn @dmnfarrell/PybiovizREADME
pybioviz - Bioinformatics visualization tools with PyViz Panel and Bokeh.
<img align="right" src=img/logo.svg width=150px>
This is a demonstration project for bioinformatic dashboards with panel and bokeh. These could be re-used inside Jupyter notebooks as part of bioinformatic workflows or deployed as local web apps. Not under active development so mainly proof of concept. Use parts of the code as needed.
Tools implemented:
- sequence alignment viewer
- genome feature viewer
- bam alignment viewer
<img src=https://github.com/dmnfarrell/pybioviz/raw/master/doc/source/sequence_align_plot.png width=600px>
Installation
pip install -e git+https://github.com/dmnfarrell/pybioviz.git#egg=pybioviz
If using JupyterLab you may need to run:
jupyter labextension install @bokeh/jupyter_bokeh
jupyter labextension install @pyviz/jupyterlab_pyviz
Notebook
Try the basics.ipynb notebook in the notebook folder to see how it works.
Usage
from bokeh.io import show, output_notebook
output_notebook()
import panel as pn
pn.extension()
from pybioviz import dashboards, plotters, utils
Sequence alignment
from Bio import AlignIO, SeqIO
aln_file = os.path.join(utils.datadir, 'test.aln')
aln = AlignIO.read(aln_file,'clustal')
seqview = plotters.plot_sequence_alignment(aln)
main = pn.Column(m,seqview)
main
Plot bam coverage
bam_file='wt_mbovis.bam'
chr='NC_002945.4'
start=1000
end=3000
df = utils.get_coverage(bam_file, chr, start, end)
p = plotters.plot_coverage(df)
Dashboards
Dashboards are small interctive apps that are created by using the plotting tools detailed above, combined with widgets that allow user interactivity. They can be created inside a notebook or launched as standalone apps in a web browser using a command in the terminal.
Sequence alignment dashboard
This dashboard is for used for viewing and manipulating multiple sequence alignments. You can load files from local directories and re-align, zoom in and out of the sequence. Other features to add and remove sequences have yet to be added.
To use this inside a notebook:
app = dashboards.sequence_alignment_viewer('file.fa')
<img src=https://github.com/dmnfarrell/pybioviz/raw/master/doc/source/sequence_aligner_dashboard.gif width=600px>
Genomic feature viewer
app = dashboards.genome_features_viewer('Mbovis_AF212297.gff','Mbovis-AF212297.fa')
<img src=https://github.com/dmnfarrell/pybioviz/raw/master/doc/source/genome_features_dashboard.gif width=600px>
Links
- https://panel.pyviz.org/
- https://docs.bokeh.org/en/latest/
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
92.1kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
343.3kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
