diff options
| author | Arun Isaac | 2026-08-26 00:42:05 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-08-26 00:42:05 +0100 |
| commit | 2dde35499067e462635cad6bfd5173f45001c18a (patch) | |
| tree | 7f202ce97ccc027f08e3942499c7e63ecfa78bba | |
| parent | b6699b087871ef261e444a58f2746c7414b16064 (diff) | |
| download | domagi-2dde35499067e462635cad6bfd5173f45001c18a.tar.gz domagi-2dde35499067e462635cad6bfd5173f45001c18a.tar.lz domagi-2dde35499067e462635cad6bfd5173f45001c18a.zip | |
Test domagi extract on node extraction.
| -rw-r--r-- | test-data/expected-output/test1-extract-node-1.gfa | 12 | ||||
| -rw-r--r-- | test-data/expected-output/test1-extract-node-2.gfa | 18 | ||||
| -rw-r--r-- | test-data/expected-output/test1-extract-node-3.gfa | 26 | ||||
| -rw-r--r-- | tests/test_domagi.py | 28 |
4 files changed, 84 insertions, 0 deletions
diff --git a/test-data/expected-output/test1-extract-node-1.gfa b/test-data/expected-output/test1-extract-node-1.gfa new file mode 100644 index 0000000..3beb269 --- /dev/null +++ b/test-data/expected-output/test1-extract-node-1.gfa @@ -0,0 +1,12 @@ +H VN:Z:1.0 +S 7 A +L 7 + 9 + 0M +S 8 G +L 8 + 9 + 0M +S 9 AAATTTTCTGGAGTTCTAT +L 9 + 10 + 0M +L 9 + 11 + 0M +S 10 A +S 11 T +P x 8+,9+,11+ * +P y 7+,9+,10+ * diff --git a/test-data/expected-output/test1-extract-node-2.gfa b/test-data/expected-output/test1-extract-node-2.gfa new file mode 100644 index 0000000..876dd44 --- /dev/null +++ b/test-data/expected-output/test1-extract-node-2.gfa @@ -0,0 +1,18 @@ +H VN:Z:1.0 +S 6 TTG +L 6 + 7 + 0M +L 6 + 8 + 0M +S 7 A +L 7 + 9 + 0M +S 8 G +L 8 + 9 + 0M +S 9 AAATTTTCTGGAGTTCTAT +L 9 + 10 + 0M +L 9 + 11 + 0M +S 10 A +L 10 + 12 + 0M +S 11 T +L 11 + 12 + 0M +S 12 ATAT +P x 6+,8+,9+,11+,12+ * +P y 6+,7+,9+,10+,12+ * diff --git a/test-data/expected-output/test1-extract-node-3.gfa b/test-data/expected-output/test1-extract-node-3.gfa new file mode 100644 index 0000000..0d58053 --- /dev/null +++ b/test-data/expected-output/test1-extract-node-3.gfa @@ -0,0 +1,26 @@ +H VN:Z:1.0 +S 4 T +L 4 + 6 + 0M +S 5 C +L 5 + 6 + 0M +S 6 TTG +L 6 + 7 + 0M +L 6 + 8 + 0M +S 7 A +L 7 + 9 + 0M +S 8 G +L 8 + 9 + 0M +S 9 AAATTTTCTGGAGTTCTAT +L 9 + 10 + 0M +L 9 + 11 + 0M +S 10 A +L 10 + 12 + 0M +S 11 T +L 11 + 12 + 0M +S 12 ATAT +L 12 + 13 + 0M +L 12 + 14 + 0M +S 13 A +S 14 T +P x 5+,6+,8+,9+,11+,12+,14+ * +P y 4+,6+,7+,9+,10+,12+,13+ * diff --git a/tests/test_domagi.py b/tests/test_domagi.py index 1134713..3312247 100644 --- a/tests/test_domagi.py +++ b/tests/test_domagi.py @@ -206,6 +206,34 @@ def test_domagi_depth_bed_windows(tmp_path, request, domagi_db_name, bed_windows pd.read_csv(io.StringIO(result.stdout), sep="\t"), check_dtype=False) +@pytest.mark.xfail +@pytest.mark.parametrize("domagi_db_name, context_steps, expected_output", + [("domagi_db_test1", + 1, + Path("test-data/expected-output/test1-extract-node-1.gfa")), + ("domagi_db_test1", + 2, + Path("test-data/expected-output/test1-extract-node-2.gfa")), + ("domagi_db_test1", + 3, + Path("test-data/expected-output/test1-extract-node-3.gfa"))]) +def test_domagi_extract_node(tmp_path, request, domagi_db_name, context_steps, expected_output): + domagi_db = request.getfixturevalue(domagi_db_name) + output_duckdb_path = tmp_path / f"{domagi_db.stem}-output.db" + runner = CliRunner() + result = runner.invoke(main, ["extract", + "--db", domagi_db, + "--node", "9", + "--context-steps", context_steps, + "--out", output_duckdb_path]) + assert result.exit_code == 0 + result = runner.invoke(main, ["view", + "--to-gfa", + "--db", output_duckdb_path]) + assert result.exit_code == 0 + with open(expected_output) as file: + assert_gfa_equal(file, io.StringIO(result.stdout)) + @pytest.mark.parametrize("domagi_db_name, expected_output", [("domagi_db_test1", Path("test-data/expected-output/test1-matrix")), |
