timholy / MzPlots.jl

Plotting utilities for mass spectrometry data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MzPlots

Build Status Coverage

This package supports limited plotting of mass spectrometry data. It is designed to be format-agnostic through its use of the MzCore interface, although currently only MzXML has been implemented.

Interactive exploration via Makie

Supposing that you have some mass spectrometry data loaded into scans, then it's as simple as

using Makie, MzPlots
scene, ax = mzplot(scans)   # `scans` is a vector of scan data you've loaded from a file
display(scene)

Limited Plots support

You can convert the scans to an AxisArray:

using AxisArrays: Axis, AxisArray
# Convenient creation of an Axis range from an interval. `n` is the number of distinct values in the range.
asrange(axi::Axis{name}, n) where name = Axis{name}(range(minimum(axi.val), stop=maximum(axi.val), length=n))

lims = limits(scans)
sz = (800, length(scans))                    # or pick something else
aa = AxisArray(zeros(sz), map(asrange, lims, sz)...)
copyto!(aa, scans)

Then you can plot aa with Plots.plot.

About

Plotting utilities for mass spectrometry data

License:MIT License


Languages

Language:Julia 100.0%