spapros.se.ProbesetSelector.plot_histogram
- ProbesetSelector.plot_histogram(x_axis_keys=None, selections=None, penalty_keys=None, unapplied_penalty_keys=None, background_key=True, **kwargs)
Plot histograms of (basic) selections under given penalties.
The full selection procedure consists of steps partially based on basic score based selection procedures. This is an interactive plotting function to investigate if the constructed penalty kernels are well chosen.
Note
The green line shows a linear interpolation of the penalty scores which is only an approximation of the penalty function.
- Parameters:
x_axis_keys (Optional[Dict[str, str]]) – Dictionary with the values from
penaly_keys
as keys and the column name ofadata.var
that was used to calcuate the respective penalty factors.selections (Optional[List[str]]) –
Plot the histograms of selections based on
’pca’ : pca loadings based selection of prior genes
’DE’ : genes selected based on differential expressed which are used as the ‘forest_DE_baseline’
’marker’ : genes from the marker list
penalty_keys (Optional[Dict]) –
Dictionary with the selection method name as key and the name of the column for
adata.var
containing the penalty factors to plot. Selections that are not inpenalty_keys
are plottet without penalty. If None (default), we use the columns defined in the selector for each selection. The respective attributes of the selector are:’pca’:
pca_penalties
’DE’:
DE_penalties
’marker’:
m_penalties_adata_celltypes
unapplied_penalty_keys (Optional[Dict]) – Same as
penalty_keys
but for penalties that were not applied to the selection.background_key (Union[bool, str]) – Key in
adata.var
for preselected genes (typically ‘highly_variable_genes’) to plot as background histogram . If True (default),g_key
is used. If None no background is plottet. If ‘all’, all genes are used as background.kwargs – Further arguments for
selection_histogram()
.
- Returns:
Figure can be showed (default True) and stored to path (default None). Change this with show and save in
kwargs
.- Return type:
None