Surface Plots
Input:
FeatureMap
To display the plot in jupyterlab ensure that the plotly-dash and jupyterlab-plotyly extensions are installed.
This plot only works if ion mobility data is present. Here we have m/z vs rt vs intensity. Intensity is represented by color.
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-07 13:28:45,773] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.07750940322875977 ms
[2024-10-07 13:28:45,773] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.
[2024-10-07 13:28:45,774] 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 Surface Plot"
config3D.context = 'jupyter'
plot3D = InteractiveThreeDimensionPlotter(config3D)
plot3D.plot(featureMap)