API - plotting#

class found.pl.PlotHiDDENOutput(adata, p_hat, labs, *, layer=None)[source]#

class which when provided with pipeline outputs (see fields), can be used to create various diagnostic plots.

can be indexed to plot only a subset of the data.

Parameters:
  • adata (AnnData) – object containing input data

  • p_hat (Series) – HiDDEN-generated p_hat values (regression step outputs)

  • labs (Series) – HiDDEN-adjusted condition labels (binarization step outputs)

  • layer (str | None) – name of layer to use when accessing layer-specific data from self.adata, X slot is used if set to None

reg_vln(group_by=None, split_mode='n', vertical=True, n=100)[source]#

method used to generate violin plots of p_hat values

Parameters:
  • group_by (str | Series | None) – key in self.adata to group violin plot by

  • split_mode (Literal[False, 'area', 'width', 'n']) – if the violin plot should be split by the refined HiDDEN labels, and if yes, how should the splits be scaled (options: "area" - meaning they have equivalent area, "n" - scaled by proportion of observations, "width" - min/max scaling so that they have the same width, False - no splitting)

  • vertical (bool) – should the plot be vertical (like a violin plot) or horizontal (e.g. like a density plot)

  • n (int) – number of bins for density estimation

Return type:

Chart

bin_bar(orig_labs, ctrl_val, group_by=None, vertical=True, scale=True)[source]#

method used to generate stacked bar plots showing levels of case, control, and HiDDEN-adjusted labels

Parameters:
  • orig_labs (str | Series) – key in self.adata for original condition labels

  • ctrl_val (object) – value corresponding to control in condition labels

  • group_by (str | Series | None) – optional key in self.adata to group calculation by

  • vertical (bool) – should the plot be vertical (i.e. metric on Y axis, groups on X axis) or horizontal (i.e. metric on X axis, groups on Y axis)

  • scale (bool) – should columns height be scaled by group size (i.e. turns into representation of group fractions instead raw numbers)

Return type:

Chart

class found.pl.PlotTunerOutput(adata, sel, outs, *, layer=None)[source]#

class which when provided with tuner outputs (see fields), can be used to create various diagnostic plots.

can be indexed to return PlotHiDDENOutput objects for diagnostics on specific hyperparameters.

Parameters:
  • adata (AnnData) – object containing input data

  • sel (object) – HiDDENt-returned selected hyperparameter configuration

  • outs (Mapping[Any, tuple[Series, Series, Any]]) – HiDDENt-returned output dictionary

  • layer (str | None) – name of layer to use when accessing layer-specific data from self.adata, X slot is used if set to None

score_line()[source]#

method used to generate a line plot of scores for tested hyperparameters

Return type:

Chart | LayerChart