groupCorrelation
groupCorrelation ¶
groupCorrelation(
data,
groupBy,
condition,
normalize=False,
subsetGroups=None,
orderRow=None,
orderColumn=None,
clusterRows=True,
clusterColumns=True,
cmap="vlag",
figsize=None,
overlayValues=False,
fontSize=10,
fontColor="black",
fileName="groupCorrelation.pdf",
outputDir=None,
saveDir=None,
show=True,
returnData=False,
returnFig=False,
dpi=300,
transparent=False,
sdataTable=None,
**kwargs
)
Correlate groups with each other by their composition across a condition.
A groupBy x condition contingency table is built, optionally row-normalised
to proportions, and the groups are then correlated with one another. Use it to
ask which samples resemble which, in terms of the cell types they contain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
groupBy
|
(str, required)
|
Column in |
required |
condition
|
(str, required)
|
Column in |
required |
normalize
|
bool
|
Convert each group's counts to proportions before correlating. Do this when the groups differ a lot in cell number. |
False
|
subsetGroups
|
list
|
Restrict to these |
None
|
orderRow
|
list
|
Explicit row order. |
None
|
orderColumn
|
list
|
Explicit column order. |
None
|
clusterRows
|
bool
|
Accepted for signature compatibility with scimap; the current
implementation does not reorder rows. Use |
True
|
clusterColumns
|
bool
|
Accepted for signature compatibility with scimap; the current
implementation does not reorder columns. Use |
True
|
cmap
|
str
|
Matplotlib colormap. |
'vlag'
|
figsize
|
tuple
|
Figure size in inches. |
None
|
overlayValues
|
bool
|
Print the correlation coefficient inside each cell. |
False
|
fontSize
|
int
|
Tick label font size. |
10
|
fontColor
|
str
|
Accepted for signature compatibility with scimap; overlaid values are drawn in the default text colour. |
'black'
|
fileName
|
str
|
File name for the saved figure. The extension decides the format. |
'groupCorrelation.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
|
|