OverlaidGeneExpression#
- class alphagenome.visualization.plot_components.OverlaidGeneExpression(gdata, show_value=True, colors=None, log_scale=False, cmap='viridis', track_height=1.0, ylabel_template='{name}:{strand}', ylabel_horizontal=True, shared_y_scale=False, global_ylims=None, alpha=0.8, legend_loc='upper right', **kwargs)[source]#
Component for visualizing overlaid scalar gene expression.
Used to visualize overlaid gene-level predictions for denoised single-cell gene expression (
SC_GENE_EXPRESSION_DENOISED; one channel per strand, in CPM) andSC_GENE_EXPRESSION.Initializes the
OverlaidGeneExpressioncomponent.- Parameters:
gdata (
Mapping[str,GeneExpressionData]) – A mapping from names toGeneExpressionDataobjects.show_value (
bool(default:True)) – Whether to show the value of the gene expression.colors (
Mapping[str,str] |None(default:None)) – An optional dictionary mapping keys ingdatato colors.log_scale (
bool(default:False)) – Whether to use a log scale for the gene expression values.cmap (
str|None(default:'viridis')) – The colormap to use ifcolorsis not provided.track_height (
float(default:1.0)) – The height of each track.ylabel_template (
str(default:'{name}:{strand}')) – A template for the y-axis labels.ylabel_horizontal (
bool(default:True)) – Whether to make the y-axis labels horizontal.shared_y_scale (
bool(default:False)) – Whether to use the same y-axis scale for all tracks.global_ylims (
tuple[float,float] |None(default:None)) – Optional global y-axis limits (min and max).alpha (
float(default:0.8)) – The transparency of the plotted lines/points.legend_loc (
str|None(default:'upper right')) – The location of the legend (such as ‘upper left’ or ‘best’). See the matplotlib Axes legend documentation for more details and options. If None, no legend is shown.**kwargs – Additional keyword arguments to pass to the plotting function.
- Raises:
ValueError – If the shapes or track metadata of the
gdatavalues do not match, or if the genome intervals ingdatado not match, or ifcolorsare provided but do not match the keys ingdata.
Methods
|
Returns the height of the axis. |
|
Plots the tracks on the given axis. |