deconvatac.tl.spatialdwls
=========================

.. py:module:: deconvatac.tl.spatialdwls


Functions
---------

.. autoapisummary::

   deconvatac.tl.spatialdwls.spatialdwls


Module Contents
---------------

.. py:function:: spatialdwls(adata_spatial, adata_ref, labels_key, cluster_key='leiden', n_cell=50, tfidf=True, r_lib_path=None, results_path='./spatialdwls_results')

   Run SpatialDWLS

   Parameters 
   -----------

   adata_spatial : AnnData
       AnnData of the spatial data , filtered by highly variable features. Feature space needs to be the same as the one of adata_ref.
       Normalized counts are expected to be saved in .X. Names of observations and features are expected as row names of adata_spatial.obs and adata_spatial.var. 
   adata_ref : AnnData 
       AnnData of the reference data, filtered by highly variable features. Feature space needs to be the same as the one of adata_spatial.
        Normalized counts are expected to be saved in .X. Names of observations and features are expected as row names of adata_ref.obs and adata_ref.var. 
   labels_key : str
       Cell type key in adata_ref.obs for label information.
   cluster_key : str
       Cluster key in adata_spatial.obs for cluster information.
   n_cell : int
       Number of cells per spot.
   tfidf : bool
       Whether the normalized counts are TFIDF-normalized.
   r_lib_path : str
       Path to R library.  
   results_path : str
       Path to save estimated cell type abundances to. 

       
   Returns
   --------

   - Saves estimated proportions as csv-file to results_path.


