From 356f3ca7eda27205dba1928bc7a182f5959ea1d5 Mon Sep 17 00:00:00 2001 From: Vitalii Kleshchevnikov Date: Sat, 16 Apr 2022 17:43:58 +0100 Subject: [PATCH 1/6] exclusion of observed variables from posterior --- tests/test_cell2location.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_cell2location.py b/tests/test_cell2location.py index 8d33f0de..a4b1d1d3 100644 --- a/tests/test_cell2location.py +++ b/tests/test_cell2location.py @@ -24,6 +24,8 @@ def test_cell2location(): sc_model.train(max_epochs=1, batch_size=1000) # export the estimated cell abundance (summary of the posterior distribution) dataset = sc_model.export_posterior(dataset, sample_kwargs={"num_samples": 10}) + # test exclusion of observed variables from posterior sampling + assert 'data_target' not in dataset.uns['mod']['post_sample_means'].keys() # test plot_QC sc_model.plot_QC() # test save/load @@ -47,6 +49,8 @@ def test_cell2location(): # export the estimated cell abundance (summary of the posterior distribution) # full data dataset = st_model.export_posterior(dataset, sample_kwargs={"num_samples": 10, "batch_size": st_model.adata.n_obs}) + # test exclusion of observed variables from posterior sampling + assert 'data_target' not in dataset.uns['mod']['post_sample_means'].keys() ## minibatches of locations ## Cell2location.setup_anndata(dataset, batch_key="batch") st_model = Cell2location(dataset, cell_state_df=inf_aver, N_cells_per_location=30, detection_alpha=200) From e36c58ca9c81f0d3cff5ad49c51f5785777f7e73 Mon Sep 17 00:00:00 2001 From: Vitalii Kleshchevnikov Date: Sat, 16 Apr 2022 18:01:47 +0100 Subject: [PATCH 2/6] black --- tests/test_cell2location.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cell2location.py b/tests/test_cell2location.py index a4b1d1d3..3bf8210e 100644 --- a/tests/test_cell2location.py +++ b/tests/test_cell2location.py @@ -25,7 +25,7 @@ def test_cell2location(): # export the estimated cell abundance (summary of the posterior distribution) dataset = sc_model.export_posterior(dataset, sample_kwargs={"num_samples": 10}) # test exclusion of observed variables from posterior sampling - assert 'data_target' not in dataset.uns['mod']['post_sample_means'].keys() + assert "data_target" not in dataset.uns["mod"]["post_sample_means"].keys() # test plot_QC sc_model.plot_QC() # test save/load @@ -50,7 +50,7 @@ def test_cell2location(): # full data dataset = st_model.export_posterior(dataset, sample_kwargs={"num_samples": 10, "batch_size": st_model.adata.n_obs}) # test exclusion of observed variables from posterior sampling - assert 'data_target' not in dataset.uns['mod']['post_sample_means'].keys() + assert "data_target" not in dataset.uns["mod"]["post_sample_means"].keys() ## minibatches of locations ## Cell2location.setup_anndata(dataset, batch_key="batch") st_model = Cell2location(dataset, cell_state_df=inf_aver, N_cells_per_location=30, detection_alpha=200) From 11b6b50dd4127418ce9be215764a8952345dac33 Mon Sep 17 00:00:00 2001 From: Vitalii Kleshchevnikov Date: Sat, 16 Apr 2022 18:10:21 +0100 Subject: [PATCH 3/6] Fix scvi-tools to version <0.16.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 7f58c58d..2e6eb5eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,7 @@ include_package_data = True packages = find: install_requires = pyro-ppl>=1.8.0 - scvi-tools>=0.15.3 + scvi-tools>=0.15.3<0.16.0 torch>=1.9.0 pymc3>=3.8<3.10 arviz==0.10.0 From e80cfe81114251dccd1ce33e9cb321aab7f731ba Mon Sep 17 00:00:00 2001 From: Vitalii Kleshchevnikov Date: Sat, 16 Apr 2022 18:17:27 +0100 Subject: [PATCH 4/6] fix scvi-tools>=0.15.3<0.15.5 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2e6eb5eb..b8f20319 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,7 @@ include_package_data = True packages = find: install_requires = pyro-ppl>=1.8.0 - scvi-tools>=0.15.3<0.16.0 + scvi-tools>=0.15.3<0.15.5 torch>=1.9.0 pymc3>=3.8<3.10 arviz==0.10.0 From 0c763dac7fea0a16a7e050da37c9c66787a3eb1b Mon Sep 17 00:00:00 2001 From: Vitalii Kleshchevnikov Date: Sat, 16 Apr 2022 18:24:50 +0100 Subject: [PATCH 5/6] fix jax version instead of scvi-tools --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b8f20319..119b89db 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,9 +15,10 @@ include_package_data = True packages = find: install_requires = pyro-ppl>=1.8.0 - scvi-tools>=0.15.3<0.15.5 + scvi-tools>=0.15.3 torch>=1.9.0 pymc3>=3.8<3.10 + jax>=0.3,<=0.3.6 arviz==0.10.0 numpy pandas From fb6715f8d206f13c7a143f46ec2ada60d3863532 Mon Sep 17 00:00:00 2001 From: Vitalii Kleshchevnikov Date: Sat, 16 Apr 2022 18:30:35 +0100 Subject: [PATCH 6/6] fix jaxlib version --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 119b89db..67bc4ce6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,7 @@ install_requires = torch>=1.9.0 pymc3>=3.8<3.10 jax>=0.3,<=0.3.6 + jaxlib>=0.1.65,<=0.3.5 arviz==0.10.0 numpy pandas