msions.msplot

This module contains functions that are useful for plotting MS data in Python.

Module Contents

Functions

plot_data(mzml_input[, feat_input, id_input, method, ...])

Plots TIC against retention time.

msions.msplot.plot_data(mzml_input: Union[pandas.DataFrame, str], feat_input: Union[pandas.DataFrame, str] = None, id_input: Union[pandas.DataFrame, str] = None, method: str = None, data_type='TIC', stats=None, return_dfs=False, color: Union[str, List[str]] = ['black', '#1f77b4'], no_labels: bool = False, alpha: float = 1.0, 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.

  • feat_input (pd.DataFrame or str) – The pandas DataFrame containing retention time and TIC or the Hardklor/Kronik file.

  • id_input (pd.DataFrame or str) – The pandas DataFrame containing retention time and TIC or the EncyclopeDIA/Percolator file.

  • method (str) – Type of acquisition method (e.g., “DIA”)

  • data_type (str) – Data chosen for plot (“TIC”, “ions”, “both”)

  • stats (bool) – Print stats for data

  • return_dfs (bool) – Return calculated DataFrames if True

  • color (List[str]) – The lists of colors for the line plots.

  • no_labels (bool) – Removes ticks and labels.

  • alpha (float) – Changes the alpha value for the line plot.

  • 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_data(ms1_df)
>>> plt.show()