@@ -913,20 +913,20 @@ def mass_features_ms2_annot_to_df(self, molecular_metadata=None):
913
913
914
914
return annot_ms2_df_full
915
915
916
- def plot_composite_mass_features (self , binsize = 1e-4 , mf_plot = True , ms2_plot = True , return_fig = False ):
916
+ def plot_composite_features (self , binsize = 1e-4 , mf_plot = True , ms2_plot = True , return_fig = False ):
917
917
"""Returns a figure displaying
918
918
(1) thresholded, unprocessed data
919
- (2) the mass features
920
- (3) which mass features are associated with MS2 spectra
919
+ (2) the m/z features
920
+ (3) which m/z features are associated with MS2 spectra
921
921
922
922
Parameters
923
923
-----------
924
924
binsize : float
925
925
Desired binsize for the m/z axis of the composite feature map. Defaults to 1e-4.
926
926
mf_plot : boolean
927
- Indicates whether to plot the mass features. Defaults to True.
927
+ Indicates whether to plot the m/z features. Defaults to True.
928
928
ms2_plot : boolean
929
- Indicates whether to identify mass features with associated MS2 spectra. Defaults to True.
929
+ Indicates whether to identify m/z features with associated MS2 spectra. Defaults to True.
930
930
return_fig : boolean
931
931
Indicates whether to plot composite feature map (False) or return figure object (True). Defaults to False.
932
932
@@ -935,15 +935,15 @@ def plot_composite_mass_features(self, binsize = 1e-4, mf_plot = True, ms2_plot
935
935
matplotlib.pyplot.Figure
936
936
A figure with the thresholded, unprocessed data on an axis of m/z value with respect to
937
937
scan time. Unprocessed data is displayed in gray scale with darker colors indicating
938
- higher intensities. If mass features are plotted, they are displayed in cyan. If mass
938
+ higher intensities. If m/z features are plotted, they are displayed in cyan. If m/z
939
939
features with associated with MS2 spectra are plotted, they are displayed in red.
940
940
941
941
Raises
942
942
------
943
943
Warning
944
- If mass features are set to be plot but aren't in the dataset.
945
- If mass features with associated MS2 data are set to be plot but no MS2 annotations
946
- were found for the mass features in the dataset.
944
+ If m/z features are set to be plot but aren't in the dataset.
945
+ If m/z features with associated MS2 data are set to be plot but no MS2 annotations
946
+ were found for the m/z features in the dataset.
947
947
"""
948
948
if mf_plot :
949
949
# Check if mass_features is set, raise error if not
@@ -962,7 +962,7 @@ def plot_composite_mass_features(self, binsize = 1e-4, mf_plot = True, ms2_plot
962
962
"mass_features not set, must run find_mass_features() first"
963
963
)
964
964
965
- ## call mass feature data
965
+ ## call m/z feature data
966
966
mf_df = self .mass_features_to_df ()
967
967
968
968
# Check if ms2_spectrum is set, raise error if not
@@ -975,7 +975,7 @@ def plot_composite_mass_features(self, binsize = 1e-4, mf_plot = True, ms2_plot
975
975
df = self ._ms_unprocessed [1 ].copy ()
976
976
df = df .dropna (subset = ['intensity' ]).reset_index (drop = True )
977
977
threshold = self .parameters .lc_ms .ph_inten_min_rel * df .intensity .max ()
978
- df_thres = df [df ["intensity" ] > threshold ].reset_index (drop = True ).copy ()
978
+ df_thres = df [df ["intensity" ] > threshold ].reset_index (drop = True ).copy ()
979
979
df = self .grid_data (df_thres )
980
980
981
981
## format unprocessed data for plotting
@@ -1004,15 +1004,15 @@ def plot_composite_mass_features(self, binsize = 1e-4, mf_plot = True, ms2_plot
1004
1004
mf_df [mf_df .ms2_spectrum .isna ()].mz ,
1005
1005
c = 'c' ,
1006
1006
s = 4 ,
1007
- label = 'Mass features without MS2'
1007
+ label = 'M/Z features without MS2'
1008
1008
)
1009
1009
else :
1010
1010
plt .scatter (
1011
1011
mf_df .scan_time ,
1012
1012
mf_df .mz ,
1013
1013
c = 'c' ,
1014
1014
s = 4 ,
1015
- label = 'Mass features'
1015
+ label = 'M/Z features'
1016
1016
)
1017
1017
1018
1018
if ms2_plot :
@@ -1021,7 +1021,7 @@ def plot_composite_mass_features(self, binsize = 1e-4, mf_plot = True, ms2_plot
1021
1021
mf_df [~ mf_df .ms2_spectrum .isna ()].mz ,
1022
1022
c = 'r' ,
1023
1023
s = 2 ,
1024
- label = 'Mass features with MS2'
1024
+ label = 'M/Z features with MS2'
1025
1025
)
1026
1026
1027
1027
plt .legend (loc = 'lower center' , bbox_to_anchor = (0.5 , - 0.25 ), ncol = 2 )
0 commit comments