sift.SiFT#
- class sift.SiFT(adata, kernel_key=None, metric=KernelType.RBF, mask_key=None, src_key=None, tgt_key=None, copy=False, kernel_params=mappingproxy({}), **kwargs)[source]#
SiFT object.
- Parameters:
adata (
AnnData) – Annotated data object.kernel_key (
Optional[str]) – Key inanndata.AnnDatawhere information for distance is stored.metric (
Literal['precomputed','knn','mapping','rbf','laplacian']) – The kernel type.src_key (
Optional[str]) – Mask for the source space of the kernel.tgt_key (
Optional[str]) – Mask for the target space of the kernel.knn_key – wey in
anndata.AnnData.obsfor k-NN masking.save (bool) – Whether to save the kernel.
kernel_params (
Optional[Dict[str,Any]]) – Kernel object parameters [length_scale].kwargs (
Any) – Keyword arguments for kernel computations [precomputed_kernel, n_neighbors, knn_batch_key].
Examples
>>> import scanpy as sc >>> import sift >>> adata = sc.read(...) >>> sft = sift.SiFT( adata=adata, kernel_key="cell_cycle_genes", metric="RBF", ) >>> sft.filter()
Attributes table#
Methods table#
|
Perform filtering, subtract the projection of the kernel from the expression. |
|
Materialize the initialized kernel. |
|
Visualize the cell-cell similarity kernel. |
Attributes#
adata#
- SiFT.adata#
The SiFT annotated data object.
kernel#
- SiFT.kernel#
The
pykeopskernel object.
Methods#
filter#
- SiFT.filter(embedding_key=None, use_raw=False, pseudocount=False, key_added=None)[source]#
Perform filtering, subtract the projection of the kernel from the expression.
- Parameters:
embedding_key (
Optional[str]) – Key inanndata.AnnData.obsmfor which to compute the projection on. If None, useanndata.AnnData.X.use_raw (
Optional[bool]) – Whether to useanndata.AnnData.raw, if present.pseudocount (
bool) – If True, add a pseudocount to filtered expression to avoid negative valueskey_added (
Optional[str]) – Key used when saving the result. If None, use'{embedding_key}_sift'. The result is saved toanndata.AnnData.X,anndata.AnnData.layersoranndata.AnnData.obsm, depending on theembedding_key.
- Return type:
- Returns:
: The filtered data matrix.