Skip to content

Commit

Permalink
Backport PR scverse#2611: feat(external): add velovi to external
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkim0 authored and meeseeksmachine committed Mar 11, 2024
1 parent c3d719e commit 41e41f6
Show file tree
Hide file tree
Showing 12 changed files with 1,905 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/api/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Module classes in the external API with respective generative and inference proc
external.tangram.TangramMapper
external.scbasset.ScBassetModule
external.contrastivevi.ContrastiveVAE
external.velovi.VELOVAE
```

Expand Down
3 changes: 3 additions & 0 deletions docs/api/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import scvi
external.SCBASSET
external.ContrastiveVI
external.POISSONVI
external.VELOVI
```

Expand Down Expand Up @@ -102,6 +103,8 @@ Here we maintain a few package specific utilities for feature selection, etc.
data.organize_multiome_anndatas
data.add_dna_sequence
data.reads_to_fragments
external.velovi.get_permutation_scores
external.velovi.preprocess_data
```

```{eval-rst}
Expand Down
12 changes: 12 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ @article{GayosoSteier21
publisher = {Nature Publishing Group}
}

@article{GayosoWeiler23,
title = {Deep generative modeling of transcriptional dynamics for RNA velocity analysis in single cells},
author = {Adam Gayoso and Philipp Weiler and Mohammad Lotfollahi and Dominik Klein and Justin Hong and Aaron Streets and Fabian J. Theis and Nir Yosef},
doi = {10.1038/s41592-023-01994-w},
year = {2023},
month = sep,
journal = {Nature Methods},
volume = {21},
pages = {50-59},
publisher = {Nature Publishing Group}
}

@article{Ionides2008,
title={Truncated Importance Sampling},
author={Edward L. Ionides},
Expand Down
2 changes: 2 additions & 0 deletions docs/release_notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ is available in the [commit logs](https://github.com/scverse/scvi-tools/commits/
argument `generate_coordinates` {pr}`2603`.
- Add experimental support for using custom {class}`lightning.pytorch.core.LightningDataModule`s
in {func}`scvi.autotune.run_autotune` {pr}`2605`.
- Add {class}`scvi.external.VELOVI` for RNA velocity estimation using variational inference
{pr}`2611`.

#### Changed

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ pymde = ["pymde"] # scvi.model.utils.mde dependencies
regseq = ["biopython>=1.81", "genomepy"] # scvi.data.add_dna_sequence
loompy = ["loompy>=3.0.6"] # read loom
scanpy = ["scanpy>=1.6"] # scvi.criticism and read 10x
velovi = ["scvelo>=0.3.0"] # scvi.external.velovi
optional = [
"scvi-tools[autotune,aws,criticism,hub,loompy,pymde,regseq,scanpy]"
"scvi-tools[autotune,aws,criticism,hub,loompy,pymde,regseq,scanpy,velovi]"
] # all optional user functionality

tutorials = [
Expand Down
2 changes: 2 additions & 0 deletions scvi/external/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .solo import SOLO
from .stereoscope import RNAStereoscope, SpatialStereoscope
from .tangram import Tangram
from .velovi import VELOVI

__all__ = [
"SCAR",
Expand All @@ -19,4 +20,5 @@
"SCBASSET",
"POISSONVI",
"ContrastiveVI",
"VELOVI",
]
5 changes: 5 additions & 0 deletions scvi/external/velovi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ._model import VELOVI
from ._module import VELOVAE
from ._utils import get_permutation_scores, preprocess_data

__all__ = ["VELOVI", "VELOVAE", "get_permutation_scores", "preprocess_data"]
9 changes: 9 additions & 0 deletions scvi/external/velovi/_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import NamedTuple


class _REGISTRY_KEYS_NT(NamedTuple):
X_KEY: str = "X"
U_KEY: str = "U"


VELOVI_REGISTRY_KEYS = _REGISTRY_KEYS_NT()
Loading

0 comments on commit 41e41f6

Please sign in to comment.