Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Dec 7, 2024
1 parent 43a3ef4 commit b221fd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sc2ts/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions sc2ts/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)
Expand Down

0 comments on commit b221fd4

Please sign in to comment.