capital.tl.genes_similarity_score

capital.tl.genes_similarity_score(aligned_data, gene=None, alignment=None, min_disp=2.0, pseudotime=None)

Calculate similarity scores using dynamic time warping [H.Sakoe78].

Use tslearn.metrics.dtw for each gene and calculate the similarity of gene expression dynamics.

Use cdata.similarity_score to access the results. Higher on the list, more similar the gene expression dynamics are.

Parameters:
  • aligned_data (CapitalData) – The data matrices containing the results of CAPTIAL.

  • gene (Union[str, list, np.ndarray]) – Genes for calculating similarity, by default None.

  • alignment (Union[str, list, None]) – Specify alignments to calculate similarity. If None, it computes for all the alignments, by default None.

  • min_disp (float) – If gene is None, the union of genes that have bigger dispersion than min_disp in the clusters of the alignment is used, by default 2.0.

  • pseudotime (str) – Specify name of the column which store user defined pseudotime in cdata.adata1.obs and cdata.adata2.obs. If None, it calculates dynamic time warping using pseudotime calculated in cp.tl.dpt(). By default None.