Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(external): add velovi to external #2611

Merged
merged 8 commits into from
Mar 11, 2024
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 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