Fix plotting: per-module kME hub selection + working module-topology & preservation-lollipop plots - #4
Closed
ChrisMao0325 wants to merge 2 commits into
Closed
Fix plotting: per-module kME hub selection + working module-topology & preservation-lollipop plots#4ChrisMao0325 wants to merge 2 commits into
ChrisMao0325 wants to merge 2 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.