about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--domagi/domagi.py7
-rw-r--r--tests/test_domagi.py1
2 files changed, 6 insertions, 2 deletions
diff --git a/domagi/domagi.py b/domagi/domagi.py
index 6981132..775c9b1 100644
--- a/domagi/domagi.py
+++ b/domagi/domagi.py
@@ -275,9 +275,14 @@ def paths(con, list_paths, fasta, threads):
         for name, in con.execute("SELECT name FROM path").fetchall():
             print(name)
     elif fasta:
+        # We take care to reverse complement soft masked lower case nucleotides
+        # as well.
         for name, sequence in con.execute("""
         SELECT ANY_VALUE(path.name),
-               string_agg(sequence, '' ORDER BY start)
+               string_agg(CASE WHEN segment_orientation='+' THEN sequence
+                          ELSE reverse(translate(sequence, 'AGCTagct', 'TCGAtcga'))
+                          END,
+                          '' ORDER BY start)
         FROM path_segment
         INNER JOIN segment ON segment.id = path_segment.segment_id
         INNER JOIN path ON path.id = path_segment.path_id
diff --git a/tests/test_domagi.py b/tests/test_domagi.py
index 4af8c37..c65b87e 100644
--- a/tests/test_domagi.py
+++ b/tests/test_domagi.py
@@ -207,7 +207,6 @@ def test_domagi_paths(tmp_path, test_data_file, expected_output):
                                    header=None),
                        check_dtype=False)
 
-@pytest.mark.xfail
 @pytest.mark.parametrize("test_data_file, expected_output",
                          [(Path("test-data/test1.gfa"),
                            Path("test-data/expected-output/test1.fa")),