From 8084f94e89fa4aec291f75bc63cd0b1b18be75cb Mon Sep 17 00:00:00 2001 From: Bryan Brancotte <bryan.brancotte@pasteur.fr> Date: Wed, 17 Jan 2024 16:49:15 +0100 Subject: [PATCH] test more plots --- jass/test/test_plots.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/jass/test/test_plots.py b/jass/test/test_plots.py index 64bb57e3..ad0012ab 100644 --- a/jass/test/test_plots.py +++ b/jass/test/test_plots.py @@ -2,11 +2,9 @@ from __future__ import absolute_import import os, shutil, tempfile +from pathlib import Path -from pandas import read_hdf -from pandas.testing import assert_frame_equal - -from jass.models.plots import create_global_plot +from jass.models import plots from . import JassTestCase @@ -17,9 +15,8 @@ class TestPlots(JassTestCase): def setUp(self): # Create a temporary directory - self.test_dir = tempfile.mkdtemp() + self.test_dir = Path(tempfile.mkdtemp()) self.worktable_hdf_path = self.get_file_path_fn("worktable-withnans.hdf5") - self.global_plot_path = os.path.join(self.test_dir, "global_manhattan.png") def tearDown(self): # Remove the directory after the test @@ -27,10 +24,16 @@ class TestPlots(JassTestCase): pass def test_create_global_plot(self): - """ - Compare result and expected SumStatJostTab - """ - create_global_plot(self.worktable_hdf_path, self.global_plot_path) + plots.create_global_plot(self.worktable_hdf_path, self.test_dir / "global_plot.png") + + def test_create_qq_plot(self): + plots.create_qq_plot(self.worktable_hdf_path, self.test_dir / "qq_plot.png") + + def test_create_quadrant_plot(self): + plots.create_quadrant_plot(self.worktable_hdf_path, self.test_dir / "quadrant_plot.png") + + def test_create_qq_plot_by_GWAS(self): + plots.create_qq_plot_by_GWAS(self.worktable_hdf_path, self.test_dir) if __name__ == "__main__": -- GitLab