sccoda.util.data_visualization.boxplots¶
-
sccoda.util.data_visualization.
boxplots
(data, feature_name, y_scale='relative', plot_facets=False, add_dots=False, cell_types=None, args_boxplot={}, args_swarmplot={}, figsize=None, dpi=100, cmap='Blues', plot_legend=True, level_order=None)¶ Grouped boxplot visualization. The cell counts for each cell type are shown as a group of boxplots, with intra–group separation by a covariate from data.obs.
The cell type groups can either be ordered along the x-axis of a single plot (plot_facets=False) or as plot facets (plot_facets=True).
- Parameters
- data :
AnnData
AnnData
A scCODA-compatible data object
- feature_name :
str
str
The name of the feature in data.obs to plot
- y_scale :
str
str
(default:'relative'
) Transformation to of cell counts. Options: “relative” - Relative abundance, “log” - log(count), “count” - absolute abundance (cell counts)
- plot_facets :
bool
bool
(default:False
) If False, plot cell types on the x-axis. If True, plot as facets
- add_dots :
bool
bool
(default:False
) If True, overlay a scatterplot with one dot for each data point
- cell_types :
list
,None
Optional
[list
] (default:None
) Subset of cell types that should be plotted
- args_boxplot :
dict
,None
Optional
[dict
] (default:{}
) Arguments passed to sns.boxplot
- args_swarmplot :
dict
,None
Optional
[dict
] (default:{}
) Arguments passed to sns.swarmplot
- figsize :
Tuple
[int
,int
],None
Optional
[Tuple
[int
,int
]] (default:None
) figure size
- dpi :
int
,None
Optional
[int
] (default:100
) dpi setting
- cmap :
str
,None
Optional
[str
] (default:'Blues'
) The seaborn color map for the barplot
- plot_legend :
bool
,None
Optional
[bool
] (default:True
) If True, adds a legend
- level_order :
List
[str
],None
Optional
[List
[str
]] (default:None
) Custom ordering of bars on the x-axis
- data :
- Return type
Tuple
[AxesSubplot
,FacetGrid
],None
Optional
[Tuple
[AxesSubplot
,FacetGrid
]]- Returns
Depending on
plot_facets
, returns aAxesSubplot
(plot_facets = False
) orFacetGrid
(plot_facets = True
) objectax – if
plot_facets = False
g – if
plot_facets = True