spatialInteractionNetwork
spatialInteractionNetwork ¶
spatialInteractionNetwork(
data,
spatialCooccurrence="spatialCooccurrence",
pVal=0.05,
cmap="vlag",
nodeColor="#22333b",
nodeSize=None,
alpha=0.9,
figsize=None,
fontSize=12,
fontColor="white",
subsetPhenotype=None,
fileName="spatialInteractionNetwork.pdf",
outputDir=None,
saveDir=None,
show=True,
returnData=False,
returnFig=False,
dpi=300,
transparent=False,
sdataTable=None,
)
Significant cell-type interactions as a circular node-edge network.
Cell types are laid out evenly on a circle and an edge is drawn for every pair
whose co-occurrence p-value is below pVal. It answers "which cell types
interact at all" faster than reading a heatmap.
Reads the same uns key as
sp.pl.spatialCooccurrence, averaging
across images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
spatialCooccurrence
|
str
|
Key in |
'spatialCooccurrence'
|
pVal
|
float
|
An edge is drawn when the pair's p-value is below this. |
0.05
|
cmap
|
str
|
Accepted for signature compatibility with scimap; edges are drawn black. |
'vlag'
|
nodeColor
|
str
|
Node fill colour. |
'#22333b'
|
nodeSize
|
float
|
Node marker area. Defaults to 600. |
None
|
alpha
|
float
|
Edge opacity. |
0.9
|
figsize
|
tuple
|
Figure size in inches. Defaults to |
None
|
fontSize
|
int
|
Node label font size. |
12
|
fontColor
|
str
|
Node label colour. |
'white'
|
subsetPhenotype
|
str | list
|
Keep only these phenotypes as nodes. |
None
|
fileName
|
str
|
File name for the saved figure. The extension decides the format. |
'spatialInteractionNetwork.pdf'
|
outputDir
|
str
|
Directory to save the figure in. When |
None
|
saveDir
|
str
|
Deprecated alias for |
None
|
show
|
bool
|
Call |
True
|
returnData
|
bool
|
Return the |
False
|
returnFig
|
bool
|
Return |
False
|
dpi
|
int
|
Resolution of the saved figure. |
300
|
transparent
|
bool
|
Save with a transparent background. |
False
|
sdataTable
|
str
|
Which |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
result |
None | DataFrame | tuple
|
|