Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist/
.pytest_cache/
CLAUDE.md
.claude/
*pycache*
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ scxmatch.test(
reference=None,
metric="sqeuclidean",
rank=False,
k=100,
total_RAM_available_gb=None
k=100
)
```

Expand All @@ -60,17 +59,15 @@ Performs Rosenbaum’s matching-based test to determine if there is a statistica
- `reference` (`str` or `list of str`, optional): The reference group(s). If `None`, all non-test samples are used as reference.
- `metric` (`str`, default `"sqeuclidean"`): Distance metric for matching. Follows `scipy.spatial.distance.cdist` standards.
- `rank` (`bool`, default `False`): If `True`, features are rank-transformed before distance computation.
- `k` (`int`, `"auto"`, or `"full"`, default `100`): Number of nearest neighbors to use for graph construction. If `full`, a full distance matrix will be calculated.
- `total_RAM_available_gb` (`float`, optional): Required if `k="auto"`.
- `k` (`int` or `None`, default `100`): Number of nearest neighbors to use for graph construction. If `None`, a full distance matrix is used.

#### Returns
- `result` (`dictionary`): Dictionary containing the P-value, the number of cross matches a1, the expected value of A1, the variance of A1, the z-score, the matching coverage, and the effect strength ratio.

#### Raises
- `TypeError`: If the input `adata` is not an `AnnData` object.
- `ValueError`: If `test_group` or `reference` contains values not present in `adata.obs[group_by]`.
- `ValueError`: If `k="auto"` and `total_RAM_available_gb` is not provided.
- `ValueError`: If `k` is not an integer, `"auto"`, or `"full"`.
- `ValueError`: If `k` is not an integer or `None`.

#### Modifies:

Expand Down
2 changes: 1 addition & 1 deletion scxmatch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test(adata, group_by, test_group, reference=None, metric="sqeuclidean", rank
The distance metric used for calculating distances between the samples during the matching process.
It can be any valid metric recognized by `scipy.spatial.distance.cdist`.

rank : bool, optional, default=True
rank : bool, optional, default=False
If `True`, ranks the features in the data matrix before performing the matching. This can help reduce
the impact of varying scales of the features on the distance computation.

Expand Down
Loading