FACSPy.pl.fop

Contents

FACSPy.pl.fop#

FACSPy.pl.fop(adata, gate, layer, marker, groupby, splitby=None, cmap=None, order=None, stat_test='Kruskal', data_group='sample_ID', figsize=(3, 3), return_dataframe=False, return_fig=False, ax=None, show=True, save=None, **kwargs)#

Plots the frequency of parent (fop) values as calculated by fp.tl.fop as a combined strip-/boxplot.

Parameters:
  • adata (AnnData) – The anndata object of shape n_obs x n_vars where rows correspond to cells and columns to the channels

  • gate (str) – The gate to be analyzed, called by the population name. This parameter has a default stored in fp.settings, but can be superseded by the user.

  • layer (str) – The layer corresponding to the data matrix. Similar to the gate parameter, it has a default stored in fp.settings which can be overwritten by user input.

  • marker (str) – The channel to be displayed. Has to be in adata.var_names

  • groupby (str) – controls the x axis and the grouping of the data points

  • splitby (Optional[str]) – The parameter controlling additional split along the groupby-axis.

  • cmap (Optional[str]) – Sets the colormap for plotting. Can be continuous or categorical, depending on the input data. When set, both seaborns ‘palette’ and ‘cmap’ parameters will use this value

  • order (Optional[Union`[:py:class:`list[str], str]]) – specifies the order of x-values.

  • stat_test (Optional[str]) – Statistical test that is used for the p-value calculation. One of Kruskal and Wilcoxon. Defaults to Kruskal.

  • data_group (str) – When MFIs/FOPs are calculated, and the groupby parameter is used, use data_group to specify the right dataframe

  • figsize (tuple[float, float]) – Contains the dimensions of the final figure as a tuple of two ints or floats.

  • return_dataframe (bool) – If set to True, returns the raw data that are used for plotting as a dataframe.

  • return_fig (bool) – If set to True, the figure is returned.

  • ax (Optional[Axes]) – A Axes created from matplotlib to plot into.

  • show (bool) – Whether to show the figure. Defaults to True.

  • save (Optional[str]) – Expects a file path including the file name. Saves the figure to the indicated path. Defaults to None.

  • kwargs – keyword arguments ultimately passed to sns.stripplot.

Return type:

Optional[Figure, Axes, DataFrame]]

Returns:

  • If show==False a Axes

  • If return_fig==True a Figure

  • If return_dataframe==True a DataFrame containing the data used for plotting

Examples

import FACSPy as fp

dataset = fp.mouse_lineages()

fp.tl.fop(dataset, layer = "compensated")

fp.pl.fop(
    dataset,
    gate = "CD45+",
    layer = "compensated",
    marker = "B220",
    groupby = "organ",
    figsize = (3,3.5)
)
../_images/FACSPy-pl-fop-1.png