ktplotspy.plot.plot_cpdb_chord

ktplotspy.plot.plot_cpdb_chord(adata, means, pvals, deconvoluted, celltype_key, face_col_dict=None, edge_col_dict=None, edge_cmap=<matplotlib.colors.LinearSegmentedColormap object>, remove_self=True, gap=2, scale_lw=10, size=50, interspace=2, raxis_range=(950, 1000), labelposition=80, label_visible=True, figsize=(8, 8), legend_params={'bbox_to_anchor': (1, 1), 'frameon': False, 'loc': 'center left'}, layer=None, **kwargs)[source]

Plotting cellphonedb results as a chord diagram.

Parameters:
  • adata (AnnData) – AnnData object with the .obs storing the celltype_key with or without splitby_key. The .obs_names must match the first column of the input meta.txt used for cellphonedb.

  • means (pd.DataFrame) – Dataframe corresponding to means.txt from cellphonedb.

  • pvals (pd.DataFrame) – Dataframe corresponding to pvalues.txt or relevant_interactions.txt from cellphonedb.

  • deconvoluted (pd.DataFrame) – Dataframe corresponding to deconvoluted.txt from cellphonedb.

  • celltype_key (str) – Column name in adata.obs storing the celltype annotations. Values in this column should match the second column of the input meta.txt used for cellphonedb.

  • face_col_dict (Optional[Dict[str, str]], optional) – dictionary of celltype : face colours. If not provided, will try and use .uns from adata if correct slot is present.

  • edge_col_dict (Optional[Dict[str, str]], optional) – Dictionary of interactions : edge colours. Otherwise, will use edge_cmap option.

  • edge_cmap (LinearSegmentedColormap, optional) – a LinearSegmentedColormap to generate edge colors.

  • remove_self (bool, optional) – whether to remove self edges.

  • gap (Union[int, float], optional) – relative size of gaps between edges on arc.

  • scale_lw (Union[int, float], optional) – numeric value to scale width of lines.

  • size (Union[int, float], optional) – Width of the arc section. If record is provided, the value is instead set by the sequence length of the record. In reality the actual arc section width in the resultant circle is determined by the ratio of size to the combined sum of the size and interspace values of the Garc class objects in the Gcircle class object.

  • interspace (Union[int, float], optional) – Distance angle (deg) to the adjacent arc section in clockwise sequence. The actual interspace size in the circle is determined by the actual arc section width in the resultant circle is determined by the ratio of size to the combined sum of the size and interspace values of the Garc class objects in the Gcircle class object.

  • raxis_range (Tuple[int, int], optional) – Radial axis range where line plot is drawn.

  • labelposition (Union[int, float], optional) – Relative label height from the center of the arc section.

  • label_visible (bool, optional) – Font size of the label. The default is 10.

  • figsize (Tuple[Union[int, float], Union[int, float]], optional) – size of figure.

  • legend_params (Dict, optional) – additional arguments for plt.legend.

  • layer (Optional[str], optional) – slot in AnnData.layers to access. If None, uses .X.

  • **kwargs – passed to plot_cpdb.

Returns:

a Gcircle object from pycircos.

Return type:

Gcircle