spatial_pscore
Short Description
sm.pl.spatial_pscore
: This function offers a visual representation of
proximity volume and density scores, essential for understanding the spatial
relationships and interactions among cell types or phenotypes within tissue samples.
To ensure accurate and meaningful visualizations, it is crucial to compute
these scores beforehand using sm.tl.spatial_pscore
. Through customizable bar
plots, users can delve into the intricacies of spatial co-occurrence patterns,
facilitating deeper insights into the cellular microenvironment.
Function
spatial_pscore(adata, label='spatial_pscore', plot_score='both', order_xaxis=None, color='grey', figsize=None, fileName='spatial_pscore.pdf', saveDir=None, **kwargs)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
The annotated data matrix with spatial proximity scores. |
required |
label |
str
|
The label/key used to access the spatial proximity scores stored in |
'spatial_pscore'
|
plot_score |
str
|
Determines which score(s) to plot. Options are: - 'Proximity Density' for plotting only the Proximity Density scores, - 'Proximity Volume' for plotting only the Proximity Volume scores, - 'both' for plotting both scores side by side. Default is 'both'. |
'both'
|
order_xaxis |
list
|
Custom order for the x-axis categories. Pass a list of category names in the desired order. This can be useful for comparing specific regions or samples in a specific sequence. |
None
|
color |
str
|
Color to use for the bar plots. This can enhance plot readability or align with publication themes. |
'grey'
|
fileName |
str
|
Name of the file to save the plot. Relevant only if |
'spatial_pscore.pdf'
|
saveDir |
str
|
Directory to save the generated plot. If None, the plot is not saved. |
None
|
**kwargs |
Additional keyword arguments passed directly to seaborn's barplot function, allowing for further customization of the plots. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Plot |
matplotlib
|
Displays the generated bar plots. |
Example
1 2 3 4 5 6 7 8 |
|
Source code in scimap/plotting/spatial_pscore.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|