Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fratajcz committed Oct 11, 2024
1 parent 094227d commit ff6ad1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions speos/tests/test_postprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import os

NODATA = int(os.getenv('NODATA', '1'))
print(NODATA)

class PostProcessorTestNoData(TestSetup):
def setUp(self):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))




Expand Down
2 changes: 1 addition & 1 deletion speos/tests/test_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ff6ad1d

Please sign in to comment.