Skip to content

Commit

Permalink
Test output files
Browse files Browse the repository at this point in the history
  • Loading branch information
asistradition committed Nov 22, 2020
1 parent a8c6151 commit 5fb85a8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions inferelator/tests/test_results_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ def setUp(self):

self.gold_standard = pd.DataFrame([[0, 1], [1, 0]], ['gene1', 'gene2'], ['tf1', 'tf2'])
self.gold_standard_unaligned = pd.DataFrame([[0, 1], [0, 0]], ['gene1', 'gene3'], ['tf1', 'tf2'])
self.metric = MetricHandler.get_metric("combined")

def test_output_files(self):

with tempfile.TemporaryDirectory() as td:
rp = results_processor.ResultsProcessor([self.beta], [self.beta_resc], metric=self.metric)
result = rp.summarize_network(td, self.gold_standard, self.prior)

if result.curve_data_file_name is not None:
self.assertTrue(os.path.exists(os.path.join(td, result.curve_data_file_name)))
if result.curve_file_name is not None:
self.assertTrue(os.path.exists(os.path.join(td, result.curve_file_name)))
if result.network_file_name is not None:
self.assertTrue(os.path.exists(os.path.join(td, result.network_file_name)))
if result.confidence_file_name is not None:
self.assertTrue(os.path.exists(os.path.join(td, result.confidence_file_name)))
if result.threshold_file_name is not None:
self.assertTrue(os.path.exists(os.path.join(td, result.threshold_file_name)))


@staticmethod
def make_PR_data(gs, confidences):
Expand Down Expand Up @@ -181,6 +200,9 @@ def test_filter_to_left_size_equal(self):
filter_data = self.metric.filter_to_left_size(GOLD_STANDARD_COLUMN, CONFIDENCE_COLUMN, data)
self.assertEqual(data.shape, filter_data.shape)

def test_output_files(self):
pass


class TestPrecisionRecallMetric(TestResults):

Expand Down

0 comments on commit 5fb85a8

Please sign in to comment.