Skip to content

Commit 30aa8d4

Browse files
Merge pull request #481 from hyanwong/tmp-fix
Get TreeInfo working even if sc2ts metadata missing
2 parents 58072b6 + ba94d0b commit 30aa8d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sc2ts/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def _preprocess_nodes(self, show_progress):
430430
self.nodes_metadata[node.id] = md
431431
self.nodes_num_exact_matches[node.id] = exact_matches.get(str(node.id), 0)
432432
group_id = None
433-
sc2ts_md = md["sc2ts"]
433+
sc2ts_md = md.get("sc2ts", {})
434434
group_id = sc2ts_md.get("group_id", None)
435435
if group_id is not None:
436436
# Shorten key for readability.
@@ -685,7 +685,7 @@ def _node_summary(self, u, child_mutations=True):
685685
if flags & (tskit.NODE_IS_SAMPLE | core.NODE_IS_REFERENCE) > 0:
686686
strain = md["strain"]
687687
else:
688-
md = md["sc2ts"]
688+
md = md.get("sc2ts", {})
689689
if (
690690
flags & (core.NODE_IS_MUTATION_OVERLAP | core.NODE_IS_REVERSION_PUSH)
691691
> 0

0 commit comments

Comments
 (0)