Commit ca74b675 authored by MARIJON Pierre's avatar MARIJON Pierre

close #4

parent 93a05f33
......@@ -195,7 +195,11 @@ class Parser:
def _add_containment(self, container, strand_ner, contained, strand_ned, pos, length):
if contained not in self.__containments:
self.__containments[contained] = list()
if container in self.containments and any([contained == c[0] for c in self.containments[container]]):
logging.critical("Warning {} contain {} before".format(container, contained))
return
self.__containments[contained].append([container, strand_ner,
strand_ned, pos, length])
......
......@@ -98,3 +98,22 @@ def test_A_contained_B_leave_contain_diff():
assert resu == p.get_gfa()
# A contain B
# B contain A
# ------------------------->
# <-------------------------
def test_A_contain_B_B_contain_A():
line = """
A\t1000\t0\t1000\t+\tB\t1000\t1\t999\t0\t1000\t255
B\t1000\t0\t1000\t+\tA\t1000\t1\t999\t0\t1000\t255
"""
resu = """
S\tA\t*\tLN:i:1000
S\tB\t*\tLN:i:1000
C\tB\t+\tA\t+\t1\t1000M
"""
p = paf2gfa.Parser()
p.parse_lines(line.split("\n"))
assert resu.strip() == p.get_gfa().strip()
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