sainsc.LazyKDE.assign_celltype ============================== .. py:method:: sainsc.LazyKDE.assign_celltype(signatures, *, log = False, chunk = (500, 500)) Calculate the cosine similarity with known cell-type signatures. For each bead calculate the cosine similarity with a set of cell-type signatures. The cell-type with highest score will be assigned to the corresponding bead. :param signatures: DataFrame of cell-type signatures. Columns are cell-types and index are genes. :type signatures: pandas.DataFrame :param log: Whether to log transform the KDE when calculating the cosine similarity. This is useful if the gene signatures are derived from log-transformed data. :type log: bool :param chunk: Size of the chunks for processing. Larger chunks require more memory but have less duplicated computation. :type chunk: tuple[int, int] :raises ValueError: If not all genes of the `signatures` are available. :raises ValueError: If `self.kernel` is not set. :raises ValueError: If `chunk` is smaller than the shape of `self.kernel`.