Skip to content

Commit

Permalink
Merge pull request tskit-dev#177 from benjeffery/fix-blank-muts
Browse files Browse the repository at this point in the history
Fix initially blank mutations
  • Loading branch information
benjeffery authored Oct 4, 2024
2 parents 732b741 + c9c7bd2 commit 61d35d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tsbrowse/pages/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def make_edges_panel(log_y, node_type, tsm):
streams = [range_stream]
filtered = lines.apply(filter_points, streams=streams)
hover = filtered.apply(hover_points)
shaded = hd.datashade(filtered, streams=streams, cmap=config.PLOT_COLOURS[1:])
shaded = hd.datashade(lines, streams=streams, cmap=config.PLOT_COLOURS[1:])
hover_tool = bkm.HoverTool(
tooltips=[
("child", "@child"),
Expand Down
9 changes: 3 additions & 6 deletions tsbrowse/pages/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .. import config
from ..plot_helpers import center_plot_title
from ..plot_helpers import customise_ticks
from ..plot_helpers import filter_points
from ..plot_helpers import hover_points
from ..plot_helpers import make_hist_on_axis
from ..plot_helpers import selected_hist
Expand All @@ -35,16 +34,14 @@ def make_muts_panel(log_y, tsm):

range_stream = hv.streams.RangeXY(source=points)

filtered = points.apply(filter_points, streams=[range_stream])

tooltips = [
("ID", "@id"),
("parents", "@num_parents"),
("descendants", "@num_descendants"),
("inheritors", "@num_inheritors"),
]
hover = HoverTool(tooltips=tooltips)
filtered.opts(
points.opts(
color="num_inheritors",
alpha="num_inheritors",
cmap="BuGn",
Expand All @@ -53,9 +50,9 @@ def make_muts_panel(log_y, tsm):
tools=[hover, "tap"],
)

hover = filtered.apply(hover_points)
hover = points.apply(hover_points)
shaded = hd.datashade(
filtered,
points,
width=400,
height=400,
streams=[range_stream],
Expand Down
2 changes: 1 addition & 1 deletion tsbrowse/pages/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def make_node_plot(data, node_types):
filtered = points.apply(filter_points, streams=streams)
hover = filtered.apply(hover_points, threshold=config.THRESHOLD)
shaded = hd.datashade(
filtered,
points,
width=400,
height=400,
streams=streams,
Expand Down

0 comments on commit 61d35d2

Please sign in to comment.