scmagnify.plotting.circosplot

Contents

scmagnify.plotting.circosplot#

scmagnify.plotting.circosplot(data, modal='GRN', regfactor_key='regfactors', lag_key='Lag', tf_key='TF', score_key='network_score', sort_key='degree_centrality', network_key='filtered_network', top_tfs=25, cluster=True, colorbar=False, circos_kws=None, track_kws=None, heatmap_kws1=None, heatmap_kws2=None, bar_kws=None, link_kws=None, label_kws=None, figsize=(8, 8), embedding_key=None, color_key=None, center_axes_rect=(0.4, 0.45, 0.2, 0.2), palette=None, scatter_kws=None, show=True, save=None, **kwargs)#

Plot a Circos plot for GRN analysis with an optional central embedding scatter plot.

Parameters:
  • data (AnnData | MuData | GRNMuData) – Single cell data object. Can be an anndata.AnnData, mudata.MuData, scmagnify.GRNMuData

  • modal (Literal['RNA', 'ATAC', 'GRN'] (default: 'GRN')) – Modality key (e.g., ‘RNA’, ‘ATAC’) when using multi-modal data. mudata.MuData or scmagnify.GRNMuData must be provided.

  • regfactor_key (str (default: 'regfactors')) – Key for RegFactors data in adata.uns.

  • lag_key (str (default: 'Lag')) – Key for Lag data in adata.uns["regfactor_key"].

  • tf_key (str (default: 'TF')) – Key for TF data in adata.uns["regfactor_key"].

  • score_key (str (default: 'network_score')) – Key for network scores in adata.varm.

  • network_key (str (default: 'filtered_network')) – Key for binarized network in data.uns.

  • top_tfs (int (default: 25)) – Number of top TFs to include based on degree centrality.

  • cluster (bool (default: True)) – Whether to cluster TFs in the heatmap.

  • colorbar (bool (default: False)) – Whether to add colorbars for heatmaps.

  • circos_kws (Optional[dict] (default: None)) – Parameters for Circos initialization. Passed to pycirclize.Circos.

  • track_kws (Optional[dict] (default: None)) – Parameters for tracks. The radius values (e.g., track1_radius) are used in pycirclize.Sector.add_track().

  • heatmap_kws1 (Optional[dict] (default: None)) – Parameters for Lag heatmap. Passed to pycirclize.Track.heatmap().

  • heatmap_kws2 (Optional[dict] (default: None)) – Parameters for TF heatmap. Passed to pycirclize.Track.heatmap().

  • bar_kws (Optional[dict] (default: None)) – Parameters for bar plots. Passed to pycirclize.Track.bar().

  • link_kws (Optional[dict] (default: None)) – Parameters for network links. Passed to pycirclize.Circos.link().

  • label_kws (Optional[dict] (default: None)) – Parameters for labels. Values (e.g., label_size) are passed to pycirclize.Track.xticks().

  • figsize (tuple (default: (8, 8))) – Figure size.

  • embedding_key (Optional[str] (default: None)) – Key in adata.obsm for the embedding to plot in the center.

  • color_key (Optional[str] (default: None)) – Key in adata.obs for coloring the embedding plot.

  • center_axes_rect (Sequence[float] (default: (0.4, 0.45, 0.2, 0.2))) – Rectangle defining the position of the central embedding axes (left, bottom, width, height).

  • palette (Union[str, list, None] (default: None)) – Color palette for categorical coloring in the embedding plot.

  • scatter_kws (Optional[dict] (default: None)) – Parameters for the scatter plot. Passed to matplotlib.axes.Axes.scatter().

  • show (bool (default: True)) – Whether to display the figure. If None, the figure will be shown by default.

  • save (Optional[str] (default: None)) – Whether to save the figure. If True, the figure is saved to a file using the writekey. If a str is provided, it is used as the filename, potentially overriding other settings. If None or False, the figure is not saved.

  • sort_key (str)

Return type:

Figure | None

Returns:

If show=False, returns the Circos figure object. matplotlib.figure.Figure