18
18
from sklearn .metrics import f1_score
19
19
from .utils import *
20
20
21
- def heatmap_scores (adata : AnnData , groupby : str , vmin : float = 0 , vmax : float = 1 , obsm_name = 'SCN_score' , order_by : str = None ):
21
+ def heatmap_scores (adata : AnnData , groupby : str , vmin : float = 0 , vmax : float = 1 , obsm_name = 'SCN_score' , order_by : str = None , fsize : list = [ 5 , 6 ] ):
22
22
"""
23
23
Plots a heatmap of single cell scores, grouping cells according to a specified .obs column and optionally ordering within each group.
24
24
@@ -29,8 +29,9 @@ def heatmap_scores(adata: AnnData, groupby: str, vmin: float = 0, vmax: float =
29
29
vmax (float, optional): Maximum value for color scaling. Defaults to 1.
30
30
obsm_name (str, optional): The key in .obsm to retrieve the matrix for plotting. Defaults to 'SCN_score'.
31
31
order_by (str, optional): The name of the column in .obs used for ordering cells within each group. Defaults to None.
32
-
33
- Returns:
32
+ fsize (list, optional): The figure size. Defaults to [5, 6].
33
+
34
+ Returns:
34
35
None: The function plots a heatmap and does not return any value.
35
36
"""
36
37
# Create a temporary AnnData object with the scores matrix and all original observations
@@ -49,7 +50,7 @@ def heatmap_scores(adata: AnnData, groupby: str, vmin: float = 0, vmax: float =
49
50
adTemp = adTemp [sorted_order , :]
50
51
51
52
# Set figure dimensions and subplot adjustments
52
- fsize = [ 5 , 6 ]
53
+
53
54
plt .rcParams ['figure.subplot.bottom' ] = 0.25
54
55
55
56
# Plot the heatmap with the sorted and grouped data
0 commit comments