Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug in the visualization of the tile plot (the plot was empty) #141

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions ppanggolin/figures/tile_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def draw_tile_plot(pangenome: Pangenome, output: Path, nocloud: bool = False, di

logging.getLogger("PPanGGOLiN").info("Getting the gene name(s) and the number for each tile of the plot ...")
for node in ordered_nodes:
fam_order.append('\u200c' + node.name)
data = node.organisms
fam_order.append(node.name)
data = set(node.organisms)
binary_data.append([len(list(node.get_genes_per_org(org))) if org in data else numpy.nan for org in order_organisms])
text_data.append([("\n".join(map(str, node.get_genes_per_org(org))))
if org in data else numpy.nan for org in order_organisms])

xaxis_values = ['\u200c' + org.name for org in order_organisms]
xaxis_values = [org.name for org in order_organisms]

logging.getLogger("PPanGGOLiN").info("Done extracting names and numbers. Making the heatmap ...")

Expand Down Expand Up @@ -175,16 +175,6 @@ def draw_tile_plot(pangenome: Pangenome, output: Path, nocloud: bool = False, di
logging.getLogger("PPanGGOLiN").info("Drawing the figure itself...")

fig = go.Figure(data=[heatmap])

fig.add_trace(go.Scatter(x=dendro_org['icoord'],
y=dendro_org['dcoord'],
mode='lines',
line=dict(color='black'),
showlegend=False,
xaxis='x2',
yaxis='y'))


fig.update_layout(layout)
out_plotly.plot(fig, filename=output.as_posix() + "/tile_plot.html", auto_open=False)
logging.getLogger("PPanGGOLiN").info(f"Done with the tile plot : '{output / 'tile_plot.html'}' ")
Loading