From b221fd4d69ec95608cfcaab6f60b998bb7f72ac8 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Sat, 7 Dec 2024 23:43:26 +0000 Subject: [PATCH] Minor tweaks --- sc2ts/core.py | 2 +- sc2ts/info.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sc2ts/core.py b/sc2ts/core.py index 7ea5d6b..831d00a 100644 --- a/sc2ts/core.py +++ b/sc2ts/core.py @@ -109,7 +109,7 @@ def decode_flags(f): def flags_summary(f): - return "".join([v.short if (v.value & f) > 0 else "-" for v in flag_values]) + return "".join([v.short if (v.value & f) > 0 else "_" for v in flag_values]) class FastaReader(collections.abc.Mapping): diff --git a/sc2ts/info.py b/sc2ts/info.py index fb9078a..b41fda1 100644 --- a/sc2ts/info.py +++ b/sc2ts/info.py @@ -753,7 +753,7 @@ def _node_summary(self, u, child_mutations=True): flags = self.ts.nodes_flags[u] strain = "" - if (flags & tskit.NODE_IS_SAMPLE) != 0: + if flags & (tskit.NODE_IS_SAMPLE | core.NODE_IS_REFERENCE) > 0: strain = md["strain"] else: md = md["sc2ts"] @@ -763,7 +763,9 @@ def _node_summary(self, u, child_mutations=True): except KeyError: strain = "debug missing" elif "group_id" in md: - strain = md["group_id"] + # FIXME clipping this artificially for now + # see https://github.com/jeromekelleher/sc2ts/issues/434 + strain = md["group_id"][:8] pango = md.get(self.pango_source, None) imputed_pango = md.get("Imputed_" + self.pango_source, None)