Heatmap Per Transition

Input: FeatureMap

By changing the type_of_heatmap in the :py:class:~massdash.plotting.PlotConfig, we can plot different axis against one another.

Options are:

  1. m/z vs retention time

  2. m/z vs ion mobility

  3. retention time vs ion mobility

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']
Initializing valid scores for selection
[2024-10-08 16:39:13,418] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.07269787788391113 ms
[2024-10-08 16:39:13,419] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.
[2024-10-08 16:39:13,419] MzMLDataAccess - INFO - There are 25 MS1 spectra and 25 MS2 spectra.

Plot Recipe

For demonstration purposes, retention time vs ion mobility is shown but this can be changes by uncommenting the other config.type_of_heatmap statements.

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

config = PlotConfig()
config.context = 'jupyter'
config.include_ms1 = True
config.include_ms2 = True
config.aggregate_mslevels = False ## separate plot per transition
config.normalization_dict = {'type':'none'}

#config.type_of_heatmap = 'm/z vs retention time'
#config.type_of_heatmap = 'm/z vs ion mobility'
config.type_of_heatmap = 'retention time vs ion mobility'

plotter = InteractiveTwoDimensionPlotter(config)
plotter.plot(featureMap)
plotter.show()
Loading BokehJS ...
[ ]: