celllabel_quant_boxplot

besca.pl.celllabel_quant_boxplot(adata, count_variable, subset_variable, condition_identifier, plot_percentage=True, condition_order=None, figsize=(8, 4), mypal='Paired')[source]

generate a box and whisker plot with overlayed swarm plot of celltype abundances

This function takes a condition identifier to generate plots in which you can compare the celltype abundances between different conditions.

Parameters:
  • data ('DataFrame') – tidy dataframe that is outputed by the function besca.tl.count_occurrence_subset_conditions(…, make_tidy = True)

  • count_variable (str) – obs on which to count - e.g. clusters or cell types

  • subset_variable (str) – obs for stratification - e.g. donor, sample, experiment

  • condition_identifier (str) – same condition_identifier used to generate data, used as hue - e.g. disease, storage, treatment

  • plot_percentages (bool | default = True) – boolian indicating if the percentages or the total counts should be plotted

  • condition_order (list | default = None) – list with the order in which the conditions should be plotted, for consistency

  • figsize ((width, height) or None | default = (8,4)) – optional parameter to define the figure size of the plot that is to be generated

  • mypal (string | default = “Paired”) – color palette for boxplots e.g. Paired, Blues_d

Return type:

Figure