addRoiScatter
addRoiScatter ¶
addRoiScatter(
data,
method=None,
marker=None,
threshold=0.5,
raw=False,
log=False,
subset=None,
imageId="imageid",
xCoordinate="X_centroid",
yCoordinate="Y_centroid",
size=5,
cmap="gist_heat",
lassoAlpha=0.8,
lassoLinewidth=3,
lassoColor="red",
roiName="selected_roi",
label="roi_scatter",
sdataTable=None,
)
Label a region of interest by thresholding a marker.
scimap's addROI_scatter opened a Matplotlib window and let you lasso cells by
hand. That does not work in a script, a notebook running headless, or CI, so the
scimappro version defines the ROI by a rule instead: cells above threshold for
marker are labelled roiName, everything else 'Other', and the result goes
into obs[label].
It is a thin wrapper over sp.tl.classify; use that
directly when you want more than one positive marker or a negative one.
For hand-drawn ROIs, draw them in OMERO and import them with
sp.helpers.addROI_omero.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
method
|
str
|
Accepted for signature compatibility with scimap. Only marker thresholding is implemented. |
None
|
marker
|
(str | list, required)
|
The marker(s) whose intensity defines the ROI. A |
None
|
threshold
|
float
|
Cells at or above this value are inside the ROI. |
0.5
|
raw
|
bool
|
Accepted for signature compatibility with scimap. |
False
|
log
|
bool
|
Accepted for signature compatibility with scimap. |
False
|
subset
|
str | list
|
Accepted for signature compatibility with scimap. |
None
|
imageId
|
str
|
Column in |
'imageid'
|
xCoordinate
|
str
|
Column in |
'X_centroid'
|
yCoordinate
|
str
|
Column in |
'Y_centroid'
|
size
|
float
|
Accepted for signature compatibility with scimap's interactive plot. |
5
|
cmap
|
str
|
Accepted for signature compatibility with scimap's interactive plot. |
'gist_heat'
|
lassoAlpha
|
float
|
Accepted for signature compatibility with scimap's interactive plot. |
0.8
|
lassoLinewidth
|
float
|
Accepted for signature compatibility with scimap's interactive plot. |
3
|
lassoColor
|
str
|
Accepted for signature compatibility with scimap's interactive plot. |
'red'
|
roiName
|
str
|
Label given to cells inside the ROI. |
'selected_roi'
|
label
|
str
|
Column in |
'roi_scatter'
|
sdataTable
|
str
|
Which |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
adata |
AnnData | SpatialData
|
The input with |