:py:mod:`spatialtis_core.cell_interaction` ========================================== .. py:module:: spatialtis_core.cell_interaction Module Contents --------------- .. py:class:: CellCombs(types: List[str], order: bool = False) Profile cell-cell interaction using permutation test :param types: All the type of cells in your research :param order: bool (False); If False, A->B and A<-B is the same .. py:method:: bootstrap(types: List[str], neighbors: spatialtis_core.types.Neighbors, labels: spatialtis_core.types.Labels, times: int = 1000, pval: float = 0.05, method: str = 'pval') -> List[Tuple[str, str, float]] Bootstrap functions 1.0 means association, -1.0 means avoidance, 0.0 means insignificance. :param types: The type of all the cells :param neighbors: List of neighbors :param labels: List of labels :param times: How many times to perform bootstrap :param pval: The threshold of p-value :param method: 'pval' or 'zscore' :returns: List of tuples, eg.('a', 'b', 1.0), the type a and type b has a relationship as association .. py:function:: comb_bootstrap(exp_matrix: numpy.ndarray, markers: List[str], neighbors: spatialtis_core.types.Neighbors, labels: spatialtis_core.types.Labels, pval: float = 0.05, times: int = 1000) -> List[Tuple[str, str, float]] Bootstrap between two types If you want to test co-localization between protein X and Y, first determine if the cell is X-positive and/or Y-positive. True is considered as positive and will be counted. :param exp_matrix: The expression matrix, each row should be a marker :param markers: Match to the row of exp_matrix :param neighbors: List of neighbors :param labels: List of labels :param pval: The threshold of p-value :param times: How many times to perform bootstrap :returns: The significance between markers List of (marker1, marker2, p-value) .. py:function:: neighbor_components(neighbors: spatialtis_core.types.Neighbors, labels: spatialtis_core.types.Labels, types: List[str]) -> (List[str], List[List[int]]) Compute the number of different cells at neighbors :param neighbors: The neighbors dict :param labels: Integer to label points :param types: A list of types match to points :returns: can be used to construct dataframe :rtype: (header, data)