From ff6ad1da86faad352ffd6eb1e3f7b2e50c58e8c3 Mon Sep 17 00:00:00 2001 From: Florin Ratajczak Date: Fri, 11 Oct 2024 14:14:28 +0000 Subject: [PATCH] fixed tests --- speos/tests/test_postprocessor.py | 29 +++++++++++++++-------------- speos/tests/test_preprocessor.py | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/speos/tests/test_postprocessor.py b/speos/tests/test_postprocessor.py index ae34c35..93e1ee4 100644 --- a/speos/tests/test_postprocessor.py +++ b/speos/tests/test_postprocessor.py @@ -7,7 +7,6 @@ import os NODATA = int(os.getenv('NODATA', '1')) -print(NODATA) class PostProcessorTestNoData(TestSetup): def setUp(self): @@ -98,19 +97,6 @@ def test_random_overlap_fast_faster_than_descriptive(self): descriptive = timeit.timeit(lambda: pp.get_random_overlap(eligible_genes, kept_genes, algorithm="descriptive"), number=3) self.assertLess(fast, descriptive) - def test_dge_missing_phenotype(self): - - config = self.config.copy() - config.input.tag = "autism" - - pp = PostProcessor(config, translation_table=self.translation_table_path) - - with open(self.test_outer_results, "r") as file: - outer_results = json.load(file) - - pp.outer_result = outer_results - - self.assertIsNone(pp.dge(self.results_file)) def test_contingency_table(self): import numpy as np @@ -214,6 +200,21 @@ def test_goea(self): self.pp.go_enrichment(self.results_file) + + def test_dge_missing_phenotype(self): + + config = self.config.copy() + config.input.tag = "autism" + + pp = PostProcessor(config, translation_table=self.translation_table_path) + + with open(self.test_outer_results, "r") as file: + outer_results = json.load(file) + + pp.outer_result = outer_results + + self.assertIsNone(pp.dge(self.results_file)) + diff --git a/speos/tests/test_preprocessor.py b/speos/tests/test_preprocessor.py index 0f16cf0..214553c 100644 --- a/speos/tests/test_preprocessor.py +++ b/speos/tests/test_preprocessor.py @@ -626,7 +626,7 @@ def test_dummy_xswap_directed(self): def test_dummy_metrics(self): gwasmappings = self.gwasmapper.get_mappings(tags="dummy", fields="name") adjacencies = self.adjacencymapper.get_mappings(tags="DummyDirectedGraph", fields="name") - preprocessor = PreProcessor(self.config, gwasmappings, adjacencies) + preprocessor = PreProcessor(self.config, gwasmappings, adjacencies, **self.prepro_kwargs) preprocessor.build_graph() metrics = preprocessor.get_metrics()