Skip to content

Replace node report Markdown with Panel #437

@jeromekelleher

Description

@jeromekelleher

Clunky report tool can be replace with panel very easily. Here's something that's most of the way there.

node = ti.pango_lineage_samples["B.1.1.7"][-1]
#node = 131223
closest_recombinant, df = ti._show_path_to_root(ti.ts.first(), node)
df_mut_path = ti.mutation_path(node)

child  = node
edge_list = [
            ts.edge(eid) for eid in np.where(ts.edges_child == child)[0]
        ]
edges = tskit.EdgeTable()
for e in sorted(edge_list, key=lambda e: e.left):
    edges.append(e)

html = ti._copying_table(node, edges)

pn.Accordion(
    ("Metadata",pn.pane.JSON(ti.nodes_metadata[node])),
    ("Copying path", pn.pane.HTML(html)),
    ("Path to root", pn.widgets.Tabulator(df)),
    ("Mutation path", pn.widgets.Tabulator(df_mut_path)),
    active=[0, 1],
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions