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

Add two tests for selecting transition_genes in tl.cell_velocities #638

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
26 changes: 26 additions & 0 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,32 @@ def test_norm_loglikelihood():
assert ll - ll_ground_truth < 1e-9


def setup_cell_velocities_tests():
# Sets up adata for test cases
# Select only part of data to speed up tests.
adata = dyn.sample_data.DentateGyrus_scvelo()[:200, :1000]
from dynamo.preprocessing import Preprocessor
preprocessor = Preprocessor()
preprocessor.preprocess_adata(adata, recipe="monocle")
dyn.tl.dynamics(adata, model="stochastic")
dyn.tl.reduceDimension(adata)
return adata


def test_cell_velocities():
adata = setup_cell_velocities_tests()

dyn.tl.cell_velocities(adata)
assert 'velocity_S' in adata.layers


def test_cell_velocities_selecting_transition_genes():
adata = setup_cell_velocities_tests()

dyn.tl.cell_velocities(adata, transition_genes=[True]*adata.n_vars)
assert 'velocity_S' in adata.layers


if __name__ == "__main__":
# test_calc_laplacian()
# test_divergence()
Expand Down
Loading