phlower.pl.harmonic_backbone

phlower.pl.harmonic_backbone(adata: AnnData, fate_tree: str = 'fate_tree', backbone_width: float = 3, backbone_color: str = 'black', backbone_joint_size: float = 100, backbone_joint_color: str = 'black', arrow_size: float = 0, arrow_color: str = 'black', full_traj_matrix: str = 'full_traj_matrix', clusters: str = 'trajs_clusters', evector_name: str | None = None, retain_clusters: List = [], dims: List[int] = [0, 1], show_legend: bool = True, legend_loc: str = 'center left', bbox_to_anchor: List = (1, 0.5), markerscale: float = 4, ax=None, sample_ratio: float = 0.1, xylabel: bool = True, color_palette=['#d60000', '#8c3bff', '#018700', '#00acc6', '#97ff00', '#ff7ed1', '#6b004f', '#ffa52f', '#573b00', '#005659', '#0000dd', '#00fdcf', '#a17569', '#bcb6ff', '#95b577', '#bf03b8', '#645474', '#790000', '#0774d8', '#fdf490', '#004b00', '#8e7900', '#ff7266', '#edb8b8', '#5d7e66', '#9ae4ff', '#eb0077', '#a57bb8', '#5900a3', '#03c600', '#9e4b00', '#9c3b4f', '#cac300', '#708297', '#00af89', '#8287ff', '#5d363b', '#380000', '#fdbfff', '#bde6bf', '#db6d01', '#93b8b5', '#e452ff', '#2f5282', '#c36690', '#54621f', '#c49e72', '#038287', '#69e680', '#802690'], **args)

plot backbone in cumsum sapce

  1. call plot_trajectory_harmonic_lines

  2. plot fate_tree nodes

  3. plot fate_tree edges

  4. add arrows to the tree edges.

Parameters

adata: AnnData

an Annodata object

fate_tree: str

key of the fate tree in adata.uns, default is ‘fate_tree’

backbone_width: float

width of the backbone lines, default is 3

backbone_color: str

color of the backbone lines, default is ‘black’

backbone_joint_size: float

size of the backbone joints, default is 100

backbone_joint_color: str

color of the backbone joints, default is ‘black’

arrow_size: float

size of the arrows, default is 0

arrow_color: str

color of the arrows, default is ‘black’

full_traj_matrix: str

key of the full trajectory matrix in adata.obsm, default is ‘full_traj_matrix’

clusters: str

key of the clusters in adata.obs, default is ‘trajs_clusters’

evector_name: str

key of the eigen vector in adata.uns, default is None

retain_clusters: List

list of clusters to be retained, default is [] to use all

dims: List[int]

list of dimensions to be used, default is [0,1]

show_legend: bool

whether to show legend, default is True

legend_loc: str

location of the legend, default is ‘center left’

bbox_to_anchor: List

bbox_to_anchor of the legend, default is (1, 0.5)

markerscale: float

markerscale of the legend, default is 4

ax: matplotlib axis

axis to plot the figure, default is None

sample_ratio: float

sample ratio of the cells to be plotted, default is 0.1

xylabel: bool

whether to show xy labels, default is True

color_palette: list

color palette to use, default is sns.color_palette(cc.glasbey, n_colors=50).as_hex()