Dunno if this is the right channel, but anyway. I...
# shameless-promo
j
Dunno if this is the right channel, but anyway. I wrote kuva ( https://github.com/Psy-Fer/kuva ) It's a scientific plotting library in rust, but also has a CLI binary mode where you can pipe in data and get plots. It can also plot to the terminal (handy for quick sanity checks on a remote system). It's got minimal dependencies and is about to have a pretty large update (v0.1.7) that will bring the plot type count to ~60. There are some bioinformatics specific plot types in there, like manhattan, volcano, and dot plots, as well as all the regular kinds of plots you would expect. It might be a handy tool for creating plots as QC steps in nextflow pipelines, because it's a CLI tool, which is also super easy to install. I'm always looking for feedback on features, bugs, ergonomics, etc. I try to make the default plots as easy to build as possible so they don't need a lot of boilerplate to get started (in rust, even easier with the CLI) Anyway, let me know here, or in the issues on the repo Here is a collection of plots with all the new ones coming in the next version too. (svg so you can zoom, and a crappy compressed version if you don't wanna downlaod that) oh, it can also play doom in an SVG (https://psy-fer.github.io/kuva/doom.html)
🦀 2
🙌🏽 1
p
Wow, cool! I've been missing Plotly in rust and struggling a bit, this looks super nice 🤩
To be fair, I've been struggling with Plotly in Python a bit too. Been toying with switching to echarts for MultiQC (just hesitant as I only switched to Plotly fairly recently!). SVG / PNG output is a pain though as Plotly needs a headless chrome to do either.
j
Kuva does svg as its core output. PNG and pdf are features you can turn on.
I'm a big fan of just regular matplotlib in python. I'll eventually get around to making a python wrapper for kuva, mostly because I want to use it in some of my python tools
👍🏻 1
p
Yeah MultiQC kind of needs all the whizzy interactive HTML stuff which complicates matters.
I used to maintain both HighCharts and matplotlib in parallel for every plot type, but it was a hassle
j
I have some wizzbang built in interactive components in kuva that I have been working on
Here is an example. The interactivity is built into the SVG and rendered by any browser
(this is what made me go... Hang on a second, can I shove doom into an svg? So I did)
p
Sounds similar to our
nextflow run doom
😅
✅ 1
MultiQC does a lot from outside the plot - the toolbox renames, recolours, hides, exports etc. so it's kind of useful to have the full JS library and data model at report-level rather than within a plot. This is very cool though, SVGs are amazing magic
j
Yea SVGs are so good. Should be the default image everywhere. No idea why people prefer png/jpeg when svg is vector, can be smaller, and has way more cool stuff you can take advantage of in the spec. I do have plans to make kuva compatible with wasm and expose the render with a public API so people can work with it directly and skip the format specific backends. That let's you embed it in GUI/web stuff.
👌 1
p
Yes though for plots, SVGs can also be huge if you have bazillions of points 😅 Can do deduplication based on coordinates to solve that though (just not in MultiQC again, as someone might filter away all points except that one sample right at the back)
j
This is why things like joint plots and rainclouds/strip/beehive plots are handy. Because you can do dedup and still show the full distributions 🙂
💯 1
m
@Phil Ewels did you ever play with https://hvplot.holoviz.org/en/docs/latest/index.html
I kinda like the syntax and you can choose your backend.
Although nothing beats having a grammar for graphics in my not so humble opinion 😋
p
Nice! Those kinds of libraries are great if you're doing a lot of different plots (eg. a notebook / exploratory analysis etc) 👍🏻