Skip to content

Commit

Permalink
Fixed the unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Apr 1, 2021
1 parent eea03cd commit 16d8979
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Mikado/parsers/bed12.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,14 @@ def __str__(self):
attributes["Parent"] = self.parent[0]
assert "Parent" in attributes
elif "parent" in attributes:
par = attributes["parent"] if isinstance(attributes["parent"], str) else attributes["parent"][0]
del attributes["parent"]
attributes["Parent"] = par
parent = attributes.pop("parent")
if isinstance(parent, (tuple, list)) and len(parent) > 0:
parent = ",".join(parent)
elif isinstance(parent, (tuple, list)) and len(parent) == 0:
parent = None
attributes["Parent"] = parent
if attributes:
line.append(";".join(f"{key}={val}" for key, val in attributes.items()))
line.append(";".join(f"{key}={val}" for key, val in attributes.items() if val is not None))
return "\t".join([str(x) for x in line])

def __eq__(self, other):
Expand Down

0 comments on commit 16d8979

Please sign in to comment.