Commit eee8aaea authored by Pierre Marijon's avatar Pierre Marijon

Order in gfa line have no impact in gfa validity

parent 3b4f575c
......@@ -21,4 +21,4 @@ L\tA\t+\tB\t+\t800M\tNM:i:0\tom:f:0.00
p = paf2gfa.Parser()
p.parse_lines(line.split("\n"))
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
......@@ -2,7 +2,6 @@ import pytest
import paf2gfa
import logging
# A and B internal match same strand
# -- -->
# \ /
......@@ -23,7 +22,7 @@ L\tA\t+\tB\t+\t4900M\tNM:i:4870\tom:f:1.02
p = paf2gfa.Parser()
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
# A and B internal match diff strand
# -- -->
......@@ -45,7 +44,7 @@ L\tA\t+\tB\t-\t4900M\tNM:i:4870\tom:f:0.88
p = paf2gfa.Parser()
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
# A and B internal match same strand
# -- -->
......@@ -64,7 +63,7 @@ H\tVN:Z:1.0
p = paf2gfa.Parser(internal=False)
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
# A and B internal match diff strand
# -- -->
......@@ -79,15 +78,9 @@ def test_A_B_internal_match_remove_diff():
resu = """
H\tVN:Z:1.0
"""
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(logging.DEBUG)
logger.addHandler(stream_handler)
p = paf2gfa.Parser(internal=False)
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
......@@ -8,44 +8,44 @@ import paf2gfa
def test_A_3_same():
line = "1\t1000\t20\t1000\t+\t2\t1000\t0\t980\t30\t980\t255"
resu = "H\tVN:Z:1.0\nS\t1\t*\tLN:i:1000\nS\t2\t*\tLN:i:1000\nL\t1\t+\t2\t+\t980M\tNM:i:950\tom:f:0.00\n"
p = paf2gfa.Parser()
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
# overlap at A 3' orientation is different
# ---------------->
p = paf2gfa.Parser()
p.parse_line(line)
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
# overlap at A 3' orientation is different
# ---------------->
# <-------------
def test_A_3_diff():
line = "1\t1000\t10\t1000\t-\t2\t1000\t10\t1000\t30\t980\t255"
def test_A_3_diff():
line = "1\t1000\t10\t1000\t-\t2\t1000\t10\t1000\t30\t980\t255"
resu = "H\tVN:Z:1.0\nS\t1\t*\tLN:i:1000\nS\t2\t*\tLN:i:1000\nL\t1\t+\t2\t-\t980M\tNM:i:950\tom:f:0.00\n"
p = paf2gfa.Parser()
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
# overlap at A 5' orientation is different
# ------------->
# ---------------->
def test_A_5_same():
line = "1\t1000\t0\t980\t+\t2\t1000\t20\t1000\t30\t980\t255"
p = paf2gfa.Parser()
p.parse_line(line)
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
# overlap at A 5' orientation is same
# ------------->
# ---------------->
def test_A_5_same():
line = "1\t1000\t0\t980\t+\t2\t1000\t20\t1000\t30\t980\t255"
resu = "H\tVN:Z:1.0\nS\t1\t*\tLN:i:1000\nS\t2\t*\tLN:i:1000\nL\t2\t+\t1\t+\t980M\tNM:i:950\tom:f:0.00\n"
p = paf2gfa.Parser()
p.parse_line(line)
assert resu.strip() == p.get_gfa().strip()
# overlap at A 5' orientation is different
# ------------->
# <----------------
def test_A_5_diff():
line = "1\t1000\t0\t980\t-\t2\t1000\t0\t980\t30\t960\t255"
p = paf2gfa.Parser()
p.parse_line(line)
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
# overlap at A 5' orientation is different
# ------------->
# <----------------
def test_A_5_diff():
line = "1\t1000\t0\t980\t-\t2\t1000\t0\t980\t30\t960\t255"
resu = "H\tVN:Z:1.0\nS\t1\t*\tLN:i:1000\nS\t2\t*\tLN:i:1000\nL\t1\t-\t2\t+\t960M\tNM:i:930\tom:f:0.00\n"
p = paf2gfa.Parser()
p.parse_lines(line.split("\n"))
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
......@@ -20,7 +20,7 @@ C B + C - 5997 2821M
p = paf2gfa.Parser()
p.parse_lines(line.split("\n"))
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
def test_A_overlap_B_B_contained_C_leave_all():
......@@ -39,4 +39,4 @@ L B + A - 882M NM:i:732 om:f:0.44
p = paf2gfa.Parser(False, False)
p.parse_lines(line.split("\n"))
assert resu.strip() == p.get_gfa().strip()
assert set(resu.strip().split("\n")) == set(p.get_gfa().strip().split("\n"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment