Skip to content
Draft
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
10 changes: 8 additions & 2 deletions docs/api/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,24 @@ For visual quality control, see {func}`~scanpy.pl.highest_expr_genes` and
pp.recipe_seurat
```

## Batch effect correction
(pp-data-integration)=

Also see {ref}`data-integration`. Note that a simple batch correction method is available via {func}`pp.regress_out`. Checkout {mod}`scanpy.external` for more.
## Data integration

Batch effect correction and other data integration.
Note that a simple batch correction method is available via {func}`pp.regress_out`.

```{eval-rst}
.. autosummary::
:nosignatures:
:toctree: generated/

pp.combat
pp.harmony_integrate
```

Also see {ref}`data integration tools <data-integration>` and external {ref}`external data integration <external-data-integration>`.

## Doublet detection

```{eval-rst}
Expand Down
8 changes: 5 additions & 3 deletions docs/external/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
.. currentmodule:: scanpy.external
```

Previously found here, but now part of scanpy’s main API:
- {func}`scanpy.pp.harmony_integrate`
- {func}`scanpy.pp.scrublet`
- {func}`scanpy.pp.scrublet_simulate_doublets`

(external-data-integration)=

## Data integration
Expand All @@ -14,10 +19,8 @@
:toctree: ../generated/

pp.bbknn
pp.harmony_integrate
pp.mnn_correct
pp.scanorama_integrate

```

## Sample demultiplexing
Expand All @@ -39,5 +42,4 @@ Note that the fundamental limitations of imputation are still under [debate](htt

pp.dca
pp.magic

```
2 changes: 1 addition & 1 deletion docs/release-notes/1.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Some highlights:
* {func}`scanpy.datasets.blobs` now accepts a `random_state` argument {pr}`2683` {smaller}`E Roellin`
* {func}`scanpy.pp.pca` and {func}`scanpy.pp.regress_out` now accept a layer argument {pr}`2588` {smaller}`S Dicks`
* {func}`scanpy.pp.subsample` with `copy=True` can now be called in backed mode {pr}`2624` {smaller}`E Roellin`
* {func}`scanpy.external.pp.harmony_integrate` now runs with 64 bit floats improving reproducibility {pr}`2655` {smaller}`S Dicks`
* {func}`scanpy.pp.harmony_integrate` now runs with 64 bit floats improving reproducibility {pr}`2655` {smaller}`S Dicks`
* {func}`scanpy.tl.rank_genes_groups` no longer warns that it's default was changed from t-test_overestim_var to t-test {pr}`2798` {smaller}`L Heumos`
* `scanpy.pp.calculate_qc_metrics` now allows `qc_vars` to be passed as a string {pr}`2859` {smaller}`N Teyssier`
* {func}`scanpy.tl.leiden` and {func}`scanpy.tl.louvain` now store clustering parameters in the key provided by the `key_added` parameter instead of always writing to (or overwriting) a default key {pr}`2864` {smaller}`J Fan`
Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/1.11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Release candidates:

#### Documentation

- {guilabel}`rc1` Improve {func}`~scanpy.external.pp.harmony_integrate` docs {smaller}`D Kühl` ({pr}`3362`)
- {guilabel}`rc1` Improve {func}`~scanpy.pp.harmony_integrate` docs {smaller}`D Kühl` ({pr}`3362`)
- {guilabel}`rc1` Raise {exc}`FutureWarning` when calling deprecated {mod}`scanpy.pp` functions {smaller}`P Angerer` ({pr}`3380`)
- {guilabel}`rc1` {smaller}`P Angerer` ({pr}`3407`)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ bbknn = [ "bbknn" ]
dask = [ "anndata[dask]", "dask[array]>=2024.5.1" ]
# PCA acceleration
dask-ml = [ "dask-ml", "scanpy[dask]" ]
harmony = [ "harmonypy" ]
leiden = [ "igraph>=0.10.8", "leidenalg>=0.10.1" ]
louvain = [ "igraph", "louvain>=0.8.2", "setuptools" ]
magic = [ "magic-impute>=2.0.4" ]
Expand Down Expand Up @@ -136,6 +135,7 @@ doc = [
]
test-min = [
"dependency-groups", # for CI scripts doctests
"pooch",
"pytest",
"pytest-cov", # only for use from VS Code
"pytest-mock",
Expand Down
29 changes: 21 additions & 8 deletions src/scanpy/external/pp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,39 @@
from __future__ import annotations

from ..._compat import deprecated
from ...preprocessing import _scrublet
from ._bbknn import bbknn
from ._dca import dca
from ._harmony_integrate import harmony_integrate
from ._hashsolo import hashsolo
from ._magic import magic
from ._mnn_correct import mnn_correct
from ._scanorama_integrate import scanorama_integrate

scrublet = deprecated("Import from sc.pp instead")(_scrublet.scrublet)
scrublet_simulate_doublets = deprecated("Import from sc.pp instead")(
_scrublet.scrublet_simulate_doublets
)

__all__ = [
"bbknn",
"dca",
"harmony_integrate",
"hashsolo",
"magic",
"mnn_correct",
"scanorama_integrate",
]


@deprecated("Import from sc.pp instead")
def harmony_integrate(*args, **kwargs):
from ...preprocessing import harmony_integrate

return harmony_integrate(*args, **kwargs)


@deprecated("Import from sc.pp instead")
def scrublet(*args, **kwargs):
from ...preprocessing import scrublet

return scrublet(*args, **kwargs)


@deprecated("Import from sc.pp instead")
def scrublet_simulate_doublets(*args, **kwargs):
from ...preprocessing import scrublet_simulate_doublets

return scrublet_simulate_doublets(*args, **kwargs)
100 changes: 0 additions & 100 deletions src/scanpy/external/pp/_harmony_integrate.py

This file was deleted.

2 changes: 2 additions & 0 deletions src/scanpy/preprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ._combat import combat
from ._deprecated.highly_variable_genes import filter_genes_dispersion
from ._deprecated.sampling import subsample
from ._harmony_integrate import harmony_integrate
from ._highly_variable_genes import highly_variable_genes
from ._normalization import normalize_total
from ._pca import pca
Expand All @@ -31,6 +32,7 @@
"filter_cells",
"filter_genes",
"filter_genes_dispersion",
"harmony_integrate",
"highly_variable_genes",
"log1p",
"neighbors",
Expand Down
Loading
Loading