3D LinePlot

To display the plot in jupyterlab ensure that the plotly-dash and jupyterlab-plotyly extensions are installed.

This plot plots intensity against m/z and retention time

Load FeatureMap

[3]:
from massdash.loaders import MzMLDataLoader
from massdash.structs import TargetedDIAConfig

# Initate TargetedDIAConfig and set parameters
extraction_config = TargetedDIAConfig()
extraction_config.im_window = 0.2
extraction_config.rt_window = 50
extraction_config.mz_tol = 20

# Initiate loader object
loader = MzMLDataLoader(dataFiles="mzml/ionMobilityTest.mzML",
                        rsltsFile="osw/ionMobilityTest.osw")

# fetch featureMap for target peptide
featureMap = loader.loadFeatureMaps("AFVDFLSDEIK", 2, extraction_config)['ionMobilityTest']
[2024-03-14 11:31:06,440] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.2033236026763916 ms
[2024-03-14 11:31:06,443] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.
[2024-03-14 11:31:06,444] MzMLDataAccess - INFO - There are 25 MS1 spectra and 25 MS2 spectra.

Plot Recipe

[4]:
from massdash.plotting import PlotConfig, InteractiveThreeDimensionPlotter

config3D = PlotConfig()
config3D.type_of_3d_plot = "3D Line Plot"
config3D.context = 'jupyter'
config3D.include_ms1 = True
config3D.include_ms2 = True
config3D.aggregate_mslevels = False

plotter = InteractiveThreeDimensionPlotter(config3D)
plotter.plot(featureMap)