c2v.utils.connect_clones

Contents

c2v.utils.connect_clones#

c2v.utils.connect_clones(clones, groupby, graph_key_added='connected', orient_col=None, orient_rule=None, ignore_names=None, weight_edges=False)#

Creates a graph of connected clones based on a grouping variable.

Parameters:
clones sc.AnnData

AnnData object with clone information.

groupby str

Name of the column in obs to group by.

graph_key_added str, optional

Name of the key added to obsp to store the graph. Default is “connected”.

orient_col str | None, optional

Name of the column in obs to orient the graph. If None, all pairs of clones are connected. Default is None.

orient_rule Literal["all_increase", "all_decrease", "increase", "decrease"] | "Callable" | None, optional

Rule to orient the graph. If None, uses “increase” if orient_col is provided. Default is None.

ignore_names list[str] | str | None, optional

Names of clones to ignore. If None, no clones are ignored. Default is None.

weight_edges bool, optional

Whether to weight edges by the inverse of the number of connected clones. Default is False.

Returns:

None Adds a graph to clones.obsp[graph_key_added].