Skip to content

Commit cdc37a0

Browse files
committed
Fix documentation.
1 parent 2c996a5 commit cdc37a0

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

stlearn/spatials/morphology/adjust.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,39 @@
66
from tqdm import tqdm
77

88
_SIMILARITY_MATRIX = Literal["cosine", "euclidean", "pearson", "spearman"]
9-
9+
_METHOD = Literal["mean", "median", "sum"]
1010

1111
def adjust(
1212
adata: AnnData,
1313
use_data: str = "X_pca",
1414
radius: float = 50.0,
1515
rates: int = 1,
16-
method="mean",
17-
copy: bool = False,
16+
method: _SIMILARITY_MATRIX = "mean",
1817
similarity_matrix: _SIMILARITY_MATRIX = "cosine",
18+
copy: bool = False,
1919
) -> AnnData | None:
2020
"""\
2121
SME normalisation: Using spot location information and tissue morphological
2222
features to correct spot gene expression
2323
2424
Parameters
2525
----------
26-
adata
26+
adata : AnnData
2727
Annotated data matrix.
28-
use_data
28+
use_data : str, default "X_pca"
2929
Input date to be adjusted by morphological features.
3030
choose one from ["raw", "X_pca", "X_umap"]
31-
radius
31+
radius: float, default 50.0
3232
Radius to select neighbour spots.
33-
rates
34-
Strength for adjustment.
35-
method
36-
Method for disk smoothing.
37-
choose one from ["means", "median"]
38-
copy
33+
rates: int, default 1
34+
Number of times to add the aggregated neighbor contribution.
35+
Higher values increase the strength of morphological adjustment.
36+
method: {'mean', 'median', 'sum'}, default 'mean'
37+
Method for aggregating neighbor contributions.
38+
similarity_matrix : {'cosine', 'euclidean', 'pearson', 'spearman'}, default 'cosine'
39+
Method to calculate morphological similarity between spots.
40+
copy : bool, default False
3941
Return a copy instead of writing to adata.
40-
similarity_matrix
41-
Matrix to calculate morphological similarity of two spots
42-
choose one from ["cosine", "euclidean", "pearson", "spearman"]
4342
Returns
4443
-------
4544
Depending on `copy`, returns or updates `adata` with the following fields.

0 commit comments

Comments
 (0)