scatrans.pl.comet_plot#
- scatrans.pl.comet_plot(df, top_n=12, save_path=None, title='Active Transcription Drivers', point_scale=1.0, min_size=2, max_size=180, s=None, alpha=0.85, figsize=(8, 6), dpi=300, fontsize=12, cmap='coolwarm', ax=None, show=True, use_style=False, positive_logfc_only=True, return_data=False, label_repel=True, label_fontsize=None, min_label_score=None)[source]#
Comet plot of log fold change vs. bias-corrected unspliced residual.
Point size and color are mapped to the active score. Designed to produce clear figures suitable for scientific publications with minimal further editing.
- Size control (referencing common patterns in omicverse.pl.* for direct control):
s: if provided, use a fixed point size for all points (in points^2). This is the simplest way to make everything small (e.g. s=3 or s=1).
point_scale: overall multiplier for the variable size calculation.
min_size / max_size: hard bounds. Use min_size=1 to allow the tiniest background points when using variable sizing by active_score.
positive_logfc_only=True (default) keeps only logFC > 0 (classic “active drivers” comet view). Set False to see the full logFC vs residual scatter including negative logFC genes.
- Returns:
(fig, ax) (always a matplotlib figure and axes. If no valid genes remain)
after coercion / filtering, returns a placeholder figure with a message
(instead of (None, None)) for better caller ergonomics.
- Parameters:
ax (matplotlib.axes.Axes, optional) – If provided, plot into this axes instead of creating a new figure. Useful for embedding in multi-panel publication figures.
s (float | None)
alpha (float)
show (bool)
use_style (bool)
positive_logfc_only (bool)
return_data (bool)
label_repel (bool)
label_fontsize (float | None)
min_label_score (float | None)