Skip to content

Commit e8808a7

Browse files
authored
Merge branch 'main' into 944-longitudinal-normalization
2 parents fa7becc + 57d84dd commit e8808a7

File tree

4 files changed

+25
-37
lines changed

4 files changed

+25
-37
lines changed

.github/labels.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
---
2-
# Labels names are important as they are used by Release Drafter to decide
3-
# regarding where to record them in changelog or if to skip them.
4-
#
5-
# The repository labels will be automatically configured using this file and
6-
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
72
- name: breaking
83
description: Breaking Changes
94
color: bfd4f2

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ default_stages:
77
minimum_pre_commit_version: 2.16.0
88
repos:
99
- repo: https://github.com/biomejs/pre-commit
10-
rev: v2.2.5
10+
rev: v2.2.6
1111
hooks:
1212
- id: biome-format
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.14.0
14+
rev: v0.14.1
1515
hooks:
1616
- id: ruff-check
1717
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]

ehrapy/preprocessing/_scanpy_pp_api.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,22 @@ def pca(
7070
chunk_size: Number of observations to include in each chunk. Required if `chunked=True` was passed.
7171
7272
Returns:
73-
:X_pca: :class:`~scipy.sparse.spmatrix`, :class:`~numpy.ndarray`
74-
75-
If `data` is array-like and `return_info=False` was passed, this function only returns `X_pca`...
76-
77-
edata : :class:`~ehrdata.EHRData` or :class:`~anndata.AnnData`
78-
79-
…otherwise if `copy=True` it returns or else adds fields to `edata`:
80-
81-
`.obsm['X_pca']`
82-
PCA representation of data.
83-
84-
`.varm['PCs']`
85-
The principal components containing the loadings.
86-
87-
`.uns['pca']['variance_ratio']`
88-
Ratio of explained variance.
89-
90-
`.uns['pca']['variance']`
91-
Explained variance, equivalent to the eigenvalues of the covariance matrix.
73+
If `data` is array-like and `return_info=False` was passed,
74+
this function returns the PCA representation of `data` as an
75+
array of the same type as the input array.
76+
77+
Otherwise, it returns `None` if `copy=False`, else an updated `AnnData` object.
78+
Sets the following fields:
79+
80+
`.obsm['X_pca' | key_added]` : :class:`~scipy.sparse.csr_matrix` | :class:`~scipy.sparse.csc_matrix` | :class:`~numpy.ndarray` (shape `(adata.n_obs, n_comps)`)
81+
PCA representation of data.
82+
`.varm['PCs' | key_added]` : :class:`~numpy.ndarray` (shape `(adata.n_vars, n_comps)`)
83+
The principal components containing the loadings.
84+
`.uns['pca' | key_added]['variance_ratio']` : :class:`~numpy.ndarray` (shape `(n_comps,)`)
85+
Ratio of explained variance.
86+
`.uns['pca' | key_added]['variance']` : :class:`~numpy.ndarray` (shape `(n_comps,)`)
87+
Explained variance, equivalent to the eigenvalues of the
88+
covariance matrix.
9289
"""
9390
return sc.pp.pca(
9491
data=data,

ehrapy/tools/_scanpy_tl_api.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -604,17 +604,15 @@ def paga(
604604
) -> EHRData | AnnData | None: # pragma: no cover
605605
"""Mapping out the coarse-grained connectivity structures of complex manifolds :cite:p:`Wolf2019`.
606606
607-
By quantifying the connectivity of partitions (groups, clusters),
608-
partition-based graph abstraction (PAGA) generates a much
607+
By quantifying the connectivity of partitions (groups, clusters), partition-based graph abstraction (PAGA) generates a much
609608
simpler abstracted graph (*PAGA graph*) of partitions, in which edge weights
610609
represent confidence in the presence of connections. By tresholding this
611610
confidence in :func:`~ehrapy.plot.paga`, a much simpler representation of the
612611
manifold data is obtained, which is nonetheless faithful to the topology of the manifold.
613612
The confidence should be interpreted as the ratio of the actual versus the
614-
expected value of connections under the null model of randomly connecting
615-
partitions. We do not provide a p-value as this null model does not
616-
precisely capture what one would consider "connected" in real data, hence it
617-
strongly overestimates the expected value. See an extensive discussion of this in :cite:p:`Wolf2019`.
613+
expected value of connections under the null model of randomly connecting partitions.
614+
We do not provide a p-value as this null model does not precisely capture what one would consider "connected" in real data, hence it strongly overestimates the expected value.
615+
See an extensive discussion of this in :cite:p:`Wolf2019`.
618616
619617
.. note::
620618
Note that you can use the result of :func:`~ehrapy.plot.paga` in
@@ -675,11 +673,9 @@ def ingest(
675673
The function uses a knn classifier for mapping labels and the UMAP package :cite:p:`McInnes2018` for mapping the embeddings.
676674
677675
.. note::
678-
We refer to this *asymmetric* dataset integration as *ingesting*
679-
annotations from reference data to new data. This is different from
680-
learning a joint representation that integrates both datasets in an
681-
unbiased way, as CCA (e.g. in Seurat) or a conditional VAE (e.g. in
682-
scVI) would do.
676+
We refer to this *asymmetric* dataset integration as *ingesting* annotations from reference data to new data.
677+
This is different from learning a joint representation that integrates both datasets in an
678+
unbiased way, as CCA (e.g. in Seurat) or a conditional VAE (e.g. in scVI) would do.
683679
684680
You need to run :func:`~ehrapy.preprocessing.neighbors` on `edata_ref` before passing it.
685681

0 commit comments

Comments
 (0)