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.
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)
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
.