spatialDistanceDistribution
spatialDistanceDistribution ¶
spatialDistanceDistribution(
data,
spatialDistance="spatial_distance",
phenotype="phenotype",
imageId="imageid",
distanceFrom=None,
distanceTo=None,
xAxis=None,
yAxis=None,
facetBy=None,
plotType=None,
subsetCol=None,
subsetValue=None,
fileName="spatial_distance_distribution.pdf",
outputDir=None,
saveDir=None,
show=True,
returnData=False,
returnFig=False,
dpi=300,
transparent=False,
sdataTable=None,
**kwargs
)
Distance distributions as box plots, one box per target cell type.
The heatmap shows means; this shows the spread behind them, which is where bimodality and long tails become visible. Built by melting the per-cell distance table into long form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
spatialDistance
|
str
|
Key in |
'spatial_distance'
|
phenotype
|
str
|
Column in |
'phenotype'
|
imageId
|
str
|
Column in |
'imageid'
|
distanceFrom
|
str | list
|
Keep only cells of these phenotypes — the cell types you measure from. |
None
|
distanceTo
|
str | list
|
Keep only these target columns — the cell types you measure to. |
None
|
xAxis
|
str
|
Accepted for signature compatibility with scimap; the x axis is always the target cell type. |
None
|
yAxis
|
str
|
Accepted for signature compatibility with scimap; the y axis is always distance. |
None
|
facetBy
|
str
|
Accepted for signature compatibility with scimap; the current
implementation draws a single panel. Use |
None
|
plotType
|
str
|
Accepted for signature compatibility with scimap; box plots are drawn. |
None
|
subsetCol
|
str
|
Column in |
None
|
subsetValue
|
str | list
|
Values of |
None
|
**kwargs
|
dict
|
Extra options. |
{}
|
fileName
|
str
|
File name for the saved figure. The extension decides the format. |
'spatial_distance_distribution.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
|
|