Skip to content

Fix plotting: per-module kME hub selection + working module-topology & preservation-lollipop plots - #4

Closed
ChrisMao0325 wants to merge 2 commits into
omicverse:mainfrom
ChrisMao0325:main
Closed

Fix plotting: per-module kME hub selection + working module-topology & preservation-lollipop plots#4
ChrisMao0325 wants to merge 2 commits into
omicverse:mainfrom
ChrisMao0325:main

Conversation

@ChrisMao0325

Copy link
Copy Markdown
Contributor

No description provided.

ChrisMao0325 and others added 2 commits July 12, 2026 12:31
…r-module kME

Both functions ranked every module's genes by a single fixed kME column
(kme_cols[0]) instead of each module's own kME_<module>. As a result, for all
modules except the one matching kme_cols[0], the kME barplot and the inner/outer
rings of the module network plot showed the wrong module's hub genes.

Now each module is ranked by its own kME_<module> column (falling back to the
first kME column only if a per-module one is absent). hub_gene_network_plot and
compute_module_umap were already correct and are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…thon port

plot_module_preservation_lollipop previously expected the R-style
wd['module_preservation'][name] = {'Z': df} object with Zsummary.pres/moduleSize
columns, which this port never produces (module_preservation() returns a flat
DataFrame and does not store it), and it used an invalid matplotlib color
('grey75'). It now consumes the DataFrame returned by module_preservation()
directly (module / Zsummary / n_genes), shades the Z<2 (not preserved) and
2<=Z<10 (moderate) regions, sizes points by gene count, and colours by module.

module_topology_heatmap / module_topology_barplot relied on wd['degrees'], which
nothing in this port populates, so order_by/features='degree'/'weighted_degree'
failed. They now compute intramodular connectivity (degree, weighted_degree)
from the TOM on the fly. The heatmap also blanks the lower triangle via NaN
(with cmap.set_bad) instead of clipping it into the color range.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant