phlower.tl.construct_delaunay

phlower.tl.construct_delaunay(adata: AnnData, graph_name: str | None = None, layout_name: str | None = None, trunc_quantile: float = 0.75, trunc_times: float = 3, cluster_name: str = 'group', circle_quant=0.1, node_attr='u', start_n=5, end_n=5, separate_ends_triangle=True, random_seed=2022, calc_layout: bool = False, iscopy: bool = False)
Main function for constructing delaunay graph from a layout to get holes
  1. triangulate using the layout given

  2. remove too long distance edges by trunc_quantile * trunc_times

  3. randomly select starts and ends points by node_attr score

  4. connect starts and ends points with delaunay triangulation

  5. run layout algorithm for graph with holes if calc_layout is true

Parameters

adata: AnnData

AnnData object

graph_name: str

graph name in adata.uns

layout_name: str

layout name in adata.obsm

trunc_quantile: float

quantile for truncating delaunay edges

trunc_times: float

times for truncating delaunay edges

cluster_name: str

cluster name in adata.obs

circle_quant: float

quantile for connecting start and end points

node_attr: str

node attribute for connecting

start_n: int

number of start points

end_n: int

number of end points

separate_ends_triangle: bool

whether to separate end points to different clusters

random_seed: int

random seed for selecting start and end points

calc_layout: bool

whether to calculate layout for the delaunay graph

iscopy: bool

whether to return a copy of adata