capital.tl.tree_alignment

capital.tl.tree_alignment(adata1, adata2, num_genes1=2000, num_genes2=2000, cost=1.0, use_raw=True)

Calculate an alignment of the two trajectory trees.

Use a dynamic programming algorithm in [P Bille05] . Use capital.pl.tree_alignment to obtain the alignment tree.

Parameters:
  • adata1 (AnnData) – The annotated data matrix.

  • adata2 (AnnData) – The annotated data matrix.

  • num_genes1 (int) – Number of highly variable genes in adata1 to calculate intersection of the genes. If not None, it recalculates highly variable genes using genes in adata.raw, if None, it uses the genes in adata.obs, by default 2000.

  • num_genes2 (int) – Same as num_genes1, but for adata2, by default 2000.

  • cost (float) – Gap cost for the tree alignment calculation, by default 1.0.

  • use_raw (bool) – If True, it uses adata.raw to calculate highly variable genes. If False and adata.raw was None, it resets adata.raw as adata, by default True.

Returns:

capital_data – The data matrices containing the results of CAPTIAL.

Return type:

[CapitalData]