Heatmap Merged Across Transitions
Input:
FeatureMap
In this plot the signals from all transitions are merged into one heatmap.
By changing the type_of_heatmap in the <link PlotConfig, we can plot different axis against one another.
Options are:
m/z vs retention time
m/z vs ion mobility
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-10 08:35:00,700] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.0776510238647461 ms
[2024-10-10 08:35:00,701] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.
[2024-10-10 08:35:00,701] 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 changing to 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 = True ## merges heatmaps
#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()