msions.msplot
This module contains functions that are useful for plotting MS data in Python.
Module Contents
Functions
|
Plots TIC against retention time. |
|
Plots ions against retention time. |
- msions.msplot.plot_tic(mzml_input: Union[pandas.DataFrame, str], color: str = '#1f77b4', xlabel: str = 'Time (min)', ylabel: str = 'Total Ion Current', no_labels: bool = False, alpha: float = 1.0, ymax: float = None, fig_params: List[float] = None)[source]
Plots TIC against retention time.
- Parameters:
mzml_input (pd.DataFrame or str) – The pandas DataFrame containing retention time and TIC or the mzML file.
color (str) – The color for the line plot.
xlabel (str) – Title for x-axis.
ylabel (str) – Title for y-axis.
no_labels (bool) – Removes ticks and labels.
alpha (float) – Changes the alpha value for the line plot.
ymax (float) – Sets the maximum value of the y-axis.
fig_params (List[float]) – Sets the figure size and optionally the dpi.
Examples
>>> from msions.msplot import plot_tic >>> from msions.mzml import tic_df >>> import matplotlib.pyplot as plot >>> ms1_df = tic_df("test.mzML") >>> plot_tic(ms1_df) >>> plt.show()
- msions.msplot.plot_ions(mzml_input: Union[pandas.DataFrame, str], color: str = '#1f77b4', xlabel: str = 'Time (min)', ylabel: str = 'Ions', no_labels: bool = False, alpha: float = 1.0, ymax: float = None, fig_params: List[float] = None)[source]
Plots ions against retention time.
- Parameters:
mzml_input (pd.DataFrame or str) – The pandas DataFrame containing retention time and TIC or the mzML file.
color (str) – The color for the line plot.
xlabel (str) – Title for x-axis.
ylabel (str) – Title for y-axis.
no_labels (bool) – Removes ticks and labels.
alpha (float) – Changes the alpha value for the line plot.
ymax (float) – Sets the maximum value of the y-axis.
fig_params (List[float]) – Sets the figure size and optionally the dpi.
Examples
>>> from msions.msplot import plot_ions >>> from msions.mzml import tic_df >>> import matplotlib.pyplot as plot >>> ms1_df = tic_df("test.mzML") >>> plot_ions(ms1_df) >>> plt.show()